aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-05-05 11:25:30 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-05-05 11:25:44 +0200
commit0c9a87b8a2fe977ea0082da05e5d0ef02196320a (patch)
treed82ce8f09957f1efe785d0544a61807331825a34
parentapi: clean up NetSetup2 GUIDs (diff)
downloadwintun-0c9a87b8a2fe977ea0082da05e5d0ef02196320a.tar.xz
wintun-0c9a87b8a2fe977ea0082da05e5d0ef02196320a.zip
api: skip requested GUID if !win10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--api/adapter.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/api/adapter.c b/api/adapter.c
index a85d17b..ba4467c 100644
--- a/api/adapter.c
+++ b/api/adapter.c
@@ -899,14 +899,18 @@ _Return_type_success_(return != INVALID_HANDLE_VALUE) HANDLE WINAPI
}
static BOOL
+IsWindows10(void)
+{
+ DWORD MajorVersion;
+ RtlGetNtVersionNumbers(&MajorVersion, NULL, NULL);
+ return MajorVersion >= 10;
+}
+
+static BOOL
HaveWHQL(void)
{
if (HAVE_WHQL)
- {
- DWORD MajorVersion;
- RtlGetNtVersionNumbers(&MajorVersion, NULL, NULL);
- return MajorVersion >= 10;
- }
+ return IsWindows10();
return FALSE;
}
@@ -1418,6 +1422,9 @@ static _Return_type_success_(return != NULL) WINTUN_ADAPTER *CreateAdapter(
{
LOG(WINTUN_LOG_INFO, L"Creating adapter");
+ if (!IsWindows10())
+ RequestedGUID = NULL;
+
if (RequestedGUID)
{
WCHAR RegPath[MAX_REG_PATH];