From faf7d3771c9bd7b8b9a3ee20ceed2a432542c318 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 19 Oct 2020 22:23:09 +0200 Subject: api: connect rundll32 child with parent using stdout and stderr The WintunCreateAdapter()+CreateAdapter() and WintunDeleteAdapter()+ DeleteAdapter() communicate using Unicode anonymous pipes now. This allows the WintunCreateAdapter() to exactly determine the adapter CreateAdapter() just created by its GUID rather than its name - avoiding the possible ambiguity caused by same-adapter-name ordinal suffixes. This also allows exact retrieval of the result code and pending reboot flag from the rundll32 child process. Furthermore, CreateAdapter() and DeleteAdapter() are now available in _DEBUG for all platforms to allow testing. It took a #pragma comment( linker, "/EXPORT") trick to stop compiler from decorating function names and exporting as _CreateAdapter@16() and _DeleteAdapter@16() in x86. Signed-off-by: Simon Rozman --- api/wintun.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api/wintun.h') diff --git a/api/wintun.h b/api/wintun.h index 0917a6c..dadac10 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -206,6 +206,8 @@ typedef BOOL(CALLBACK *WINTUN_LOGGER_FUNC)(_In_ WINTUN_LOGGER_LEVEL Level, _In_z /** * Sets logger callback function. * - * @param NewLogger Pointer to callback function to use as a new global logger. + * @param NewLogger Pointer to callback function to use as a new global logger. NewLogger may be called from various + * threads concurrently. Should the logging require serialization, you must handle serialization in + * NewLogger. */ typedef void(WINAPI *WINTUN_SET_LOGGER_FUNC)(_In_ WINTUN_LOGGER_FUNC NewLogger); -- cgit v1.2.3-59-g8ed1b