/*********************************************************************** * DceFreeDCE */ void FASTCALL DceFreeDCE(PDCE pdce, BOOLEAN Force) { BOOL Hit = FALSE; ASSERT(pdce != NULL); if (NULL == pdce) return; pdce->DCXFlags |= DCX_INDESTROY; if (Force && GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED) { TRACE("Change ownership for DCE! -> %p\n" , pdce); // NOTE: Windows sets W32PF_OWNDCCLEANUP and moves on. if (GreIsHandleValid(pdce->hDC)) { GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED); } else { ERR("Attempted to change ownership of an DCEhDC %p currently being destroyed!!!\n", pdce->hDC); Hit = TRUE; } } else { if (GreGetObjectOwner(pdce->hDC) == GDI_OBJ_HMGR_PUBLIC) GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED); } if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE); if (pdce->hrgnClip && !(pdce->DCXFlags & DCX_KEEPCLIPRGN)) { GreDeleteObject(pdce->hrgnClip); pdce->hrgnClip = NULL; } RemoveEntryList(&pdce->List); ExFreePoolWithTag(pdce, USERTAG_DCE); DCECount--; TRACE("Freed DCE's! %d \n", DCECount); }
BOOLEAN APIENTRY DxEngDeleteDC(HDC hdc, BOOL Force) { return IntGdiDeleteDC(hdc, Force); }