fixed NtUserGetClientOrigin()
authorThomas Bluemel <thomas@reactsoft.com>
Tue, 23 Dec 2003 21:33:25 +0000 (21:33 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Tue, 23 Dec 2003 21:33:25 +0000 (21:33 +0000)
svn path=/trunk/; revision=7204

reactos/subsys/win32k/include/winpos.h
reactos/subsys/win32k/ntuser/painting.c
reactos/subsys/win32k/ntuser/winpos.c

index fc51e2b..d45ce2b 100644 (file)
@@ -5,6 +5,8 @@
 #define SWP_NOCLIENTMOVE          0x0800
 #define SWP_NOCLIENTSIZE          0x1000
 
+BOOL FASTCALL
+IntGetClientOrigin(HWND hWnd, LPPOINT Point);
 LRESULT FASTCALL
 WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect);
 UINT FASTCALL
index 119bbbe..151172f 100644 (file)
@@ -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: painting.c,v 1.51 2003/12/23 18:19:07 navaraf Exp $
+ *  $Id: painting.c,v 1.52 2003/12/23 21:33:25 weiden Exp $
  *
  *  COPYRIGHT:        See COPYING in the top level directory
  *  PROJECT:          ReactOS kernel
@@ -701,8 +701,8 @@ IntFixCaret(HWND hWnd, LPRECT lprc, UINT flags)
       pt.x = info.rcCaret.left;
       pt.y = info.rcCaret.top;
 
-      NtUserGetClientOrigin(info.hwndCaret, &FromOffset);
-      NtUserGetClientOrigin(hWnd, &ToOffset);
+      IntGetClientOrigin(info.hwndCaret, &FromOffset);
+      IntGetClientOrigin(hWnd, &ToOffset);
       Offset.x = FromOffset.x - ToOffset.x;
       Offset.y = FromOffset.y - ToOffset.y;
       info.rcCaret.left += Offset.x;
@@ -1153,7 +1153,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *rect,
          for (i = 0; List[i]; i++)
          {
             NtUserGetWindowRect(List[i], &r);
-            NtUserGetClientOrigin(hWnd, &ClientOrigin);
+            IntGetClientOrigin(hWnd, &ClientOrigin);
             r.left -= ClientOrigin.x;
             r.top -= ClientOrigin.y;
             r.right -= ClientOrigin.x;
index 49b068f..a78611e 100644 (file)
@@ -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: winpos.c,v 1.66 2003/12/23 21:13:00 weiden Exp $
+/* $Id: winpos.c,v 1.67 2003/12/23 21:33:25 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -29,6 +29,7 @@
 /* INCLUDES ******************************************************************/
 
 #include <ddk/ntddk.h>
+#include <internal/safe.h>
 #include <win32k/win32k.h>
 #include <include/object.h>
 #include <include/guicheck.h>
 #define HAS_THINFRAME(Style, ExStyle) \
             (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
 
-BOOL STDCALL
-NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
+BOOL FASTCALL
+IntGetClientOrigin(HWND hWnd, LPPOINT Point)
 {
   PWINDOW_OBJECT WindowObject;
-
+  
   WindowObject = IntGetWindowObject(hWnd);
   if (WindowObject == NULL)
     {
       Point->x = Point->y = 0;
-      return(TRUE);
+      return FALSE;
     }
   Point->x = WindowObject->ClientRect.left;
   Point->y = WindowObject->ClientRect.top;
-  return(TRUE);
+  
+  IntReleaseWindowObject(WindowObject);
+  return TRUE;
+}
+
+BOOL STDCALL
+NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
+{
+  BOOL Ret;
+  POINT pt;
+  NTSTATUS Status;
+  
+  Ret = IntGetClientOrigin(hWnd, &pt);
+  
+  Status = MmCopyToCaller(Point, &pt, sizeof(POINT));
+  if(!NT_SUCCESS(Status))
+  {
+    SetLastNtError(Status);
+    return FALSE;
+  }
+  
+  return Ret;
 }
 
 /*******************************************************************