* wincap.cc (wincapc::init): Drop memset call since it can result in

a race condition.  Drop all considerations for pre-Windows 2000 systems
	since Cygwin won't start on them anyway.
This commit is contained in:
Corinna Vinschen 2012-07-24 13:56:14 +00:00
parent 5f3eab86a6
commit 67d71dbf10
2 changed files with 40 additions and 54 deletions

View File

@ -1,3 +1,9 @@
2012-07-24 Corinna Vinschen <corinna@vinschen.de>
* wincap.cc (wincapc::init): Drop memset call since it can result in
a race condition. Drop all considerations for pre-Windows 2000 systems
since Cygwin won't start on them anyway.
2012-07-23 Christopher Faylor <me.cygwin2012@cgf.cx>
Change "set_thread_waiting" to "set_signal_arrived" throughout.

View File

@ -347,71 +347,51 @@ wincapc::init ()
return; // already initialized
GetSystemInfo (&system_info);
memset (&version, 0, sizeof version);
version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)))
api_fatal ("Cygwin requires at least Windows 2000.");
GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version));
switch (version.dwPlatformId)
switch (version.dwMajorVersion)
{
case VER_PLATFORM_WIN32_NT:
switch (version.dwMajorVersion)
case 5:
switch (version.dwMinorVersion)
{
case 4:
/* I'd be very surprised if this code is ever hit, but it doesn't
hurt to keep it. */
api_fatal ("Cygwin requires at least Windows 2000.");
case 0:
if (version.wServicePackMajor < 4)
caps = &wincap_2000;
else
caps = &wincap_2000sp4;
break;
case 5:
switch (version.dwMinorVersion)
case 1:
caps = &wincap_xp;
switch (version.wServicePackMajor)
{
case 0:
if (version.wServicePackMajor < 4)
caps = &wincap_2000;
else
caps = &wincap_2000sp4;
break;
case 1:
caps = &wincap_xp;
switch (version.wServicePackMajor)
{
case 0:
caps = &wincap_xp;
case 1:
caps = &wincap_xpsp1;
default:
caps = &wincap_xpsp2;
}
break;
default:
caps = &wincap_2003;
}
break;
case 6:
switch (version.dwMinorVersion)
{
case 0:
caps = &wincap_vista;
break;
case 1:
caps = &wincap_7;
break;
default:
caps = &wincap_8;
break;
case 0:
caps = &wincap_xp;
case 1:
caps = &wincap_xpsp1;
default:
caps = &wincap_xpsp2;
}
break;
default:
caps = &wincap_minimal;
break;
caps = &wincap_2003;
}
break;
case VER_PLATFORM_WIN32_WINDOWS:
/* I'd be very surprised if this code is ever hit, but it doesn't
hurt to keep it. */
api_fatal ("Windows 95/98/Me are not supported.");
case 6:
switch (version.dwMinorVersion)
{
case 0:
caps = &wincap_vista;
break;
case 1:
caps = &wincap_7;
break;
default:
caps = &wincap_8;
break;
}
break;
default:
caps = &wincap_minimal;