Merge 16748 from trunk:
Add check for global handles to NtGdiDeleteDC, this prevents applications from destroying DCs that are part of DCEs.
Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/objects/dc.c

Modified: branches/ros-branch-0_2_7/reactos/subsys/win32k/objects/dc.c
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/objects/dc.c	2005-08-03 17:21:19 UTC (rev 17024)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/objects/dc.c	2005-08-03 17:24:05 UTC (rev 17025)
@@ -924,10 +924,17 @@
 {
   PDC  DCToDelete;
 
+  if (!GDIOBJ_OwnedByCurrentProcess(DCHandle))
+    {
+      SetLastWin32Error(ERROR_INVALID_HANDLE);
+      return FALSE;
+    }
+  
   DCToDelete = DC_LockDc(DCHandle);
   if (DCToDelete == NULL)
     {
-      return  FALSE;
+      SetLastWin32Error(ERROR_INVALID_HANDLE);
+      return FALSE;
     }
 
   /*  First delete all saved DCs  */