sync with trunk r46493
[reactos.git] / subsystems / win32 / win32k / ntuser / windc.c
index 608ba2f..b870b49 100644 (file)
@@ -646,6 +646,11 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
          Hit = TRUE;
      }
   }
+  else
+  {
+     if (!GreGetObjectOwner(pdce->hDC, GDIObjType_DC_TYPE))
+        DC_SetOwnership( pdce->hDC, PsGetCurrentProcess());
+  }
 
   if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE);