[WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display mode instead of assuming a constant index. CORE-15325

This commit is contained in:
Thomas Faber 2019-06-15 21:25:01 +02:00
parent 28ed2347ef
commit 00e882c2b1
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -266,6 +266,7 @@ PDEVOBJ_vRefreshModeList(
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEINFO pdminfo, pdmiNext;
DEVMODEW dmDefault;
DEVMODEW dmCurrent;
/* Lock the PDEV */
EngAcquireSemaphore(ppdev->hsemDevLock);
@ -274,6 +275,7 @@ PDEVOBJ_vRefreshModeList(
/* Remember our default mode */
dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
dmCurrent = *ppdev->pdmwDev;
/* Clear out the modes */
for (pdminfo = pGraphicsDevice->pdevmodeInfo;
@ -293,7 +295,7 @@ PDEVOBJ_vRefreshModeList(
DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
}
ppdev->pdmwDev = pGraphicsDevice->pDevModeList[pGraphicsDevice->iCurrentMode].pdm;
ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
/* Unlock PDEV */
EngReleaseSemaphore(ppdev->hsemDevLock);