mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:22:58 +00:00
[Win32k]
- Finish object attribute support part 2. - Removed DC from the list, ReactOS handles this in a different way. Comment out Brush and Pen switches until proper handling is implemented. svn path=/trunk/; revision=51185
This commit is contained in:
parent
c5dad4998c
commit
9e22fe5962
1 changed files with 31 additions and 14 deletions
|
@ -741,16 +741,22 @@ IsObjectDead(HGDIOBJ hObject)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process Environment Cached GDI Handles
|
||||||
|
*
|
||||||
|
* What types of GDI handle objects that are cached in the GDI handle buffer?
|
||||||
|
* Brushes set to BS_SOLID, Pens with widths of zero or set to PS_SOLID, and
|
||||||
|
* Regions that are set to NULLREGION or SIMPLEREGION.
|
||||||
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
bPEBCacheHandle(HGDIOBJ Handle, int oType, PVOID pAttr)
|
bPEBCacheHandle(HGDIOBJ Handle, int oType, PVOID pAttr)
|
||||||
{
|
{
|
||||||
PGDIHANDLECACHE GdiHandleCache;
|
PGDIHANDLECACHE GdiHandleCache;
|
||||||
HGDIOBJ *hPtr;
|
HGDIOBJ *hPtr;
|
||||||
BOOL Ret = FALSE;
|
|
||||||
int Offset = 0, Number;
|
|
||||||
HANDLE Lock;
|
HANDLE Lock;
|
||||||
|
int Number, Offset, MaxNum = CACHE_PEN_ENTRIES;
|
||||||
|
BOOL Ret = FALSE;
|
||||||
|
|
||||||
GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
|
GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
|
||||||
|
|
||||||
|
@ -758,6 +764,7 @@ bPEBCacheHandle(HGDIOBJ Handle, int oType, PVOID pAttr)
|
||||||
{
|
{
|
||||||
case hctBrushHandle:
|
case hctBrushHandle:
|
||||||
Offset = 0;
|
Offset = 0;
|
||||||
|
MaxNum = CACHE_BRUSH_ENTRIES;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case hctPenHandle:
|
case hctPenHandle:
|
||||||
|
@ -783,10 +790,10 @@ bPEBCacheHandle(HGDIOBJ Handle, int oType, PVOID pAttr)
|
||||||
|
|
||||||
hPtr = GdiHandleCache->Handle + Offset;
|
hPtr = GdiHandleCache->Handle + Offset;
|
||||||
|
|
||||||
if ( pAttr && oType == hctRegionHandle)
|
if ( pAttr )
|
||||||
{
|
{
|
||||||
if ( Number < CACHE_REGION_ENTRIES )
|
if ( Number < MaxNum )
|
||||||
{
|
{ // This object is cached and waiting for it's resurrection by the users.
|
||||||
((PRGN_ATTR)pAttr)->AttrFlags |= ATTR_CACHED;
|
((PRGN_ATTR)pAttr)->AttrFlags |= ATTR_CACHED;
|
||||||
hPtr[Number] = Handle;
|
hPtr[Number] = Handle;
|
||||||
GdiHandleCache->ulNumHandles[oType]++;
|
GdiHandleCache->ulNumHandles[oType]++;
|
||||||
|
@ -817,6 +824,7 @@ GreDeleteObject(HGDIOBJ hObject)
|
||||||
INT Index;
|
INT Index;
|
||||||
PGDI_TABLE_ENTRY Entry;
|
PGDI_TABLE_ENTRY Entry;
|
||||||
DWORD dwObjectType;
|
DWORD dwObjectType;
|
||||||
|
INT ihct;
|
||||||
PVOID pAttr = NULL;
|
PVOID pAttr = NULL;
|
||||||
|
|
||||||
DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject);
|
DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject);
|
||||||
|
@ -831,14 +839,27 @@ GreDeleteObject(HGDIOBJ hObject)
|
||||||
switch (dwObjectType)
|
switch (dwObjectType)
|
||||||
{
|
{
|
||||||
case GDI_OBJECT_TYPE_BRUSH:
|
case GDI_OBJECT_TYPE_BRUSH:
|
||||||
|
ihct = hctBrushHandle;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GDI_OBJECT_TYPE_PEN:
|
||||||
|
ihct = hctPenHandle;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDI_OBJECT_TYPE_REGION:
|
case GDI_OBJECT_TYPE_REGION:
|
||||||
/* If pAttr NULL, the probability is high for System Region. */
|
ihct = hctRegionHandle;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (dwObjectType)
|
||||||
|
{
|
||||||
|
// case GDI_OBJECT_TYPE_BRUSH:
|
||||||
|
// case GDI_OBJECT_TYPE_PEN:
|
||||||
|
case GDI_OBJECT_TYPE_REGION:
|
||||||
|
/* If pAttr NULL, the probability is high for System GDI handle object. */
|
||||||
if ( pAttr &&
|
if ( pAttr &&
|
||||||
bPEBCacheHandle(hObject, hctRegionHandle, pAttr))
|
bPEBCacheHandle(hObject, ihct, pAttr) )
|
||||||
{
|
{ /* User space handle only! */
|
||||||
/* User space handle only! */
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (pAttr)
|
if (pAttr)
|
||||||
|
@ -847,10 +868,6 @@ GreDeleteObject(HGDIOBJ hObject)
|
||||||
Entry->UserData = NULL;
|
Entry->UserData = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDI_OBJECT_TYPE_DC:
|
|
||||||
// DC_FreeDcAttr(hObject);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL != hObject
|
return NULL != hObject
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue