* cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7

and Windows 2008 R2 as recognized OSes.  Update products array to
	the latest documented list.
This commit is contained in:
Corinna Vinschen 2009-01-16 12:10:02 +00:00
parent 3491d19262
commit ab30b9e352
2 changed files with 60 additions and 32 deletions

View File

@ -1,3 +1,9 @@
2009-01-16 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7
and Windows 2008 R2 as recognized OSes. Update products array to
the latest documented list.
2009-01-09 Christopher Faylor <me+cygwin@cgf.cx> 2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
* ldd.cc: New file. First stab at implementing ldd-like functionality * ldd.cc: New file. First stab at implementing ldd-like functionality

View File

@ -1,7 +1,7 @@
/* cygcheck.cc /* cygcheck.cc
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008 Red Hat, Inc. 2006, 2007, 2008, 2009 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -1199,7 +1199,7 @@ dump_sysinfo ()
char *found_cygwin_dll; char *found_cygwin_dll;
bool is_nt = false; bool is_nt = false;
bool more_info = true; bool more_info = true;
char osname[80]; char osname[128];
printf ("\nCygwin Configuration Diagnostics\n"); printf ("\nCygwin Configuration Diagnostics\n");
time (&now); time (&now);
@ -1232,10 +1232,15 @@ dump_sysinfo ()
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.wProductType == VER_NT_WORKSTATION) if (osversion.dwMinorVersion == 0)
strcpy (osname, "Vista"); strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
else ? "Vista" : "2008");
strcpy (osname, "2008"); else if (osversion.dwMinorVersion == 1)
{
strcpy (osname, osversion.wProductType == VER_NT_WORKSTATION
? "7" : "2008 R2");
strcat (osname, " (Not yet supported!)");
}
DWORD prod; DWORD prod;
if (GetProductInfo (osversion.dwMajorVersion, if (GetProductInfo (osversion.dwMajorVersion,
osversion.dwMinorVersion, osversion.dwMinorVersion,
@ -1244,39 +1249,56 @@ dump_sysinfo ()
&prod)) &prod))
{ {
#define PRODUCT_UNLICENSED 0xabcdabcd #define PRODUCT_UNLICENSED 0xabcdabcd
#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x19 #define PRODUCT_HYPERV 0x2a
const char *products[] = const char *products[] =
{ {
"", "",
" Ultimate Edition", " Ultimate",
" Home Basic Edition", " Home Basic",
" Home Premium Edition", " Home Premium",
" Enterprise Edition", " Enterprise",
" Home Basic N Edition", " Home Basic N",
" Business Edition", " Business",
" Server Standard Edition", " Server Standard",
" Server Datacenter Edition", " Server Datacenter",
" Small Business Server", " Small Business Server",
" Server Enterprise Edition", " Server Enterprise",
" Starter Edition", " Starter",
" Server Datacenter Edition Core", " Server Datacenter Core",
" Server Standard Edition Core", " Server Standard Core",
" Server Enterprise Edition Core", " Server Enterprise Core",
" Server Enterprise Edition for Itanium-based Systems", " Server Enterprise for Itanium-based Systems",
" Business N Edition", " Business N",
" Web Server Edition", " Web Server",
" Cluster Server Edition", " HPC Edition",
" Home Server Edition", " Home Server",
" Storage Server Express Edition", " Storage Server Express",
" Storage Server Standard Edition", " Storage Server Standard",
" Storage Server Workgroup Edition", " Storage Server Workgroup",
" Storage Server Enterprise Edition", " Storage Server Enterprise",
" Server for Small Business Edition", " for Windows Essential Server Solutions",
" Small Business Server Premium Edition" " Small Business Server Premium",
" Home Premium N",
" Enterprise N",
" Ultimate N",
" Web Server Core",
" Essential Business Server Management Server",
" Essential Business Server Security Server"
" Essential Business Server Messaging Server",
"",
"",
" without Hyper-V for Windows Essential Server Solutions",
" Server Standard without Hyper-V",
" Server Datacenter without Hyper-V",
" Server Enterprise without Hyper-V",
" Server Datacenter Core without Hyper-V",
" Server Standard Core without Hyper-V",
" Server Enterprise Core without Hyper-V",
" Hyper-V Server"
}; };
if (prod == PRODUCT_UNLICENSED) if (prod == PRODUCT_UNLICENSED)
strcat (osname, "Unlicensed"); strcat (osname, "Unlicensed");
else if (prod > PRODUCT_SMALLBUSINESS_SERVER_PREMIUM) else if (prod > PRODUCT_HYPERV)
strcat (osname, ""); strcat (osname, "");
else else
strcat (osname, products[prod]); strcat (osname, products[prod]);