GetClientRect implementation by Tim Jobling
authorGé van Geldorp <ge@gse.nl>
Thu, 6 Mar 2003 21:03:49 +0000 (21:03 +0000)
committerGé van Geldorp <ge@gse.nl>
Thu, 6 Mar 2003 21:03:49 +0000 (21:03 +0000)
svn path=/trunk/; revision=4251

reactos/iface/addsys/w32ksvc.db
reactos/include/win32k/ntuser.h
reactos/lib/user32/windows/window.c
reactos/subsys/win32k/ntuser/window.c

index b1190ea..934e5cf 100644 (file)
@@ -359,6 +359,7 @@ NtUserGetClassInfo                      5
 NtUserGetClassLong                     2
 NtUserGetClassName                      3
 NtUserGetClientOrigin                  2
+NtUserGetClientRect                    2
 NtUserGetClipboardData                  2
 NtUserGetClipboardFormatName            3
 NtUserGetClipboardOwner                 0
index d841c83..f191c38 100644 (file)
@@ -11,6 +11,8 @@ INT STDCALL
 NtUserReleaseDC(HWND hWnd, HDC hDc);
 BOOL STDCALL
 NtUserGetWindowRect(HWND hWnd, LPRECT Rect);
+BOOL STDCALL
+NtUserGetClientRect(HWND hWnd, LPRECT Rect);
 HANDLE STDCALL
 NtUserGetProp(HWND hWnd, ATOM Atom);
 BOOL STDCALL
index 95827a4..7b6180c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.17 2003/03/04 22:34:48 rcampbell Exp $
+/* $Id: window.c,v 1.18 2003/03/06 21:03:49 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
@@ -577,7 +577,7 @@ GetAncestor(HWND hwnd, UINT gaFlags)
 WINBOOL STDCALL
 GetClientRect(HWND hWnd, LPRECT lpRect)
 {
-  return FALSE;
+  return(NtUserGetClientRect(hWnd, lpRect));
 }
 
 HWND STDCALL
index 8d15fc2..04b3002 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.23 2003/03/04 00:39:56 rcampbell Exp $
+/* $Id: window.c,v 1.24 2003/03/06 21:03:49 gvg Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -11,6 +11,7 @@
 /* INCLUDES ******************************************************************/
 
 #include <ddk/ntddk.h>
+#include <internal/safe.h>
 #include <win32k/win32k.h>
 #include <include/object.h>
 #include <include/guicheck.h>
@@ -189,6 +190,27 @@ NtUserGetWindowRect(HWND hWnd, LPRECT Rect)
   return(W32kGetWindowRect(hWnd, Rect));
 }
 
+BOOL STDCALL
+NtUserGetClientRect(HWND hWnd, LPRECT Rect)
+{
+  PWINDOW_OBJECT WindowObject;
+  RECT SafeRect;
+
+  WindowObject = W32kGetWindowObject(hWnd);
+  if (WindowObject == NULL)
+    {
+      return(FALSE);
+    }
+  W32kGetClientRect(WindowObject, &SafeRect);
+  if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT))))
+    {
+      return(FALSE);
+    }
+
+  W32kReleaseWindowObject(WindowObject);
+  return(TRUE);
+}
+
 HWND
 W32kGetActiveWindow(VOID)
 {