Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/winex11.drv/display.c | 6 ++++++ include/ntddvdeo.h | 1 + 2 files changed, 7 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index b3ff213ae89..0b20cff5e79 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -30,6 +30,7 @@ #include "initguid.h" #include "devguid.h" #include "devpkey.h" +#include "ntddvdeo.h" #include "setupapi.h" #define WIN32_NO_STATUS #include "winternl.h" @@ -409,6 +410,7 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g WCHAR *driver, LUID *gpu_luid) { static const BOOL present = TRUE; + SP_DEVICE_INTERFACE_DATA iface_data = {sizeof(iface_data)}; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; DEVPROPTYPE property_type; @@ -432,6 +434,10 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g goto done; }
+ /* Register GUID_DISPLAY_DEVICE_ARRIVAL */ + if (!SetupDiCreateDeviceInterfaceW(devinfo, &device_data, &GUID_DISPLAY_DEVICE_ARRIVAL, NULL, 0, &iface_data)) + goto done; + /* Write HardwareID registry property, REG_MULTI_SZ */ written = sprintfW(bufferW, gpu_hardware_id_fmtW, gpu->vendor_id, gpu->device_id); bufferW[written + 1] = 0; diff --git a/include/ntddvdeo.h b/include/ntddvdeo.h index 9523e37f7b4..8736c6cc845 100644 --- a/include/ntddvdeo.h +++ b/include/ntddvdeo.h @@ -21,5 +21,6 @@
DEFINE_GUID(GUID_DEVINTERFACE_DISPLAY_ADAPTER, 0x5b45201d, 0xf2f2, 0x4f3b, 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99); DEFINE_GUID(GUID_DEVINTERFACE_MONITOR, 0xe6f07b5f, 0xee97, 0x4a90, 0xb0, 0x76, 0x33, 0xf5, 0x7b, 0xf4, 0xea, 0xa7); +DEFINE_GUID(GUID_DISPLAY_DEVICE_ARRIVAL, 0x1ca05180, 0xa699, 0x450a, 0x9a, 0x0c, 0xde, 0x4f, 0xbe, 0x3d, 0xdd, 0x89);
#endif
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/winemac.drv/display.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 5a87e2331be..0617c08f393 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -29,6 +29,7 @@ #include "initguid.h" #include "devguid.h" #include "devpkey.h" +#include "ntddvdeo.h" #include "setupapi.h" #define WIN32_NO_STATUS #include "winternl.h" @@ -1452,6 +1453,7 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int WCHAR *driver, LUID *gpu_luid) { static const BOOL present = TRUE; + SP_DEVICE_INTERFACE_DATA iface_data = {sizeof(iface_data)}; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; DEVPROPTYPE property_type; @@ -1474,6 +1476,10 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int goto done; }
+ /* Register GUID_DISPLAY_DEVICE_ARRIVAL */ + if (!SetupDiCreateDeviceInterfaceW(devinfo, &device_data, &GUID_DISPLAY_DEVICE_ARRIVAL, NULL, 0, &iface_data)) + goto done; + /* Write HardwareID registry property, REG_MULTI_SZ */ written = sprintfW(bufferW, gpu_hardware_id_fmtW, gpu->vendor_id, gpu->device_id); bufferW[written + 1] = 0;
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- v2: - moved from gdi32/tests/driver.c to user32/tests/monitor.c.
dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/monitor.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index dd101d69f3c..1422efb142b 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid +IMPORTS = setupapi user32 gdi32 advapi32 hid
C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index cee7b629cd7..6fa5053719a 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -29,6 +29,10 @@ #include "winreg.h" #include "winternl.h" #include "ddk/d3dkmthk.h" +#include "initguid.h" +#include "ntddvdeo.h" +#include "devguid.h" +#include "setupapi.h" #include "wine/heap.h" #include <stdio.h>
@@ -2389,6 +2393,34 @@ static void test_display_dc(void) } }
+static void test_device_interfaces(void) +{ + SP_DEVINFO_DATA device_data = {sizeof(device_data)}; + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; + unsigned int i; + HDEVINFO set; + BOOL ret; + + set = SetupDiGetClassDevsW(&GUID_DISPLAY_DEVICE_ARRIVAL, NULL, NULL, DIGCF_DEVICEINTERFACE); + ok(set != INVALID_HANDLE_VALUE, "SetupDiGetClassDevs failed, error %u.\n", GetLastError()); + + i = 0; + while ((ret = SetupDiEnumDeviceInfo(set, i, &device_data))) + { + ret = SetupDiEnumDeviceInterfaces(set, &device_data, &GUID_DISPLAY_DEVICE_ARRIVAL, 0, &iface); + ok(IsEqualGUID(&iface.InterfaceClassGuid, &GUID_DISPLAY_DEVICE_ARRIVAL), + "Got unexpected guid %s.\n", + wine_dbgstr_guid(&iface.InterfaceClassGuid)); + ok(ret, "Got unexpected ret %#x, GetLastError() %u.\n", ret, GetLastError()); + ++i; + } + ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "Got unexpected ret %#x, GetLastError() %u.\n", + ret, GetLastError()); + ok(i || broken(!i) /* before Win8 */, "Could not find any devices.\n"); + + SetupDiDestroyDeviceInfoList(set); +} + START_TEST(monitor) { init_function_pointers(); @@ -2401,4 +2433,5 @@ START_TEST(monitor) test_display_config(); test_handles(); test_display_dc(); + test_device_interfaces(); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=97422
Your paranoid android.
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064 (32 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64 (32 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064v1809 (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064 (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064_2qxl (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64 (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64_ar (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64_he (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64_ja (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w10pro64_zh_CN (64 bit report) ===
user32: cursoricon.c:2508: Test failed: cursor not shown in info cursoricon.c:2532: Test failed: cursor not shown in info cursoricon.c:2585: Test failed: cursor not shown in info cursoricon.c:2597: Test failed: cursor not shown in info
=== w1064_2qxl (64 bit report) ===
user32: input.c:1303: Test failed: Wrong set pos: (100,100) input.c:1323: Test failed: GetCursorPos: (100,100) input.c:4102: Test failed: 7:0: WaitForSingleObject returned 258 input.c:4045: Test failed: 7:0: expected that X highest bit is set, got 0 input.c:4046: Test failed: 7:0: expected that X keystate is set input.c:4046: Test failed: 7:0: expected that X keystate is set input.c:4053: Test failed: 7:0: expected that X keystate is set input.c:4053: Test failed: 7:0: expected that X keystate is set input.c:4045: Test failed: 7:1: expected that X highest bit is set, got 0x1 input.c:4046: Test failed: 7:1: expected that X keystate is set input.c:4046: Test failed: 7:1: expected that X keystate is set input.c:4053: Test failed: 7:1: expected that X keystate is set input.c:4053: Test failed: 7:1: expected that X keystate is set input.c:4045: Test failed: 7:2: expected that X highest bit is set, got 0 input.c:4046: Test failed: 7:2: expected that X keystate is set input.c:4046: Test failed: 7:2: expected that X keystate is set input.c:4053: Test failed: 7:2: expected that X keystate is set input.c:4053: Test failed: 7:2: expected that X keystate is set input.c:4045: Test failed: 7:3: expected that X highest bit is set, got 0x1 input.c:4046: Test failed: 7:3: expected that X keystate is set input.c:4046: Test failed: 7:3: expected that X keystate is set input.c:4053: Test failed: 7:3: expected that X keystate is set input.c:4053: Test failed: 7:3: expected that X keystate is set input.c:4045: Test failed: 8:0: expected that X highest bit is set, got 0 input.c:4046: Test failed: 8:0: expected that X keystate is set input.c:4046: Test failed: 8:0: expected that X keystate is set input.c:4053: Test failed: 8:0: expected that X keystate is set input.c:4053: Test failed: 8:0: expected that X keystate is set input.c:4045: Test failed: 8:1: expected that X highest bit is set, got 0x1 input.c:4046: Test failed: 8:1: expected that X keystate is set input.c:4046: Test failed: 8:1: expected that X keystate is set input.c:4053: Test failed: 8:1: expected that X keystate is set input.c:4053: Test failed: 8:1: expected that X keystate is set input.c:4045: Test failed: 8:2: expected that X highest bit is set, got 0 input.c:4046: Test failed: 8:2: expected that X keystate is set input.c:4046: Test failed: 8:2: expected that X keystate is set input.c:4053: Test failed: 8:2: expected that X keystate is set input.c:4053: Test failed: 8:2: expected that X keystate is set input.c:4045: Test failed: 8:3: expected that X highest bit is set, got 0x1 input.c:4046: Test failed: 8:3: expected that X keystate is set input.c:4046: Test failed: 8:3: expected that X keystate is set input.c:4053: Test failed: 8:3: expected that X keystate is set input.c:4053: Test failed: 8:3: expected that X keystate is set
=== w10pro64_he (64 bit report) ===
user32: input.c:1433: Test failed: Wrong new pos: (150,150)
=== w10pro64_ja (64 bit report) ===
user32: input.c:1303: Test failed: Wrong set pos: (99,100) input.c:1323: Test failed: GetCursorPos: (99,100)
=== w1064_2qxl (64 bit report) ===
user32: listbox.c:1188: Test failed: SendMessage(LB_DIR, DDL_DRIVES, *) filled with 16 entries, expected 17 listbox.c:1249: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with 16 entries, expected 20
=== w10pro64_ar (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w10pro64_he (64 bit report) ===
user32: menu.c:2337: Test failed: test 6 menu.c:2337: Test failed: test 8 menu.c:2337: Test failed: test 10 menu.c:2337: Test failed: test 12 menu.c:2337: Test failed: test 14 menu.c:2337: Test failed: test 16
=== w7u_2qxl (32 bit report) ===
user32: msg.c:12665: Test failed: msg.message = 30 instead of WM_TIMER msg.c:12669: Test failed: msg.message = 30 instead of WM_TIMER
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:5564: Test failed: RedrawWindow:show_popup_extreme_location: 24: the msg 0x0085 was expected, but got msg 0x0047 instead msg.c:5564: Test failed: RedrawWindow:show_popup_extreme_location: 25: the msg sequence is not complete: expected 0014 - actual 0000
=== w8 (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:224: Test failed: Unexpected WM_DISPLAYCHANGE message sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1 sysparams.c:245: Test failed: too many changes counter=1 last change=42 sysparams.c:283: Test failed: Missed a message: change_counter=2
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064 (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064_tsign (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64 (32 bit report) ===
user32: sysparams.c:2494: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2505: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64_ar (64 bit report) ===
user32: sysparams.c:351: Test failed: Wrong value in registry: Software\Microsoft\Windows NT\CurrentVersion\Windows MenuDropAlignment '1' instead of '0' sysparams.c:1189: Test failed: SPI_{GET,SET}MENUDROPALIGNMENT: got 1 instead of 0 sysparams.c:1191: Test failed: SM_MENUDROPALIGNMENT: got 1 instead of 0
On 9/6/21 8:42 PM, Paul Gofman wrote:
Signed-off-by: Paul Gofman pgofman@codeweavers.com
dlls/winex11.drv/display.c | 6 ++++++ include/ntddvdeo.h | 1 + 2 files changed, 7 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index b3ff213ae89..0b20cff5e79 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -30,6 +30,7 @@ #include "initguid.h" #include "devguid.h" #include "devpkey.h" +#include "ntddvdeo.h" #include "setupapi.h" #define WIN32_NO_STATUS #include "winternl.h" @@ -409,6 +410,7 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g WCHAR *driver, LUID *gpu_luid) { static const BOOL present = TRUE;
- SP_DEVICE_INTERFACE_DATA iface_data = {sizeof(iface_data)}; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; DEVPROPTYPE property_type;
@@ -432,6 +434,10 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g goto done; }
- /* Register GUID_DISPLAY_DEVICE_ARRIVAL */
- if (!SetupDiCreateDeviceInterfaceW(devinfo, &device_data, &GUID_DISPLAY_DEVICE_ARRIVAL, NULL, 0, &iface_data))
goto done;
iface_data is not used. You can pass NULL instead.
- /* Write HardwareID registry property, REG_MULTI_SZ */ written = sprintfW(bufferW, gpu_hardware_id_fmtW, gpu->vendor_id, gpu->device_id); bufferW[written + 1] = 0;
diff --git a/include/ntddvdeo.h b/include/ntddvdeo.h index 9523e37f7b4..8736c6cc845 100644 --- a/include/ntddvdeo.h +++ b/include/ntddvdeo.h @@ -21,5 +21,6 @@
DEFINE_GUID(GUID_DEVINTERFACE_DISPLAY_ADAPTER, 0x5b45201d, 0xf2f2, 0x4f3b, 0x85, 0xbb, 0x30, 0xff, 0x1f, 0x95, 0x35, 0x99); DEFINE_GUID(GUID_DEVINTERFACE_MONITOR, 0xe6f07b5f, 0xee97, 0x4a90, 0xb0, 0x76, 0x33, 0xf5, 0x7b, 0xf4, 0xea, 0xa7); +DEFINE_GUID(GUID_DISPLAY_DEVICE_ARRIVAL, 0x1ca05180, 0xa699, 0x450a, 0x9a, 0x0c, 0xde, 0x4f, 0xbe, 0x3d, 0xdd, 0x89);
#endif
On 9/6/21 17:26, Zhiyi Zhang wrote:
iface_data is not used. You can pass NULL instead.
Yeah, thanks, I will resend.
Not strictly related, but is there any reason why your Proton patch "winex11.drv: Link display device interfaces" cannot go upstream? Yes, I know the functionality is managed in PnP driver on Windows, but since we don't have one and unlikely to have it in the near future is there anything wrong in making DIGCF_PRESENT flag work this way with display devices? Some games depend on that, and my other patch for D3DKMTOpenAdapterFromDeviceName() implementation is hard to get right without that one working.
On 9/6/21 10:40 PM, Paul Gofman wrote:
On 9/6/21 17:26, Zhiyi Zhang wrote:
iface_data is not used. You can pass NULL instead.
Yeah, thanks, I will resend.
Not strictly related, but is there any reason why your Proton patch "winex11.drv: Link display device interfaces" cannot go upstream? Yes, I know the functionality is managed in PnP driver on Windows, but since we don't have one and unlikely to have it in the near future is there anything wrong in making DIGCF_PRESENT flag work this way with display devices? Some games depend on that, and my other patch for D3DKMTOpenAdapterFromDeviceName() implementation is hard to get right without that one working.
It's because the way DIGCF_PRESENT that is implemented in Proton is incorrect. So "winex11.drv: Link display device interfaces" is also not proper.
On 9/6/21 17:45, Zhiyi Zhang wrote:
On 9/6/21 10:40 PM, Paul Gofman wrote:
On 9/6/21 17:26, Zhiyi Zhang wrote:
iface_data is not used. You can pass NULL instead.
Yeah, thanks, I will resend.
Not strictly related, but is there any reason why your Proton patch "winex11.drv: Link display device interfaces" cannot go upstream? Yes, I know the functionality is managed in PnP driver on Windows, but since we don't have one and unlikely to have it in the near future is there anything wrong in making DIGCF_PRESENT flag work this way with display devices? Some games depend on that, and my other patch for D3DKMTOpenAdapterFromDeviceName() implementation is hard to get right without that one working.
It's because the way DIGCF_PRESENT that is implemented in Proton is incorrect. So "winex11.drv: Link display device interfaces" is also not proper.
To summarize, we had a brief conversation with Zhiyi in the chat and DIGCF_PRESENT is actually implemented upstream for device interfaces, so the current version of the "Link display device interfaces" patch makes some sense upstream too. So Zhiyi is going to look into upstreaming that patch. While my patch for GUID_DISPLAY_DEVICE_ARRIVAL is not actually much useful with SetupDiGetClassDevsW() not returning any interfaces for display devices when DIGCF_PRESENT is specified (the only game which I know depends on that specifies that flag), so I will resend the patch once that part is upstream.