summaryrefslogtreecommitdiff
path: root/indra/llwindow/lldxhardware.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
commitbaa73fddd9287ddafd2d31551cb253b355ed910a (patch)
treee3f0986617fe6c0ee0a14df6aac13c6bb6f92507 /indra/llwindow/lldxhardware.cpp
parentdc3833f31b8a20220ddb1775e1625c016c397435 (diff)
parentfcaa1ad46fd1df4cfec9dee12caf6e7b5bf32136 (diff)
Merge with viewer-2.0.0-3 branch
Diffstat (limited to 'indra/llwindow/lldxhardware.cpp')
-rw-r--r--indra/llwindow/lldxhardware.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index d33a0a6eea..d8058baf53 100644
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -625,7 +625,37 @@ LLSD LLDXHardware::getDisplayInfo()
ret["DeviceName"] = device_name;
std::string device_driver= get_string(device_containerp, L"szDriverVersion");
ret["DriverVersion"] = device_driver;
- }
+
+ // ATI has a slightly different version string
+ if(device_name.length() >= 4 && device_name.substr(0,4) == "ATI ")
+ {
+ // get the key
+ HKEY hKey;
+ const DWORD RV_SIZE = 100;
+ WCHAR release_version[RV_SIZE];
+
+ // Hard coded registry entry. Using this since it's simpler for now.
+ // And using EnumDisplayDevices to get a registry key also requires
+ // a hard coded Query value.
+ if(ERROR_SUCCESS == RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\ATI Technologies\\CBT"), &hKey))
+ {
+ // get the value
+ DWORD dwType = REG_SZ;
+ DWORD dwSize = sizeof(WCHAR) * RV_SIZE;
+ if(ERROR_SUCCESS == RegQueryValueEx(hKey, TEXT("ReleaseVersion"),
+ NULL, &dwType, (LPBYTE)release_version, &dwSize))
+ {
+ // print the value
+ // windows doesn't guarantee to be null terminated
+ release_version[RV_SIZE - 1] = NULL;
+ ret["DriverVersion"] = utf16str_to_utf8str(release_version);
+
+ }
+ RegCloseKey(hKey);
+ }
+ }
+ }
+
LCleanup:
SAFE_RELEASE(file_containerp);
SAFE_RELEASE(driver_containerp);