Author: cwittich Date: Sat Mar 21 16:29:40 2015 New Revision: 66851
URL: http://svn.reactos.org/svn/reactos?rev=66851&view=rev Log: [WIN32K] Gracefully handle failure in DrvEnableSurface. patch by Timo Kreuzer
Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c
Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.c?r... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Sat Mar 21 16:29:40 2015 @@ -217,9 +217,15 @@ { /* 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 @@ pSurface = PDEVOBJ_pSurface(ppdevTmp); if (!pSurface) { - DPRINT1("DrvEnableSurface failed\n"); + DPRINT1("PDEVOBJ_pSurface failed\n"); goto leave; }