https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00e882c2b1ba302d01c2c63a803d78e4fbac7168

commit 00e882c2b1ba302d01c2c63a803d78e4fbac7168
Author:     Thomas Faber <thomas.fa...@reactos.org>
AuthorDate: Sat Jun 15 21:25:01 2019 +0200
Commit:     Thomas Faber <thomas.fa...@reactos.org>
CommitDate: Sun Jun 16 12:45:58 2019 +0200

    [WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the 
current display mode instead of assuming a constant index. CORE-15325
---
 win32ss/gdi/eng/pdevobj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);

Reply via email to