Signed-off-by: Brendan Shanks bshanks@codeweavers.com ---
v2: Trace the names of packet types (both implemented and unimplemented)
dlls/user32/sysparams.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 8b2b3381dc3..3ec6c54023b 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4815,7 +4815,7 @@ done: */ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) { - FIXME("stub: %p\n", packet); + TRACE("(%p)\n", packet);
if (!packet || packet->size < sizeof(*packet)) return ERROR_GEN_FAILURE; @@ -4825,6 +4825,9 @@ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) case DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME: { DISPLAYCONFIG_SOURCE_DEVICE_NAME *source_name = (DISPLAYCONFIG_SOURCE_DEVICE_NAME *)packet; + + FIXME("DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME: stub\n"); + if (packet->size < sizeof(*source_name)) return ERROR_INVALID_PARAMETER;
@@ -4833,6 +4836,9 @@ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME: { DISPLAYCONFIG_TARGET_DEVICE_NAME *target_name = (DISPLAYCONFIG_TARGET_DEVICE_NAME *)packet; + + FIXME("DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME: stub\n"); + if (packet->size < sizeof(*target_name)) return ERROR_INVALID_PARAMETER;
@@ -4841,6 +4847,9 @@ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE: { DISPLAYCONFIG_TARGET_PREFERRED_MODE *preferred_mode = (DISPLAYCONFIG_TARGET_PREFERRED_MODE *)packet; + + FIXME("DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE: stub\n"); + if (packet->size < sizeof(*preferred_mode)) return ERROR_INVALID_PARAMETER;
@@ -4849,6 +4858,9 @@ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) case DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME: { DISPLAYCONFIG_ADAPTER_NAME *adapter_name = (DISPLAYCONFIG_ADAPTER_NAME *)packet; + + FIXME("DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME: stub\n"); + if (packet->size < sizeof(*adapter_name)) return ERROR_INVALID_PARAMETER;
Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/user32/sysparams.c | 48 +++++++++++++++++++++++++++++++++++-- dlls/user32/tests/monitor.c | 2 -- 2 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 3ec6c54023b..6c0c3e76db7 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4815,23 +4815,67 @@ done: */ LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) { + LONG ret = ERROR_GEN_FAILURE; + HANDLE mutex; + HDEVINFO devinfo; + SP_DEVINFO_DATA device_data = {sizeof(device_data)}; + DWORD index = 0, type; + LUID gpu_luid; + TRACE("(%p)\n", packet);
if (!packet || packet->size < sizeof(*packet)) return ERROR_GEN_FAILURE; + wait_graphics_driver_ready();
switch (packet->type) { case DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME: { DISPLAYCONFIG_SOURCE_DEVICE_NAME *source_name = (DISPLAYCONFIG_SOURCE_DEVICE_NAME *)packet; + WCHAR device_name[CCHDEVICENAME]; + LONG source_id;
- FIXME("DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME: stub\n"); + TRACE("DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME\n");
if (packet->size < sizeof(*source_name)) return ERROR_INVALID_PARAMETER;
- return ERROR_NOT_SUPPORTED; + mutex = get_display_device_init_mutex(); + devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_MONITOR, DISPLAY, NULL, DIGCF_PRESENT); + if (devinfo == INVALID_HANDLE_VALUE) + { + release_display_device_init_mutex(mutex); + return ret; + } + + while (SetupDiEnumDeviceInfo(devinfo, index++, &device_data)) + { + if (!SetupDiGetDevicePropertyW(devinfo, &device_data, &DEVPROPKEY_MONITOR_GPU_LUID, + &type, (BYTE *)&gpu_luid, sizeof(gpu_luid), NULL, 0)) + continue; + + if ((source_name->header.adapterId.LowPart != gpu_luid.LowPart) || + (source_name->header.adapterId.HighPart != gpu_luid.HighPart)) + continue; + + /* QueryDisplayConfig() derives the source ID from the adapter name. */ + if (!SetupDiGetDevicePropertyW(devinfo, &device_data, &WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, + &type, (BYTE *)device_name, sizeof(device_name), NULL, 0)) + continue; + + source_id = strtolW(device_name + ARRAY_SIZE(ADAPTER_PREFIX), NULL, 10); + source_id--; + if (source_name->header.id != source_id) + continue; + + lstrcpyW(source_name->viewGdiDeviceName, device_name); + ret = ERROR_SUCCESS; + break; + } + SetupDiDestroyDeviceInfoList(devinfo); + release_display_device_init_mutex(mutex); + return ret; } case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME: { diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index f469111a26c..8fe4701d003 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1300,7 +1300,6 @@ static void test_QueryDisplayConfig_result(UINT32 flags,
for (i = 0; i < paths; i++) { - todo_wine { source_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; source_name.header.size = sizeof(source_name); source_name.header.adapterId = pi[i].sourceInfo.adapterId; @@ -1309,7 +1308,6 @@ static void test_QueryDisplayConfig_result(UINT32 flags, ret = pDisplayConfigGetDeviceInfo(&source_name.header); ok(!ret, "Expected 0, got %d\n", ret); ok(source_name.viewGdiDeviceName[0] != '\0', "Expected GDI device name, got empty string\n"); - }
todo_wine { target_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
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=75386
Your paranoid android.
=== debiant (32 bit report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout sysparams: Timeout
=== debiant (build log) ===
The task timed out
=== debiant (32 bit WoW report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout
=== debiant (build log) ===
The task timed out
Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/user32/tests/monitor.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 8fe4701d003..6e8c9a275d7 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1309,6 +1309,15 @@ static void test_QueryDisplayConfig_result(UINT32 flags, ok(!ret, "Expected 0, got %d\n", ret); ok(source_name.viewGdiDeviceName[0] != '\0', "Expected GDI device name, got empty string\n");
+ /* Test with an invalid adapter LUID */ + source_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; + source_name.header.size = sizeof(source_name); + source_name.header.adapterId.LowPart = 0xFFFF; + source_name.header.adapterId.HighPart = 0xFFFF; + source_name.header.id = pi[i].sourceInfo.id; + ret = pDisplayConfigGetDeviceInfo(&source_name.header); + ok(ret == ERROR_GEN_FAILURE, "Expected GEN_FAILURE, got %d\n", ret); + todo_wine { target_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; target_name.header.size = sizeof(target_name);
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=75387
Your paranoid android.
=== debiant (32 bit report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout sysparams: Timeout
=== debiant (build log) ===
The task timed out
=== debiant (32 bit WoW report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout
=== debiant (build log) ===
The task timed out
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=75385
Your paranoid android.
=== debiant (32 bit report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout
=== debiant (build log) ===
The task timed out
=== debiant (32 bit WoW report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout
=== debiant (build log) ===
The task timed out