mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/win32-vd_agent
synced 2025-12-26 13:26:00 +00:00
20 lines
615 B
C++
20 lines
615 B
C++
#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;
|
|
}
|