bugfix a bsod in DD_Cleanup
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c

Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
--- trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-12-11 19:36:43 UTC (rev 20077)
+++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-12-11 19:42:08 UTC (rev 20078)
@@ -19,16 +19,19 @@
 
 BOOL INTERNAL_CALL
 DD_Cleanup(PVOID ObjectBody)
-{
-    if (ObjectBody == NULL)
-        return FALSE;
-        
+{       
 	PDD_DIRECTDRAW pDirectDraw = (PDD_DIRECTDRAW) ObjectBody;
 	DPRINT1("DD_Cleanup\n");
 	
 	if (!pDirectDraw)
 		return FALSE;
-
+    
+    if (pDirectDraw->Global.dhpdev == NULL)
+        return FALSE;
+        
+    if (pDirectDraw->DrvDisableDirectDraw == NULL)
+        return FALSE;
+        
 	pDirectDraw->DrvDisableDirectDraw(pDirectDraw->Global.dhpdev);
 	return TRUE;
 }