Commit b1b1399d authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

user32: Improve DisplayConfigGetDeviceInfo() stub.

parent 4e795a8d
......@@ -4528,5 +4528,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;
}
}
......@@ -1332,8 +1332,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);
......@@ -1366,7 +1364,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);
......@@ -1379,7 +1376,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;
......@@ -1393,7 +1389,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;
......@@ -1407,7 +1402,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment