https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3f716870ca878799ef670…
commit 3f716870ca878799ef6700d6eea83fcdb0945f51
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Tue Jan 1 20:44:24 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 2 21:12:19 2019 +0100
[FRAMEBUF] Correctly check the return value of the EngDeviceIoControl() call and
return adequate value in DrvAssertMode().
---
win32ss/drivers/displays/framebuf/surface.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/win32ss/drivers/displays/framebuf/surface.c
b/win32ss/drivers/displays/framebuf/surface.c
index 43b3b89b96..b0b74da295 100644
--- a/win32ss/drivers/displays/framebuf/surface.c
+++ b/win32ss/drivers/displays/framebuf/surface.c
@@ -174,27 +174,28 @@ DrvAssertMode(
if (bEnable)
{
- BOOLEAN Result;
/*
* Reinitialize the device to a clean state.
*/
- Result = EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE,
- &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
- &ulTemp);
+ if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE,
+ &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
+ &ulTemp))
+ {
+ /* We failed, bail out */
+ return FALSE;
+ }
if (ppdev->BitsPerPixel == 8)
{
IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
}
- return Result;
-
+ return TRUE;
}
else
{
/*
* Call the miniport driver to reset the device to a known state.
*/
-
return !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE,
NULL, 0, NULL, 0, &ulTemp);
}