win32u: Set DEVPKEY_Device_BusNumber for GPUs.
This commit is contained in:
parent
80910517d7
commit
bee387dc8a
2 changed files with 31 additions and 0 deletions
|
@ -1006,6 +1006,7 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
|
|||
WCHAR device_id[256];
|
||||
DEVPROPTYPE type;
|
||||
unsigned int i;
|
||||
UINT32 value;
|
||||
HDEVINFO set;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -1030,6 +1031,17 @@ static void test_gpu_device_properties_guid(const GUID *devinterface_guid)
|
|||
ok(ret, "Got unexpected ret %d, GetLastError() %lu.\n", ret, GetLastError());
|
||||
ok(type == DEVPROP_TYPE_STRING, "Got type %ld.\n", type);
|
||||
|
||||
ret = SetupDiGetDevicePropertyW(set, &device_data, &DEVPKEY_Device_BusNumber, &type,
|
||||
(BYTE *)&value, sizeof(value), NULL, 0);
|
||||
if (!wcsicmp(device_id, L"root\\basicrender") || !wcsicmp(device_id, L"root\\basicdisplay"))
|
||||
{
|
||||
ok(!ret, "Found Bus Id.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(ret, "Got unexpected ret %d, GetLastError() %lu, %s.\n", ret, GetLastError(), debugstr_w(device_id));
|
||||
ok(type == DEVPROP_TYPE_UINT32, "Got type %ld.\n", type);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
SetupDiDestroyDeviceInfoList(set);
|
||||
|
|
|
@ -101,6 +101,14 @@ static const WCHAR devpkey_device_matching_device_id[] =
|
|||
'\\','0','0','0','8'
|
||||
};
|
||||
|
||||
static const WCHAR devpkey_device_bus_number[] =
|
||||
{
|
||||
'P','r','o','p','e','r','t','i','e','s',
|
||||
'\\','{','A','4','5','C','2','5','4','E','-','D','F','1','C','-','4','E','F','D',
|
||||
'-','8','0','2','0','-','6','7','D','1','4','6','A','8','5','0','E','0','}',
|
||||
'\\','0','0','1','7'
|
||||
};
|
||||
|
||||
static const WCHAR devpropkey_device_ispresentW[] =
|
||||
{
|
||||
'P','r','o','p','e','r','t','i','e','s',
|
||||
|
@ -1237,6 +1245,17 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param )
|
|||
NtClose( subkey );
|
||||
}
|
||||
|
||||
if (gpu->vendor_id && gpu->device_id)
|
||||
{
|
||||
if ((subkey = reg_create_key( hkey, devpkey_device_bus_number,
|
||||
sizeof(devpkey_device_bus_number), 0, NULL )))
|
||||
{
|
||||
set_reg_value( subkey, NULL, 0xffff0000 | DEVPROP_TYPE_UINT32,
|
||||
&gpu_index, sizeof(gpu_index) );
|
||||
NtClose( subkey );
|
||||
}
|
||||
}
|
||||
|
||||
desc = gpu->name;
|
||||
if (!desc[0]) desc = wine_adapterW;
|
||||
set_reg_value( hkey, device_descW, REG_SZ, desc, (lstrlenW( desc ) + 1) * sizeof(WCHAR) );
|
||||
|
|
Loading…
Add table
Reference in a new issue