Created
September 5, 2020 03:22
-
-
Save ijat/396663fc902683f9a86be84a7fcd88c5 to your computer and use it in GitHub Desktop.
Check if Windows 8.1 or higher c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool IsWindows81orHigher() { | |
NTSTATUS(WINAPI * RtlGetVersion)(LPOSVERSIONINFOEXW); | |
OSVERSIONINFOEXW osInfo; | |
*(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion"); | |
if (NULL != RtlGetVersion) | |
{ | |
osInfo.dwOSVersionInfoSize = sizeof(osInfo); | |
RtlGetVersion(&osInfo); | |
return (osInfo.dwMajorVersion >= 6 && osInfo.dwMinorVersion >= 3) || osInfo.dwMajorVersion >= 10; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment