MCPcopy Create free account
hub / github.com/carbonengine/trinity / DoGetDriverVersion

Function DoGetDriverVersion

trinityal/Tr2DriverUtilities.cpp:99–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99ALResult DoGetDriverVersion( uint32_t deviceId, Tr2VideoDriverInfo& info )
100{
101 std::string keyPath;
102 if( !GetDeviceRegistryKey( deviceId, keyPath ) )
103 {
104 return E_FAIL;
105 }
106
107 HKEY key;
108 LONG result = RegOpenKeyEx( HKEY_LOCAL_MACHINE, keyPath.c_str(), 0, KEY_QUERY_VALUE, &key );
109 if( result != ERROR_SUCCESS )
110 {
111 return E_FAIL;
112 }
113 ON_BLOCK_EXIT_WITH_UNUSED( [&] { RegCloseKey( key ); } );
114
115 if( GetRegistryValue( key, "DriverVersion", info.driverVersionString ) )
116 {
117 DriverVersionToInt64( info.driverVersionString.c_str(), info.driverVersion );
118 }
119 GetRegistryValue( key, "DriverDate", info.driverDate );
120 if( GetRegistryValue( key, "ProviderName", info.driverVendor ) )
121 {
122 info.isAmdDynamicSwitchable = info.driverVendor == "Advanced Micro Devices, Inc." || info.driverVendor == "ATI Technologies Inc.";
123 }
124
125 info.isOptimus = IsOptimus();
126 info.isAmdDynamicSwitchable = false;
127
128 return S_OK;
129}
130
131#else
132

Callers 1

GetDriverVersionFunction · 0.85

Calls 4

GetDeviceRegistryKeyFunction · 0.85
GetRegistryValueFunction · 0.85
DriverVersionToInt64Function · 0.85
IsOptimusFunction · 0.85

Tested by

no test coverage detected