cygcheck.cc: Handle W10/2016 sysinfo

* cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016.
        Add missing product types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2015-08-30 21:34:24 +02:00
parent e2ae671ce1
commit 6fbb37b3fa
2 changed files with 68 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2015-08-30 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016.
Add missing product types.
2015-08-30 Corinna Vinschen <corinna@vinschen.de> 2015-08-30 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (track_down): Skip error output for "api-ms-win-" * cygcheck.cc (track_down): Skip error output for "api-ms-win-"

View File

@ -1464,12 +1464,13 @@ dump_sysinfo ()
{ {
case VER_PLATFORM_WIN32_NT: case VER_PLATFORM_WIN32_NT:
is_nt = true; is_nt = true;
if (osversion.dwMajorVersion == 6) if (osversion.dwMajorVersion >= 6)
{ {
HMODULE k32 = GetModuleHandleW (L"kernel32.dll"); HMODULE k32 = GetModuleHandleW (L"kernel32.dll");
BOOL (WINAPI *GetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD) = BOOL (WINAPI *GetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD) =
(BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD)) (BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD))
GetProcAddress (k32, "GetProductInfo"); GetProcAddress (k32, "GetProductInfo");
if (osversion.dwMajorVersion == 6)
switch (osversion.dwMinorVersion) switch (osversion.dwMinorVersion)
{ {
case 0: case 0:
@ -1491,9 +1492,14 @@ dump_sysinfo ()
case 4: case 4:
default: default:
strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
? "10" : "2014"); ? "10 Preview" : "2016 Preview");
break; break;
} }
else if (osversion.dwMajorVersion == 10)
{
strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
? "10" : "2016");
}
DWORD prod; DWORD prod;
if (GetProductInfo (osversion.dwMajorVersion, if (GetProductInfo (osversion.dwMajorVersion,
osversion.dwMinorVersion, osversion.dwMinorVersion,
@ -1601,16 +1607,46 @@ dump_sysinfo ()
/* 0x0000005f */ " Storage Server Workgroup (Evaluation inst.)", /* 0x0000005f */ " Storage Server Workgroup (Evaluation inst.)",
/* 0x00000060 */ " Storage Server Standard (Evaluation inst.)", /* 0x00000060 */ " Storage Server Standard (Evaluation inst.)",
/* 0x00000061 */ "", /* 0x00000061 */ "",
/* 0x00000062 */ " N", /* "8 N" */ /* 0x00000062 */ " N",
/* 0x00000063 */ " China", /* "8 China" */ /* 0x00000063 */ " China",
/* 0x00000064 */ " Single Language", /* "8 Single Language" */ /* 0x00000064 */ " Single Language",
/* 0x00000065 */ "", /* "8" */ /* 0x00000065 */ " Home",
/* 0x00000066 */ "", /* 0x00000066 */ "",
/* 0x00000067 */ " Professional with Media Center" /* 0x00000067 */ " Professional with Media Center"
/* 0x00000068 */ " Mobile"
/* 0x00000069 */ "",
/* 0x0000006a */ "",
/* 0x0000006b */ "",
/* 0x0000006c */ "",
/* 0x0000006d */ "",
/* 0x0000006e */ "",
/* 0x0000006f */ "",
/* 0x00000070 */ "",
/* 0x00000071 */ "",
/* 0x00000072 */ "",
/* 0x00000073 */ "",
/* 0x00000074 */ "",
/* 0x00000075 */ "",
/* 0x00000076 */ "",
/* 0x00000077 */ "",
/* 0x00000078 */ "",
/* 0x00000079 */ " Education"
/* 0x0000007a */ " Education N"
/* 0x0000007b */ "",
/* 0x0000007c */ "",
/* 0x0000007d */ "",
/* 0x0000007e */ "",
/* 0x0000007f */ "",
/* 0x00000080 */ "",
/* 0x00000081 */ "",
/* 0x00000082 */ "",
/* 0x00000083 */ "",
/* 0x00000084 */ "",
/* 0x00000085 */ " Mobile Enterprise"
}; };
if (prod == PRODUCT_UNLICENSED) if (prod == PRODUCT_UNLICENSED)
strcat (osname, "Unlicensed"); strcat (osname, "Unlicensed");
else if (prod > PRODUCT_PROFESSIONAL_WMC) else if (prod > 0x00000085)
strcat (osname, ""); strcat (osname, "");
else else
strcat (osname, products[prod]); strcat (osname, products[prod]);