Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/user32/sysparams.c | 50 ++++++++++++++++++++++++++++++++++++- dlls/user32/tests/monitor.c | 6 ----- 2 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 82d7877f3e..20128ec7d8 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -4522,5 +4522,53 @@ LONG WINAPI QueryDisplayConfig(UINT32 flags, UINT32 *numpathelements, DISPLAYCON LONG WINAPI DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER *packet) { FIXME("stub: %p\n", packet); - return ERROR_NOT_SUPPORTED; + + if (!packet || packet->size < sizeof(*packet)) + return ERROR_GEN_FAILURE; + + switch (packet->type) + { + case DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME: + { + DISPLAYCONFIG_SOURCE_DEVICE_NAME *source_name = (DISPLAYCONFIG_SOURCE_DEVICE_NAME *)packet; + if (packet->size < sizeof(*source_name)) + return ERROR_INVALID_PARAMETER; + + return ERROR_NOT_SUPPORTED; + } + case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME: + { + DISPLAYCONFIG_TARGET_DEVICE_NAME *target_name = (DISPLAYCONFIG_TARGET_DEVICE_NAME *)packet; + if (packet->size < sizeof(*target_name)) + return ERROR_INVALID_PARAMETER; + + return ERROR_NOT_SUPPORTED; + } + case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE: + { + DISPLAYCONFIG_TARGET_PREFERRED_MODE *preferred_mode = (DISPLAYCONFIG_TARGET_PREFERRED_MODE *)packet; + if (packet->size < sizeof(*preferred_mode)) + return ERROR_INVALID_PARAMETER; + + return ERROR_NOT_SUPPORTED; + } + case DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME: + { + DISPLAYCONFIG_ADAPTER_NAME *adapter_name = (DISPLAYCONFIG_ADAPTER_NAME *)packet; + if (packet->size < sizeof(*adapter_name)) + return ERROR_INVALID_PARAMETER; + + return ERROR_NOT_SUPPORTED; + } + case DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE: + case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE: + case DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION: + case DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION: + case DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO: + case DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE: + case DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL: + default: + FIXME("Unimplemented packet type: %u\n", packet->type); + return ERROR_INVALID_PARAMETER; + } } diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 2dd642f58f..0a086f9e10 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -1211,8 +1211,6 @@ static void test_display_config_get_device_info(void) DISPLAYCONFIG_TARGET_PREFERRED_MODE preferred_mode; DISPLAYCONFIG_ADAPTER_NAME adapter_name;
- todo_wine - { ret = pDisplayConfigGetDeviceInfo(NULL); ok(ret == ERROR_GEN_FAILURE, "got %d\n", ret);
@@ -1245,7 +1243,6 @@ static void test_display_config_get_device_info(void) source_name.header.size = sizeof(source_name) - 1; ret = pDisplayConfigGetDeviceInfo(&source_name.header); ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); - }
source_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; source_name.header.size = sizeof(source_name); @@ -1258,7 +1255,6 @@ static void test_display_config_get_device_info(void) target_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; target_name.header.size = sizeof(target_name) - 1; ret = pDisplayConfigGetDeviceInfo(&target_name.header); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
target_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; @@ -1272,7 +1268,6 @@ static void test_display_config_get_device_info(void) preferred_mode.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE; preferred_mode.header.size = sizeof(preferred_mode) - 1; ret = pDisplayConfigGetDeviceInfo(&preferred_mode.header); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
preferred_mode.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE; @@ -1286,7 +1281,6 @@ static void test_display_config_get_device_info(void) adapter_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME; adapter_name.header.size = sizeof(adapter_name) - 1; ret = pDisplayConfigGetDeviceInfo(&adapter_name.header); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
adapter_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME;