[Spice-commits] common/vdcommon.cpp
Alon Levy
alon at kemper.freedesktop.org
Sun Aug 29 05:07:59 PDT 2010
common/vdcommon.cpp | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
New commits:
commit 53b32d4db33af4422382fbe629bb0314e252bdda
Author: Alon Levy <alevy at redhat.com>
Date: Sun Aug 29 15:07:47 2010 +0300
vdservice: add missing vdcommon.cpp
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;
+}
More information about the Spice-commits
mailing list