diff options
| author | Gregory Lemercier <greglemercier@free.fr> | 2018-10-09 19:17:56 +0200 |
|---|---|---|
| committer | Gregory Lemercier <greglemercier@free.fr> | 2018-10-09 19:19:12 +0200 |
| commit | 93a88d7323ed72dfc08e45b15f996d94d96bb106 (patch) | |
| tree | 5b15ac50e973996aa23f5e8022f5cf1274d33abd /src | |
| parent | c23b6f8f56384573a9215db127982b8f79f396d0 (diff) | |
| download | monzero-core-93a88d7323ed72dfc08e45b15f996d94d96bb106.tar.gz monzero-core-93a88d7323ed72dfc08e45b15f996d94d96bb106.tar.xz monzero-core-93a88d7323ed72dfc08e45b15f996d94d96bb106.zip | |
Utils: add support for newer Windows versions detection
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/util.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp index 2a1d49af0..35e885fa3 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -307,10 +307,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 ")); @@ -324,6 +333,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"); |
