api: skip requested GUID if !win10

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-05-05 11:25:30 +02:00
parent 747ba7121d
commit 0c9a87b8a2

View File

@ -899,14 +899,18 @@ _Return_type_success_(return != INVALID_HANDLE_VALUE) HANDLE WINAPI
}
static BOOL
HaveWHQL(void)
{
if (HAVE_WHQL)
IsWindows10(void)
{
DWORD MajorVersion;
RtlGetNtVersionNumbers(&MajorVersion, NULL, NULL);
return MajorVersion >= 10;
}
static BOOL
HaveWHQL(void)
{
if (HAVE_WHQL)
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];