WIN32: Fix incorrect Windows version check

There's no point in testing for Windows 10 since the comparison is already "greater than or equals", and it identifies itself as 6.2 for backwards compatibility. Likely it was failing before because the return type was wrong.

Version checks are unreliable anyways, should use feature checks, but "if it ain't broke don't fix it".
This commit is contained in:
SupSuper 2018-11-22 12:26:32 +00:00 committed by Thierry Crozat
parent 61070f6ce0
commit 7bff9176d5
2 changed files with 6 additions and 6 deletions

View file

@ -29,8 +29,8 @@
// VerSetConditionMask and VerifyVersionInfo didn't appear until Windows 2000,
// so we need to check for them at runtime
LONGLONG VerSetConditionMaskFunc(ULONGLONG dwlConditionMask, DWORD dwTypeMask, BYTE dwConditionMask) {
typedef BOOL(WINAPI *VerSetConditionMaskFunction)(ULONGLONG conditionMask, DWORD typeMask, BYTE conditionOperator);
ULONGLONG VerSetConditionMaskFunc(ULONGLONG dwlConditionMask, DWORD dwTypeMask, BYTE dwConditionMask) {
typedef ULONGLONG(WINAPI *VerSetConditionMaskFunction)(ULONGLONG conditionMask, DWORD typeMask, BYTE conditionOperator);
VerSetConditionMaskFunction verSetConditionMask = (VerSetConditionMaskFunction)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "VerSetConditionMask");
if (verSetConditionMask == NULL)
@ -52,11 +52,11 @@ BOOL VerifyVersionInfoFunc(LPOSVERSIONINFOEXA lpVersionInformation, DWORD dwType
namespace Win32 {
bool confirmWindowsVersion(int majorVersion, int minorVersion) {
OSVERSIONINFOEX versionInfo;
OSVERSIONINFOEXA versionInfo;
DWORDLONG conditionMask = 0;
ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX));
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEXA));
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
versionInfo.dwMajorVersion = majorVersion;
versionInfo.dwMinorVersion = minorVersion;