diff options
author | Alon Levy <alevy@redhat.com> | 2010-08-29 15:07:47 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2010-08-29 15:07:47 +0300 |
commit | 53b32d4db33af4422382fbe629bb0314e252bdda (patch) | |
tree | 1874ee3596ec07086c3e3c12e150b68dfe249812 /common | |
parent | 349e6a5bf8804b25c3af6e1f439122a7cc269cc2 (diff) |
vdservice: add missing vdcommon.cpp
Diffstat (limited to 'common')
-rw-r--r-- | common/vdcommon.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/vdcommon.cpp b/common/vdcommon.cpp new file mode 100644 index 0000000..372d9bb --- /dev/null +++ b/common/vdcommon.cpp @@ -0,0 +1,19 @@ +#include "vdcommon.h" + +bool get_qxl_device_id(TCHAR* 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; +} |