Commit in reactos on MAIN
include/win32k/ntuser.h+21.119 -> 1.120
lib/user32/misc/stubs.c+1-141.56 -> 1.57
lib/user32/windows/paint.c+17-41.24 -> 1.25
subsys/win32k/include/window.h+61.52 -> 1.53
subsys/win32k/ntuser/misc.c+18-11.54 -> 1.55
                    /window.c+87-11.200 -> 1.201
+131-20
6 modified files
Implemented GetWindowRgn() and GetWindowRgnBox()

reactos/include/win32k
ntuser.h 1.119 -> 1.120
diff -u -r1.119 -r1.120
--- ntuser.h	23 Mar 2004 16:32:19 -0000	1.119
+++ ntuser.h	23 Mar 2004 21:47:36 -0000	1.120
@@ -178,6 +178,8 @@
   DWORD Param,
   DWORD Routine);
 
+#define TWOPARAM_ROUTINE_GETWINDOWRGNBOX    0x48
+#define TWOPARAM_ROUTINE_GETWINDOWRGN       0x49
 #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT   0x50
 #define TWOPARAM_ROUTINE_SETMENUITEMRECT    0x51
 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE   0x52

reactos/lib/user32/misc
stubs.c 1.56 -> 1.57
diff -u -r1.56 -r1.57
--- stubs.c	23 Jan 2004 23:38:26 -0000	1.56
+++ stubs.c	23 Mar 2004 21:47:36 -0000	1.57
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.56 2004/01/23 23:38:26 ekohl Exp $
+/* $Id: stubs.c,v 1.57 2004/03/23 21:47:36 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
@@ -805,19 +805,6 @@
 /*
  * @unimplemented
  */
-int
-STDCALL
-GetWindowRgnBox(
-    HWND hWnd,
-    LPRECT lprc)
-{
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-/*
- * @unimplemented
- */
 BOOL
 STDCALL
 IsGUIThread(

reactos/lib/user32/windows
paint.c 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- paint.c	23 Mar 2004 16:32:20 -0000	1.24
+++ paint.c	23 Mar 2004 21:47:37 -0000	1.25
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: paint.c,v 1.24 2004/03/23 16:32:20 weiden Exp $
+/* $Id: paint.c,v 1.25 2004/03/23 21:47:37 weiden Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/paint.c
@@ -256,7 +256,7 @@
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 int
 STDCALL
@@ -264,10 +264,23 @@
   HWND hWnd,
   HRGN hRgn)
 {
-  UNIMPLEMENTED;
-  return 0;
+  return (int)NtUserCallTwoParam((DWORD)hWnd, (DWORD)hRgn, TWOPARAM_ROUTINE_GETWINDOWRGN);
+}
+
+
+/*
+ * @implemented
+ */
+int
+STDCALL
+GetWindowRgnBox(
+    HWND hWnd,
+    LPRECT lprc)
+{
+  return (int)NtUserCallTwoParam((DWORD)hWnd, (DWORD)lprc, TWOPARAM_ROUTINE_GETWINDOWRGNBOX);
 }
 
+
 const BYTE MappingTable[33] = {5,9,2,3,5,7,0,0,0,7,5,5,3,2,7,5,3,3,0,5,7,10,5,0,11,4,1,1,3,8,6,12,7};
 /*
  * @implemented

reactos/subsys/win32k/include
window.h 1.52 -> 1.53
diff -u -r1.52 -r1.53
--- window.h	22 Mar 2004 20:14:28 -0000	1.52
+++ window.h	23 Mar 2004 21:47:37 -0000	1.53
@@ -188,6 +188,12 @@
 PWINDOW_OBJECT FASTCALL
 IntGetParentObject(PWINDOW_OBJECT Wnd);
 
+INT FASTCALL
+IntGetWindowRgn(HWND hWnd, HRGN hRgn);
+
+INT FASTCALL
+IntGetWindowRgnBox(HWND hWnd, RECT *Rect);
+
 DWORD IntRemoveWndProcHandle(WNDPROC Handle);
 DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
 DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);

reactos/subsys/win32k/ntuser
misc.c 1.54 -> 1.55
diff -u -r1.54 -r1.55
--- misc.c	7 Mar 2004 11:59:43 -0000	1.54
+++ misc.c	23 Mar 2004 21:47:37 -0000	1.55
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.54 2004/03/07 11:59:43 navaraf Exp $
+/* $Id: misc.c,v 1.55 2004/03/23 21:47:37 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -197,6 +197,23 @@
   
   switch(Routine)
   {
+    case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
+    {
+      DWORD Ret;
+      RECT rcRect;
+      Ret = (DWORD)IntGetWindowRgnBox((HWND)Param1, &rcRect);
+      Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT));
+      if(!NT_SUCCESS(Status))
+      {
+        SetLastNtError(Status);
+        return ERROR;
+      }
+      return Ret;
+    }
+    case TWOPARAM_ROUTINE_GETWINDOWRGN:
+    {
+      return (DWORD)IntGetWindowRgn((HWND)Param1, (HRGN)Param2);
+    }
     case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
     {
       DWORD Ret;

reactos/subsys/win32k/ntuser
window.c 1.200 -> 1.201
diff -u -r1.200 -r1.201
--- window.c	23 Mar 2004 16:32:20 -0000	1.200
+++ window.c	23 Mar 2004 21:47:37 -0000	1.201
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: window.c,v 1.200 2004/03/23 16:32:20 weiden Exp $
+/* $Id: window.c,v 1.201 2004/03/23 21:47:37 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -3394,6 +3394,92 @@
 }
 
 
+INT FASTCALL
+IntGetWindowRgn(HWND hWnd, HRGN hRgn)
+{
+  INT Ret;
+  PWINDOW_OBJECT WindowObject;
+  HRGN VisRgn;
+  ROSRGNDATA *pRgn;
+  
+  if(!(WindowObject = IntGetWindowObject(hWnd)))
+  {
+    SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+    return ERROR;
+  }
+  if(!hRgn)
+  {
+    IntReleaseWindowObject(WindowObject);
+    SetLastWin32Error(ERROR_INVALID_PARAMETER);
+    return ERROR;
+  }
+  
+  /* Create a new window region using the window rectangle */
+  VisRgn = UnsafeIntCreateRectRgnIndirect(&WindowObject->WindowRect);
+  NtGdiOffsetRgn(VisRgn, -WindowObject->WindowRect.left, -WindowObject->WindowRect.top);
+  /* if there's a region assigned to the window, combine them both */
+  if(WindowObject->WindowRegion && !(WindowObject->Style & WS_MINIMIZE))
+    NtGdiCombineRgn(VisRgn, VisRgn, WindowObject->WindowRegion, RGN_AND);
+  /* Copy the region into hRgn */
+  NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY);
+  
+  if((pRgn = RGNDATA_LockRgn(hRgn)))
+  {
+    Ret = pRgn->rdh.iType;
+    RGNDATA_UnlockRgn(hRgn);
+  }
+  else
+    Ret = ERROR;
+  
+  NtGdiDeleteObject(VisRgn);
+  
+  IntReleaseWindowObject(WindowObject);
+  return Ret;
+}
+
+INT FASTCALL
+IntGetWindowRgnBox(HWND hWnd, RECT *Rect)
+{
+  INT Ret;
+  PWINDOW_OBJECT WindowObject;
+  HRGN VisRgn;
+  ROSRGNDATA *pRgn;
+  
+  if(!(WindowObject = IntGetWindowObject(hWnd)))
+  {
+    SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+    return ERROR;
+  }
+  if(!Rect)
+  {
+    IntReleaseWindowObject(WindowObject);
+    SetLastWin32Error(ERROR_INVALID_PARAMETER);
+    return ERROR;
+  }
+  
+  /* Create a new window region using the window rectangle */
+  VisRgn = UnsafeIntCreateRectRgnIndirect(&WindowObject->WindowRect);
+  NtGdiOffsetRgn(VisRgn, -WindowObject->WindowRect.left, -WindowObject->WindowRect.top);
+  /* if there's a region assigned to the window, combine them both */
+  if(WindowObject->WindowRegion && !(WindowObject->Style & WS_MINIMIZE))
+    NtGdiCombineRgn(VisRgn, VisRgn, WindowObject->WindowRegion, RGN_AND);
+  
+  if((pRgn = RGNDATA_LockRgn(VisRgn)))
+  {
+    Ret = pRgn->rdh.iType;
+    *Rect = pRgn->rdh.rcBound;
+    RGNDATA_UnlockRgn(VisRgn);
+  }
+  else
+    Ret = ERROR;
+  
+  NtGdiDeleteObject(VisRgn);
+  
+  IntReleaseWindowObject(WindowObject);
+  return Ret;
+}
+
+
 /*
  * @implemented
  */
CVSspam 0.2.8