Merge pull request #4545

93a88d73 Utils: add support for newer Windows versions detection (Gregory Lemercier)
pull/4736/head
Riccardo Spagni 6 years ago
commit d7ff24c1e0
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

@ -308,10 +308,19 @@ namespace tools
StringCchCopy(pszOS, BUFSIZE, TEXT("Microsoft "));
// Test for the specific product.
if ( osvi.dwMajorVersion == 10 )
{
if ( osvi.dwMinorVersion == 0 )
{
if( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows 10 "));
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2016 " ));
}
}
if ( osvi.dwMajorVersion == 6 )
{
if( osvi.dwMinorVersion == 0 )
if ( osvi.dwMinorVersion == 0 )
{
if( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows Vista "));
@ -325,6 +334,20 @@ namespace tools
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 R2 " ));
}
if ( osvi.dwMinorVersion == 2 )
{
if( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows 8 "));
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2012 " ));
}
if ( osvi.dwMinorVersion == 3 )
{
if( osvi.wProductType == VER_NT_WORKSTATION )
StringCchCat(pszOS, BUFSIZE, TEXT("Windows 8.1 "));
else StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2012 R2 " ));
}
pGPI = (PGPI) GetProcAddress(
GetModuleHandle(TEXT("kernel32.dll")),
"GetProductInfo");

Loading…
Cancel
Save