From 79f16507c4835560bf6b2285922a9781bd262a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 22 Oct 2022 13:33:55 +0200 Subject: [PATCH] [VGAMP/VGADDI] Be consistent in IOCTL_VIDEO_GET_CURRENT_MODE and IOCTL_VIDEO_SET_CURRENT_MODE As IOCTL_VIDEO_GET_CURRENT_MODE returns 2 as ModeIndex, wait for the same value in IOCTL_VIDEO_SET_CURRENT_MODE. Also change vgaddi to send this hardcoded value. vga_new also uses 2 as index for 640x480x16 --- win32ss/drivers/displays/vga/objects/screen.c | 2 +- win32ss/drivers/miniport/vga/vgamp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win32ss/drivers/displays/vga/objects/screen.c b/win32ss/drivers/displays/vga/objects/screen.c index 8c11ef0cebe..8cd4de9e576 100644 --- a/win32ss/drivers/displays/vga/objects/screen.c +++ b/win32ss/drivers/displays/vga/objects/screen.c @@ -139,7 +139,7 @@ BOOL InitVGA(PPDEV ppdev, BOOL bFirst) ppdev->sizeSurf.cx = 640; ppdev->sizeSurf.cy = 480; - ppdev->ModeNum = 12; + ppdev->ModeNum = 2; /* Set the mode that was requested */ if (EngDeviceIoControl(ppdev->KMDriver, diff --git a/win32ss/drivers/miniport/vga/vgamp.c b/win32ss/drivers/miniport/vga/vgamp.c index 4b892cc281e..a477b643342 100644 --- a/win32ss/drivers/miniport/vga/vgamp.c +++ b/win32ss/drivers/miniport/vga/vgamp.c @@ -545,7 +545,7 @@ BOOLEAN VGASetColorRegisters(IN PVIDEO_CLUT ColorLookUpTable, BOOLEAN VGASetCurrentMode(IN PVIDEO_MODE RequestedMode, OUT PSTATUS_BLOCK StatusBlock) { - if(RequestedMode->RequestedMode == 12) + if(RequestedMode->RequestedMode == 2) { InitVGAMode(); return TRUE;