[Win32k]
authorJames Tabor <james.tabor@reactos.org>
Mon, 21 Mar 2011 02:20:24 +0000 (02:20 +0000)
committerJames Tabor <james.tabor@reactos.org>
Mon, 21 Mar 2011 02:20:24 +0000 (02:20 +0000)
- Setup RectInRegion for internal use.

svn path=/trunk/; revision=51102

reactos/subsystems/win32/win32k/include/region.h
reactos/subsystems/win32/win32k/objects/rect.c
reactos/subsystems/win32/win32k/objects/region.c

index 5ad6e2c..a7e531d 100644 (file)
@@ -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);
index e301218..9fd5cda 100644 (file)
@@ -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 <win32k.h>
 
index d1b0044..d0bd3ba 100644 (file)
@@ -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