[FRAMEBUF] Correctly check the return value of the EngDeviceIoControl() call and return adequate value in DrvAssertMode().

This commit is contained in:
Hermès Bélusca-Maïto 2019-01-01 20:44:24 +01:00
parent 60448f83fb
commit 3f716870ca
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -174,27 +174,28 @@ DrvAssertMode(
if (bEnable) if (bEnable)
{ {
BOOLEAN Result;
/* /*
* Reinitialize the device to a clean state. * Reinitialize the device to a clean state.
*/ */
Result = EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE, if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_CURRENT_MODE,
&(ppdev->ModeIndex), sizeof(ULONG), NULL, 0, &(ppdev->ModeIndex), sizeof(ULONG), NULL, 0,
&ulTemp); &ulTemp))
{
/* We failed, bail out */
return FALSE;
}
if (ppdev->BitsPerPixel == 8) if (ppdev->BitsPerPixel == 8)
{ {
IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256); IntSetPalette(dhpdev, ppdev->PaletteEntries, 0, 256);
} }
return Result; return TRUE;
} }
else else
{ {
/* /*
* Call the miniport driver to reset the device to a known state. * Call the miniport driver to reset the device to a known state.
*/ */
return !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE, return !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE,
NULL, 0, NULL, 0, &ulTemp); NULL, 0, NULL, 0, &ulTemp);
} }