mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[Win32k]
- System regions do not possess user attribute sections. See bug 5124. - Read the patch for more information. svn path=/trunk/; revision=45168
This commit is contained in:
@@ -32,7 +32,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||
|
||||
if (Dc->rosdc.hClipRgn == NULL)
|
||||
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hVisRgn, 0, RGN_COPY);
|
||||
else
|
||||
else // FYI: Vis == NULL! source of "IntGdiCombineRgn requires hSrc2 != NULL for combine mode 1!"
|
||||
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hClipRgn, Dc->rosdc.hVisRgn, RGN_AND);
|
||||
NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y);
|
||||
|
||||
|
||||
@@ -167,22 +167,50 @@ BOOL
|
||||
FASTCALL
|
||||
DC_SetOwnership(HDC hDC, PEPROCESS Owner)
|
||||
{
|
||||
INT Index;
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PDC pDC;
|
||||
|
||||
if (!GDIOBJ_SetOwnership(hDC, Owner)) return FALSE;
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (pDC)
|
||||
{
|
||||
/*
|
||||
System Regions:
|
||||
These regions do not use attribute sections and when allocated, use
|
||||
gdiobj level functions.
|
||||
*/
|
||||
if (pDC->rosdc.hClipRgn)
|
||||
{
|
||||
{ // FIXME! HAX!!!
|
||||
KeEnterCriticalRegion();
|
||||
Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hClipRgn);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
|
||||
Entry->UserData = NULL;
|
||||
KeLeaveCriticalRegion();
|
||||
//
|
||||
if (!GDIOBJ_SetOwnership(pDC->rosdc.hClipRgn, Owner)) return FALSE;
|
||||
}
|
||||
if (pDC->rosdc.hVisRgn)
|
||||
{
|
||||
{ // FIXME! HAX!!!
|
||||
KeEnterCriticalRegion();
|
||||
Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hVisRgn);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
|
||||
Entry->UserData = NULL;
|
||||
KeLeaveCriticalRegion();
|
||||
//
|
||||
if (!GDIOBJ_SetOwnership(pDC->rosdc.hVisRgn, Owner)) return FALSE;
|
||||
}
|
||||
if (pDC->rosdc.hGCClipRgn)
|
||||
{
|
||||
{ // FIXME! HAX!!!
|
||||
KeEnterCriticalRegion();
|
||||
Index = GDI_HANDLE_GET_INDEX(pDC->rosdc.hGCClipRgn);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
if (Entry->UserData) FreeObjectAttr(Entry->UserData);
|
||||
Entry->UserData = NULL;
|
||||
KeLeaveCriticalRegion();
|
||||
//
|
||||
if (!GDIOBJ_SetOwnership(pDC->rosdc.hGCClipRgn, Owner)) return FALSE;
|
||||
}
|
||||
if (pDC->dclevel.hPath)
|
||||
|
||||
@@ -753,7 +753,8 @@ GreDeleteObject(HGDIOBJ hObject)
|
||||
if (pAttr)
|
||||
{
|
||||
KeEnterCriticalRegion();
|
||||
FreeObjectAttr(pAttr);
|
||||
if (pAttr) FreeObjectAttr(pAttr);
|
||||
Entry->UserData = NULL;
|
||||
KeLeaveCriticalRegion();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2085,6 +2085,7 @@ RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr)
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PROSRGNDATA pRgn;
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HANDLE pid;
|
||||
|
||||
pRgn = REGION_LockRgn(hRgn);
|
||||
|
||||
@@ -2094,9 +2095,11 @@ RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr)
|
||||
Index = GDI_HANDLE_GET_INDEX(hRgn);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
pRgn_Attr = Entry->UserData;
|
||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
KeLeaveCriticalRegion();
|
||||
|
||||
if (pRgn_Attr)
|
||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
||||
pRgn_Attr )
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
@@ -2144,6 +2147,7 @@ RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
||||
INT Index;
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HANDLE pid;
|
||||
|
||||
if (pRgn)
|
||||
{
|
||||
@@ -2151,9 +2155,11 @@ RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
||||
Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
pRgn_Attr = Entry->UserData;
|
||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
KeLeaveCriticalRegion();
|
||||
|
||||
if ( pRgn_Attr )
|
||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
||||
pRgn_Attr )
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
@@ -2175,6 +2181,12 @@ RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
||||
REGION_UnlockRgn(pRgn);
|
||||
}
|
||||
|
||||
/*
|
||||
System Regions:
|
||||
These regions do not use attribute sections and when allocated, use gdiobj
|
||||
level functions.
|
||||
*/
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
REGION_Cleanup(PVOID ObjectBody)
|
||||
{
|
||||
@@ -2191,7 +2203,6 @@ REGION_Delete(PROSRGNDATA pRgn)
|
||||
REGION_FreeRgn(pRgn);
|
||||
}
|
||||
|
||||
|
||||
VOID FASTCALL
|
||||
IntGdiReleaseRaoRgn(PDC pDC)
|
||||
{
|
||||
@@ -2202,7 +2213,6 @@ IntGdiReleaseRaoRgn(PDC pDC)
|
||||
RECTL_vSetEmptyRect(&pDC->erclClip);
|
||||
}
|
||||
|
||||
|
||||
VOID FASTCALL
|
||||
IntGdiReleaseVisRgn(PDC pDC)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user