NOISSUE dumb down Windows version detection...

Hopefully the analytics thing will accept it this time.
This commit is contained in:
Petr Mrázek 2016-11-25 00:39:15 +01:00
parent a5fb931e8e
commit d5fdc23eb2

View File

@ -11,38 +11,11 @@ QString Sys::getSystemInfo()
} }
else else
{ {
// We support only Windows NT (XP and up) - everything else is not interesting.
OSVERSIONINFOW osvi; OSVERSIONINFOW osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOW)); ZeroMemory(&osvi, sizeof(OSVERSIONINFOW));
GetVersionExW(&osvi); GetVersionExW(&osvi);
QString os = QString("Windows NT %1.%2").arg(osvi.dwMajorVersion).arg(osvi.dwMinorVersion); cached = QString("Windows %1.%2").arg(osvi.dwMajorVersion).arg(osvi.dwMinorVersion);
return cached;
#if defined(_WIN64)
// 64-bit programs run only on Win64
os.append("; Win64");
// determine CPU type
SYSTEM_INFO info;
ZeroMemory(&info, sizeof(SYSTEM_INFO));
GetNativeSystemInfo(&info);
auto arch = info.wProcessorArchitecture;
if(arch == PROCESSOR_ARCHITECTURE_AMD64)
{
os.append("; x64");
}
else if (arch == PROCESSOR_ARCHITECTURE_IA64)
{
os.append("; IA64");
}
#elif defined(_WIN32)
// 32-bit programs run on both 32-bit and 64-bit Windows
// so must sniff
BOOL f64 = false;
if(IsWow64Process(GetCurrentProcess(), &f64) && f64)
{
os.append("; WOW64");
}
#endif
return os;
} }
} }