Add check for global handles to NtGdiDeleteDC, this prevents applications from destroying DCs that are part of DCEs.
Modified: trunk/reactos/subsys/win32k/objects/dc.c
--- trunk/reactos/subsys/win32k/objects/dc.c 2005-07-26 15:47:26 UTC (rev 16747) +++ trunk/reactos/subsys/win32k/objects/dc.c 2005-07-26 16:03:46 UTC (rev 16748) @@ -962,10 +962,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 */