mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 19:59:49 +00:00
[WIN32K]
Do not ignore failure when calling DrvEnablePDEV and properly handle a failure in PDEVOBJ_bEnablePDEV instead of ASSERTing. Properly cleanup the PDEV after failure, check if the PDEV was enabled before calling DrvDisablePDEV. Fixes some crashes with VBox driver. svn path=/trunk/; revision=62855
This commit is contained in:
parent
e67aa1e2ca
commit
a794e3f2d0
|
@ -94,8 +94,12 @@ PDEVOBJ_vRelease(PPDEVOBJ ppdev)
|
||||||
PALETTE_ShareUnlockPalette(ppdev->ppalSurf);
|
PALETTE_ShareUnlockPalette(ppdev->ppalSurf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable PDEV */
|
/* Check if the PDEV was enabled */
|
||||||
|
if (ppdev->dhpdev != NULL)
|
||||||
|
{
|
||||||
|
/* Disable the PDEV */
|
||||||
ppdev->pfn.DisablePDEV(ppdev->dhpdev);
|
ppdev->pfn.DisablePDEV(ppdev->dhpdev);
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove it from list */
|
/* Remove it from list */
|
||||||
if( ppdev == gppdevList )
|
if( ppdev == gppdevList )
|
||||||
|
@ -155,6 +159,11 @@ PDEVOBJ_bEnablePDEV(
|
||||||
(HDEV)ppdev,
|
(HDEV)ppdev,
|
||||||
ppdev->pGraphicsDevice->pwszDescription,
|
ppdev->pGraphicsDevice->pwszDescription,
|
||||||
ppdev->pGraphicsDevice->DeviceObject);
|
ppdev->pGraphicsDevice->DeviceObject);
|
||||||
|
if (ppdev->dhpdev == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to enable PDEV\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fix up some values */
|
/* Fix up some values */
|
||||||
if (ppdev->gdiinfo.ulLogPixelsX == 0)
|
if (ppdev->gdiinfo.ulLogPixelsX == 0)
|
||||||
|
@ -337,7 +346,8 @@ EngpCreatePDEV(
|
||||||
if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
|
if (!PDEVOBJ_bEnablePDEV(ppdev, pdm, NULL))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to enable PDEV!\n");
|
DPRINT1("Failed to enable PDEV!\n");
|
||||||
ASSERT(FALSE);
|
PDEVOBJ_vRelease(ppdev);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: this must be done in a better way */
|
/* FIXME: this must be done in a better way */
|
||||||
|
|
Loading…
Reference in a new issue