- Fixes to region support code. See bug 5124.
svn path=/trunk/; revision=45181
typedef struct _ROS_DC_INFO
{
HRGN hClipRgn; /* Clip region (may be 0) */
- HRGN hVisRgn; /* Should me to DC. Visible region (must never be 0) */
+ HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
BYTE bitsPerPixel;
BOOL FASTCALL GreDeleteObject(HGDIOBJ hObject);
BOOL FASTCALL IsObjectDead(HGDIOBJ);
BOOL FASTCALL IntGdiSetDCOwnerEx( HDC, DWORD, BOOL);
-BOOL FASTCALL IntGdiSetRegeionOwner(HRGN,DWORD);
+BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
/*!
* Release GDI object. Every object locked by GDIOBJ_LockObj() must be unlocked.
PROSRGNDATA FASTCALL IntGdiCreateRectRgn(INT, INT, INT, INT);
PROSRGNDATA FASTCALL RGNOBJAPI_Lock(HRGN,PRGN_ATTR *);
VOID FASTCALL RGNOBJAPI_Unlock(PROSRGNDATA);
+HRGN FASTCALL IntSysCreateRectRgn(INT,INT,INT,INT);
-#define UnsafeIntCreateRectRgnIndirect(prc) \
- NtGdiCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
+#define IntSysCreateRectRgnIndirect(prc) \
+ IntSysCreateRectRgn((prc)->left, (prc)->top, (prc)->right, (prc)->bottom)
#endif /* not __WIN32K_REGION_H */
if (pMsg->message == WM_PAINT)
{
/* send a WM_NCPAINT and WM_ERASEBKGND if the non-client area is still invalid */
- HRGN hrgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
+ HRGN hrgn = IntSysCreateRectRgn( 0, 0, 0, 0 );
co_UserGetUpdateRgn( Window, hrgn, TRUE );
- GreDeleteObject( hrgn );
+ REGION_FreeRgnByHandle( hrgn );
}
return retval;
}
Monitor->rcWork = Monitor->rcMonitor;
Monitor->cWndStack = 0;
- Monitor->hrgnMonitor= NtGdiCreateRectRgn( Monitor->rcMonitor.left,
- Monitor->rcMonitor.top,
- Monitor->rcMonitor.right,
- Monitor->rcMonitor.bottom );
+ Monitor->hrgnMonitor= IntSysCreateRectRgnIndirect( &Monitor->rcMonitor );
- IntGdiSetRegeionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
+ IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
if (gMonitorList == NULL)
{
Wnd = Window->Wnd;
if (Client)
- hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->rcClient);
+ hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
else
- hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->rcWindow);
+ hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
if (Window->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
{
hRgnWindow = IntCalcWindowRgn(Window, TRUE);
if (hRgnWindow == NULL)
{
- GreDeleteObject(hRgnNonClient);
+ REGION_FreeRgnByHandle(hRgnNonClient);
return (HRGN)1;
}
hRgnWindow, RGN_DIFF);
if (RgnType == ERROR)
{
- GreDeleteObject(hRgnWindow);
- GreDeleteObject(hRgnNonClient);
+ REGION_FreeRgnByHandle(hRgnWindow);
+ REGION_FreeRgnByHandle(hRgnNonClient);
return (HRGN)1;
}
else if (RgnType == NULLREGION)
{
- GreDeleteObject(hRgnWindow);
- GreDeleteObject(hRgnNonClient);
+ REGION_FreeRgnByHandle(hRgnWindow);
+ REGION_FreeRgnByHandle(hRgnNonClient);
return NULL;
}
if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
hRgnWindow, RGN_AND) == NULLREGION)
{
- GDIOBJ_SetOwnership(Window->hrgnUpdate, PsGetCurrentProcess());
- GreDeleteObject(Window->hrgnUpdate);
+ IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+ REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
if (!(Window->state & WINDOWOBJECT_NEED_INTERNALPAINT))
MsqDecPaintCountQueue(Window->pti->MessageQueue);
}
}
- GreDeleteObject(hRgnWindow);
+ REGION_FreeRgnByHandle(hRgnWindow);
return hRgnNonClient;
}
{
HRGN hRgnClient;
- hRgnClient = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ hRgnClient = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
- GreDeleteObject(hRgnClient);
+ REGION_FreeRgnByHandle(hRgnClient);
}
/*
{
HRGN hRgnWindow;
- hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ hRgnWindow = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND);
- GreDeleteObject(hRgnWindow);
+ REGION_FreeRgnByHandle(hRgnWindow);
}
else
{
{
if (Window->hrgnUpdate == NULL)
{
- Window->hrgnUpdate = NtGdiCreateRectRgn(0, 0, 0, 0);
- GDIOBJ_SetOwnership(Window->hrgnUpdate, NULL);
+ Window->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
+ IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
}
if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
hRgn, RGN_OR) == NULLREGION)
{
- GDIOBJ_SetOwnership(Window->hrgnUpdate, PsGetCurrentProcess());
- GreDeleteObject(Window->hrgnUpdate);
+ IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+ REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
}
if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
hRgn, RGN_DIFF) == NULLREGION)
{
- GDIOBJ_SetOwnership(Window->hrgnUpdate, PsGetCurrentProcess());
- GreDeleteObject(Window->hrgnUpdate);
+ IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+ REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
}
}
/*
* Recursive call to update children hrgnUpdate
*/
- HRGN hRgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
+ HRGN hRgnTemp = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(hRgnTemp, hRgn, 0, RGN_COPY);
IntInvalidateWindows(Child, hRgnTemp, Flags);
- GreDeleteObject(hRgnTemp);
+ REGION_FreeRgnByHandle(hRgnTemp);
}
}
{
if (UpdateRgn != NULL)
{
- hRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ hRgn = IntSysCreateRectRgn(0, 0, 0, 0);
if (NtGdiCombineRgn(hRgn, UpdateRgn, NULL, RGN_COPY) == NULLREGION)
{
- GreDeleteObject(hRgn);
+ REGION_FreeRgnByHandle(hRgn);
hRgn = NULL;
}
else
{
if (!RECTL_bIsEmptyRect(UpdateRect))
{
- hRgn = UnsafeIntCreateRectRgnIndirect((RECTL *)UpdateRect);
+ hRgn = IntSysCreateRectRgnIndirect((RECTL *)UpdateRect);
NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
}
}
(Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
{
if (!RECTL_bIsEmptyRect(&Window->Wnd->rcWindow))
- hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
}
else
{
if (!RECTL_bIsEmptyRect(&Window->Wnd->rcClient))
- hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
}
}
if (hRgn != NULL)
{
- GreDeleteObject(hRgn);
+ REGION_FreeRgnByHandle(hRgn);
}
return TRUE;
{
MsqDecPaintCountQueue(Window->pti->MessageQueue);
GdiGetClipBox(Ps.hdc, &Ps.rcPaint);
- GDIOBJ_SetOwnership(Window->hrgnUpdate, PsGetCurrentProcess());
+ IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
/* The region is part of the dc now and belongs to the process! */
Window->hrgnUpdate = NULL;
}
}
else
{
- hrgnOwn = UnsafeIntCreateRectRgnIndirect(&rcDst);
+ hrgnOwn = IntSysCreateRectRgnIndirect(&rcDst);
}
/* Add the source rect */
- hrgnTmp = UnsafeIntCreateRectRgnIndirect(&rcSrc);
+ hrgnTmp = IntSysCreateRectRgnIndirect(&rcSrc);
NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_OR);
/* Substract the part of the dest that was visible in source */
NtGdiOffsetRgn(hrgnTmp, dx, dy);
Result = NtGdiCombineRgn(hrgnOwn, hrgnOwn, hrgnTmp, RGN_DIFF);
- GreDeleteObject(hrgnTmp);
+ REGION_FreeRgnByHandle(hrgnTmp);
if (prcUpdate)
{
if (!hrgnUpdate)
{
- GreDeleteObject(hrgnOwn);
+ REGION_FreeRgnByHandle(hrgnOwn);
}
}
else
if (hrgnUpdate)
hrgnOwn = hrgnUpdate;
else
- hrgnOwn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ hrgnOwn = IntSysCreateRectRgn(0, 0, 0, 0);
hDC = UserGetDCEx(Window, 0, DCX_CACHE | DCX_USESTYLE);
if (!hDC)
* the scroll.
*/
- hrgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
+ hrgnTemp = IntSysCreateRectRgn(0, 0, 0, 0);
if (co_UserGetUpdateRgn(Window, hrgnTemp, FALSE) != NULLREGION)
{
- HRGN hrgnClip = UnsafeIntCreateRectRgnIndirect(&rcClip);
+ HRGN hrgnClip = IntSysCreateRectRgnIndirect(&rcClip);
NtGdiOffsetRgn(hrgnTemp, dx, dy);
NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnClip, RGN_AND);
co_UserRedrawWindow(Window, NULL, hrgnTemp, RDW_INVALIDATE | RDW_ERASE);
- GreDeleteObject(hrgnClip);
+ REGION_FreeRgnByHandle(hrgnClip);
}
- GreDeleteObject(hrgnTemp);
+ REGION_FreeRgnByHandle(hrgnTemp);
if (flags & SW_SCROLLCHILDREN)
{
CLEANUP:
if (hrgnOwn && !hrgnUpdate)
{
- GreDeleteObject(hrgnOwn);
+ REGION_FreeRgnByHandle(hrgnOwn);
}
if (Window)
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
if (ClientArea)
{
- VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
}
else
{
- VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
}
/*
CurrentWnd = CurrentWindow->Wnd;
if (!CurrentWnd || !(CurrentWnd->style & WS_VISIBLE))
{
- GreDeleteObject(VisRgn);
+ REGION_FreeRgnByHandle(VisRgn);
return NULL;
}
- ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->rcClient);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcClient);
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
- GreDeleteObject(ClipRgn);
+ REGION_FreeRgnByHandle(ClipRgn);
if ((PreviousWnd->style & WS_CLIPSIBLINGS) ||
(PreviousWnd == Wnd && ClipSiblings))
if ((CurrentSiblingWnd->style & WS_VISIBLE) &&
!(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT))
{
- ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
/* Combine it with the window region if available */
if (CurrentSibling->hrgnClip && !(CurrentSiblingWnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->rcWindow.left, CurrentSiblingWnd->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
- GreDeleteObject(ClipRgn);
+ REGION_FreeRgnByHandle(ClipRgn);
}
CurrentSibling = CurrentSibling->spwndNext;
}
if ((CurrentWnd->style & WS_VISIBLE) &&
!(CurrentWnd->ExStyle & WS_EX_TRANSPARENT))
{
- ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->rcWindow);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcWindow);
/* Combine it with the window region if available */
if (CurrentWindow->hrgnClip && !(CurrentWnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(ClipRgn, CurrentWnd->rcWindow.left, CurrentWnd->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
- GreDeleteObject(ClipRgn);
+ REGION_FreeRgnByHandle(ClipRgn);
}
CurrentWindow = CurrentWindow->spwndNext;
}
Wnd = Window->Wnd;
- Temp = NtGdiCreateRectRgn(0, 0, 0, 0);
+ Temp = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY);
Parent = Window->spwndParent;
RDW_ALLCHILDREN);
UserDerefObjectCo(Parent);
}
- GreDeleteObject(Temp);
+ REGION_FreeRgnByHandle(Temp);
}
/* EOF */
0 != (Flags & DCX_CLIPSIBLINGS));
if (VisRgn == NULL)
- VisRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ VisRgn = IntSysCreateRectRgn(0, 0, 0, 0);
return VisRgn;
}
}
else if (Dce->hrgnClip != NULL)
{
- GreDeleteObject(Dce->hrgnClip);
+ REGION_FreeRgnByHandle(Dce->hrgnClip);
}
Dce->hrgnClip = NULL;
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if (NULL != DesktopWindow)
{
- hRgnVisible = UnsafeIntCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
+ hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
}
else
{
{
if(hRgnVisible != NULL)
{
- GreDeleteObject(hRgnVisible);
+ REGION_FreeRgnByHandle(hRgnVisible);
}
- hRgnVisible = NtGdiCreateRectRgn(0, 0, 0, 0);
+ hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0);
}
}
if (hRgnVisible != NULL)
{
- GreDeleteObject(hRgnVisible);
+ REGION_FreeRgnByHandle(hRgnVisible);
}
}
if (!(Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && ClipRegion)
{
if (!(Flags & DCX_KEEPCLIPRGN))
- GreDeleteObject(ClipRegion);
+ REGION_FreeRgnByHandle(ClipRegion);
ClipRegion = NULL;
}
{
if (!(Flags & DCX_WINDOW))
{
- Dce->hrgnClip = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
}
else
{
- Dce->hrgnClip = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
}
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
}
if (pdce->hrgnClip && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN))
{
- GreDeleteObject(pdce->hrgnClip);
+ REGION_FreeRgnByHandle(pdce->hrgnClip);
}
RemoveEntryList(&pdce->List);
Wnd = Window->Wnd;
/* Create a new window region using the window rectangle */
- VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
/* if there's a region assigned to the window, combine them both */
if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
else
Ret = ERROR;
- GreDeleteObject(VisRgn);
+ REGION_FreeRgnByHandle(VisRgn);
return Ret;
}
Wnd = Window->Wnd;
/* Create a new window region using the window rectangle */
- VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
/* if there's a region assigned to the window, combine them both */
if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
else
Ret = ERROR;
- GreDeleteObject(VisRgn);
+ REGION_FreeRgnByHandle(VisRgn);
return Ret;
}
((WinPos.flags & SWP_NOSIZE) || !(WvrFlags & WVR_REDRAW)) &&
!(Window->Wnd->ExStyle & WS_EX_TRANSPARENT))
{
- CopyRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
/*
{
/* Nothing to copy, clean up */
RGNOBJAPI_Unlock(VisRgn);
- GreDeleteObject(CopyRgn);
+ REGION_FreeRgnByHandle(CopyRgn);
CopyRgn = NULL;
}
else if (OldWindowRect.left != NewWindowRect.left ||
/* We need to redraw what wasn't visible before */
if (VisAfter != NULL)
{
- DirtyRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ DirtyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
if (CopyRgn != NULL)
{
RgnType = NtGdiCombineRgn(DirtyRgn, VisAfter, CopyRgn, RGN_DIFF);
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
}
}
- GreDeleteObject(DirtyRgn);
+ REGION_FreeRgnByHandle(DirtyRgn);
}
if (CopyRgn != NULL)
{
- GreDeleteObject(CopyRgn);
+ REGION_FreeRgnByHandle(CopyRgn);
}
/* Expose what was covered before but not covered anymore */
if (VisBefore != NULL)
{
- ExposedRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ ExposedRgn = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(ExposedRgn, VisBefore, NULL, RGN_COPY);
NtGdiOffsetRgn(ExposedRgn, OldWindowRect.left - NewWindowRect.left,
OldWindowRect.top - NewWindowRect.top);
{
co_VIS_WindowLayoutChanged(Window, ExposedRgn);
}
- GreDeleteObject(ExposedRgn);
- GreDeleteObject(VisBefore);
+ REGION_FreeRgnByHandle(ExposedRgn);
+ REGION_FreeRgnByHandle(VisBefore);
}
if (VisAfter != NULL)
{
- GreDeleteObject(VisAfter);
+ REGION_FreeRgnByHandle(VisAfter);
}
if (!(WinPos.flags & SWP_NOACTIVATE))
{
PROSRGNDATA CombinedRegion;
+ if (!Dc->rosdc.hVisRgn)
+ {
+ DPRINT1("Warning, hVisRgn is NULL!\n");
+ }
+
if (Dc->rosdc.hGCClipRgn == NULL)
- Dc->rosdc.hGCClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
if (Dc->rosdc.hClipRgn == NULL)
NtGdiCombineRgn(Dc->rosdc.hGCClipRgn, Dc->rosdc.hVisRgn, 0, RGN_COPY);
if (dc->rosdc.hVisRgn == NULL)
{
- dc->rosdc.hVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ dc->rosdc.hVisRgn = IntSysCreateRectRgn(0, 0, 0, 0);
GDIOBJ_CopyOwnership(hdc, dc->rosdc.hVisRgn);
}
{
if (dc->rosdc.hClipRgn != NULL)
{
- GreDeleteObject(dc->rosdc.hClipRgn);
+ REGION_FreeRgnByHandle(dc->rosdc.hClipRgn);
dc->rosdc.hClipRgn = NULL;
}
}
{
REGION_GetRgnBox(Rgn, &rect);
RGNOBJAPI_Unlock(Rgn);
- dc->rosdc.hClipRgn = UnsafeIntCreateRectRgnIndirect(&rect);
+ dc->rosdc.hClipRgn = IntSysCreateRectRgnIndirect(&rect);
}
else
{
- dc->rosdc.hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
}
}
if(fnMode == RGN_COPY)
IntLPtoDP(dc, (LPPOINT)&Rect, 2);
- NewRgn = UnsafeIntCreateRectRgnIndirect(&Rect);
+ NewRgn = IntSysCreateRectRgnIndirect(&Rect);
if (!NewRgn)
{
Result = ERROR;
{
if (!dc->rosdc.hClipRgn)
{
- dc->rosdc.hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
+ dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hVisRgn, NewRgn, RGN_DIFF);
Result = SIMPLEREGION;
}
{
Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_DIFF);
}
- GreDeleteObject(NewRgn);
+ REGION_FreeRgnByHandle(NewRgn);
}
if (Result != ERROR)
CLIPPING_UpdateGCRegion(dc);
IntLPtoDP(dc, (LPPOINT)&Rect, 2);
- NewRgn = UnsafeIntCreateRectRgnIndirect(&Rect);
+ NewRgn = IntSysCreateRectRgnIndirect(&Rect);
if (!NewRgn)
{
Result = ERROR;
else
{
Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_AND);
- GreDeleteObject(NewRgn);
+ REGION_FreeRgnByHandle(NewRgn);
}
if (Result != ERROR)
CLIPPING_UpdateGCRegion(dc);
{
if ( pDC->dclevel.prgnClip )
{
- TempRgn = IntGdiCreateRectRgn(0,0,0,0);
+ TempRgn = IntSysCreateRectRgn(0,0,0,0);
if (TempRgn)
{
Ret = IntGdiCombineRgn( TempRgn,
if (pDC->prgnAPI)
{
REGION_Delete(pDC->prgnAPI);
- pDC->prgnAPI = IntGdiCreateRectRgn(0,0,0,0);
+ pDC->prgnAPI = IntSysCreateRectRgn(0,0,0,0);
}
if (pDC->prgnRao)
{
REGION_Delete(pDC->prgnRao);
- pDC->prgnRao = IntGdiCreateRectRgn(0,0,0,0);
+ pDC->prgnRao = IntSysCreateRectRgn(0,0,0,0);
}
if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip)
pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0);
- hVisRgn = NtGdiCreateRectRgn(0, 0, pdc->ppdev->gdiinfo.ulHorzRes,
+ hVisRgn = IntSysCreateRectRgn(0, 0, pdc->ppdev->gdiinfo.ulHorzRes,
pdc->ppdev->gdiinfo.ulVertRes);
if (!CreateAsIC)
if (hVisRgn)
{
GdiSelectVisRgn(hdc, hVisRgn);
- GreDeleteObject(hVisRgn);
+ REGION_FreeRgnByHandle(hVisRgn);
}
IntGdiSetTextAlign(hdc, TA_TOP);
NtGdiDeleteObjectApp(DisplayDC);
}
- hVisRgn = NtGdiCreateRectRgn(0, 0, 1, 1);
+ hVisRgn = IntSysCreateRectRgn(0, 0, 1, 1);
if (hVisRgn)
{
GdiSelectVisRgn(hdcNew, hVisRgn);
- GreDeleteObject(hVisRgn);
+ REGION_FreeRgnByHandle(hVisRgn);
}
if (Layout) NtGdiSetLayout(hdcNew, -1, Layout);
}
/* FIXME; improve by using a region without a handle and selecting it */
- hVisRgn = NtGdiCreateRectRgn(0,
- 0,
- psurfBmp->SurfObj.sizlBitmap.cx,
- psurfBmp->SurfObj.sizlBitmap.cy);
+ hVisRgn = IntSysCreateRectRgn( 0,
+ 0,
+ psurfBmp->SurfObj.sizlBitmap.cx,
+ psurfBmp->SurfObj.sizlBitmap.cy);
/* Release the exclusive lock */
SURFACE_UnlockSurface(psurfBmp);
if (hVisRgn)
{
GdiSelectVisRgn(hDC, hVisRgn);
- GreDeleteObject(hVisRgn);
+ REGION_FreeRgnByHandle(hVisRgn);
}
return hOrgBmp;
hPtr = GdiHandleCache->Handle + Offset;
- if ( oType == hctRegionHandle)
+ if ( pAttr && oType == hctRegionHandle)
{
if ( Number < CACHE_REGION_ENTRIES )
{
break;
case GDI_OBJECT_TYPE_REGION:
- if (bPEBCacheHandle(hObject, hctRegionHandle, pAttr))
+ /* If pAttr NULL, the probability is high for System Region. */
+ if ( pAttr &&
+ bPEBCacheHandle(hObject, hctRegionHandle, pAttr))
{
+ /* User space handle only! */
return TRUE;
}
if (pAttr)
{
KeEnterCriticalRegion();
- if (pAttr) FreeObjectAttr(pAttr);
+ FreeObjectAttr(pAttr);
Entry->UserData = NULL;
KeLeaveCriticalRegion();
}
BOOL
FASTCALL
-IntGdiSetRegeionOwner(HRGN hRgn, DWORD OwnerMask)
+IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
{
INT Index;
PGDI_TABLE_ENTRY Entry;
//
// System Region Functions
//
-INT
-FASTCALL
-IntSysRegComplexity(HRGN hRgn)
-{
- PROSRGNDATA pRgn;
- INT Ret;
-
- pRgn = REGION_LockRgn(hRgn);
- Ret = REGION_Complexity( pRgn );
- REGION_UnlockRgn(pRgn);
- return Ret;
-}
-
HRGN
FASTCALL
IntSysCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
ASSERT(!(pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)));
- if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return FALSE;
+ if (!(tmpVisRgn = IntSysCreateRectRgn(0, 0, 0, 0))) return FALSE;
// Transform region into device co-ords
if (!REGION_LPTODP(dc, tmpVisRgn, hRgn) ||
NtGdiOffsetRgn(tmpVisRgn, dc->ptlDCOrig.x, dc->ptlDCOrig.y) == ERROR)
{
- GreDeleteObject(tmpVisRgn);
+ REGION_FreeRgnByHandle(tmpVisRgn);
return FALSE;
}
visrgn = RGNOBJAPI_Lock(tmpVisRgn, NULL);
if (visrgn == NULL)
{
- GreDeleteObject(tmpVisRgn);
+ REGION_FreeRgnByHandle(tmpVisRgn);
return FALSE;
}
0xFFFF);//FIXME:don't know what to put here
RGNOBJAPI_Unlock(visrgn);
- GreDeleteObject(tmpVisRgn);
+ REGION_FreeRgnByHandle(tmpVisRgn);
// Fill the region
return TRUE;
HRGN FrameRgn;
BOOL Ret;
- if (!(FrameRgn = NtGdiCreateRectRgn(0, 0, 0, 0)))
+ if (!(FrameRgn = IntSysCreateRectRgn(0, 0, 0, 0)))
{
return FALSE;
}
if (!REGION_CreateFrameRgn(FrameRgn, hRgn, Width, Height))
{
- GreDeleteObject(FrameRgn);
+ REGION_FreeRgnByHandle(FrameRgn);
return FALSE;
}
Ret = NtGdiFillRgn(hDC, FrameRgn, hBrush);
- GreDeleteObject(FrameRgn);
+ REGION_FreeRgnByHandle(FrameRgn);
return Ret;
}