add VideoDriverInfo
This commit is contained in:
+34
-21
@@ -64,7 +64,7 @@ IntDir=.\../Debug6
|
|||||||
TargetDir=\temp\stepmania
|
TargetDir=\temp\stepmania
|
||||||
TargetName=StepMania-debug-ogl
|
TargetName=StepMania-debug-ogl
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -82,25 +82,25 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania
|
|||||||
# PROP Intermediate_Dir "StepMania___Xbox_Debug___VC6"
|
# PROP Intermediate_Dir "StepMania___Xbox_Debug___VC6"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
CPP=cl.exe
|
XBCP=xbecopy.exe
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
# ADD BASE XBCP /NOLOGO
|
||||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
# ADD XBCP /NOLOGO
|
||||||
BSC32=bscmake.exe
|
XBE=imagebld.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
||||||
# ADD BSC32 /nologo
|
# ADD XBE /nologo /stack:0x10000 /debug
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
||||||
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
XBE=imagebld.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE XBE /nologo /stack:0x10000 /debug
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD XBE /nologo /stack:0x10000 /debug
|
# ADD BSC32 /nologo
|
||||||
XBCP=xbecopy.exe
|
CPP=cl.exe
|
||||||
# ADD BASE XBCP /NOLOGO
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
||||||
# ADD XBCP /NOLOGO
|
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ IntDir=.\../Release6
|
|||||||
TargetDir=\temp\stepmania
|
TargetDir=\temp\stepmania
|
||||||
TargetName=StepMania-ogl
|
TargetName=StepMania-ogl
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -1775,6 +1775,23 @@ SOURCE=.\archutils\Win32\USB.cpp
|
|||||||
|
|
||||||
SOURCE=.\archutils\Win32\USB.h
|
SOURCE=.\archutils\Win32\USB.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\archutils\Win32\VideoDriverInfo.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\archutils\Win32\VideoDriverInfo.h
|
||||||
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
@@ -3183,15 +3200,11 @@ SOURCE=.\ScreenAutogenOptions.h
|
|||||||
|
|
||||||
SOURCE=.\ScreenAutoGraphicDetail.cpp
|
SOURCE=.\ScreenAutoGraphicDetail.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug OGL"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Win32 Debug D3D"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Win32 Release D3D"
|
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "StepMania - Win32 Release OGL"
|
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="ScreenAttract.h">
|
RelativePath="ScreenAttract.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ScreenAutoGraphicDetail.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ScreenAutoGraphicDetail.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="ScreenAutogenOptions.cpp">
|
RelativePath="ScreenAutogenOptions.cpp">
|
||||||
</File>
|
</File>
|
||||||
@@ -992,6 +998,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
<File
|
<File
|
||||||
RelativePath="archutils\Win32\USB.h">
|
RelativePath="archutils\Win32\USB.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="archutils\Win32\VideoDriverInfo.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="archutils\Win32\VideoDriverInfo.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="archutils\Win32\arch_setup.h">
|
RelativePath="archutils\Win32\arch_setup.h">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -2,17 +2,10 @@
|
|||||||
#include "DebugInfoHunt.h"
|
#include "DebugInfoHunt.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
#include "VideoDriverInfo.h"
|
||||||
#include "../../archutils/Win32/GotoURL.h"
|
#include "../../archutils/Win32/GotoURL.h"
|
||||||
|
|
||||||
|
|
||||||
struct VideoDriverInfo
|
|
||||||
{
|
|
||||||
CString sProvider;
|
|
||||||
CString sDescription;
|
|
||||||
CString sVersion;
|
|
||||||
CString sDate;
|
|
||||||
CString sDeviceID;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void LogVideoDriverInfo( VideoDriverInfo info )
|
void LogVideoDriverInfo( VideoDriverInfo info )
|
||||||
@@ -25,90 +18,6 @@ void LogVideoDriverInfo( VideoDriverInfo info )
|
|||||||
LOG->Info("%-15s:\t%s", "DeviceID", info.sDeviceID.c_str());
|
LOG->Info("%-15s:\t%s", "DeviceID", info.sDeviceID.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
CString GetRegValue( HKEY hKey, CString sName )
|
|
||||||
{
|
|
||||||
char szBuffer[MAX_PATH];
|
|
||||||
DWORD nSize = sizeof(szBuffer)-1;
|
|
||||||
if( RegQueryValueEx(hKey, sName, NULL, NULL, (LPBYTE)szBuffer, &nSize) == ERROR_SUCCESS )
|
|
||||||
return szBuffer;
|
|
||||||
else
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GetVideoDriverInfo9x( int iIndex, VideoDriverInfo& infoOut )
|
|
||||||
{
|
|
||||||
HKEY hkey;
|
|
||||||
CString sKey = ssprintf("SYSTEM\\CurrentControlSet\\Services\\Class\\Display\\%04d",iIndex);
|
|
||||||
if (RegOpenKey(HKEY_LOCAL_MACHINE, sKey, &hkey) != ERROR_SUCCESS)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
infoOut.sDate = GetRegValue( hkey, "DriverDate");
|
|
||||||
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
|
|
||||||
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
|
|
||||||
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
|
|
||||||
infoOut.sVersion = GetRegValue( hkey, "Ver");
|
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GetVideoDriverInfo2k( int iIndex, VideoDriverInfo& infoOut )
|
|
||||||
{
|
|
||||||
HKEY hkey;
|
|
||||||
CString sKey = ssprintf("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}\\%04d",iIndex);
|
|
||||||
if (RegOpenKey(HKEY_LOCAL_MACHINE, sKey, &hkey) != ERROR_SUCCESS)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
infoOut.sDate = GetRegValue( hkey, "DriverDate");
|
|
||||||
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
|
|
||||||
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
|
|
||||||
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
|
|
||||||
infoOut.sVersion = GetRegValue( hkey, "DriverVersion");
|
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CString GetPrimaryVideoName9xAnd2k() // this will not work on 95 and NT b/c of EnumDisplayDevices
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef BOOL (WINAPI* pfnEnumDisplayDevices)(PVOID,DWORD,PDISPLAY_DEVICE,DWORD);
|
|
||||||
pfnEnumDisplayDevices EnumDisplayDevices;
|
|
||||||
HINSTANCE hInstUser32;
|
|
||||||
|
|
||||||
hInstUser32 = LoadLibrary("User32.DLL");
|
|
||||||
if( !hInstUser32 )
|
|
||||||
return "";
|
|
||||||
|
|
||||||
// VC6 don't have a stub to static link with, so link dynamically.
|
|
||||||
EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA");
|
|
||||||
if( EnumDisplayDevices == NULL )
|
|
||||||
{
|
|
||||||
FreeLibrary(hInstUser32);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
CString sPrimaryDeviceName;
|
|
||||||
for( DWORD i=0; true; i++ )
|
|
||||||
{
|
|
||||||
DISPLAY_DEVICE dd;
|
|
||||||
ZERO( dd );
|
|
||||||
dd.cb = sizeof(dd);
|
|
||||||
if( !EnumDisplayDevices(NULL, i, &dd, 0) )
|
|
||||||
break;
|
|
||||||
if( dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE )
|
|
||||||
{
|
|
||||||
sPrimaryDeviceName = (char*)dd.DeviceString;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FreeLibrary(hInstUser32);
|
|
||||||
return sPrimaryDeviceName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -121,15 +30,10 @@ static void GetDisplayDriverDebugInfo()
|
|||||||
else
|
else
|
||||||
LOG->Info( "Primary display driver: %s", sPrimaryDeviceName.c_str() );
|
LOG->Info( "Primary display driver: %s", sPrimaryDeviceName.c_str() );
|
||||||
|
|
||||||
OSVERSIONINFO version;
|
|
||||||
version.dwOSVersionInfoSize=sizeof(version);
|
|
||||||
GetVersionEx(&version);
|
|
||||||
bool bIsWin9x = version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS;
|
|
||||||
|
|
||||||
for( int i=0; true; i++ )
|
for( int i=0; true; i++ )
|
||||||
{
|
{
|
||||||
VideoDriverInfo info;
|
VideoDriverInfo info;
|
||||||
if( ! (bIsWin9x ? GetVideoDriverInfo9x : GetVideoDriverInfo2k)(i,info) )
|
if( !GetVideoDriverInfo(i, info) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( sPrimaryDeviceName == "" ) // failed to get primary disaply name (NT4)
|
if( sPrimaryDeviceName == "" ) // failed to get primary disaply name (NT4)
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "VideoDriverInfo.h"
|
||||||
|
#include "RageUtil.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
|
||||||
|
static CString GetRegValue( HKEY hKey, CString sName )
|
||||||
|
{
|
||||||
|
char szBuffer[MAX_PATH];
|
||||||
|
DWORD nSize = sizeof(szBuffer)-1;
|
||||||
|
if( RegQueryValueEx(hKey, sName, NULL, NULL, (LPBYTE)szBuffer, &nSize) == ERROR_SUCCESS )
|
||||||
|
return szBuffer;
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetVideoDriverInfo9x( int iIndex, VideoDriverInfo& infoOut )
|
||||||
|
{
|
||||||
|
HKEY hkey;
|
||||||
|
CString sKey = ssprintf("SYSTEM\\CurrentControlSet\\Services\\Class\\Display\\%04d",iIndex);
|
||||||
|
if (RegOpenKey(HKEY_LOCAL_MACHINE, sKey, &hkey) != ERROR_SUCCESS)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
infoOut.sDate = GetRegValue( hkey, "DriverDate");
|
||||||
|
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
|
||||||
|
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
|
||||||
|
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
|
||||||
|
infoOut.sVersion = GetRegValue( hkey, "Ver");
|
||||||
|
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool GetVideoDriverInfo2k( int iIndex, VideoDriverInfo& infoOut )
|
||||||
|
{
|
||||||
|
HKEY hkey;
|
||||||
|
CString sKey = ssprintf("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}\\%04d",iIndex);
|
||||||
|
if (RegOpenKey(HKEY_LOCAL_MACHINE, sKey, &hkey) != ERROR_SUCCESS)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
infoOut.sDate = GetRegValue( hkey, "DriverDate");
|
||||||
|
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
|
||||||
|
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
|
||||||
|
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
|
||||||
|
infoOut.sVersion = GetRegValue( hkey, "DriverVersion");
|
||||||
|
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// this will not work on 95 and NT b/c of EnumDisplayDevices
|
||||||
|
CString GetPrimaryVideoName9xAnd2k()
|
||||||
|
{
|
||||||
|
|
||||||
|
typedef BOOL (WINAPI* pfnEnumDisplayDevices)(PVOID,DWORD,PDISPLAY_DEVICE,DWORD);
|
||||||
|
pfnEnumDisplayDevices EnumDisplayDevices;
|
||||||
|
HINSTANCE hInstUser32;
|
||||||
|
|
||||||
|
hInstUser32 = LoadLibrary("User32.DLL");
|
||||||
|
if( !hInstUser32 )
|
||||||
|
return "";
|
||||||
|
|
||||||
|
// VC6 don't have a stub to static link with, so link dynamically.
|
||||||
|
EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA");
|
||||||
|
if( EnumDisplayDevices == NULL )
|
||||||
|
{
|
||||||
|
FreeLibrary(hInstUser32);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
CString sPrimaryDeviceName;
|
||||||
|
for( DWORD i=0; true; i++ )
|
||||||
|
{
|
||||||
|
DISPLAY_DEVICE dd;
|
||||||
|
ZERO( dd );
|
||||||
|
dd.cb = sizeof(dd);
|
||||||
|
if( !EnumDisplayDevices(NULL, i, &dd, 0) )
|
||||||
|
break;
|
||||||
|
if( dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE )
|
||||||
|
{
|
||||||
|
sPrimaryDeviceName = (char*)dd.DeviceString;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FreeLibrary(hInstUser32);
|
||||||
|
return sPrimaryDeviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetPrimaryVideoDriverInfo(VideoDriverInfo &info)
|
||||||
|
{
|
||||||
|
const CString sPrimaryDeviceName = GetPrimaryVideoName9xAnd2k();
|
||||||
|
if( sPrimaryDeviceName == "" )
|
||||||
|
LOG->Warn("GetPrimaryVideoName9xAnd2k failed; renderer selection may be wrong");
|
||||||
|
|
||||||
|
for( int i=0; true; i++ )
|
||||||
|
{
|
||||||
|
if( !GetVideoDriverInfo(i, info) )
|
||||||
|
RageException::Throw( "Got video name \"%s\" but wasn't enumerated among %i devices",
|
||||||
|
sPrimaryDeviceName.c_str(), i );
|
||||||
|
|
||||||
|
if( sPrimaryDeviceName == "" ) // failed to get primary display name (NT4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( info.sDescription == sPrimaryDeviceName )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get info for the given card number. Return false if that card doesn't exist. */
|
||||||
|
bool GetVideoDriverInfo(int cardno, VideoDriverInfo &info)
|
||||||
|
{
|
||||||
|
OSVERSIONINFO version;
|
||||||
|
version.dwOSVersionInfoSize=sizeof(version);
|
||||||
|
GetVersionEx(&version);
|
||||||
|
const bool bIsWin9x = version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS;
|
||||||
|
|
||||||
|
return (bIsWin9x ? GetVideoDriverInfo9x : GetVideoDriverInfo2k)(cardno,info);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef VIDEO_DRIVER_INFO_H
|
||||||
|
#define VIDEO_DRIVER_INFO_H
|
||||||
|
|
||||||
|
struct VideoDriverInfo
|
||||||
|
{
|
||||||
|
CString sProvider;
|
||||||
|
CString sDescription;
|
||||||
|
CString sVersion;
|
||||||
|
CString sDate;
|
||||||
|
CString sDeviceID;
|
||||||
|
};
|
||||||
|
|
||||||
|
CString GetPrimaryVideoName9xAnd2k();
|
||||||
|
bool GetVideoDriverInfo(int cardno, VideoDriverInfo &info);
|
||||||
|
void GetPrimaryVideoDriverInfo(VideoDriverInfo &info);
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user