- Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to

I_DetectOS().


SVN r1996 (trunk)
This commit is contained in:
Randy Heit 2009-11-24 04:29:36 +00:00
parent 754fe70a79
commit 53b1b7efab
2 changed files with 34 additions and 6 deletions

View File

@ -1,4 +1,6 @@
November 23, 2009
- Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to
I_DetectOS().
- Fixed: ArtiPork did not use all its sprite frames.
- Fixed: FWadCollection::AddFile() did not call FixPathSeperator(), so
savegames would hold the full file path for wads that had been specified

View File

@ -480,11 +480,16 @@ void I_WaitVBL(int count)
void I_DetectOS(void)
{
OSVERSIONINFO info;
OSVERSIONINFOEX info;
const char *osname;
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if (!GetVersionEx((OSVERSIONINFO *)&info))
{
// Retry with the older OSVERSIONINFO structure.
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&info);
GetVersionEx((OSVERSIONINFO *)&info);
}
switch (info.dwPlatformId)
{
@ -522,10 +527,31 @@ void I_DetectOS(void)
osname = "Server 2003";
}
}
else if (info.dwMajorVersion == 6 && info.dwMinorVersion == 0)
else if (info.dwMajorVersion == 6)
{
if (info.dwMinorVersion == 0)
{
if (info.wProductType == VER_NT_WORKSTATION)
{
osname = "Vista";
}
else
{
osname = "Server 2008";
}
}
else if (info.dwMinorVersion == 1)
{
if (info.wProductType == VER_NT_WORKSTATION)
{
osname = "7";
}
else
{
osname = "Server 2008 R2";
}
}
}
break;
default:
@ -543,7 +569,7 @@ void I_DetectOS(void)
}
else
{
Printf ("OS: Windows %s %lu.%lu (Build %lu)\n %s\n",
Printf ("OS: Windows %s (NT %lu.%lu) Build %lu\n %s\n",
osname,
info.dwMajorVersion, info.dwMinorVersion,
info.dwBuildNumber, info.szCSDVersion);