[FRAMEBUF] Correctly check the return value of the EngDeviceIoControl() call and...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 1 Jan 2019 19:44:24 +0000 (20:44 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 2 Jan 2019 20:12:19 +0000 (21:12 +0100)
win32ss/drivers/displays/framebuf/surface.c

index 43b3b89..b0b74da 100644 (file)
@@ -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);
    }