ddraw/tests: Avoid picking a large mode on Win10 in test_coop_level_mode_set_enum_cb.

This commit is contained in:
Stefan Dösinger 2022-09-06 19:20:35 +03:00 committed by Alexandre Julliard
parent 64effe6df7
commit fc9f3bbfa5
4 changed files with 52 additions and 8 deletions

View file

@ -2874,8 +2874,19 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC *surface_
if (surface_desc->dwWidth == param->ddraw_width && surface_desc->dwHeight == param->ddraw_height)
return DDENUMRET_OK;
/* The docs say the DDENUMRET_CANCEL below cancels the enumeration, so the check should be
* redundant. However, since Windows 10 this no longer works and the enumeration continues
* until all supported modes are enumerated. Win8 and earlier do cancel.
*
* Unrelatedly, some testbot machines report high res modes like 1920x1080, but suffer from
* some problems when we actually try to set them (w10pro64 and its localization siblings).
* Try to stay below the registry mode if possible. */
if (!param->user32_width || (surface_desc->dwWidth < registry_mode.dmPelsWidth
&& surface_desc->dwHeight < registry_mode.dmPelsHeight))
{
param->user32_width = surface_desc->dwWidth;
param->user32_height = surface_desc->dwHeight;
}
return DDENUMRET_CANCEL;
}

View file

@ -2971,8 +2971,19 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC *surface_
if (surface_desc->dwWidth == param->ddraw_width && surface_desc->dwHeight == param->ddraw_height)
return DDENUMRET_OK;
/* The docs say the DDENUMRET_CANCEL below cancels the enumeration, so the check should be
* redundant. However, since Windows 10 this no longer works and the enumeration continues
* until all supported modes are enumerated. Win8 and earlier do cancel.
*
* Unrelatedly, some testbot machines report high res modes like 1920x1080, but suffer from
* some problems when we actually try to set them (w10pro64 and its localization siblings).
* Try to stay below the registry mode if possible. */
if (!param->user32_width || (surface_desc->dwWidth < registry_mode.dmPelsWidth
&& surface_desc->dwHeight < registry_mode.dmPelsHeight))
{
param->user32_width = surface_desc->dwWidth;
param->user32_height = surface_desc->dwHeight;
}
return DDENUMRET_CANCEL;
}

View file

@ -3209,8 +3209,19 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC2 *surface
if (surface_desc->dwWidth == param->ddraw_width && surface_desc->dwHeight == param->ddraw_height)
return DDENUMRET_OK;
/* The docs say the DDENUMRET_CANCEL below cancels the enumeration, so the check should be
* redundant. However, since Windows 10 this no longer works and the enumeration continues
* until all supported modes are enumerated. Win8 and earlier do cancel.
*
* Unrelatedly, some testbot machines report high res modes like 1920x1080, but suffer from
* some problems when we actually try to set them (w10pro64 and its localization siblings).
* Try to stay below the registry mode if possible. */
if (!param->user32_width || (surface_desc->dwWidth < registry_mode.dmPelsWidth
&& surface_desc->dwHeight < registry_mode.dmPelsHeight))
{
param->user32_width = surface_desc->dwWidth;
param->user32_height = surface_desc->dwHeight;
}
return DDENUMRET_CANCEL;
}

View file

@ -2860,8 +2860,19 @@ static HRESULT CALLBACK test_coop_level_mode_set_enum_cb(DDSURFACEDESC2 *surface
if (surface_desc->dwWidth == param->ddraw_width && surface_desc->dwHeight == param->ddraw_height)
return DDENUMRET_OK;
/* The docs say the DDENUMRET_CANCEL below cancels the enumeration, so the check should be
* redundant. However, since Windows 10 this no longer works and the enumeration continues
* until all supported modes are enumerated. Win8 and earlier do cancel.
*
* Unrelatedly, some testbot machines report high res modes like 1920x1080, but suffer from
* some problems when we actually try to set them (w10pro64 and its localization siblings).
* Try to stay below the registry mode if possible. */
if (!param->user32_width || (surface_desc->dwWidth < registry_mode.dmPelsWidth
&& surface_desc->dwHeight < registry_mode.dmPelsHeight))
{
param->user32_width = surface_desc->dwWidth;
param->user32_height = surface_desc->dwHeight;
}
return DDENUMRET_CANCEL;
}