NOISSUE dumb down Windows version detection...
Hopefully the analytics thing will accept it this time.
This commit is contained in:
parent
a5fb931e8e
commit
d5fdc23eb2
@ -11,38 +11,11 @@ QString Sys::getSystemInfo()
|
||||
}
|
||||
else
|
||||
{
|
||||
// We support only Windows NT (XP and up) - everything else is not interesting.
|
||||
OSVERSIONINFOW osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFOW));
|
||||
GetVersionExW(&osvi);
|
||||
QString os = QString("Windows NT %1.%2").arg(osvi.dwMajorVersion).arg(osvi.dwMinorVersion);
|
||||
|
||||
#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;
|
||||
cached = QString("Windows %1.%2").arg(osvi.dwMajorVersion).arg(osvi.dwMinorVersion);
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user