Allow identification of Windows Vista/Windows 7 in logfiles (as opposed to "unknown NT-based").
This commit is contained in:
@@ -18,17 +18,17 @@ static void GetMemoryDebugInfo()
|
||||
{
|
||||
MEMORYSTATUS mem;
|
||||
GlobalMemoryStatus(&mem);
|
||||
|
||||
|
||||
LOG->Info("Memory: %imb total, %imb swap (%imb swap avail)",
|
||||
mem.dwTotalPhys / 1048576,
|
||||
mem.dwTotalPageFile / 1048576,
|
||||
mem.dwTotalPhys / 1048576,
|
||||
mem.dwTotalPageFile / 1048576,
|
||||
mem.dwAvailPageFile / 1048576);
|
||||
}
|
||||
|
||||
static void GetDisplayDriverDebugInfo()
|
||||
{
|
||||
RString sPrimaryDeviceName = GetPrimaryVideoName();
|
||||
|
||||
|
||||
if( sPrimaryDeviceName == "" )
|
||||
LOG->Info( "Primary display driver could not be determined." );
|
||||
|
||||
@@ -61,7 +61,7 @@ static void GetDisplayDriverDebugInfo()
|
||||
VideoDriverInfo info;
|
||||
if( !GetVideoDriverInfo(i, info) )
|
||||
break;
|
||||
|
||||
|
||||
LogVideoDriverInfo( info );
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
@@ -209,7 +210,7 @@ static void GetWindowsVersionDebugInfo()
|
||||
Ver += "Win98";
|
||||
else if(ovi.dwMinorVersion == 90)
|
||||
Ver += "WinME";
|
||||
else
|
||||
else
|
||||
Ver += "unknown 9x-based";
|
||||
}
|
||||
else if(ovi.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
@@ -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 += "???";
|
||||
@@ -235,7 +265,7 @@ static void GetSoundDriverDebugInfo()
|
||||
for(int i = 0; i < cnt; ++i)
|
||||
{
|
||||
WAVEOUTCAPS caps;
|
||||
|
||||
|
||||
MMRESULT ret = waveOutGetDevCaps(i, &caps, sizeof(caps));
|
||||
if(ret != MMSYSERR_NOERROR)
|
||||
{
|
||||
@@ -263,7 +293,7 @@ void SearchForDebugInfo()
|
||||
/*
|
||||
* (c) 2003-2004 Glenn Maynard
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
@@ -273,7 +303,7 @@ void SearchForDebugInfo()
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
|
||||
Reference in New Issue
Block a user