win32k RECT/RECTL issues:

- Although RECT and RECTL are defined equal, the compiler treats them as incompatible. MS has created a lot of definitions with RECT and a lot with RECTL. So far we had to typecast them. Now with adding some defines into a win32k header file, we can finally treat them as equal inside win32k and get rid of a lot of type casts. Also use RECTL in favour of RECT internally, as this is the type that MS uses for the DDI and seems to be the more appropriate type.
- We had a lot of "const PRECT" stuff inside win32k. Note: there's difference between "const RECT *" (what you currently want) and "CONST PRECT" (which you proabably don't want). Despite the fact that CONST is not an official modifier (please stick to const) the main difference is that the former describes a pointer to a constant structure, while the latter describes a constant pointer to a modifyable structure.
- In an attempt to clean up the overpolluted IntGdi namespace, "objectify" the rect functions, moving them into their own namespace RECTL_Xxx.

svn path=/trunk/; revision=40100
This commit is contained in:
Timo Kreuzer 2009-03-19 01:42:34 +00:00
parent ee6542397d
commit 8d620098f5
33 changed files with 401 additions and 410 deletions

View file

@ -34,8 +34,8 @@
static __inline int
CompareRightDown(
const PRECT r1,
const PRECT r2)
const RECTL *r1,
const RECTL *r2)
{
int Cmp;
@ -70,8 +70,8 @@ CompareRightDown(
static __inline int
CompareRightUp(
const PRECT r1,
const PRECT r2)
const RECTL *r1,
const RECTL *r2)
{
int Cmp;
@ -106,8 +106,8 @@ CompareRightUp(
static __inline int
CompareLeftDown(
const PRECT r1,
const PRECT r2)
const RECTL *r1,
const RECTL *r2)
{
int Cmp;
@ -142,8 +142,8 @@ CompareLeftDown(
static __inline int
CompareLeftUp(
const PRECT r1,
const PRECT r2)
const RECTL *r1,
const RECTL *r2)
{
int Cmp;
@ -177,8 +177,8 @@ CompareLeftUp(
static __inline int
CompareSpans(
const PSPAN Span1,
const PSPAN Span2)
const SPAN *Span1,
const SPAN *Span2)
{
int Cmp;

View file

@ -91,8 +91,8 @@ IntEngWndUpdateClipObj(
{
if (visRgn->rdh.nCount > 0)
{
ClipObj = IntEngCreateClipRegion(visRgn->rdh.nCount, (PRECTL)visRgn->Buffer,
(PRECTL)&visRgn->rdh.rcBound);
ClipObj = IntEngCreateClipRegion(visRgn->rdh.nCount, visRgn->Buffer,
&visRgn->rdh.rcBound);
DPRINT("Created visible region with %d rects\n", visRgn->rdh.nCount);
DPRINT(" BoundingRect: %d, %d %d, %d\n",
visRgn->rdh.rcBound.left, visRgn->rdh.rcBound.top,
@ -122,8 +122,8 @@ IntEngWndUpdateClipObj(
if (ClipObj == NULL)
{
/* Fall back to client rect */
ClipObj = IntEngCreateClipRegion(1, (PRECTL)&Window->Wnd->ClientRect,
(PRECTL)&Window->Wnd->ClientRect);
ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->ClientRect,
&Window->Wnd->ClientRect);
}
if (ClipObj == NULL)

View file

@ -43,11 +43,6 @@ const LONG LINC[2] = {-1, 1};
#define VCMPCLRS(a,b,c) \
!(!VCMPCLR(a,b,c,Red) || !VCMPCLR(a,b,c,Green) || !VCMPCLR(a,b,c,Blue))
#define MOVERECT(r,x,y) \
r.left += x; r.right += x; \
r.top += y; r.bottom += y
/* Horizontal/Vertical gradients */
#define HVINITCOL(Col, id) \
c[id] = v1->Col >> 8; \
@ -94,7 +89,7 @@ IntEngGradientFillRect(
rcGradient.top = min(v1->y, v2->y);
rcGradient.bottom = max(v1->y, v2->y);
rcSG = rcGradient;
MOVERECT(rcSG, pptlDitherOrg->x, pptlDitherOrg->y);
RECTL_vOffsetRect(&rcSG, pptlDitherOrg->x, pptlDitherOrg->y);
if(Horizontal)
{
@ -115,7 +110,7 @@ IntEngGradientFillRect(
CLIPOBJ_cEnumStart(pco, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0);
do
{
RECT FillRect;
RECTL FillRect;
ULONG Color;
if(Horizontal)
@ -123,7 +118,7 @@ IntEngGradientFillRect(
EnumMore = CLIPOBJ_bEnum(pco, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top <= rcSG.bottom; i++)
{
if(IntGdiIntersectRect(&FillRect, (PRECT)&RectEnum.arcl[i], (PRECT)&rcSG))
if(RECTL_bIntersectRect(&FillRect, &RectEnum.arcl[i], &rcSG))
{
HVINITCOL(Red, 0);
HVINITCOL(Green, 1);
@ -151,7 +146,7 @@ IntEngGradientFillRect(
EnumMore = CLIPOBJ_bEnum(pco, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top <= rcSG.bottom; i++)
{
if(IntGdiIntersectRect(&FillRect, (PRECT)&RectEnum.arcl[i], (PRECT)&rcSG))
if(RECTL_bIntersectRect(&FillRect, &RectEnum.arcl[i], &rcSG))
{
HVINITCOL(Red, 0);
HVINITCOL(Green, 1);
@ -181,13 +176,13 @@ IntEngGradientFillRect(
CLIPOBJ_cEnumStart(pco, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0);
do
{
RECT FillRect;
RECTL FillRect;
ULONG Color = XLATEOBJ_iXlate(pxlo, RGB(v1->Red, v1->Green, v1->Blue));
EnumMore = CLIPOBJ_bEnum(pco, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top <= rcSG.bottom; i++)
{
if(IntGdiIntersectRect(&FillRect, (PRECT)&RectEnum.arcl[i], (PRECT)&rcSG))
if(RECTL_bIntersectRect(&FillRect, &RectEnum.arcl[i], &rcSG))
{
for(; FillRect.top < FillRect.bottom; FillRect.top++)
{
@ -369,7 +364,7 @@ IntEngGradientFillTriangle(
// EnumMore = CLIPOBJ_bEnum(pco, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
// for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top <= prclExtents->bottom; i++)
// {
// if(IntGdiIntersectRect((PRECT)&FillRect, (PRECT)&RectEnum.arcl[i], (PRECT)prclExtents))
// if(RECTL_bIntersectRect(&FillRect, &RectEnum.arcl[i], prclExtents))
// {
// BOOL InY;
@ -417,7 +412,7 @@ IntEngGradientFillTriangle(
// EnumMore = CLIPOBJ_bEnum(pco, (ULONG) sizeof(RectEnum), (PVOID) &RectEnum);
// for (i = 0; i < RectEnum.c && RectEnum.arcl[i].top <= prclExtents->bottom; i++)
// {
// if(IntGdiIntersectRect((PRECT)&FillRect, (PRECT)&RectEnum.arcl[i], (PRECT)prclExtents))
// if(RECTL_bIntersectRect(&FillRect, &RectEnum.arcl[i], prclExtents))
// {
// S_INITLINE(v1, v3, 0);
// S_INITLINE(v1, v2, 1);

View file

@ -4,10 +4,10 @@
#include <include/dc.h>
#include <include/region.h>
INT FASTCALL IntGdiGetClipBox(PDC, LPRECT rc);
INT FASTCALL IntGdiGetClipBox(PDC, RECTL* rc);
INT FASTCALL IntGdiExtSelectClipRgn (PDC, PROSRGNDATA, int);
INT FASTCALL GdiGetClipBox(HDC hDC, LPRECT rc);
INT FASTCALL GdiGetClipBox(HDC hDC, RECTL *rc);
INT FASTCALL GdiSelectVisRgn(HDC hdc, HRGN hrgn);
INT FASTCALL GdiExtSelectClipRgn (PDC dc, HRGN hrgn, int fnMode);

View file

@ -17,7 +17,7 @@ typedef struct _DESKTOP
/* Pointer to the active queue. */
PVOID ActiveMessageQueue;
/* Rectangle of the work area */
RECT WorkArea;
RECTL WorkArea;
/* Handle of the desktop window. */
HANDLE DesktopWindow;
/* Thread blocking input */
@ -65,7 +65,7 @@ VOID APIENTRY
IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
VOID FASTCALL
IntGetDesktopWorkArea(PDESKTOP Desktop, PRECT Rect);
IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect);
LRESULT CALLBACK
IntDesktopWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

View file

@ -155,26 +155,6 @@ IntGdiCombineTransform(LPXFORM XFormResult,
LPXFORM xform1,
LPXFORM xform2);
/* RECT functions */
VOID FASTCALL
IntGdiSetRect(PRECT Rect, INT left, INT top, INT right, INT bottom);
VOID FASTCALL
IntGdiSetEmptyRect(PRECT Rect);
BOOL FASTCALL
IntGdiIsEmptyRect(const RECT* Rect);
VOID FASTCALL
IntGdiOffsetRect(LPRECT Rect, INT x, INT y);
BOOL FASTCALL
IntGdiUnionRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
BOOL FASTCALL
IntGdiIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
/* Stock objects */
BOOL FASTCALL

View file

@ -23,7 +23,7 @@ typedef struct _MENU_ITEM
ULONG_PTR dwItemData;
UNICODE_STRING Text;
HBITMAP hbmpItem;
RECT Rect;
RECTL Rect;
UINT XTab;
} MENU_ITEM, *PMENU_ITEM;
@ -40,7 +40,7 @@ typedef struct _SETMENUITEMRECT
{
UINT uItem;
BOOL fByPosition;
RECT rcRect;
RECTL rcRect;
} SETMENUITEMRECT, *PSETMENUITEMRECT;
PMENU_OBJECT FASTCALL
@ -95,7 +95,7 @@ DWORD FASTCALL
IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck);
BOOL FASTCALL
IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECT *rcRect);
IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECTL *rcRect);
DWORD APIENTRY UserInsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);

View file

@ -6,7 +6,7 @@
#include <include/window.h>
BOOL FASTCALL
co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn, ULONG Flags);
co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL

View file

@ -67,7 +67,7 @@ BOOL FASTCALL PATH_PolyPolyline( PDC dc, const POINT* pts, const DWORD* counts,
BOOL FASTCALL PATH_Rectangle (PDC dc, INT x1, INT y1, INT x2, INT y2);
BOOL FASTCALL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
BOOL FASTCALL PATH_PathToRegion (PPATH pPath, INT nPolyFillMode, HRGN *pHrgn);
BOOL FASTCALL PATH_ExtTextOut(PDC dc,INT x,INT y,UINT flags,const RECT *lprc,LPCWSTR str,UINT count,const INT *dx);
BOOL FASTCALL PATH_ExtTextOut(PDC dc,INT x,INT y,UINT flags,const RECTL *lprc,LPCWSTR str,UINT count,const INT *dx);
VOID FASTCALL IntGdiCloseFigure(PPATH pPath);
BOOL FASTCALL PATH_Delete(HPATH hPath);

View file

@ -1,17 +1,60 @@
#ifndef _WIN32K_RECT_H
#define _WIN32K_RECT_H
BOOL APIENTRY
NtGdiUnionRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
BOOL APIENTRY
NtGdiSetRect(PRECT Rect, int left, int top, int right, int bottom);
BOOL APIENTRY
NtGdiSetEmptyRect(PRECT Rect);
BOOL APIENTRY
NtGdiIsEmptyRect(const RECT* Rect);
BOOL APIENTRY
NtGdiIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2);
BOOL APIENTRY
NtGdiOffsetRect(LPRECT Rect, int x, int y);
VOID
FORCEINLINE
RECTL_vSetRect(RECTL *prcl, LONG left, LONG top, LONG right, LONG bottom)
{
prcl->left = left;
prcl->top = top;
prcl->right = right;
prcl->bottom = bottom;
}
VOID
FORCEINLINE
RECTL_vSetEmptyRect(RECTL *prcl)
{
prcl->left = 0;
prcl->top = 0;
prcl->right = 0;
prcl->bottom = 0;
}
VOID
FORCEINLINE
RECTL_vOffsetRect(RECTL *prcl, INT cx, INT cy)
{
prcl->left += cx;
prcl->right += cx;
prcl->top += cy;
prcl->bottom += cy;
}
BOOL
FORCEINLINE
RECTL_bIsEmptyRect(const RECTL *prcl)
{
return (prcl->left >= prcl->right || prcl->top >= prcl->bottom);
}
BOOL
FORCEINLINE
RECTL_bPointInRect(const RECTL *prcl, INT x, INT y)
{
return (x >= prcl->left && x <= prcl->right &&
y >= prcl->top && y <= prcl->bottom);
}
BOOL
FASTCALL
RECTL_bUnionRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2);
BOOL
FASTCALL
RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2);
#endif /* _WIN32K_RECT_H */

View file

@ -15,7 +15,7 @@ typedef struct _ROSRGNDATA
BASEOBJECT BaseObject;
RGNDATAHEADER rdh;
PRECT Buffer;
RECTL *Buffer;
} ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA;
@ -27,10 +27,10 @@ typedef struct _ROSRGNDATA
#define REGION_UnlockRgn(pRgn) GDIOBJ_UnlockObjByPtr((POBJ)pRgn)
PROSRGNDATA FASTCALL REGION_AllocRgnWithHandle(INT n);
VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, CONST RECT *rect);
INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, LPRECT pRect);
BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, CONST LPRECT rc);
BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const PRECT rect, const PPOINT off);
VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, const RECTL *rect);
INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect);
BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc);
BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off);
VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
BOOL INTERNAL_CALL REGION_Cleanup(PVOID ObjectBody);
@ -41,7 +41,7 @@ VOID FASTCALL REGION_Delete(PROSRGNDATA);
VOID FASTCALL IntGdiReleaseRaoRgn(PDC);
VOID FASTCALL IntGdiReleaseVisRgn(PDC);
INT APIENTRY IntGdiGetRgnBox(HRGN, LPRECT);
INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*);
BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN );
HRGN FASTCALL IntCreatePolyPolygonRgn(PPOINT, PULONG, INT, INT);

View file

@ -106,7 +106,7 @@ DWORD FASTCALL ftGdiGetFontData(PFONTGDI,DWORD,DWORD,PVOID,DWORD);
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL LPRECT,
BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL RECTL*,
IN LPWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD);
DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD);

View file

@ -116,7 +116,7 @@ NTSTATUS FASTCALL
CleanupWindowImpl (VOID);
VOID FASTCALL
IntGetClientRect (PWINDOW_OBJECT WindowObject, PRECT Rect);
IntGetClientRect (PWINDOW_OBJECT WindowObject, RECTL *Rect);
HWND FASTCALL
IntGetActiveWindow (VOID);
@ -147,7 +147,7 @@ INT FASTCALL
IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
INT FASTCALL
IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECT *Rect);
IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect);
BOOL FASTCALL
IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);

View file

@ -21,12 +21,12 @@ FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);
BOOL FASTCALL
IntGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
LRESULT FASTCALL
co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientRect);
co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECTL* WindowRect, RECTL* ClientRect);
UINT FASTCALL
co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack);
UINT FASTCALL
co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos);
co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECTL* NewPos);
BOOLEAN FASTCALL
co_WinPosSetWindowPos(PWINDOW_OBJECT Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
INT cy, UINT flags);
@ -38,6 +38,6 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes
VOID FASTCALL co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
VOID FASTCALL WinPosInitInternalPos(PWINDOW_OBJECT WindowObject,
POINT *pt, PRECT RestoreRect);
POINT *pt, RECTL *RestoreRect);
#endif /* _WIN32K_WINPOS_H */

View file

@ -840,13 +840,13 @@ CLEANUP:
BOOL
APIENTRY
NtUserClipCursor(
RECT *UnsafeRect)
RECTL *UnsafeRect)
{
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
PWINSTATION_OBJECT WinSta;
PSYSTEM_CURSORINFO CurInfo;
RECT Rect;
RECTL Rect;
PWINDOW_OBJECT DesktopWindow = NULL;
POINT MousePos = {0};
DECLARE_RETURN(BOOL);
@ -1001,12 +1001,12 @@ CLEANUP:
BOOL
APIENTRY
NtUserGetClipCursor(
RECT *lpRect)
RECTL *lpRect)
{
/* FIXME - check if process has WINSTA_READATTRIBUTES */
PSYSTEM_CURSORINFO CurInfo;
PWINSTATION_OBJECT WinSta;
RECT Rect;
RECTL Rect;
NTSTATUS Status;
DECLARE_RETURN(BOOL);
@ -1038,7 +1038,7 @@ NtUserGetClipCursor(
Rect.bottom = UserGetSystemMetrics(SM_CYSCREEN);
}
Status = MmCopyToCaller((PRECT)lpRect, &Rect, sizeof(RECT));
Status = MmCopyToCaller(lpRect, &Rect, sizeof(RECT));
if(!NT_SUCCESS(Status))
{
ObDereferenceObject(WinSta);
@ -1491,7 +1491,7 @@ UserDrawIconEx(
if (DoFlickerFree || bAlpha)
{
RECT r;
RECTL r;
BITMAP bm;
SURFACE *psurfOff = NULL;

View file

@ -439,9 +439,9 @@ IntValidateDesktopHandle(
}
VOID FASTCALL
IntGetDesktopWorkArea(PDESKTOP Desktop, PRECT Rect)
IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect)
{
PRECT Ret;
RECTL *Ret;
ASSERT(Desktop);
@ -1358,7 +1358,7 @@ CLEANUP:
BOOL APIENTRY
NtUserPaintDesktop(HDC hDC)
{
RECT Rect;
RECTL Rect;
HBRUSH DesktopBrush, PreviousBrush;
HWND hWndDesktop;
BOOL doPatBlt = TRUE;
@ -1513,7 +1513,7 @@ NtUserPaintDesktop(HDC hDC)
if (g_PaintDesktopVersion)
{
static WCHAR s_wszVersion[256] = {0};
RECT rect;
RECTL rect;
if (*s_wszVersion)
{

View file

@ -734,7 +734,7 @@ UserCallNextHookEx(
case HCBT_MOVESIZE:
{
RECT rt;
RECTL rt;
DPRINT1("HOOK HCBT_MOVESIZE\n");
if (lParam)
{

View file

@ -1265,14 +1265,14 @@ co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
INT FASTCALL
IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y,
RECT lprect)
RECTL lprect)
{
return 0;
}
BOOL FASTCALL
co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
UINT Flags, POINT *Pos, UINT MenuPos, RECT *ExcludeRect)
UINT Flags, POINT *Pos, UINT MenuPos, RECTL *ExcludeRect)
{
co_IntInitTracking(Window, Menu, TRUE, Flags);
@ -1281,7 +1281,7 @@ co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
}
BOOL FASTCALL
IntSetMenuItemRect(PMENU_OBJECT Menu, UINT Item, BOOL fByPos, RECT *rcRect)
IntSetMenuItemRect(PMENU_OBJECT Menu, UINT Item, BOOL fByPos, RECTL *rcRect)
{
PMENU_ITEM mi;
if(IntGetMenuItemByFlag(Menu, Item, (fByPos ? MF_BYPOSITION : MF_BYCOMMAND),
@ -1327,7 +1327,7 @@ IntCleanupMenus(struct _EPROCESS *Process, PW32PROCESS Win32Process)
}
VOID APIENTRY
co_InflateRect(LPRECT rect, int dx, int dy)
co_InflateRect(RECTL *rect, int dx, int dy)
{
rect->left -= dx;
rect->top -= dy;
@ -1876,7 +1876,7 @@ NtUserGetMenuBarInfo(
PWINDOW_OBJECT WindowObject;
HMENU hMenu;
POINT Offset;
RECT Rect;
RECTL Rect;
MENUBARINFO kmbi;
DECLARE_RETURN(BOOL);
@ -2098,12 +2098,12 @@ NtUserGetMenuItemRect(
HWND hWnd,
HMENU hMenu,
UINT uItem,
LPRECT lprcItem)
PRECTL lprcItem)
{
ROSMENUINFO mi;
PWINDOW_OBJECT ReferenceWnd;
LONG XMove, YMove;
RECT Rect;
RECTL Rect;
NTSTATUS Status;
PMENU_OBJECT Menu;
PMENU_ITEM MenuItem;

View file

@ -316,9 +316,9 @@ IntGetPrimaryMonitor()
*/
static
UINT
IntGetMonitorsFromRect(OPTIONAL IN LPCRECT pRect,
IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
OPTIONAL OUT HMONITOR *hMonitorList,
OPTIONAL OUT LPRECT monitorRectList,
OPTIONAL OUT PRECTL monitorRectList,
OPTIONAL IN DWORD listSize,
OPTIONAL IN DWORD flags)
{
@ -329,7 +329,7 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECT pRect,
/* find monitors which intersect the rectangle */
for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next)
{
RECT MonitorRect, IntersectionRect;
RECTL MonitorRect, IntersectionRect;
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Monitor->Lock);
MonitorRect.left = 0; /* FIXME: get origin */
@ -456,16 +456,16 @@ INT
APIENTRY
NtUserEnumDisplayMonitors(
OPTIONAL IN HDC hDC,
OPTIONAL IN LPCRECT pRect,
OPTIONAL IN LPCRECTL pRect,
OPTIONAL OUT HMONITOR *hMonitorList,
OPTIONAL OUT LPRECT monitorRectList,
OPTIONAL OUT PRECTL monitorRectList,
OPTIONAL IN DWORD listSize)
{
INT numMonitors, i;
HMONITOR *safeHMonitorList = NULL;
LPRECT safeRectList = NULL;
RECT rect, *myRect;
RECT dcRect;
PRECTL safeRectList = NULL;
RECTL rect, *myRect;
RECTL dcRect;
NTSTATUS status;
/* get rect */
@ -729,7 +729,7 @@ NtUserMonitorFromPoint(
IN DWORD dwFlags)
{
INT NumMonitors;
RECT InRect;
RECTL InRect;
HMONITOR hMonitor = NULL;
/* fill inRect */
@ -783,14 +783,14 @@ NtUserMonitorFromPoint(
HMONITOR
APIENTRY
NtUserMonitorFromRect(
IN LPCRECT pRect,
IN LPCRECTL pRect,
IN DWORD dwFlags)
{
INT numMonitors, iLargestArea = -1, i;
LPRECT rectList;
PRECTL rectList;
HMONITOR *hMonitorList;
HMONITOR hMonitor = NULL;
RECT rect;
RECTL rect;
NTSTATUS status;
/* get rect */
@ -883,7 +883,7 @@ NtUserMonitorFromWindow(
{
PWINDOW_OBJECT Window;
HMONITOR hMonitor = NULL;
RECT Rect;
RECTL Rect;
DECLARE_RETURN(HMONITOR);
DPRINT("Enter NtUserMonitorFromWindow\n");

View file

@ -1092,7 +1092,7 @@ BOOL
APIENTRY
NtUserValidateRect(
HWND hWnd,
CONST RECT *lpRect)
const RECT *lpRect)
{
UNIMPLEMENTED;
return 0;

View file

@ -55,7 +55,7 @@
*/
BOOL FASTCALL
IntIntersectWithParents(PWINDOW_OBJECT Child, PRECT WindowRect)
IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
{
PWINDOW_OBJECT ParentWindow;
PWINDOW ParentWnd;
@ -70,7 +70,7 @@ IntIntersectWithParents(PWINDOW_OBJECT Child, PRECT WindowRect)
return FALSE;
}
if (!IntGdiIntersectRect(WindowRect, WindowRect, &ParentWnd->ClientRect))
if (!RECTL_bIntersectRect(WindowRect, WindowRect, &ParentWnd->ClientRect))
{
return FALSE;
}
@ -534,7 +534,7 @@ IntIsWindowDrawable(PWINDOW_OBJECT Window)
*/
BOOL FASTCALL
co_UserRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRgn,
co_UserRedrawWindow(PWINDOW_OBJECT Window, const RECTL* UpdateRect, HRGN UpdateRgn,
ULONG Flags)
{
HRGN hRgn = NULL;
@ -572,21 +572,21 @@ co_UserRedrawWindow(PWINDOW_OBJECT Window, const RECT* UpdateRect, HRGN UpdateRg
}
else if (UpdateRect != NULL)
{
if (!IntGdiIsEmptyRect(UpdateRect))
if (!RECTL_bIsEmptyRect(UpdateRect))
{
hRgn = UnsafeIntCreateRectRgnIndirect((RECT *)UpdateRect);
hRgn = UnsafeIntCreateRectRgnIndirect((RECTL *)UpdateRect);
NtGdiOffsetRgn(hRgn, Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top);
}
}
else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
(Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
{
if (!IntGdiIsEmptyRect(&Window->Wnd->WindowRect))
if (!RECTL_bIsEmptyRect(&Window->Wnd->WindowRect))
hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect);
}
else
{
if (!IntGdiIsEmptyRect(&Window->Wnd->ClientRect))
if (!RECTL_bIsEmptyRect(&Window->Wnd->ClientRect))
hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect);
}
}
@ -712,7 +712,7 @@ IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax,
static
HWND FASTCALL
co_IntFixCaret(PWINDOW_OBJECT Window, LPRECT lprc, UINT flags)
co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
{
PDESKTOP Desktop;
PTHRDCARETINFO CaretInfo;
@ -732,7 +732,7 @@ co_IntFixCaret(PWINDOW_OBJECT Window, LPRECT lprc, UINT flags)
((flags & SW_SCROLLCHILDREN) && IntIsChildWindow(Window, WndCaret)))
{
POINT pt, FromOffset, ToOffset, Offset;
RECT rcCaret;
RECTL rcCaret;
pt.x = CaretInfo->Pos.x;
pt.y = CaretInfo->Pos.y;
@ -744,7 +744,7 @@ co_IntFixCaret(PWINDOW_OBJECT Window, LPRECT lprc, UINT flags)
rcCaret.top = pt.y;
rcCaret.right = pt.x + CaretInfo->Size.cx;
rcCaret.bottom = pt.y + CaretInfo->Size.cy;
if (IntGdiIntersectRect(lprc, lprc, &rcCaret))
if (RECTL_bIntersectRect(lprc, lprc, &rcCaret))
{
co_UserHideCaret(0);
lprc->left = pt.x;
@ -927,7 +927,7 @@ INT FASTCALL
co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
{
int RegionType;
RECT Rect;
RECTL Rect;
ASSERT_REFS_CO(Window);
@ -998,7 +998,7 @@ BOOL APIENTRY
NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
{
PWINDOW_OBJECT Window;
RECT Rect;
RECTL Rect;
INT RegionType;
PROSRGNDATA RgnData;
NTSTATUS Status;
@ -1031,12 +1031,12 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
REGION_UnlockRgn(RgnData);
if (RegionType != ERROR && RegionType != NULLREGION)
IntGdiIntersectRect(&Rect, &Rect, &Window->Wnd->ClientRect);
RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->ClientRect);
}
if (IntIntersectWithParents(Window, &Rect))
{
IntGdiOffsetRect(&Rect,
RECTL_vOffsetRect(&Rect,
-Window->Wnd->ClientRect.left,
-Window->Wnd->ClientRect.top);
} else
@ -1045,7 +1045,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
}
}
if (bErase && !IntGdiIsEmptyRect(&Rect))
if (bErase && !RECTL_bIsEmptyRect(&Rect))
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
@ -1055,7 +1055,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
if (UnsafeRect != NULL)
{
Status = MmCopyToCaller(UnsafeRect, &Rect, sizeof(RECT));
Status = MmCopyToCaller(UnsafeRect, &Rect, sizeof(RECTL));
if (!NT_SUCCESS(Status))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
@ -1063,7 +1063,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
}
}
RETURN(!IntGdiIsEmptyRect(&Rect));
RETURN(!RECTL_bIsEmptyRect(&Rect));
CLEANUP:
DPRINT("Leave NtUserGetUpdateRect, ret=%i\n",_ret_);
@ -1082,7 +1082,7 @@ BOOL APIENTRY
NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
UINT flags)
{
RECT SafeUpdateRect;
RECTL SafeUpdateRect;
NTSTATUS Status;
PWINDOW_OBJECT Wnd;
DECLARE_RETURN(BOOL);
@ -1098,8 +1098,8 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
if (lprcUpdate != NULL)
{
Status = MmCopyFromCaller(&SafeUpdateRect, (PRECT)lprcUpdate,
sizeof(RECT));
Status = MmCopyFromCaller(&SafeUpdateRect, lprcUpdate,
sizeof(RECTL));
if (!NT_SUCCESS(Status))
{
@ -1134,24 +1134,24 @@ CLEANUP:
static
INT FASTCALL
UserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcScroll,
const RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate)
UserScrollDC(HDC hDC, INT dx, INT dy, const RECTL *prcScroll,
const RECTL *prcClip, HRGN hrgnUpdate, RECTL *prcUpdate)
{
PDC pDC;
RECT rcScroll, rcClip, rcSrc, rcDst;
RECTL rcScroll, rcClip, rcSrc, rcDst;
INT Result;
GdiGetClipBox(hDC, &rcClip);
rcScroll = rcClip;
if (prcClip)
{
IntGdiIntersectRect(&rcClip, &rcClip, prcClip);
RECTL_bIntersectRect(&rcClip, &rcClip, prcClip);
}
if (prcScroll)
{
rcScroll = *prcScroll;
IntGdiIntersectRect(&rcSrc, &rcClip, prcScroll);
RECTL_bIntersectRect(&rcSrc, &rcClip, prcScroll);
}
else
{
@ -1159,8 +1159,8 @@ UserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcScroll,
}
rcDst = rcSrc;
IntGdiOffsetRect(&rcDst, dx, dy);
IntGdiIntersectRect(&rcDst, &rcDst, &rcClip);
RECTL_vOffsetRect(&rcDst, dx, dy);
RECTL_bIntersectRect(&rcDst, &rcDst, &rcClip);
if (!NtGdiBitBlt(hDC, rcDst.left, rcDst.top,
rcDst.right - rcDst.left, rcDst.bottom - rcDst.top,
@ -1185,8 +1185,8 @@ UserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcScroll,
/* Begin with the shifted and then clipped scroll rect */
rcDst = rcScroll;
IntGdiOffsetRect(&rcDst, dx, dy);
IntGdiIntersectRect(&rcDst, &rcDst, &rcClip);
RECTL_vOffsetRect(&rcDst, dx, dy);
RECTL_bIntersectRect(&rcDst, &rcDst, &rcClip);
if (hrgnUpdate)
{
hrgnOwn = hrgnUpdate;
@ -1242,7 +1242,7 @@ NtUserScrollDC(HDC hDC, INT dx, INT dy, const RECT *prcUnsafeScroll,
const RECT *prcUnsafeClip, HRGN hrgnUpdate, LPRECT prcUnsafeUpdate)
{
DECLARE_RETURN(DWORD);
RECT rcScroll, rcClip, rcUpdate;
RECTL rcScroll, rcClip, rcUpdate;
NTSTATUS Status = STATUS_SUCCESS;
DWORD Result;
@ -1325,7 +1325,7 @@ DWORD APIENTRY
NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
const RECT *prcUnsafeClip, HRGN hrgnUpdate, LPRECT prcUnsafeUpdate, UINT flags)
{
RECT rcScroll, rcClip, rcCaret, rcUpdate;
RECTL rcScroll, rcClip, rcCaret, rcUpdate;
INT Result;
PWINDOW_OBJECT Window = NULL, CaretWnd;
HDC hDC;
@ -1353,7 +1353,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
if (prcUnsafeScroll)
{
ProbeForRead(prcUnsafeScroll, sizeof(*prcUnsafeScroll), 1);
IntGdiIntersectRect(&rcScroll, &rcClip, prcUnsafeScroll);
RECTL_bIntersectRect(&rcScroll, &rcClip, prcUnsafeScroll);
}
else
rcScroll = rcClip;
@ -1361,7 +1361,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
if (prcUnsafeClip)
{
ProbeForRead(prcUnsafeClip, sizeof(*prcUnsafeClip), 1);
IntGdiIntersectRect(&rcClip, &rcClip, prcUnsafeClip);
RECTL_bIntersectRect(&rcClip, &rcClip, prcUnsafeClip);
}
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@ -1419,10 +1419,10 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
if (flags & SW_SCROLLCHILDREN)
{
PWINDOW_OBJECT Child;
RECT rcChild;
RECTL rcChild;
POINT ClientOrigin;
USER_REFERENCE_ENTRY WndRef;
RECT rcDummy;
RECTL rcDummy;
IntGetClientOrigin(Window, &ClientOrigin);
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
@ -1433,7 +1433,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
rcChild.right -= ClientOrigin.x;
rcChild.bottom -= ClientOrigin.y;
if (! prcUnsafeScroll || IntGdiIntersectRect(&rcDummy, &rcChild, &rcScroll))
if (! prcUnsafeScroll || RECTL_bIntersectRect(&rcDummy, &rcChild, &rcScroll))
{
UserRefObjectCo(Child, &WndRef);
co_WinPosSetWindowPos(Child, 0, rcChild.left + dx, rcChild.top + dy, 0, 0,
@ -1503,7 +1503,7 @@ BOOL
UserDrawSysMenuButton(
PWINDOW_OBJECT pWnd,
HDC hDc,
LPRECT lpRc,
RECTL *lpRc,
BOOL Down)
{
HICON hIcon;
@ -1543,7 +1543,7 @@ UserDrawSysMenuButton(
BOOL
UserDrawCaptionText(HDC hDc,
const PUNICODE_STRING Text,
const LPRECT lpRc,
const RECTL *lpRc,
UINT uFlags)
{
HFONT hOldFont = NULL, hFont = NULL;
@ -1608,7 +1608,7 @@ UserDrawCaptionText(HDC hDc,
BOOL UserDrawCaption(
PWINDOW_OBJECT pWnd,
HDC hDc,
LPCRECT lpRc,
RECTL *lpRc,
HFONT hFont,
HICON hIcon,
const PUNICODE_STRING str,
@ -1620,7 +1620,7 @@ BOOL UserDrawCaption(
HDC hMemDc = NULL;
ULONG Height;
UINT VCenter = 0, Padding = 0;
RECT r = *lpRc;
RECTL r = *lpRc;
LONG ButtonWidth, IconWidth;
BOOL HasIcon;
PWINDOW Wnd = NULL;
@ -1901,7 +1901,7 @@ NtUserDrawCaptionTemp(
UINT uFlags)
{
PWINDOW_OBJECT pWnd = NULL;
RECT SafeRect;
RECTL SafeRect;
UNICODE_STRING SafeStr = {0};
BOOL Ret = FALSE;
@ -1918,8 +1918,8 @@ NtUserDrawCaptionTemp(
_SEH2_TRY
{
ProbeForRead(lpRc, sizeof(RECT), sizeof(ULONG));
RtlCopyMemory(&SafeRect, lpRc, sizeof(RECT));
ProbeForRead(lpRc, sizeof(RECTL), sizeof(ULONG));
RtlCopyMemory(&SafeRect, lpRc, sizeof(RECTL));
if (str != NULL)
{
SafeStr = ProbeForReadUnicodeString(str);

View file

@ -57,12 +57,12 @@
* the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
*/
BOOL FASTCALL
IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, PRECT lprect)
IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
{
BOOL vertical;
PWINDOW Wnd = Window->Wnd;
RECT ClientRect = Window->Wnd->ClientRect;
RECT WindowRect = Window->Wnd->WindowRect;
RECTL ClientRect = Window->Wnd->ClientRect;
RECTL WindowRect = Window->Wnd->WindowRect;
switch (nBar)
{
@ -107,7 +107,7 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
{
PWINDOW Wnd = Window->Wnd;
INT Thumb, ThumbBox, ThumbPos, cxy, mx;
RECT ClientRect;
RECTL ClientRect;
switch(idObject)
{
@ -120,7 +120,7 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
cxy = psbi->rcScrollBar.bottom - psbi->rcScrollBar.top;
break;
case SB_CTL:
IntGetClientRect (Window, &ClientRect);
IntGetClientRect(Window, &ClientRect);
if(Wnd->Style & SBS_VERT)
{
Thumb = UserGetSystemMetrics(SM_CYVSCROLL);
@ -391,7 +391,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
if (bRedraw)
{
RECT UpdateRect = psbi->rcScrollBar;
RECTL UpdateRect = psbi->rcScrollBar;
UpdateRect.left -= Window->Wnd->ClientRect.left - Window->Wnd->WindowRect.left;
UpdateRect.right -= Window->Wnd->ClientRect.left - Window->Wnd->WindowRect.left;
UpdateRect.top -= Window->Wnd->ClientRect.top - Window->Wnd->WindowRect.top;

View file

@ -453,7 +453,7 @@ NtUserCallTwoParam(
case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
{
DWORD Ret;
RECT rcRect;
RECTL rcRect;
Window = UserGetWindowObject((HWND)Param1);
if (!Window) RETURN(ERROR);

View file

@ -506,7 +506,7 @@ IntSystemParametersInfo(
}
case SPI_SETWORKAREA:
{
RECT *rc;
RECTL *rc;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop;
@ -517,7 +517,7 @@ IntSystemParametersInfo(
}
ASSERT(pvParam);
rc = (RECT*)pvParam;
rc = pvParam;
Desktop->WorkArea = *rc;
bChanged = TRUE;
@ -535,7 +535,7 @@ IntSystemParametersInfo(
}
ASSERT(pvParam);
IntGetDesktopWorkArea(Desktop, (PRECT)pvParam);
IntGetDesktopWorkArea(Desktop, pvParam);
break;
}

View file

@ -739,7 +739,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
* \note Does not check the validity of the parameters
*/
VOID FASTCALL
IntGetClientRect(PWINDOW_OBJECT Window, PRECT Rect)
IntGetClientRect(PWINDOW_OBJECT Window, RECTL *Rect)
{
ASSERT( Window );
ASSERT( Rect );
@ -1484,14 +1484,14 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
* calculates the default position of a window
*/
BOOL FASTCALL
IntCalcDefPosSize(PWINDOW_OBJECT Parent, PWINDOW_OBJECT Window, RECT *rc, BOOL IncPos)
IntCalcDefPosSize(PWINDOW_OBJECT Parent, PWINDOW_OBJECT Window, RECTL *rc, BOOL IncPos)
{
SIZE Sz;
POINT Pos = {0, 0};
if(Parent != NULL)
{
IntGdiIntersectRect(rc, rc, &Parent->Wnd->ClientRect);
RECTL_bIntersectRect(rc, rc, &Parent->Wnd->ClientRect);
if(IncPos)
{
@ -1899,7 +1899,7 @@ AllocErr:
/* default positioning for overlapped windows */
if(!(Wnd->Style & (WS_POPUP | WS_CHILD)))
{
RECT rc, WorkArea;
RECTL rc, WorkArea;
PRTL_USER_PROCESS_PARAMETERS ProcessParams;
BOOL CalculatedDefPosSize = FALSE;
@ -1997,7 +1997,7 @@ AllocErr:
Wnd->WindowRect.bottom = Pos.y + Size.cy;
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)
{
IntGdiOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,
RECTL_vOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,
ParentWindow->Wnd->ClientRect.top);
}
Wnd->ClientRect = Wnd->WindowRect;
@ -2032,7 +2032,7 @@ AllocErr:
Wnd->WindowRect.bottom = Pos.y + Size.cy;
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)
{
IntGdiOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,
RECTL_vOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left,
ParentWindow->Wnd->ClientRect.top);
}
Wnd->ClientRect = Wnd->WindowRect;
@ -2067,7 +2067,7 @@ AllocErr:
&Window->Wnd->WindowRect,
&Window->Wnd->ClientRect);
IntGdiOffsetRect(&Window->Wnd->WindowRect,
RECTL_vOffsetRect(&Window->Wnd->WindowRect,
MaxPos.x - Window->Wnd->WindowRect.left,
MaxPos.y - Window->Wnd->WindowRect.top);
@ -2172,7 +2172,7 @@ AllocErr:
/* Show or maybe minimize or maximize the window. */
if (Wnd->Style & (WS_MINIMIZE | WS_MAXIMIZE))
{
RECT NewPos;
RECTL NewPos;
UINT16 SwFlag;
SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE :
@ -4484,7 +4484,7 @@ IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
}
INT FASTCALL
IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECT *Rect)
IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect)
{
INT Ret;
HRGN VisRgn;

View file

@ -191,7 +191,7 @@ UINT
FASTCALL
co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
{
RECT rectParent;
RECTL rectParent;
INT i, x, y, xspacing, yspacing;
HWND *List = IntWinListChildren(parent);
@ -248,7 +248,7 @@ WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
}
VOID FASTCALL
WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, PRECT RestoreRect)
WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
{
PWINDOW_OBJECT Parent;
UINT XInc, YInc;
@ -256,7 +256,7 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, PRECT RestoreRect)
if (!Wnd->InternalPosInitialized)
{
RECT WorkArea;
RECTL WorkArea;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; /* Or rather get it from the window? */
@ -333,7 +333,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
RDW_NOINTERNALPAINT);
Wnd->Style |= WS_MINIMIZE;
WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos);
IntGdiSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
UserGetSystemMetrics(SM_CXMINIMIZED),
UserGetSystemMetrics(SM_CYMINIMIZED));
SwpFlags |= SWP_NOCOPYBITS;
@ -351,7 +351,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
Wnd->Style &= ~WS_MINIMIZE;
}
Wnd->Style |= WS_MAXIMIZE;
IntGdiSetRect(NewPos, Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y,
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y,
Size.x, Size.y);
break;
}
@ -366,7 +366,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
co_WinPosGetMinMaxInfo(Window, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL);
Wnd->Style |= WS_MAXIMIZE;
IntGdiSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
break;
}
@ -401,7 +401,7 @@ VOID FASTCALL
WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info)
{
UINT XInc, YInc;
RECT WorkArea;
RECTL WorkArea;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; /* Or rather get it from the window? */
@ -459,7 +459,7 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
static
VOID FASTCALL
FixClientRect(PRECT ClientRect, PRECT WindowRect)
FixClientRect(PRECTL ClientRect, PRECTL WindowRect)
{
if (ClientRect->left < WindowRect->left)
{
@ -519,11 +519,11 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
Parent = Window->Parent;
if (0 != (Wnd->Style & WS_CHILD) && Parent)
{
IntGdiOffsetRect(&(params.rgrc[0]), - Parent->Wnd->ClientRect.left,
RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->ClientRect.left,
- Parent->Wnd->ClientRect.top);
IntGdiOffsetRect(&(params.rgrc[1]), - Parent->Wnd->ClientRect.left,
RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->ClientRect.left,
- Parent->Wnd->ClientRect.top);
IntGdiOffsetRect(&(params.rgrc[2]), - Parent->Wnd->ClientRect.left,
RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->ClientRect.left,
- Parent->Wnd->ClientRect.top);
}
params.lppos = &winposCopy;
@ -538,7 +538,7 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
*ClientRect = params.rgrc[0];
if ((Wnd->Style & WS_CHILD) && Parent)
{
IntGdiOffsetRect(ClientRect, Parent->Wnd->ClientRect.left,
RECTL_vOffsetRect(ClientRect, Parent->Wnd->ClientRect.left,
Parent->Wnd->ClientRect.top);
}
FixClientRect(ClientRect, WindowRect);
@ -577,8 +577,8 @@ static
BOOL FASTCALL
co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
PWINDOWPOS WinPos,
PRECT WindowRect,
PRECT ClientRect)
PRECTL WindowRect,
PRECTL ClientRect)
{
INT X, Y;
PWINDOW Wnd;
@ -616,7 +616,7 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
WindowRect->top = Y;
WindowRect->right += X - Wnd->WindowRect.left;
WindowRect->bottom += Y - Wnd->WindowRect.top;
IntGdiOffsetRect(ClientRect,
RECTL_vOffsetRect(ClientRect,
X - Wnd->WindowRect.left,
Y - Wnd->WindowRect.top);
}
@ -871,8 +871,8 @@ co_WinPosSetWindowPos(
)
{
WINDOWPOS WinPos;
RECT NewWindowRect;
RECT NewClientRect;
RECTL NewWindowRect;
RECTL NewClientRect;
PROSRGNDATA VisRgn;
HRGN VisBefore = NULL;
HRGN VisAfter = NULL;
@ -880,11 +880,11 @@ co_WinPosSetWindowPos(
HRGN ExposedRgn = NULL;
HRGN CopyRgn = NULL;
ULONG WvrFlags = 0;
RECT OldWindowRect, OldClientRect;
RECTL OldWindowRect, OldClientRect;
int RgnType;
HDC Dc;
RECT CopyRect;
RECT TempRect;
RECTL CopyRect;
RECTL TempRect;
PWINDOW_OBJECT Ancestor;
ASSERT_REFS_CO(Window);
@ -1132,11 +1132,11 @@ co_WinPosSetWindowPos(
RgnType != NULLREGION)
{
PROSRGNDATA pCopyRgn;
RECT ORect = OldClientRect;
RECT NRect = NewClientRect;
IntGdiOffsetRect(&ORect, - OldWindowRect.left, - OldWindowRect.top);
IntGdiOffsetRect(&NRect, - NewWindowRect.left, - NewWindowRect.top);
IntGdiIntersectRect(&CopyRect, &ORect, &NRect);
RECTL ORect = OldClientRect;
RECTL NRect = NewClientRect;
RECTL_vOffsetRect(&ORect, - OldWindowRect.left, - OldWindowRect.top);
RECTL_vOffsetRect(&NRect, - NewWindowRect.left, - NewWindowRect.top);
RECTL_bIntersectRect(&CopyRect, &ORect, &NRect);
pCopyRgn = REGION_LockRgn(CopyRgn);
REGION_CropAndOffsetRegion(pCopyRgn, pCopyRgn, &CopyRect, NULL);
REGION_UnlockRgn(pCopyRgn);
@ -1316,7 +1316,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
{
BOOLEAN WasVisible;
UINT Swp = 0;
RECT NewPos;
RECTL NewPos;
BOOLEAN ShowFlag;
// HRGN VisibleRgn;
PWINDOW Wnd;

View file

@ -23,14 +23,6 @@
#define NDEBUG
#include <debug.h>
#define IN_RECT(r,x,y) \
( \
(x) >= (r).left && \
(y) >= (r).top && \
(x) < (r).right && \
(y) < (r).bottom \
)
HBITMAP APIENTRY
IntGdiCreateBitmap(
INT Width,
@ -366,7 +358,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
XPos += dc->ptlDCOrig.x;
YPos += dc->ptlDCOrig.y;
if (IN_RECT(dc->CombinedClip->rclBounds,XPos,YPos))
if (RECTL_bPointInRect(&dc->CombinedClip->rclBounds, XPos, YPos))
{
bInRect = TRUE;
psurf = SURFACE_LockSurface(dc->w.hBitmap);

View file

@ -43,8 +43,8 @@ CLIPPING_UpdateGCRegion(DC* Dc)
Dc->CombinedClip = IntEngCreateClipRegion(
CombinedRegion->rdh.nCount,
(PRECTL)CombinedRegion->Buffer,
(PRECTL)&CombinedRegion->rdh.rcBound);
CombinedRegion->Buffer,
&CombinedRegion->rdh.rcBound);
REGION_UnlockRgn(CombinedRegion);
}
@ -124,7 +124,7 @@ int FASTCALL GdiExtSelectClipRgn(PDC dc,
if (!dc->w.hClipRgn)
{
PROSRGNDATA Rgn;
RECT rect;
RECTL rect;
if((Rgn = REGION_LockRgn(dc->w.hVisRgn)))
{
REGION_GetRgnBox(Rgn, &rect);
@ -169,7 +169,7 @@ int APIENTRY NtGdiExtSelectClipRgn(HDC hDC,
}
INT FASTCALL
GdiGetClipBox(HDC hDC, LPRECT rc)
GdiGetClipBox(HDC hDC, PRECTL rc)
{
PROSRGNDATA Rgn;
INT retval;
@ -194,11 +194,11 @@ GdiGetClipBox(HDC hDC, LPRECT rc)
}
INT APIENTRY
NtGdiGetAppClipBox(HDC hDC, LPRECT rc)
NtGdiGetAppClipBox(HDC hDC, PRECTL rc)
{
INT Ret;
NTSTATUS Status = STATUS_SUCCESS;
RECT Saferect;
RECTL Saferect;
Ret = GdiGetClipBox(hDC, &Saferect);
@ -231,7 +231,7 @@ int APIENTRY NtGdiExcludeClipRect(HDC hDC,
int BottomRect)
{
INT Result;
RECT Rect;
RECTL Rect;
HRGN NewRgn;
PDC dc = DC_LockDc(hDC);
@ -282,7 +282,7 @@ int APIENTRY NtGdiIntersectClipRect(HDC hDC,
int BottomRect)
{
INT Result;
RECT Rect;
RECTL Rect;
HRGN NewRgn;
PDC dc = DC_LockDc(hDC);
@ -374,13 +374,13 @@ BOOL APIENTRY NtGdiPtVisible(HDC hDC,
}
BOOL APIENTRY NtGdiRectVisible(HDC hDC,
CONST PRECT UnsafeRect)
LPRECT UnsafeRect)
{
NTSTATUS Status = STATUS_SUCCESS;
PROSRGNDATA Rgn;
PDC dc = DC_LockDc(hDC);
BOOL Result = FALSE;
RECT Rect;
RECTL Rect;
if (!dc)
{
@ -545,8 +545,8 @@ NEW_CLIPPING_UpdateGCRegion(PDC pDC)
// if (Dc->CombinedClip != NULL) IntEngDeleteClipRegion(Dc->CombinedClip);
co = IntEngCreateClipRegion( ((PROSRGNDATA)pDC->prgnRao)->rdh.nCount,
(PRECTL)((PROSRGNDATA)pDC->prgnRao)->Buffer,
(PRECTL)&pDC->erclClip);
((PROSRGNDATA)pDC->prgnRao)->Buffer,
&pDC->erclClip);
return REGION_Complexity(pDC->prgnRao);
}

View file

@ -3105,7 +3105,7 @@ GreExtTextOutW(
IN INT XStart,
IN INT YStart,
IN UINT fuOptions,
IN OPTIONAL LPRECT lprc,
IN OPTIONAL PRECTL lprc,
IN LPWSTR String,
IN INT Count,
IN OPTIONAL LPINT Dx,
@ -3188,7 +3188,7 @@ GreExtTextOutW(
XStart,
YStart,
fuOptions,
(const RECT *)lprc,
(const RECTL *)lprc,
String,
Count,
(const INT *)Dx)) goto fail;
@ -3694,7 +3694,7 @@ NtGdiExtTextOutW(
{
BOOL Result = FALSE;
NTSTATUS Status = STATUS_SUCCESS;
RECT SafeRect;
RECTL SafeRect;
BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE];
PVOID Buffer = LocalBuffer;
LPWSTR SafeString = NULL;

View file

@ -2025,7 +2025,7 @@ PATH_add_outline(PDC dc, INT x, INT y, TTPOLYGONHEADER *header, DWORD size)
*/
BOOL
FASTCALL
PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECT *lprc,
PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc,
LPCWSTR str, UINT count, const INT *dx)
{
unsigned int idx;

View file

@ -25,87 +25,61 @@
/* FUNCTIONS *****************************************************************/
VOID FASTCALL
IntGdiSetEmptyRect(PRECT Rect)
BOOL
FASTCALL
RECTL_bUnionRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2)
{
Rect->left = Rect->right = Rect->top = Rect->bottom = 0;
}
BOOL FASTCALL
IntGdiIsEmptyRect(const RECT* Rect)
{
return(Rect->left >= Rect->right || Rect->top >= Rect->bottom);
}
VOID FASTCALL
IntGdiOffsetRect(LPRECT Rect, INT x, INT y)
{
Rect->left += x;
Rect->right += x;
Rect->top += y;
Rect->bottom += y;
}
BOOL FASTCALL
IntGdiUnionRect(PRECT Dest, const RECT* Src1, const RECT* Src2)
{
if (IntGdiIsEmptyRect(Src1))
if (RECTL_bIsEmptyRect(prcl1))
{
if (IntGdiIsEmptyRect(Src2))
{
IntGdiSetEmptyRect(Dest);
return FALSE;
}
else
{
*Dest = *Src2;
}
if (RECTL_bIsEmptyRect(prcl2))
{
RECTL_vSetEmptyRect(prclDst);
return FALSE;
}
else
{
*prclDst = *prcl2;
}
}
else
else
{
if (IntGdiIsEmptyRect(Src2))
{
*Dest = *Src1;
}
else
{
Dest->left = min(Src1->left, Src2->left);
Dest->top = min(Src1->top, Src2->top);
Dest->right = max(Src1->right, Src2->right);
Dest->bottom = max(Src1->bottom, Src2->bottom);
}
if (RECTL_bIsEmptyRect(prcl2))
{
*prclDst = *prcl1;
}
else
{
prclDst->left = min(prcl1->left, prcl2->left);
prclDst->top = min(prcl1->top, prcl2->top);
prclDst->right = max(prcl1->right, prcl2->right);
prclDst->bottom = max(prcl1->bottom, prcl2->bottom);
}
}
return TRUE;
return TRUE;
}
VOID FASTCALL
IntGdiSetRect(PRECT Rect, INT left, INT top, INT right, INT bottom)
{
Rect->left = left;
Rect->top = top;
Rect->right = right;
Rect->bottom = bottom;
}
BOOL FASTCALL
IntGdiIntersectRect(PRECT Dest, const RECT* Src1, const RECT* Src2)
BOOL
FASTCALL
RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2)
{
if (IntGdiIsEmptyRect(Src1) || IntGdiIsEmptyRect(Src2) ||
Src1->left >= Src2->right || Src2->left >= Src1->right ||
Src1->top >= Src2->bottom || Src2->top >= Src1->bottom)
if (RECTL_bIsEmptyRect(prcl1) || RECTL_bIsEmptyRect(prcl2) ||
prcl1->left >= prcl2->right || prcl2->left >= prcl1->right ||
prcl1->top >= prcl2->bottom || prcl2->top >= prcl1->bottom)
{
IntGdiSetEmptyRect(Dest);
return FALSE;
RECTL_vSetEmptyRect(prclDst);
return FALSE;
}
Dest->left = max(Src1->left, Src2->left);
Dest->right = min(Src1->right, Src2->right);
Dest->top = max(Src1->top, Src2->top);
Dest->bottom = min(Src1->bottom, Src2->bottom);
prclDst->left = max(prcl1->left, prcl2->left);
prclDst->right = min(prcl1->right, prcl2->right);
prclDst->top = max(prcl1->top, prcl2->top);
prclDst->bottom = min(prcl1->bottom, prcl2->bottom);
return TRUE;
return TRUE;
}
/* EOF */

View file

@ -126,15 +126,15 @@ HRGN hrgnDefault = NULL;
#if 1
#define COPY_RECTS(dest, src, nRects) \
do { \
PRECT xDest = (dest); \
PRECT xSrc = (src); \
PRECTL xDest = (dest); \
PRECTL xSrc = (src); \
UINT xRects = (nRects); \
while(xRects-- > 0) { \
*(xDest++) = *(xSrc++); \
} \
} while(0)
#else
#define COPY_RECTS(dest, src, nRects) RtlCopyMemory(dest, src, (nRects) * sizeof(RECT))
#define COPY_RECTS(dest, src, nRects) RtlCopyMemory(dest, src, (nRects) * sizeof(RECTL))
#endif
#define EMPTY_REGION(pReg) { \
@ -408,11 +408,11 @@ typedef struct _ScanLineListBlock
/*
* Check to see if there is enough memory in the present region.
*/
static __inline int xmemcheck(ROSRGNDATA *reg, PRECT *rect, PRECT *firstrect)
static __inline int xmemcheck(ROSRGNDATA *reg, PRECTL *rect, PRECTL *firstrect)
{
if ( (reg->rdh.nCount+1) * sizeof(RECT) >= reg->rdh.nRgnSize )
{
PRECT temp;
PRECTL temp;
DWORD NewSize = 2 * reg->rdh.nRgnSize;
if (NewSize < (reg->rdh.nCount + 1) * sizeof(RECT))
{
@ -439,7 +439,7 @@ static __inline int xmemcheck(ROSRGNDATA *reg, PRECT *rect, PRECT *firstrect)
return 1;
}
#define MEMCHECK(reg, rect, firstrect) xmemcheck(reg,&(rect),(LPRECT *)&(firstrect))
#define MEMCHECK(reg, rect, firstrect) xmemcheck(reg,&(rect),(PRECTL *)&(firstrect))
typedef void (FASTCALL *overlapProcp)(PROSRGNDATA, PRECT, PRECT, PRECT, PRECT, INT, INT);
typedef void (FASTCALL *nonOverlapProcp)(PROSRGNDATA, PRECT, PRECT, INT, INT);
@ -513,7 +513,7 @@ REGION_CopyRegion(
{
if (dst->rdh.nRgnSize < src->rdh.nCount * sizeof(RECT))
{
PRECT temp;
PRECTL temp;
temp = ExAllocatePoolWithTag(PagedPool, src->rdh.nCount * sizeof(RECT), TAG_REGION );
if (!temp)
@ -538,7 +538,7 @@ REGION_CopyRegion(
static void FASTCALL
REGION_SetExtents(ROSRGNDATA *pReg)
{
RECT *pRect, *pRectEnd, *pExtents;
RECTL *pRect, *pRectEnd, *pExtents;
if (pReg->rdh.nCount == 0)
{
@ -551,8 +551,8 @@ REGION_SetExtents(ROSRGNDATA *pReg)
}
pExtents = &pReg->rdh.rcBound;
pRect = (PRECT)pReg->Buffer;
pRectEnd = (PRECT)pReg->Buffer + pReg->rdh.nCount - 1;
pRect = pReg->Buffer;
pRectEnd = pReg->Buffer + pReg->rdh.nCount - 1;
/*
* Since pRect is the first rectangle in the region, it must have the
@ -585,22 +585,22 @@ BOOL FASTCALL
REGION_CropAndOffsetRegion(
PROSRGNDATA rgnDst,
PROSRGNDATA rgnSrc,
const PRECT rect,
const PPOINT offset
const RECTL *rect,
const POINTL *offset
)
{
POINT pt = {0,0};
PPOINT off = offset;
const POINT *off = offset;
if (!off) off = &pt;
if (!rect) // just copy and offset
{
PRECT xrect;
PRECTL xrect;
if (rgnDst == rgnSrc)
{
if (off->x || off->y)
xrect = (PRECT)rgnDst->Buffer;
xrect = rgnDst->Buffer;
else
return TRUE;
}
@ -624,10 +624,10 @@ REGION_CropAndOffsetRegion(
{
for (i = 0; i < rgnDst->rdh.nCount; i++)
{
xrect[i].left = ((PRECT)rgnSrc->Buffer + i)->left + off->x;
xrect[i].right = ((PRECT)rgnSrc->Buffer + i)->right + off->x;
xrect[i].top = ((PRECT)rgnSrc->Buffer + i)->top + off->y;
xrect[i].bottom = ((PRECT)rgnSrc->Buffer + i)->bottom + off->y;
xrect[i].left = (rgnSrc->Buffer + i)->left + off->x;
xrect[i].right = (rgnSrc->Buffer + i)->right + off->x;
xrect[i].top = (rgnSrc->Buffer + i)->top + off->y;
xrect[i].bottom = (rgnSrc->Buffer + i)->bottom + off->y;
}
rgnDst->rdh.rcBound.left += off->x;
rgnDst->rdh.rcBound.right += off->x;
@ -652,17 +652,17 @@ REGION_CropAndOffsetRegion(
}
else // region box and clipping rect appear to intersect
{
PRECT lpr, rpr;
PRECTL lpr, rpr;
ULONG i, j, clipa, clipb;
INT left = rgnSrc->rdh.rcBound.right + off->x;
INT right = rgnSrc->rdh.rcBound.left + off->x;
for (clipa = 0; ((PRECT)rgnSrc->Buffer + clipa)->bottom <= rect->top; clipa++)
for (clipa = 0; (rgnSrc->Buffer + clipa)->bottom <= rect->top; clipa++)
//region and rect intersect so we stop before clipa > rgnSrc->rdh.nCount
; // skip bands above the clipping rectangle
for (clipb = clipa; clipb < rgnSrc->rdh.nCount; clipb++)
if (((PRECT)rgnSrc->Buffer + clipb)->top >= rect->bottom)
if ((rgnSrc->Buffer + clipb)->top >= rect->bottom)
break; // and below it
// clipa - index of the first rect in the first intersecting band
@ -670,7 +670,7 @@ REGION_CropAndOffsetRegion(
if ((rgnDst != rgnSrc) && (rgnDst->rdh.nCount < (i = (clipb - clipa))))
{
PRECT temp;
PRECTL temp;
temp = ExAllocatePoolWithTag(PagedPool, i * sizeof(RECT), TAG_REGION);
if (!temp)
return FALSE;
@ -686,11 +686,11 @@ REGION_CropAndOffsetRegion(
{
// i - src index, j - dst index, j is always <= i for obvious reasons
lpr = (PRECT)rgnSrc->Buffer + i;
lpr = rgnSrc->Buffer + i;
if (lpr->left < rect->right && lpr->right > rect->left)
{
rpr = (PRECT)rgnDst->Buffer + j;
rpr = rgnDst->Buffer + j;
rpr->top = lpr->top + off->y;
rpr->bottom = lpr->bottom + off->y;
@ -720,13 +720,13 @@ REGION_CropAndOffsetRegion(
break;
for (i = j; i > 0; i--) // fixup bottom band
if (((PRECT)rgnDst->Buffer + i)->bottom > right)
((PRECT)rgnDst->Buffer + i)->bottom = right;
if ((rgnDst->Buffer + i)->bottom > right)
(rgnDst->Buffer + i)->bottom = right;
else
break;
rgnDst->rdh.rcBound.top = ((PRECT)rgnDst->Buffer)->top;
rgnDst->rdh.rcBound.bottom = ((PRECT)rgnDst->Buffer + j)->bottom;
rgnDst->rdh.rcBound.top = (rgnDst->Buffer)->top;
rgnDst->rdh.rcBound.bottom = (rgnDst->Buffer + j)->bottom;
rgnDst->rdh.iType = RDH_RECTANGLES;
}
@ -736,7 +736,7 @@ REGION_CropAndOffsetRegion(
empty:
if (!rgnDst->Buffer)
{
rgnDst->Buffer = (PRECT)ExAllocatePoolWithTag(PagedPool, RGN_DEFAULT_RECTS * sizeof(RECT), TAG_REGION);
rgnDst->Buffer = ExAllocatePoolWithTag(PagedPool, RGN_DEFAULT_RECTS * sizeof(RECT), TAG_REGION);
if (rgnDst->Buffer)
{
rgnDst->rdh.nCount = RGN_DEFAULT_RECTS;
@ -771,15 +771,15 @@ REGION_Coalesce(
INT curStart /* Index of start of current band */
)
{
RECT *pPrevRect; /* Current rect in previous band */
RECT *pCurRect; /* Current rect in current band */
RECT *pRegEnd; /* End of region */
RECTL *pPrevRect; /* Current rect in previous band */
RECTL *pCurRect; /* Current rect in current band */
RECTL *pRegEnd; /* End of region */
INT curNumRects; /* Number of rectangles in current band */
INT prevNumRects; /* Number of rectangles in previous band */
INT bandtop; /* top coordinate for current band */
pRegEnd = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pPrevRect = (PRECT)pReg->Buffer + prevStart;
pRegEnd = pReg->Buffer + pReg->rdh.nCount;
pPrevRect = pReg->Buffer + prevStart;
prevNumRects = curStart - prevStart;
/*
@ -787,7 +787,7 @@ REGION_Coalesce(
* this because multiple bands could have been added in REGION_RegionOp
* at the end when one region has been exhausted.
*/
pCurRect = (PRECT)pReg->Buffer + curStart;
pCurRect = pReg->Buffer + curStart;
bandtop = pCurRect->top;
for (curNumRects = 0;
(pCurRect != pRegEnd) && (pCurRect->top == bandtop);
@ -809,8 +809,8 @@ REGION_Coalesce(
{
pRegEnd--;
}
curStart = pRegEnd - (PRECT)pReg->Buffer;
pRegEnd = (PRECT)pReg->Buffer + pReg->rdh.nCount;
curStart = pRegEnd - pReg->Buffer;
pRegEnd = pReg->Buffer + pReg->rdh.nCount;
}
if ((curNumRects == prevNumRects) && (curNumRects != 0))
@ -921,18 +921,18 @@ REGION_RegionOp(
nonOverlapProcp nonOverlap2Func /* Function to call for non-overlapping bands in region 2 */
)
{
RECT *r1; /* Pointer into first region */
RECT *r2; /* Pointer into 2d region */
RECT *r1End; /* End of 1st region */
RECT *r2End; /* End of 2d region */
RECTL *r1; /* Pointer into first region */
RECTL *r2; /* Pointer into 2d region */
RECTL *r1End; /* End of 1st region */
RECTL *r2End; /* End of 2d region */
INT ybot; /* Bottom of intersection */
INT ytop; /* Top of intersection */
RECT *oldRects; /* Old rects for newReg */
RECTL *oldRects; /* Old rects for newReg */
ULONG prevBand; /* Index of start of
* previous band in newReg */
ULONG curBand; /* Index of start of current band in newReg */
RECT *r1BandEnd; /* End of current band in r1 */
RECT *r2BandEnd; /* End of current band in r2 */
RECTL *r1BandEnd; /* End of current band in r1 */
RECTL *r2BandEnd; /* End of current band in r2 */
ULONG top; /* Top of non-overlapping band */
ULONG bot; /* Bottom of non-overlapping band */
@ -943,8 +943,8 @@ REGION_RegionOp(
* the two source regions, then mark the "new" region empty, allocating
* another array of rectangles for it to use.
*/
r1 = (PRECT)reg1->Buffer;
r2 = (PRECT)reg2->Buffer;
r1 = reg1->Buffer;
r2 = reg2->Buffer;
r1End = r1 + reg1->rdh.nCount;
r2End = r2 + reg2->rdh.nCount;
@ -955,7 +955,7 @@ REGION_RegionOp(
* extents and simply set numRects to zero.
*/
oldRects = (PRECT)newReg->Buffer;
oldRects = newReg->Buffer;
newReg->rdh.nCount = 0;
/*
@ -1159,7 +1159,7 @@ REGION_RegionOp(
{
if (REGION_NOT_EMPTY(newReg))
{
RECT *prev_rects = (PRECT)newReg->Buffer;
RECTL *prev_rects = newReg->Buffer;
newReg->Buffer = ExAllocatePoolWithTag(PagedPool, newReg->rdh.nCount*sizeof(RECT), TAG_REGION);
if (! newReg->Buffer)
@ -1210,18 +1210,18 @@ REGION_RegionOp(
static void FASTCALL
REGION_IntersectO(
PROSRGNDATA pReg,
PRECT r1,
PRECT r1End,
PRECT r2,
PRECT r2End,
PRECTL r1,
PRECTL r1End,
PRECTL r2,
PRECTL r2End,
INT top,
INT bottom
)
{
INT left, right;
RECT *pNextRect;
RECTL *pNextRect;
pNextRect = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pNextRect = pReg->Buffer + pReg->rdh.nCount;
while ((r1 != r1End) && (r2 != r2End))
{
@ -1317,15 +1317,15 @@ REGION_IntersectRegion(
static void FASTCALL
REGION_UnionNonO (
PROSRGNDATA pReg,
PRECT r,
PRECT rEnd,
PRECTL r,
PRECTL rEnd,
INT top,
INT bottom
)
{
RECT *pNextRect;
RECTL *pNextRect;
pNextRect = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pNextRect = pReg->Buffer + pReg->rdh.nCount;
while (r != rEnd)
{
@ -1356,17 +1356,17 @@ REGION_UnionNonO (
static void FASTCALL
REGION_UnionO (
PROSRGNDATA pReg,
PRECT r1,
PRECT r1End,
PRECT r2,
PRECT r2End,
PRECTL r1,
PRECTL r1End,
PRECTL r2,
PRECTL r2End,
INT top,
INT bottom
)
{
RECT *pNextRect;
RECTL *pNextRect;
pNextRect = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pNextRect = pReg->Buffer + pReg->rdh.nCount;
#define MERGERECT(r) \
if ((pReg->rdh.nCount != 0) && \
@ -1516,15 +1516,15 @@ REGION_UnionRegion(
static void FASTCALL
REGION_SubtractNonO1(
PROSRGNDATA pReg,
PRECT r,
PRECT rEnd,
PRECTL r,
PRECTL rEnd,
INT top,
INT bottom
)
{
RECT *pNextRect;
RECTL *pNextRect;
pNextRect = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pNextRect = pReg->Buffer + pReg->rdh.nCount;
while (r != rEnd)
{
@ -1555,19 +1555,19 @@ REGION_SubtractNonO1(
static void FASTCALL
REGION_SubtractO(
PROSRGNDATA pReg,
PRECT r1,
PRECT r1End,
PRECT r2,
PRECT r2End,
PRECTL r1,
PRECTL r1End,
PRECTL r2,
PRECTL r2End,
INT top,
INT bottom
)
{
RECT *pNextRect;
RECTL *pNextRect;
INT left;
left = r1->left;
pNextRect = (PRECT)pReg->Buffer + pReg->rdh.nCount;
pNextRect = pReg->Buffer + pReg->rdh.nCount;
while ((r1 != r1End) && (r2 != r2End))
{
@ -1763,7 +1763,7 @@ REGION_XorRegion(
VOID FASTCALL
REGION_UnionRectWithRgn(
ROSRGNDATA *rgn,
const RECT *rect
const RECTL *rect
)
{
ROSRGNDATA region;
@ -1782,8 +1782,8 @@ REGION_CreateSimpleFrameRgn(
INT y
)
{
RECT rc[4];
PRECT prc;
RECTL rc[4];
PRECTL prc;
if (x != 0 || y != 0)
{
@ -1860,7 +1860,7 @@ REGION_CreateFrameRgn(
)
{
PROSRGNDATA srcObj, destObj;
PRECT rc;
PRECTL rc;
ULONG i;
if (!(srcObj = REGION_LockRgn(hSrc)))
@ -1899,7 +1899,7 @@ REGION_CreateFrameRgn(
else
{
/* Original region moved to right */
rc = (PRECT)srcObj->Buffer;
rc = srcObj->Buffer;
for (i = 0; i < srcObj->rdh.nCount; i++)
{
rc->left += x;
@ -1909,7 +1909,7 @@ REGION_CreateFrameRgn(
REGION_IntersectRegion(destObj, destObj, srcObj);
/* Original region moved to left */
rc = (PRECT)srcObj->Buffer;
rc = srcObj->Buffer;
for (i = 0; i < srcObj->rdh.nCount; i++)
{
rc->left -= 2 * x;
@ -1919,7 +1919,7 @@ REGION_CreateFrameRgn(
REGION_IntersectRegion(destObj, destObj, srcObj);
/* Original region moved down */
rc = (PRECT)srcObj->Buffer;
rc = srcObj->Buffer;
for (i = 0; i < srcObj->rdh.nCount; i++)
{
rc->left += x;
@ -1931,7 +1931,7 @@ REGION_CreateFrameRgn(
REGION_IntersectRegion(destObj, destObj, srcObj);
/* Original region moved up */
rc = (PRECT)srcObj->Buffer;
rc = srcObj->Buffer;
for (i = 0; i < srcObj->rdh.nCount; i++)
{
rc->top -= 2 * y;
@ -1941,7 +1941,7 @@ REGION_CreateFrameRgn(
REGION_IntersectRegion(destObj, destObj, srcObj);
/* Restore the original region */
rc = (PRECT)srcObj->Buffer;
rc = srcObj->Buffer;
for (i = 0; i < srcObj->rdh.nCount; i++)
{
rc->top += y;
@ -1963,11 +1963,11 @@ REGION_LPTODP(
HRGN hDest,
HRGN hSrc)
{
RECT *pCurRect, *pEndRect;
RECTL *pCurRect, *pEndRect;
PROSRGNDATA srcObj = NULL;
PROSRGNDATA destObj = NULL;
RECT tmpRect;
RECTL tmpRect;
BOOL ret = FALSE;
PDC_ATTR Dc_Attr;
@ -1996,8 +1996,8 @@ REGION_LPTODP(
}
EMPTY_REGION(destObj);
pEndRect = (PRECT)srcObj->Buffer + srcObj->rdh.nCount;
for (pCurRect = (PRECT)srcObj->Buffer; pCurRect < pEndRect; pCurRect++)
pEndRect = srcObj->Buffer + srcObj->rdh.nCount;
for (pCurRect = srcObj->Buffer; pCurRect < pEndRect; pCurRect++)
{
tmpRect = *pCurRect;
tmpRect.left = XLPTODP(Dc_Attr, tmpRect.left);
@ -2093,7 +2093,7 @@ IntGdiReleaseRaoRgn(PDC pDC)
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
pDC->DC_Flags |= DC_FLAG_DIRTY_RAO;
Entry->Flags |= GDI_ENTRY_VALIDATE_VIS;
IntGdiSetEmptyRect((PRECT)&pDC->erclClip);
RECTL_vSetEmptyRect(&pDC->erclClip);
}
@ -2104,7 +2104,7 @@ IntGdiReleaseVisRgn(PDC pDC)
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
pDC->DC_Flags |= DC_FLAG_DIRTY_RAO;
Entry->Flags |= GDI_ENTRY_VALIDATE_VIS;
IntGdiSetEmptyRect((PRECT)&pDC->erclClip);
RECTL_vSetEmptyRect(&pDC->erclClip);
REGION_Delete(pDC->prgnVis);
pDC->prgnVis = prgnDefault;
}
@ -2137,7 +2137,7 @@ IntUpdateVisRectRgn(PDC pDC, PROSRGNDATA pRgn)
rcl.bottom -= pDC->erclWindow.top;
}
else
IntGdiSetEmptyRect((PRECT)&rcl);
RECTL_vSetEmptyRect(&rcl);
pDc_Attr->VisRectRegion.Rect = rcl;
@ -2303,7 +2303,7 @@ NtGdiCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
PROSRGNDATA pRgn;
HRGN hRgn;
/* Allocate region data structure with space for 1 RECT */
/* Allocate region data structure with space for 1 RECTL */
if (!(pRgn = REGION_AllocRgnWithHandle(1)))
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@ -2332,7 +2332,7 @@ NtGdiCreateRoundRectRgn(
PROSRGNDATA obj;
HRGN hrgn;
int asq, bsq, d, xd, yd;
RECT rect;
RECTL rect;
/* Make the dimensions sensible */
@ -2444,7 +2444,7 @@ NtGdiEqualRgn(
)
{
PROSRGNDATA rgn1, rgn2;
PRECT tRect1, tRect2;
PRECTL tRect1, tRect2;
ULONG i;
BOOL bRet = FALSE;
@ -2465,8 +2465,8 @@ NtGdiEqualRgn(
rgn1->rdh.rcBound.bottom != rgn2->rdh.rcBound.bottom)
goto exit;
tRect1 = (PRECT)rgn1->Buffer;
tRect2 = (PRECT)rgn2->Buffer;
tRect1 = rgn1->Buffer;
tRect2 = rgn2->Buffer;
if (!tRect1 || !tRect2)
goto exit;
@ -2598,7 +2598,7 @@ NtGdiFillRgn(
{
HBRUSH oldhBrush;
PROSRGNDATA rgn;
PRECT r;
PRECTL r;
if (NULL == (rgn = REGION_LockRgn(hRgn)))
{
@ -2654,7 +2654,7 @@ NtGdiFrameRgn(
INT FASTCALL
REGION_GetRgnBox(
PROSRGNDATA Rgn,
LPRECT pRect
PRECTL pRect
)
{
DWORD ret;
@ -2754,7 +2754,7 @@ NtGdiGetRandomRgn(
INT APIENTRY
IntGdiGetRgnBox(
HRGN hRgn,
LPRECT pRect
PRECTL pRect
)
{
PROSRGNDATA Rgn;
@ -2775,11 +2775,11 @@ IntGdiGetRgnBox(
INT APIENTRY
NtGdiGetRgnBox(
HRGN hRgn,
LPRECT pRect
PRECTL pRect
)
{
PROSRGNDATA Rgn;
RECT SafeRect;
RECTL SafeRect;
DWORD ret;
NTSTATUS Status = STATUS_SUCCESS;
@ -2822,7 +2822,7 @@ NtGdiInvertRgn(
{
PROSRGNDATA RgnData;
ULONG i;
PRECT rc;
PRECTL rc;
if (!(RgnData = REGION_LockRgn(hRgn)))
{
@ -2830,7 +2830,7 @@ NtGdiInvertRgn(
return FALSE;
}
rc = (PRECT)RgnData->Buffer;
rc = RgnData->Buffer;
for (i = 0; i < RgnData->rdh.nCount; i++)
{
@ -2868,7 +2868,7 @@ NtGdiOffsetRgn(
if (XOffset || YOffset)
{
int nbox = rgn->rdh.nCount;
PRECT pbox = (PRECT)rgn->Buffer;
PRECTL pbox = rgn->Buffer;
if (nbox && pbox)
{
@ -2935,8 +2935,8 @@ IntGdiPaintRgn(
}
ClipRegion = IntEngCreateClipRegion(visrgn->rdh.nCount,
(PRECTL)visrgn->Buffer,
(PRECTL)&visrgn->rdh.rcBound );
visrgn->Buffer,
&visrgn->rdh.rcBound );
ASSERT(ClipRegion);
pBrush = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
ASSERT(pBrush);
@ -2972,14 +2972,14 @@ NtGdiPtInRegion(
{
PROSRGNDATA rgn;
ULONG i;
PRECT r;
PRECTL r;
if (!(rgn = REGION_LockRgn(hRgn) ) )
return FALSE;
if (rgn->rdh.nCount > 0 && INRECT(rgn->rdh.rcBound, X, Y))
{
r = (PRECT) rgn->Buffer;
r = rgn->Buffer;
for (i = 0; i < rgn->rdh.nCount; i++)
{
if (INRECT(*r, X, Y))
@ -2998,15 +2998,15 @@ BOOL
FASTCALL
REGION_RectInRegion(
PROSRGNDATA Rgn,
CONST LPRECT rc
const RECTL *rc
)
{
PRECT pCurRect, pRectEnd;
PRECTL pCurRect, pRectEnd;
// this is (just) a useful optimization
if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, rc))
{
for (pCurRect = (PRECT)Rgn->Buffer, pRectEnd = pCurRect + Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect + Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
{
if (pCurRect->bottom <= rc->top) continue; // not far enough down yet
if (pCurRect->top >= rc->bottom) break; // too far down
@ -3023,11 +3023,11 @@ BOOL
APIENTRY
NtGdiRectInRegion(
HRGN hRgn,
LPRECT unsaferc
LPRECTL unsaferc
)
{
PROSRGNDATA Rgn;
RECT rc = {0};
RECTL rc = {0};
BOOL Ret;
NTSTATUS Status = STATUS_SUCCESS;
@ -3070,7 +3070,7 @@ REGION_SetRectRgn(
INT BottomRect
)
{
PRECT firstRect;
PRECTL firstRect;
if (LeftRect > RightRect)
{
@ -3087,7 +3087,7 @@ REGION_SetRectRgn(
if ((LeftRect != RightRect) && (TopRect != BottomRect))
{
firstRect = (PRECT)rgn->Buffer;
firstRect = rgn->Buffer;
ASSERT(firstRect);
firstRect->left = rgn->rdh.rcBound.left = LeftRect;
firstRect->top = rgn->rdh.rcBound.top = TopRect;
@ -3126,10 +3126,10 @@ NtGdiSetRectRgn(
HRGN APIENTRY
NtGdiUnionRectWithRgn(
HRGN hDest,
CONST PRECT UnsafeRect
const RECTL *UnsafeRect
)
{
RECT SafeRect = {0};
RECTL SafeRect = {0};
PROSRGNDATA Rgn;
NTSTATUS Status = STATUS_SUCCESS;
@ -3457,11 +3457,11 @@ REGION_PtsToRegion(
POINTBLOCK *FirstPtBlock,
ROSRGNDATA *reg)
{
RECT *rects;
RECTL *rects;
POINT *pts;
POINTBLOCK *CurPtBlock;
int i;
RECT *extents, *temp;
RECTL *extents, *temp;
INT numRects;
extents = &reg->rdh.rcBound;

View file

@ -27,6 +27,13 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
#define STARTF_USEPOSITION 4
#include <stdarg.h>
#include <windef.h>
/* Avoid type casting, by defining RECT to RECTL */
#define RECT RECTL
#define PRECT PRECTL
#define LPRECT LPRECTL
#define LPCRECT LPCRECTL
#include <winerror.h>
#include <wingdi.h>
#include <winddi.h>