NtGdiDdCreateDirectDrawObject
- add missing error checking for GDIOBJ_AllocObj 
- add missing error checking for GDIOBJ_LockObj
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c

Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
--- trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-10-05 19:49:37 UTC (rev 18279)
+++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-10-05 19:50:48 UTC (rev 18280)
@@ -50,9 +50,7 @@
 		DC_UnlockDc(pDC);
 		return NULL;
 	}
-
 	
-
 	BOOL success = pDC->DriverFunctions.EnableDirectDraw(
 		pDC->PDev, &callbacks, &surface_callbacks, &palette_callbacks);
 
@@ -64,7 +62,21 @@
 	}
 
 	HANDLE hDirectDraw = GDIOBJ_AllocObj(GDI_OBJECT_TYPE_DIRECTDRAW);
+	if (!hDirectDraw)
+	{
+		/* No more memmory */
+		DC_UnlockDc(pDC);
+		return NULL;
+	}
+
 	PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW);
+	if (!pDirectDraw)
+	{
+		/* invalid handle */
+		DC_UnlockDc(pDC);
+		return NULL;
+	}
+	
 
 	pDirectDraw->Global.dhpdev = pDC->PDev;
 	pDirectDraw->Local.lpGbl = &pDirectDraw->Global;