Skip to content

Commit 00e882c

Browse files
committed
[WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display mode instead of assuming a constant index. CORE-15325
1 parent 28ed234 commit 00e882c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

win32ss/gdi/eng/pdevobj.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ PDEVOBJ_vRefreshModeList(
266266
PGRAPHICS_DEVICE pGraphicsDevice;
267267
PDEVMODEINFO pdminfo, pdmiNext;
268268
DEVMODEW dmDefault;
269+
DEVMODEW dmCurrent;
269270

270271
/* Lock the PDEV */
271272
EngAcquireSemaphore(ppdev->hsemDevLock);
@@ -274,6 +275,7 @@ PDEVOBJ_vRefreshModeList(
274275

275276
/* Remember our default mode */
276277
dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
278+
dmCurrent = *ppdev->pdmwDev;
277279

278280
/* Clear out the modes */
279281
for (pdminfo = pGraphicsDevice->pdevmodeInfo;
@@ -293,7 +295,7 @@ PDEVOBJ_vRefreshModeList(
293295
DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
294296
}
295297

296-
ppdev->pdmwDev = pGraphicsDevice->pDevModeList[pGraphicsDevice->iCurrentMode].pdm;
298+
ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
297299

298300
/* Unlock PDEV */
299301
EngReleaseSemaphore(ppdev->hsemDevLock);

0 commit comments

Comments
 (0)