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 --- dlls/gdi32/tests/Makefile.in | 2 +- dlls/gdi32/tests/driver.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/tests/Makefile.in b/dlls/gdi32/tests/Makefile.in index 876f6a376a2..3eb478ff765 100644 --- a/dlls/gdi32/tests/Makefile.in +++ b/dlls/gdi32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = gdi32.dll -IMPORTS = user32 gdi32 advapi32 +IMPORTS = setupapi user32 gdi32 advapi32
C_SRCS = \ bitmap.c \ diff --git a/dlls/gdi32/tests/driver.c b/dlls/gdi32/tests/driver.c index eb0da18b32e..1b00aa32a73 100644 --- a/dlls/gdi32/tests/driver.c +++ b/dlls/gdi32/tests/driver.c @@ -29,6 +29,10 @@ #include "winternl.h" #include "dwmapi.h" #include "ddk/d3dkmthk.h" +#include "initguid.h" +#include "ntddvdeo.h" +#include "devguid.h" +#include "setupapi.h"
#include "wine/test.h"
@@ -789,6 +793,34 @@ static void test_D3DKMTCheckOcclusion(void) DestroyWindow(hwnd); }
+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(driver) { HMODULE gdi32 = GetModuleHandleA("gdi32.dll"); @@ -814,6 +846,7 @@ START_TEST(driver) test_D3DKMTCheckVidPnExclusiveOwnership(); test_D3DKMTSetVidPnSourceOwner(); test_D3DKMTCheckOcclusion(); + test_device_interfaces();
FreeLibrary(dwmapi); }
On Mon, Sep 06, 2021 at 02:51:52PM +0300, Paul Gofman wrote:
Signed-off-by: Paul Gofman pgofman@codeweavers.com
dlls/gdi32/tests/Makefile.in | 2 +- dlls/gdi32/tests/driver.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-)
These probably make more sense in dlls/user32/tests/monitor.c
Huw.
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=97418
Your paranoid android.
=== w1064v1809 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally