diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:47:08 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-12 03:47:08 +0000 |
commit | 68852bdf95b0a8a4d7dfc70578caa503f49f3dbf (patch) | |
tree | 23d0c6a1e787d53136004590f68fe11567516952 /content/gpu | |
parent | 0158ac1f5d29789b7ca5cf022083b7c70abec368 (diff) | |
download | chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.zip chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.tar.gz chromium_src-68852bdf95b0a8a4d7dfc70578caa503f49f3dbf.tar.bz2 |
Windows: Detect whether Lenovo dCute is installed.
The associated Thinkpad USB Port Replicator driver can crash on GPU process startup.
This patch is just to detect it and note its presence in about:gpu. The fix for the crash itself will be separate.
BUG=181665
Review URL: https://chromiumcodereview.appspot.com/12566026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r-- | content/gpu/gpu_info_collector_win.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index 3123eb39..51e1762 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -185,6 +185,24 @@ Version DisplayLinkVersion() { return Version(WideToASCII(version)); } + +// Returns whether Lenovo dCute is installed. +bool IsLenovoDCuteInstalled() { + base::win::RegKey key; + + if (FAILED(key.Open( + HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY))) { + return false; + } + + if (FAILED(key.OpenKey(L"Lenovo", KEY_READ | KEY_WOW64_64KEY))) + return false; + + if (FAILED(key.OpenKey(L"Lenovo dCute", KEY_READ | KEY_WOW64_64KEY))) + return false; + + return true; +} } // namespace anonymous namespace gpu_info_collector { @@ -515,6 +533,8 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) { HMODULE nvd3d9wrap = GetModuleHandleW(L"nvd3d9wrap.dll"); gpu_info->optimus = nvd3d9wrap != NULL; + gpu_info->lenovo_dcute = IsLenovoDCuteInstalled(); + gpu_info->display_link_version = DisplayLinkVersion(); if (!gpu_info->display_link_version .IsValid()) { |