| 97 | } |
| 98 | |
| 99 | ALResult 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 |
no test coverage detected