diff options
author | Arnon Gilboa <agilboa@redhat.com> | 2010-11-09 20:50:21 +0200 |
---|---|---|
committer | Arnon Gilboa <agilboa@redhat.com> | 2010-11-09 20:50:21 +0200 |
commit | 35d1b7c835561d44f631e2e1777a13b3573c3ccf (patch) | |
tree | 4f934447e133cab5ff910c3d5c13547a35fc0672 /vdagent/desktop_layout.cpp | |
parent | 1e7f9e85a78be3a6d70557de43f968387278bd05 (diff) |
Revert "vdservice: don't start when no qxl device present"
This reverts commit 349e6a5bf8804b25c3af6e1f439122a7cc269cc2 which breaks vsdervice on Windows 7
Diffstat (limited to 'vdagent/desktop_layout.cpp')
-rw-r--r-- | vdagent/desktop_layout.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp index b7a6b9c..32502bc 100644 --- a/vdagent/desktop_layout.cpp +++ b/vdagent/desktop_layout.cpp @@ -17,7 +17,6 @@ #include "desktop_layout.h" #include "vdlog.h" -#include "vdcommon.h" void DisplayMode::set_res(DWORD width, DWORD height, DWORD depth) { @@ -156,6 +155,24 @@ bool DesktopLayout::is_attached(LPCTSTR dev_name) return !!dev_mode.dmBitsPerPel; } +bool DesktopLayout::get_qxl_device_id(WCHAR* device_key, DWORD* device_id) +{ + DWORD type = REG_BINARY; + DWORD size = sizeof(*device_id); + bool key_found = false; + HKEY key; + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, wcsstr(device_key, L"System"), + 0L, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) { + if (RegQueryValueEx(key, L"QxlDeviceID", NULL, &type, (LPBYTE)device_id, &size) == + ERROR_SUCCESS) { + key_found = true; + } + RegCloseKey(key); + } + return key_found; +} + void DesktopLayout::init_dev_mode(DEVMODE* dev_mode, DisplayMode* mode, bool set_pos) { ZeroMemory(dev_mode, sizeof(DEVMODE)); |