winex11.drv: Allow setting a 0-bit color depth display mode.

Windows 8.1 and older allow setting a display mode with 0-bit color depth.

Fix a regression from 981fb4edb3.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2020-08-25 15:16:51 +08:00 committed by Alexandre Julliard
parent 1aa7c9af90
commit f04360cfbe
1 changed files with 3 additions and 1 deletions

View File

@ -473,7 +473,9 @@ static DEVMODEW *get_full_mode(ULONG_PTR id, DEVMODEW *dev_mode)
{
found_mode = (DEVMODEW *)((BYTE *)modes + (sizeof(*modes) + modes[0].dmDriverExtra) * mode_idx);
if (dev_mode->dmFields & DM_BITSPERPEL && found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel)
if (dev_mode->dmFields & DM_BITSPERPEL &&
dev_mode->dmBitsPerPel &&
found_mode->dmBitsPerPel != dev_mode->dmBitsPerPel)
continue;
if (dev_mode->dmFields & DM_PELSWIDTH && found_mode->dmPelsWidth != dev_mode->dmPelsWidth)
continue;