aboutsummaryrefslogtreecommitdiffstats
path: root/api/main.h
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2021-07-28 13:50:40 +0200
committerSimon Rozman <simon@rozman.si>2021-07-28 20:22:18 +0200
commit7dffa4be72c77bd7322039ffdc558a842abba8af (patch)
tree1712373ccfbd56596959206cb6b48c8d02d395ca /api/main.h
parentdriver: workaround SDV failure with code analysis (diff)
downloadwintun-7dffa4be72c77bd7322039ffdc558a842abba8af.tar.xz
wintun-7dffa4be72c77bd7322039ffdc558a842abba8af.zip
vs: move shared configuration to wintun.props and upgrade
Remember to rename wintun.vcxproj.user file in your local working folder to wintun.props.user manually. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api/main.h')
-rw-r--r--api/main.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/api/main.h b/api/main.h
new file mode 100644
index 0000000..9f6b0de
--- /dev/null
+++ b/api/main.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved.
+ */
+
+#pragma once
+
+#include <Windows.h>
+
+/* TODO: Replace with is_defined. MSVC has issues with the linux kernel varadic macro trick for this. */
+#if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)
+# define MAYBE_WOW64 1
+#else
+# define MAYBE_WOW64 0
+#endif
+#if defined(_M_AMD64) || defined(_M_ARM64)
+# define ACCEPT_WOW64 1
+#else
+# define ACCEPT_WOW64 0
+#endif
+#ifdef HAVE_WHQL
+# undef HAVE_WHQL
+# define HAVE_WHQL 1
+#else
+# define HAVE_WHQL 0
+#endif
+#pragma warning(disable : 4127) /* conditional expression is constant */
+
+extern HINSTANCE ResourceModule;
+extern HANDLE ModuleHeap;
+extern SECURITY_ATTRIBUTES SecurityAttributes;
+extern BOOL IsLocalSystem;