[Win32SS|GDI] Implement seldom used API and update types for local DC's.

Two working in house application require these API. Known as FolCOL and Reach.
This commit is contained in:
James Tabor 2021-09-25 11:57:26 -05:00
parent a602bc3550
commit 970344bd16
8 changed files with 150 additions and 98 deletions

View file

@ -1484,6 +1484,40 @@ GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
return TRUE;
}
BOOL
NTAPI
GDIOBJ_ConvertFromStockObj(HGDIOBJ *phObj)
{
PENTRY pentry;
POBJ pobj;
/* Reference the handle entry */
pentry = ENTRY_ReferenceEntryByHandle(*phObj, 0);
if (!pentry)
{
DPRINT1("GDIOBJ: Requested handle 0x%p is not valid.\n", *phObj);
return FALSE;
}
/* Update the entry */
pentry->FullUnique &= ~GDI_ENTRY_STOCK_MASK;
pentry->ObjectOwner.ulObj = 0;
/* Get the pointer to the BASEOBJECT */
pobj = pentry->einfo.pobj;
/* Calculate the new handle */
pobj->hHmgr = (HGDIOBJ)((ULONG_PTR)pobj->hHmgr & ~GDI_HANDLE_STOCK_MASK);
/* Return the new handle */
*phObj = pobj->hHmgr;
/* Dereference the handle */
GDIOBJ_vDereferenceObject(pobj);
return TRUE;
}
POBJ NTAPI
GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
{