Gracefully handle failure in DrvEnableSurface.
patch by Timo Kreuzer

svn path=/trunk/; revision=66851
This commit is contained in:
Christoph von Wittich 2015-03-21 16:29:40 +00:00
parent 7bab2c0560
commit 4a5a775bf6

View file

@ -217,9 +217,15 @@ PDEVOBJ_pSurface(
{
/* Call the drivers DrvEnableSurface */
hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
if (hsurf== NULL)
{
DPRINT1("Failed to create PDEV surface!");
return NULL;
}
/* Get a reference to the surface */
ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
NT_ASSERT(ppdev->pSurface != NULL);
}
/* Increment reference count */
@ -469,7 +475,7 @@ PDEVOBJ_bSwitchMode(
pSurface = PDEVOBJ_pSurface(ppdevTmp);
if (!pSurface)
{
DPRINT1("DrvEnableSurface failed\n");
DPRINT1("PDEVOBJ_pSurface failed\n");
goto leave;
}