if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG!
{ // This is a cheesy way to do this.
PDC dc = DC_LockDc ( hDC );
+ ASSERT(dc);
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
RtlZeroMemory(defaultDCstate, sizeof(DC));
defaultDCstate->pdcattr = &defaultDCstate->dcattr;
else
{
DPRINT("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC);
- IntGdiSetDCOwnerEx( pDce->hDC, GDI_OBJ_HMGR_NONE, FALSE);
+ GreSetDCOwner(pDce->hDC, GDI_OBJ_HMGR_NONE);
pDce->ptiOwner = NULL;
}
}
else if (Dce->hrgnClip != NULL)
{
- GDIOBJ_FreeObjByHandle(Dce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT);
+ GreDeleteObject(Dce->hrgnClip);
}
Dce->hrgnClip = NULL;
}
dce->DCXFlags &= ~DCX_DCEBUSY;
DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC);
- if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE))
+ if (!GreSetDCOwner(dce->hDC, GDI_OBJ_HMGR_NONE))
return 0;
dce->ptiOwner = NULL; // Reset ownership.
dce->ppiOwner = NULL;
{
if(hRgnVisible != NULL)
{
- REGION_FreeRgnByHandle(hRgnVisible);
+ GreDeleteObject(hRgnVisible);
}
hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0);
}
if (hRgnVisible != NULL)
{
- REGION_FreeRgnByHandle(hRgnVisible);
+ GreDeleteObject(hRgnVisible);
}
}
return(NULL);
}
- if (!GDIOBJ_ValidateHandle(Dce->hDC, GDI_OBJECT_TYPE_DC))
+ if (!GreIsHandleValid(Dce->hDC))
{
DPRINT1("FIXME: Got DCE with invalid hDC! 0x%x\n", Dce->hDC);
Dce->hDC = DceCreateDisplayDC();
if (Dce->hrgnClip != NULL)
{
DPRINT1("Should not be called!!\n");
- GDIOBJ_FreeObjByHandle(Dce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT);
+ GreDeleteObject(Dce->hrgnClip);
Dce->hrgnClip = NULL;
}
Dce->hrgnClip = ClipRegion;
{
DPRINT("ENTER!!!!!! DCX_CACHE!!!!!! hDC-> %x\n", Dce->hDC);
// Need to set ownership so Sync dcattr will work.
- IntGdiSetDCOwnerEx( Dce->hDC, GDI_OBJ_HMGR_POWNED, FALSE);
+ GreSetDCOwner(Dce->hDC, GDI_OBJ_HMGR_POWNED);
Dce->ptiOwner = GetW32ThreadInfo(); // Set the temp owning
}
pdce->DCXFlags |= DCX_INDESTROY;
- if (Force && !GDIOBJ_OwnedByCurrentProcess(pdce->hDC))
+ if (Force &&
+ GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED)
{
DPRINT("Change ownership for DCE! -> %x\n" , pdce);
// Note: Windows sets W32PF_OWNDCCLEANUP and moves on.
- if (!IsObjectDead((HGDIOBJ) pdce->hDC))
+ if (GreIsHandleValid(pdce->hDC))
{
- DC_SetOwnership( pdce->hDC, PsGetCurrentProcess());
+ GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED);
}
else
{
}
else
{
- if (!GreGetObjectOwner(pdce->hDC, GDIObjType_DC_TYPE))
- DC_SetOwnership( pdce->hDC, PsGetCurrentProcess());
+ 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))
{
- GDIOBJ_FreeObjByHandle(pdce->hrgnClip, GDI_OBJECT_TYPE_REGION|GDI_OBJECT_TYPE_SILENT);
+ GreDeleteObject(pdce->hrgnClip);
pdce->hrgnClip = NULL;
}
pDCE->hwndCurrent = 0;
DPRINT("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %x \n", pDCE->hDC);
- if (!IntGdiSetDCOwnerEx( pDCE->hDC, GDI_OBJ_HMGR_NONE, FALSE))
+ if (!GreSetDCOwner( pDCE->hDC, GDI_OBJ_HMGR_NONE))
{
DPRINT1("Fail Owner Switch hDC-> %x \n", pDCE->hDC);
break;
}
pLE = LEDce.Flink;
pDCE = CONTAINING_RECORD(pLE, DCE, List);
- if(!pDCE) return; // Another null test!
+
do
{
if(!pDCE) break;
}
}
- if (!GDIOBJ_ValidateHandle(pDCE->hDC, GDI_OBJECT_TYPE_DC) ||
+ if (!GreIsHandleValid(pDCE->hDC) ||
(dc = DC_LockDc(pDCE->hDC)) == NULL)
{
pLE = pDCE->List.Flink;