Allow identification of Windows Vista/Windows 7 in logfiles (as opposed to "unknown NT-based").

This commit is contained in:
AJ Kelly
2010-06-05 15:52:12 -05:00
parent 25193851b6
commit 5be876fd34
+35 -5
View File
@@ -72,10 +72,10 @@ static RString wo_ssprintf( MMRESULT err, const char *fmt, ...)
char buf[MAXERRORLENGTH];
waveOutGetErrorText(err, buf, MAXERRORLENGTH);
va_list va;
va_start(va, fmt);
RString s = vssprintf( fmt, va );
va_end(va);
va_list va;
va_start(va, fmt);
RString s = vssprintf( fmt, va );
va_end(va);
return s += ssprintf( "(%s)", buf );
}
@@ -191,7 +191,7 @@ static void GetDriveDebugInfo()
static void GetWindowsVersionDebugInfo()
{
/* Detect operating system. */
// Detect operating system.
OSVERSIONINFO ovi;
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx(&ovi))
@@ -200,6 +200,7 @@ static void GetWindowsVersionDebugInfo()
return;
}
RString Ver = ssprintf("Windows %i.%i (", ovi.dwMajorVersion, ovi.dwMinorVersion);
if(ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
@@ -220,6 +221,35 @@ static void GetWindowsVersionDebugInfo()
Ver += "Win2000";
else if(ovi.dwMajorVersion == 5 && ovi.dwMinorVersion == 1)
Ver += "WinXP";
else if(ovi.dwMajorVersion == 5 && ovi.dwMinorVersion == 2)
{
Ver += "WinServer2003";
// todo: check for R2
/*
if(GetSystemMetrics(SM_SERVERR2) != 0)
Ver += "R2";
*/
}
else if(ovi.dwMajorVersion == 6 && ovi.dwMinorVersion == 0)
{
Ver += "Vista";
// todo: make this check work
/*
if(ovi.wProductType == VER_NT_WORKSTATION)
Ver += "Vista";
else
Ver += "WinServer2008";
*/
}
else if(ovi.dwMajorVersion == 6 && ovi.dwMinorVersion == 1)
Ver += "Win7";
// todo: make this check work
/*
if(ovi.wProductType == VER_NT_WORKSTATION)
Ver += "Win7";
else
Ver += "WinServer2008 R2";
*/
else
Ver += "unknown NT-based";
} else Ver += "???";