Commit in reactos on win32k_user_rewrite
include/win32k/ntuser.h+1-11.137.4.3 -> 1.137.4.4
subsys/win32k/include/internal.h+71.1.4.6 -> 1.1.4.7
                     /misc.h+281.1.4.1 -> 1.1.4.2
subsys/win32k/ntuser/callback.c+7-11.25.8.2 -> 1.25.8.3
                    /desktop.c+18-31.17.2.3 -> 1.17.2.4
                    /input.c+2-11.36.4.4 -> 1.36.4.5
                    /ntuser.c+92-141.1.4.7 -> 1.1.4.8
                    /stubs.c+1-321.45.12.4 -> 1.45.12.5
                    /userlock.c+8-21.1.4.1 -> 1.1.4.2
                    /window.c+15-51.244.2.4 -> 1.244.2.5
                    /winpos.c+12-121.120.2.1 -> 1.120.2.2
+191-71
11 modified files
fixed some dead-locks and uninitialized variables

reactos/include/win32k
ntuser.h 1.137.4.3 -> 1.137.4.4
diff -u -r1.137.4.3 -r1.137.4.4
--- ntuser.h	1 Sep 2004 14:14:25 -0000	1.137.4.3
+++ ntuser.h	1 Sep 2004 22:14:49 -0000	1.137.4.4
@@ -373,7 +373,7 @@
          int cy,
 		     UINT Flags);
 BOOL STDCALL
-NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText);
+NtUserDefSetText(HWND hWnd, PUNICODE_STRING WindowText);
 
 BOOLEAN
 STDCALL

reactos/subsys/win32k/include
internal.h 1.1.4.6 -> 1.1.4.7
diff -u -r1.1.4.6 -r1.1.4.7
--- internal.h	1 Sep 2004 14:14:26 -0000	1.1.4.6
+++ internal.h	1 Sep 2004 22:14:50 -0000	1.1.4.7
@@ -650,11 +650,16 @@
 #define DCX_KEEPCLIPRGN		0x00040000
 #define DCX_NOCLIPCHILDREN      0x00080000
 
+#if 0
 #define IntLockWindowUpdate(Window) \
   ExAcquireFastMutex(&Window->UpdateLock)
 
 #define IntUnLockWindowUpdate(Window) \
   ExReleaseFastMutex(&Window->UpdateLock)
+#else
+#define IntLockWindowUpdate(Window)
+#define IntUnLockWindowUpdate(Window)
+#endif
 
 #define IntInvalidateRect(WndObj, Rect, Erase) \
    IntRedrawWindow((WndObj), (LPRECT)(Rect), 0, RDW_INVALIDATE | ((Erase) ? RDW_ERASE : 0))
@@ -926,6 +931,8 @@
 WORD           FASTCALL IntSetWindowWord(PWINDOW_OBJECT WindowObject, INT Index, WORD NewValue);
 ULONG          FASTCALL IntGetWindowThreadProcessId(PWINDOW_OBJECT Window, ULONG *Pid);
 PWINDOW_OBJECT FASTCALL IntGetWindow(PWINDOW_OBJECT Window, UINT uCmd);
+BOOL           FASTCALL IntDefSetText(PWINDOW_OBJECT WindowObject, PUNICODE_STRING WindowText);
+INT            FASTCALL IntInternalGetWindowText(PWINDOW_OBJECT WindowObject, LPWSTR lpString, INT nMaxCount);
 BOOL           FASTCALL IntDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
 DWORD          FASTCALL IntRemoveWndProcHandle(WNDPROC Handle);
 DWORD          FASTCALL IntRemoveProcessWndProcHandles(HANDLE ProcessID);

reactos/subsys/win32k/include
misc.h 1.1.4.1 -> 1.1.4.2
diff -u -r1.1.4.1 -r1.1.4.2
--- misc.h	15 Jul 2004 20:07:16 -0000	1.1.4.1
+++ misc.h	1 Sep 2004 22:14:50 -0000	1.1.4.2
@@ -37,9 +37,37 @@
 IntUserLeaveCritical(VOID);
 
 inline BOOL
+IntUserIsInCriticalShared(VOID);
+
+inline BOOL
 IntUserIsInCritical(VOID);
 
 inline NTSTATUS
 IntConvertThreadToGUIThread(PETHREAD Thread);
 
+#define TempReleaseUserLock(UserLock) \
+  if(IntUserIsInCritical()) \
+  { \
+    (UserLock) = 1; \
+    IntUserLeaveCritical(); \
+  } \
+  else if(IntUserIsInCriticalShared()) \
+  { \
+    (UserLock) = 2; \
+    IntUserLeaveCritical(); \
+  } \
+  else \
+    (UserLock) = 0
+
+#define TempEnterUserLock(UserLock) \
+  switch(UserLock) \
+  { \
+    case 1: \
+      IntUserEnterCritical(); \
+      break; \
+    case 2: \
+      IntUserEnterCriticalShared(); \
+      break; \
+  } \
+
 #endif /* ndef _SUBSYS_WIN32K_INCLUDE_CLEANUP_H */

reactos/subsys/win32k/ntuser
callback.c 1.25.8.2 -> 1.25.8.3
diff -u -r1.25.8.2 -r1.25.8.3
--- callback.c	31 Aug 2004 11:38:56 -0000	1.25.8.2
+++ callback.c	1 Sep 2004 22:14:50 -0000	1.25.8.3
@@ -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: callback.c,v 1.25.8.2 2004/08/31 11:38:56 weiden Exp $
+/* $Id: callback.c,v 1.25.8.3 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -45,6 +45,12 @@
     StatusVar = NtW32Call(a, b, c, d, e); \
     IntUserEnterCritical(); \
   } \
+  else if(IntUserIsInCriticalShared()) \
+  { \
+    IntUserLeaveCritical(); \
+    StatusVar = NtW32Call(a, b, c, d, e); \
+    IntUserEnterCriticalShared(); \
+  } \
   else \
     StatusVar = NtW32Call(a, b, c, d, e) \
 

reactos/subsys/win32k/ntuser
desktop.c 1.17.2.3 -> 1.17.2.4
diff -u -r1.17.2.3 -r1.17.2.4
--- desktop.c	31 Aug 2004 14:34:39 -0000	1.17.2.3
+++ desktop.c	1 Sep 2004 22:14:50 -0000	1.17.2.4
@@ -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: desktop.c,v 1.17.2.3 2004/08/31 14:34:39 weiden Exp $
+ *  $Id: desktop.c,v 1.17.2.4 2004/09/01 22:14:50 weiden Exp $
  *
  *  COPYRIGHT:        See COPYING in the top level directory
  *  PROJECT:          ReactOS kernel
@@ -247,13 +247,21 @@
 {
   CSRSS_API_REQUEST Request;
   CSRSS_API_REPLY Reply;
+  NTSTATUS Status;
+  INT UserLock;
+  
   DbgPrint("IntShowDesktop 0x%x\n", Desktop->DesktopWindow->Handle);
   Request.Type = CSRSS_SHOW_DESKTOP;
   Request.Data.ShowDesktopRequest.DesktopWindow = Desktop->DesktopWindow->Handle;
   Request.Data.ShowDesktopRequest.Width = Width;
   Request.Data.ShowDesktopRequest.Height = Height;
 
-  return CsrNotify(&Request, &Reply);
+  /* leave the user lock temporarily so we don't dead-lock in case csr calls some user32 api */
+  TempReleaseUserLock(UserLock);
+  Status = CsrNotify(&Request, &Reply);
+  TempEnterUserLock(UserLock);
+  
+  return Status;
 }
 
 NTSTATUS FASTCALL
@@ -262,11 +270,18 @@
 #if 0
   CSRSS_API_REQUEST Request;
   CSRSS_API_REPLY Reply;
+  NTSTATUS Status;
+  INT UserLock;
 
   Request.Type = CSRSS_HIDE_DESKTOP;
   Request.Data.HideDesktopRequest.DesktopWindow = Desktop->DesktopWindow;
 
-  return NotifyCsrss(&Request, &Reply);
+  /* leave the user lock temporarily so we don't dead-lock in case csr calls some user32 api */
+  TempReleaseUserLock(UserLock);
+  Status = NotifyCsrss(&Request, &Reply);
+  TempEnterUserLock(UserLock);
+  
+  return Status;
 #else
   Desktop->DesktopWindow->Style &= ~WS_VISIBLE;
   return STATUS_SUCCESS;

reactos/subsys/win32k/ntuser
input.c 1.36.4.4 -> 1.36.4.5
diff -u -r1.36.4.4 -r1.36.4.5
--- input.c	31 Aug 2004 11:38:56 -0000	1.36.4.4
+++ input.c	1 Sep 2004 22:14:50 -0000	1.36.4.5
@@ -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: input.c,v 1.36.4.4 2004/08/31 11:38:56 weiden Exp $
+/* $Id: input.c,v 1.36.4.5 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -532,6 +532,7 @@
     DesktopWindow = WinSta->InputDesktop->DesktopWindow;
     if (DesktopWindow != NULL)
     {
+      DbgPrint("DesktopWindow 0x%x: %d, %d\n", DesktopWindow, DesktopWindow->ClientRect.right, DesktopWindow->ClientRect.bottom);
       if(MousePos.x >= DesktopWindow->ClientRect.right)
         MousePos.x = DesktopWindow->ClientRect.right - 1;
       if(MousePos.y >= DesktopWindow->ClientRect.bottom)

reactos/subsys/win32k/ntuser
ntuser.c 1.1.4.7 -> 1.1.4.8
diff -u -r1.1.4.7 -r1.1.4.8
--- ntuser.c	1 Sep 2004 14:14:26 -0000	1.1.4.7
+++ ntuser.c	1 Sep 2004 22:14:50 -0000	1.1.4.8
@@ -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: ntuser.c,v 1.1.4.7 2004/09/01 14:14:26 weiden Exp $
+/* $Id: ntuser.c,v 1.1.4.8 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -33,10 +33,12 @@
  */
 
 #define BEGIN_NTUSER(ReturnType, ErrorReturn) \
-  ReturnType Result, ErrorResult = ErrorReturn
+  ReturnType Result, ErrorResult = ErrorReturn; \
+  DbgPrint("%s:%i: %s\n", __FILE__, __LINE__, __FUNCTION__)
 
 #define BEGIN_NTUSER_NOERR(ReturnType) \
-  ReturnType Result
+  ReturnType Result; \
+  DbgPrint("%s:%i: %s\n", __FILE__, __LINE__, __FUNCTION__)
 
 #define END_NTUSER() \
   if(IN_CRITICAL()) \
@@ -143,22 +145,18 @@
  */
 
 #define ENTER_CRITICAL() \
-  DbgPrint("%s:%i ENTER_CRICITAL\n", __FILE__, __LINE__); \
-  IntUserEnterCritical(); \
-  DbgPrint("%s:%i ENTER_CRICITAL done\n", __FILE__, __LINE__)
+  IntUserEnterCritical()
 
 #define ENTER_CRITICAL_SHARED() \
-  DbgPrint("%s:%i ENTER_CRICITAL_SHARED\n", __FILE__, __LINE__); \
-  IntUserEnterCriticalShared(); \
-  DbgPrint("%s:%i ENTER_CRICITAL_SHARED done\n", __FILE__, __LINE__)
+  IntUserEnterCriticalShared()
 
 #define LEAVE_CRITICAL() \
-  DbgPrint("%s:%i LEAVE_CRITICAL\n", __FILE__, __LINE__); \
   IntUserLeaveCritical()
 
 #define IN_CRITICAL() \
   IntUserIsInCritical()
 
+
 /*
  * User entry points
  */
@@ -533,6 +531,32 @@
 }
 
 BOOL STDCALL
+NtUserDefSetText(HWND hWnd, PUNICODE_STRING WindowText)
+{
+  UNICODE_STRING WndText;
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_BUFFERS();
+  BEGIN_NTUSER(BOOL, FALSE);
+  
+  if(WindowText != NULL)
+  {
+    NTUSER_COPY_BUFFER_NTERROR(&WndText, WindowText, sizeof(UNICODE_STRING));
+    /* FIXME - probe the string */
+  }
+  else
+  {
+    RtlInitUnicodeString(&WndText, NULL);
+  }
+  
+  ENTER_CRITICAL();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  Result = IntDefSetText(Window, &WndText);
+  LEAVE_CRITICAL();
+  
+  END_NTUSER();
+}
+
+BOOL STDCALL
 NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
 {
   BEGIN_NTUSER_NOERR(BOOL);
@@ -1126,7 +1150,7 @@
   NTUSER_USER_OBJECT(WINDOW, Window);
   BEGIN_NTUSER(HWND, NULL);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
   Result = (Window->Parent != NULL ? Window->Parent->Handle : NULL);
   LEAVE_CRITICAL();
@@ -1318,6 +1342,27 @@
   END_NTUSER();
 }
 
+INT STDCALL
+NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(INT, 0);
+  
+  if(lpString && (nMaxCount <= 1))
+  {
+    NTUSER_FAIL_ERROR(ERROR_INVALID_PARAMETER);
+  }
+  
+  /* FIXME - probe the buffer lpString points to */
+  
+  ENTER_CRITICAL_SHARED();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  Result = IntInternalGetWindowText(Window, lpString, nMaxCount);
+  LEAVE_CRITICAL();
+  
+  END_NTUSER();
+}
+
 BOOL STDCALL
 NtUserInvalidateRect(HWND hWnd, CONST RECT *Rect, BOOL Erase)
 {
@@ -1814,7 +1859,7 @@
   NTUSER_USER_OBJECT(WINDOW, Window);
   BEGIN_NTUSER(DWORD, 0);
   
-  ENTER_CRITICAL_SHARED();
+  ENTER_CRITICAL();
   VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
   Result = IntSetClassLong(Window, Offset, dwNewLong, Ansi);
   LEAVE_CRITICAL();
@@ -1829,7 +1874,7 @@
   NTUSER_USER_OBJECT(CURSOR, OldCursor);
   BEGIN_NTUSER(HCURSOR, (HCURSOR)0);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(hCursor != (HCURSOR)0)
   {
     VALIDATE_USER_OBJECT(CURSOR, hCursor, Cursor);
@@ -2003,6 +2048,35 @@
   END_NTUSER();
 }
 
+BOOL STDCALL
+NtUserSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  NTUSER_USER_OBJECT(WINDOW, InsertAfterWindow);
+  BEGIN_NTUSER(BOOL, FALSE);
+  
+  ENTER_CRITICAL();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  if(hWndInsertAfter == HWND_BOTTOM)
+    InsertAfterWindow = WINDOW_BOTTOM;
+  else if(hWndInsertAfter == HWND_NOTOPMOST)
+    InsertAfterWindow = WINDOW_NOTOPMOST;
+  else if(hWndInsertAfter == HWND_TOP)
+    InsertAfterWindow = WINDOW_TOP;
+  else if(hWndInsertAfter == HWND_TOPMOST)
+    InsertAfterWindow = WINDOW_TOPMOST;
+  else if(hWndInsertAfter == HWND_MESSAGE)
+    InsertAfterWindow = WINDOW_MESSAGE;
+  else
+  {
+    VALIDATE_USER_OBJECT(WINDOW, hWndInsertAfter, InsertAfterWindow);
+  }
+  Result = WinPosSetWindowPos(Window, InsertAfterWindow, X, Y, cx, cy, uFlags);
+  LEAVE_CRITICAL();
+
+  END_NTUSER();
+}
+
 WORD STDCALL
 NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
 {
@@ -2177,7 +2251,11 @@
 BOOL STDCALL
 NtUserWaitMessage(VOID)
 {
+  BEGIN_NTUSER_NOERR(BOOL);
+  
   /* We're not going to lock anything here, we don't want other threads to hang */
-  return IntWaitMessage(NULL, 0, 0);
+  Result = IntWaitMessage(NULL, 0, 0);
+  
+  END_NTUSER_NOERR();
 }
 

reactos/subsys/win32k/ntuser
stubs.c 1.45.12.4 -> 1.45.12.5
diff -u -r1.45.12.4 -r1.45.12.5
--- stubs.c	1 Sep 2004 14:14:26 -0000	1.45.12.4
+++ stubs.c	1 Sep 2004 22:14:50 -0000	1.45.12.5
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.45.12.4 2004/09/01 14:14:26 weiden Exp $
+/* $Id: stubs.c,v 1.45.12.5 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -1205,21 +1205,6 @@
 }
 
 
-BOOL STDCALL
-NtUserSetWindowPos(      
-    HWND hWnd,
-    HWND hWndInsertAfter,
-    int X,
-    int Y,
-    int cx,
-    int cy,
-    UINT uFlags)
-{
-   UNIMPLEMENTED;
-   return 0;
-}
-
-
 INT STDCALL
 NtUserSetWindowRgn(
   HWND hWnd,
@@ -1273,22 +1258,6 @@
 }
 
 
-BOOL STDCALL
-NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-
-INT STDCALL
-NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
-{
-   UNIMPLEMENTED;
-   return 0;
-}
-
-
 /*
  * Miscellaneous
  */

reactos/subsys/win32k/ntuser
userlock.c 1.1.4.1 -> 1.1.4.2
diff -u -r1.1.4.1 -r1.1.4.2
--- userlock.c	15 Jul 2004 20:12:56 -0000	1.1.4.1
+++ userlock.c	1 Sep 2004 22:14:50 -0000	1.1.4.2
@@ -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: userlock.c,v 1.1.4.1 2004/07/15 20:12:56 weiden Exp $
+/* $Id: userlock.c,v 1.1.4.2 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -62,9 +62,15 @@
 }
 
 inline BOOL
-IntUserIsInCritical(VOID)
+IntUserIsInCriticalShared(VOID)
 {
   /* Exclusive locks are shared locks at the same time */
   return ExIsResourceAcquiredSharedLite(&UserLock);
 }
 
+inline BOOL
+IntUserIsInCritical(VOID)
+{
+  return ExIsResourceAcquiredExclusiveLite(&UserLock);
+}
+

reactos/subsys/win32k/ntuser
window.c 1.244.2.4 -> 1.244.2.5
diff -u -r1.244.2.4 -r1.244.2.5
--- window.c	1 Sep 2004 14:14:26 -0000	1.244.2.4
+++ window.c	1 Sep 2004 22:14:50 -0000	1.244.2.5
@@ -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.244.2.4 2004/09/01 14:14:26 weiden Exp $
+/* $Id: window.c,v 1.244.2.5 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -1091,9 +1091,9 @@
   Cs.x = Pos.x;
   Cs.y = Pos.y;
 
-  DPRINT("[win32k.window] IntCreateWindow style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent);
-  DPRINT("IntCreateWindow(): (%d,%d-%d,%d)\n", x, y, nWidth, nHeight);
-  DPRINT("IntCreateWindow(): About to send NCCREATE message.\n");
+  DPRINT1("[win32k.window] IntCreateWindow style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent);
+  DPRINT1("IntCreateWindow(): (%d,%d-%d,%d)\n", x, y, nWidth, nHeight);
+  DPRINT1("IntCreateWindow(): About to send NCCREATE message.\n");
   Result = IntSendMessage(WindowObject, WM_NCCREATE, 0, (LPARAM) &Cs);
   
   /* FIXME - make sure the window still exists! */
@@ -1993,8 +1993,18 @@
   
   RtlFreeUnicodeString(&WindowObject->WindowName);
   WindowObject->WindowName = *WindowText;
+  WindowObject->WindowName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowObject->WindowName.Length, TAG_STRING);
+  if(WindowObject->WindowName.Buffer != NULL)
+  {
+    RtlCopyUnicodeString(&WindowObject->WindowName, WindowText);
+  }
+  else
+  {
+    DPRINT1("Failed to allocate enough memory for the window text!\n");
+    RtlZeroMemory(&WindowObject->WindowName, sizeof(UNICODE_STRING));
+  }
   
-  return TRUE;
+  return FALSE;
 }
 
 INT FASTCALL

reactos/subsys/win32k/ntuser
winpos.c 1.120.2.1 -> 1.120.2.2
diff -u -r1.120.2.1 -r1.120.2.2
--- winpos.c	15 Jul 2004 20:07:18 -0000	1.120.2.1
+++ winpos.c	1 Sep 2004 22:14:50 -0000	1.120.2.2
@@ -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.120.2.1 2004/07/15 20:07:18 weiden Exp $
+/* $Id: winpos.c,v 1.120.2.2 2004/09/01 22:14:50 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -378,11 +378,11 @@
   /* convert the PWINDOW_OBJECTs to HWNDs or HWND_* constants */
   WinPos->hwnd = (HWNDValidateWindowObject(WindowPos->Window) ? WindowPos->Window->Handle : WindowPos->Window);
   WinPos->hwndInsertAfter = (HWNDValidateWindowObject(WindowPos->InsertAfter) ? WindowPos->InsertAfter->Handle : WindowPos->InsertAfter);
-  WinPos->x = WinPos->x;
-  WinPos->y = WinPos->y;
-  WinPos->cx = WinPos->cx;
-  WinPos->cy = WinPos->cy;
-  WinPos->flags = WinPos->flags;
+  WinPos->x = WindowPos->x;
+  WinPos->y = WindowPos->y;
+  WinPos->cx = WindowPos->cx;
+  WinPos->cy = WindowPos->cy;
+  WinPos->flags = WindowPos->flags;
 }
 
 VOID STATIC FASTCALL
@@ -503,7 +503,7 @@
       IntSendMessage(WindowObject, WM_WINDOWPOSCHANGING, 0, (LPARAM) &winposCopy);
       WinPosToInternalWindowPosStructure(WinPos, &winposCopy);
     }
-  
+
   *WindowRect = WindowObject->WindowRect;
   *ClientRect = WindowObject->ClientRect;
 
@@ -803,8 +803,8 @@
    WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect);
 
    /* Fix up the flags. */
-   
-   /* WARNING!!! The handle values in the WINDOWPOS are wither HWND_* constants
+
+   /* WARNING!!! The handle values in the WINDOWPOS are whether HWND_* constants
                  of PWINDOW_OBJECTs! They're not Handles! */
    
    if (!WinPosFixupFlags(Window, &WinPos))
@@ -826,7 +826,7 @@
       /* WARNING!!! The handle values in WinPos are NOT handles, they're PWINDOW_OBJECTs! */
       WinPos.InsertAfter = WinPosDoOwnedPopups(WinPos.Window, WinPos.InsertAfter);
    }
-  
+
    /* Compute the visible region before the window position is changed */
    if (!(WinPos.flags & (SWP_NOREDRAW | SWP_SHOWWINDOW)) &&
        (WinPos.flags & (SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | 
@@ -1082,9 +1082,9 @@
       {
          NtGdiOffsetRgn(DirtyRgn,
             Window->WindowRect.left - Window->ClientRect.left,
-            Window->WindowRect.top - Window->ClientRect.top);
+            Window->WindowRect.top - Window->ClientRect.top);DbgPrint("WS10a\n");
          IntRedrawWindow(Window, NULL, DirtyRgn,
-            RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
+            RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);DbgPrint("WS10b\n");
       }
       NtGdiDeleteObject(DirtyRgn);
    }
CVSspam 0.2.8