From: Paul Gofman pgofman@codeweavers.com
--- dlls/gdi32/tests/driver.c | 12 ++++++++++++ dlls/win32u/sysparams.c | 17 +++++++++++++++++ 2 files changed, 29 insertions(+)
diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c index 092bde0e5c1..eabd3ed15b8 100644 --- a/dlls/gdi32/tests/driver.c +++ b/dlls/gdi32/tests/driver.c @@ -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); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index a02158a17a0..8ed27860cf5 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -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,15 @@ 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) );