aboutsummaryrefslogtreecommitdiffstats
path: root/api/rundll32.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 02:09:00 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 02:25:57 +0100
commit1201c9f346f1e9b2bc00b0a9854fc6e182e851ef (patch)
tree7a404f1a14c3fbb258bb11b464c72dcb15f319d3 /api/rundll32.c
parentapi: begin to separate rundll32 jumps (diff)
downloadwintun-1201c9f346f1e9b2bc00b0a9854fc6e182e851ef.tar.xz
wintun-1201c9f346f1e9b2bc00b0a9854fc6e182e851ef.zip
api: ensure more code compiles by using dead code elimination
It'd be nicer to do this via if (is_defined(HAVE_WHATEVER)) But MSVC won't work with the linux kernel macros for this. Ongoing research. Nevertheless, this makes most of the program always pass through the compiler's type checker, only to have dead code removed later. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/rundll32.c')
-rw-r--r--api/rundll32.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/api/rundll32.c b/api/rundll32.c
index 85121a5..8bab711 100644
--- a/api/rundll32.c
+++ b/api/rundll32.c
@@ -3,6 +3,10 @@
* Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved.
*/
+#include "entry.h"
+
+#if ACCEPT_WOW64 == 1
+
#include "adapter.h"
#include "logger.h"
#include "wintun.h"
@@ -14,8 +18,6 @@
#define EXPORT comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
-#if defined(ACCEPT_WOW64) || defined(_DEBUG)
-
static DWORD
WriteFormatted(_In_ DWORD StdHandle, _In_z_ const WCHAR *Template, ...)
{
@@ -147,5 +149,4 @@ VOID __stdcall DeleteDriver(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int n
WriteFormatted(STD_OUTPUT_HANDLE, L"%1!X!", WintunDeleteDriver());
Done();
}
-
#endif