forked from Green-Sky/tomato
improve windows version detecting code
This commit is contained in:
parent
6b96be7a57
commit
183277250f
@ -20,18 +20,21 @@ void runSysCheck(void) {
|
|||||||
NTSTATUS(WINAPI *RtlGetVersion)(LPOSVERSIONINFOEXW);
|
NTSTATUS(WINAPI *RtlGetVersion)(LPOSVERSIONINFOEXW);
|
||||||
OSVERSIONINFOEXW osInfo;
|
OSVERSIONINFOEXW osInfo;
|
||||||
|
|
||||||
*(FARPROC*)&RtlGetVersion = GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
|
HMODULE lib = GetModuleHandleW(L"ntdll.dll");
|
||||||
|
if (lib) {
|
||||||
|
*(FARPROC*)&RtlGetVersion = GetProcAddress(lib, "RtlGetVersion");
|
||||||
|
|
||||||
if (NULL != RtlGetVersion) {
|
if (NULL != RtlGetVersion) {
|
||||||
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
||||||
RtlGetVersion(&osInfo);
|
RtlGetVersion(&osInfo);
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (
|
if (
|
||||||
osInfo.dwBuildNumber >= 26000 // canary versions of 11 24H2 included
|
osInfo.dwBuildNumber >= 26000 // canary versions of 11 24H2 included
|
||||||
) {
|
) {
|
||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Unsupported System", "Your version of windows is too new and endangers the privacy of all involved.", nullptr);
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Unsupported System", "Your version of windows is too new and endangers the privacy of all involved.", nullptr);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user