From 01ecf02e26cfef98698c80acf26ad50a9c517e8e Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 21 Mar 2011 02:20:24 +0000 Subject: [PATCH] [Win32k] - Setup RectInRegion for internal use. svn path=/trunk/; revision=51102 --- .../subsystems/win32/win32k/include/region.h | 1 + .../subsystems/win32/win32k/objects/rect.c | 1 - .../subsystems/win32/win32k/objects/region.c | 33 ++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/region.h b/reactos/subsystems/win32/win32k/include/region.h index 5ad6e2cb52f..a7e531dff8b 100644 --- a/reactos/subsystems/win32/win32k/include/region.h +++ b/reactos/subsystems/win32/win32k/include/region.h @@ -44,6 +44,7 @@ INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*); BOOL FASTCALL IntGdiPaintRgn(PDC, HRGN ); HRGN FASTCALL IntCreatePolyPolygonRgn(PPOINT, PULONG, INT, INT); INT FASTCALL IntGdiOffsetRgn(PROSRGNDATA,INT,INT); +BOOL FASTCALL IntRectInRegion(HRGN,LPRECTL); INT FASTCALL IntGdiCombineRgn(PROSRGNDATA, PROSRGNDATA, PROSRGNDATA, INT); INT FASTCALL REGION_Complexity(PROSRGNDATA); diff --git a/reactos/subsystems/win32/win32k/objects/rect.c b/reactos/subsystems/win32/win32k/objects/rect.c index e3012185ca7..9fd5cdaefc6 100644 --- a/reactos/subsystems/win32/win32k/objects/rect.c +++ b/reactos/subsystems/win32/win32k/objects/rect.c @@ -16,7 +16,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* $Id$ */ #include diff --git a/reactos/subsystems/win32/win32k/objects/region.c b/reactos/subsystems/win32/win32k/objects/region.c index d1b00441065..d0bd3bafc61 100644 --- a/reactos/subsystems/win32/win32k/objects/region.c +++ b/reactos/subsystems/win32/win32k/objects/region.c @@ -3204,6 +3204,27 @@ IntCreatePolyPolygonRgn( return hrgn; } +BOOL +FASTCALL +IntRectInRegion( + HRGN hRgn, + LPRECTL rc +) +{ + PROSRGNDATA Rgn; + BOOL Ret; + + if (!(Rgn = RGNOBJAPI_Lock(hRgn, NULL))) + { + return ERROR; + } + + Ret = REGION_RectInRegion(Rgn, rc); + RGNOBJAPI_Unlock(Rgn); + return Ret; +} + + // // NtGdi Exported Functions // @@ -3765,16 +3786,9 @@ NtGdiRectInRegion( LPRECTL unsaferc ) { - PROSRGNDATA Rgn; RECTL rc = {0}; - BOOL Ret; NTSTATUS Status = STATUS_SUCCESS; - if (!(Rgn = RGNOBJAPI_Lock(hRgn, NULL))) - { - return ERROR; - } - _SEH2_TRY { ProbeForRead(unsaferc, sizeof(RECT), 1); @@ -3788,15 +3802,12 @@ NtGdiRectInRegion( if (!NT_SUCCESS(Status)) { - RGNOBJAPI_Unlock(Rgn); SetLastNtError(Status); DPRINT1("NtGdiRectInRegion: bogus rc\n"); return ERROR; } - Ret = REGION_RectInRegion(Rgn, &rc); - RGNOBJAPI_Unlock(Rgn); - return Ret; + return IntRectInRegion(hRgn, &rc); } BOOL -- 2.17.1