From: Thomas Faber Date: Sat, 15 Jun 2019 19:25:01 +0000 (+0200) Subject: [WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display... X-Git-Tag: 0.4.14-dev~770 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=00e882c2b1ba302d01c2c63a803d78e4fbac7168;hp=28ed2347ef8b382c0062e7001765ba3a9b5b7a3e [WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display mode instead of assuming a constant index. CORE-15325 --- diff --git a/win32ss/gdi/eng/pdevobj.c b/win32ss/gdi/eng/pdevobj.c index 85098a58437..19c2fee06ba 100644 --- a/win32ss/gdi/eng/pdevobj.c +++ b/win32ss/gdi/eng/pdevobj.c @@ -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);