Commit in reactos/subsys/win32k on win32k_user_rewrite
include/callback.h+4-41.18.8.1 -> 1.18.8.2
       /internal.h+40-141.1.4.3 -> 1.1.4.4
ntuser/callback.c+6-61.25.8.1 -> 1.25.8.2
      /input.c+2-21.36.4.3 -> 1.36.4.4
      /keyboard.c+6-61.31.2.1 -> 1.31.2.2
      /message.c+71-341.71.4.2 -> 1.71.4.3
      /msgqueue.c+41-301.100.12.2 -> 1.100.12.3
      /ntuser.c+133-81.1.4.4 -> 1.1.4.5
      /painting.c+3-31.84.2.1 -> 1.84.2.2
      /stubs.c+1-351.45.12.2 -> 1.45.12.3
      /timer.c+5-51.33.4.1 -> 1.33.4.2
      /window.c+2-11.244.2.2 -> 1.244.2.3
+314-148
12 modified files
get rid of window handles in the message queue

reactos/subsys/win32k/include
callback.h 1.18.8.1 -> 1.18.8.2
diff -u -r1.18.8.1 -r1.18.8.2
--- callback.h	15 Jul 2004 20:07:16 -0000	1.18.8.1
+++ callback.h	31 Aug 2004 11:38:55 -0000	1.18.8.2
@@ -12,10 +12,10 @@
 
 VOID STDCALL
 IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
-			    HWND hWnd,
-			    UINT Msg,
-			    ULONG_PTR CompletionCallbackContext,
-			    LRESULT Result);
+			   PWINDOW_OBJECT Window,
+			   UINT Msg,
+			   ULONG_PTR CompletionCallbackContext,
+			   LRESULT Result);
 
 
 HMENU STDCALL

reactos/subsys/win32k/include
internal.h 1.1.4.3 -> 1.1.4.4
diff -u -r1.1.4.3 -r1.1.4.4
--- internal.h	27 Aug 2004 15:56:05 -0000	1.1.4.3
+++ internal.h	31 Aug 2004 11:38:56 -0000	1.1.4.4
@@ -440,17 +440,43 @@
 
 #define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))
 
+#define MsgCopyKMsgToMsg(msg, kmsg) \
+ (msg)->hwnd = ((kmsg)->Window ? (kmsg)->Window->Handle : NULL); \
+ (msg)->message = (kmsg)->message; \
+ (msg)->wParam = (kmsg)->wParam; \
+ (msg)->lParam = (kmsg)->lParam; \
+ (msg)->time = (kmsg)->time; \
+ (msg)->pt = (kmsg)->pt
+
+#define MsgCopyMsgToKMsg(kmsg, msg, MsgWindow) \
+ (kmsg)->Window = (MsgWindow); \
+ (kmsg)->message = (msg)->message; \
+ (kmsg)->wParam = (msg)->wParam; \
+ (kmsg)->lParam = (msg)->lParam; \
+ (kmsg)->time = (msg)->time; \
+ (kmsg)->pt = (msg)->pt
+
+typedef struct _KMSG
+{
+  PWINDOW_OBJECT Window;
+  UINT message;
+  WPARAM wParam;
+  LPARAM lParam;
+  DWORD time;
+  POINT pt;
+} KMSG, *PKMSG;
+
 typedef struct _USER_MESSAGE
 {
   LIST_ENTRY ListEntry;
   BOOLEAN FreeLParam;
-  MSG Msg;
+  KMSG Msg;
 } USER_MESSAGE;
 
 typedef struct _USER_SENT_MESSAGE
 {
   LIST_ENTRY ListEntry;
-  MSG Msg;
+  KMSG Msg;
   PKEVENT volatile CompletionEvent;
   LRESULT volatile * volatile Result;
   struct _USER_MESSAGE_QUEUE* SenderQueue;
@@ -465,7 +491,7 @@
   SENDASYNCPROC CompletionCallback;
   ULONG_PTR CompletionCallbackContext;
   LRESULT Result;
-  HWND hWnd;
+  PWINDOW_OBJECT Window;
   UINT Msg;
   LIST_ENTRY ListEntry;
 } USER_SENT_MESSAGE_NOTIFY;
@@ -554,9 +580,9 @@
 NTSTATUS            FASTCALL MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
                                             PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam,
                                             UINT uTimeout, BOOL Block, ULONG_PTR *uResult);
-PUSER_MESSAGE       FASTCALL MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam);
+PUSER_MESSAGE       FASTCALL MsqCreateMessage(PKMSG Msg, BOOLEAN FreeLParam);
 VOID                FASTCALL MsqDestroyMessage(PUSER_MESSAGE Message);
-VOID                FASTCALL MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN FreeLParam);
+VOID                FASTCALL MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, PKMSG Msg, BOOLEAN FreeLParam);
 VOID                FASTCALL MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
 BOOLEAN             FASTCALL MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
                                             IN BOOLEAN Hardware,
@@ -577,13 +603,14 @@
 VOID                FASTCALL MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue, PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
 VOID                FASTCALL MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
 VOID                FASTCALL MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
-NTSTATUS            FASTCALL CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry);
-NTSTATUS            FASTCALL CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg);
+NTSTATUS            FASTCALL CopyMsgToKernelMem(PKMSG KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry, PWINDOW_OBJECT MsgWindow);
+NTSTATUS            FASTCALL CopyMsgToUserMem(MSG *UserModeMsg, PKMSG KernelModeMsg);
 LRESULT             FASTCALL IntSendMessage(PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam);
 LRESULT             FASTCALL IntSendMessageTimeout(PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, 
                                                    UINT uFlags, UINT uTimeout, ULONG_PTR *uResult);
+BOOL                FASTCALL IntPostThreadMessage(PW32THREAD W32Thread, UINT Msg, WPARAM wParam, LPARAM lParam);
 BOOL                FASTCALL IntWaitMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax);
-BOOL                FASTCALL IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
+BOOL                FASTCALL IntTranslateKbdMessage(PKMSG lpMsg, HKL dwhkl);
 inline VOID                  MsqSetQueueBits(PUSER_MESSAGE_QUEUE queue, WORD bits);
 inline VOID                  MsqClearQueueBits(PUSER_MESSAGE_QUEUE queue, WORD bits);
 BOOL                         IntInitMessagePumpHook(VOID);
@@ -597,8 +624,7 @@
 
 BOOL       FASTCALL IntPeekMessage(PUSER_MESSAGE Msg, PWINDOW_OBJECT FilterWindow,
                                    UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg);
-BOOL       FASTCALL IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, PWINDOW_OBJECT MsgWindow,
-                                             LPMSG Msg, USHORT *HitTest, BOOL Remove);
+BOOL       FASTCALL IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, PKMSG Msg, USHORT *HitTest, BOOL Remove);
 PMSGMEMORY FASTCALL FindMsgMemory(UINT Msg);
 UINT       FASTCALL MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam);
 BOOL       FASTCALL IntGetMessage(PUSER_MESSAGE Msg, PWINDOW_OBJECT FilterWindow,
@@ -609,8 +635,8 @@
 
 VOID           FASTCALL MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 VOID           FASTCALL MsqPostHotKeyMessage(PVOID Thread, PWINDOW_OBJECT Window, WPARAM wParam, LPARAM lParam);
-VOID           FASTCALL MsqInsertSystemMessage(MSG* Msg);
-BOOL           FASTCALL MsqIsDblClk(LPMSG Msg, BOOL Remove);
+VOID           FASTCALL MsqInsertSystemMessage(PKMSG Msg);
+BOOL           FASTCALL MsqIsDblClk(PKMSG Msg, BOOL Remove);
 PWINDOW_OBJECT FASTCALL MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, PWINDOW_OBJECT Window);
 
 /* PAINTING *******************************************************************/
@@ -653,7 +679,7 @@
 VOID FASTCALL IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion);
 BOOL FASTCALL IntRedrawWindow(PWINDOW_OBJECT Window, LPRECT UpdateRect, HRGN UpdateRgn, UINT Flags);
 BOOL FASTCALL IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax,
-                                 PW32THREAD Thread, MSG *Message, BOOL Remove);
+                                 PW32THREAD Thread, PKMSG Message, BOOL Remove);
 HDC  FASTCALL IntBeginPaint(PWINDOW_OBJECT Window, PAINTSTRUCT* lPs);
 BOOL FASTCALL IntEndPaint(PWINDOW_OBJECT Window, CONST PAINTSTRUCT* lPs);
 BOOL FASTCALL IntGetUpdateRect(PWINDOW_OBJECT Window, LPRECT Rect, BOOL Erase);
@@ -706,7 +732,7 @@
    LARGE_INTEGER  Timeout;
    HANDLE         ThreadID;
    UINT           Period;
-   MSG            Msg;
+   KMSG           Msg;
 } MSG_TIMER_ENTRY;
 
 NTSTATUS         FASTCALL InitTimerImpl(VOID);

reactos/subsys/win32k/ntuser
callback.c 1.25.8.1 -> 1.25.8.2
diff -u -r1.25.8.1 -r1.25.8.2
--- callback.c	15 Jul 2004 20:07:17 -0000	1.25.8.1
+++ callback.c	31 Aug 2004 11:38:56 -0000	1.25.8.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: callback.c,v 1.25.8.1 2004/07/15 20:07:17 weiden Exp $
+/* $Id: callback.c,v 1.25.8.2 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -125,16 +125,16 @@
 
 VOID STDCALL
 IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
-			    HWND hWnd,
-			    UINT Msg,
-			    ULONG_PTR CompletionCallbackContext,
-			    LRESULT Result)
+			   PWINDOW_OBJECT Window,
+			   UINT Msg,
+			   ULONG_PTR CompletionCallbackContext,
+			   LRESULT Result)
 {
   SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
   NTSTATUS Status;
 
   Arguments.Callback = CompletionCallback;
-  Arguments.Wnd = hWnd;
+  Arguments.Wnd = (Window != NULL ? Window->Handle : NULL);
   Arguments.Msg = Msg;
   Arguments.Context = CompletionCallbackContext;
   Arguments.Result = Result;

reactos/subsys/win32k/ntuser
input.c 1.36.4.3 -> 1.36.4.4
diff -u -r1.36.4.3 -r1.36.4.4
--- input.c	27 Aug 2004 15:56:05 -0000	1.36.4.3
+++ input.c	31 Aug 2004 11:38:56 -0000	1.36.4.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: input.c,v 1.36.4.3 2004/08/27 15:56:05 weiden Exp $
+/* $Id: input.c,v 1.36.4.4 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -472,7 +472,7 @@
   PSYSTEM_CURSORINFO CurInfo;
   PWINSTATION_OBJECT WinSta;
   BOOL DoMove, SwapButtons;
-  MSG Msg;
+  KMSG Msg;
   HBITMAP hBitmap;
   BITMAPOBJ *BitmapObj;
   SURFOBJ *SurfObj;

reactos/subsys/win32k/ntuser
keyboard.c 1.31.2.1 -> 1.31.2.2
diff -u -r1.31.2.1 -r1.31.2.2
--- keyboard.c	15 Jul 2004 20:07:17 -0000	1.31.2.1
+++ keyboard.c	31 Aug 2004 11:38:56 -0000	1.31.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: keyboard.c,v 1.31.2.1 2004/07/15 20:07:17 weiden Exp $
+/* $Id: keyboard.c,v 1.31.2.2 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -601,13 +601,13 @@
 }
 
 BOOL FASTCALL
-IntTranslateKbdMessage(LPMSG lpMsg,
+IntTranslateKbdMessage(PKMSG lpMsg,
                        HKL dwhkl)
 {
   static INT dead_char = 0;
   LONG UState = 0;
   WCHAR wp[2] = { 0 };
-  MSG NewMsg = { 0 };
+  KMSG NewMsg = { 0 };
   PKBDTABLES keyLayout;
   BOOL Result = FALSE;
   DWORD ScanCode = 0;
@@ -653,14 +653,14 @@
 	}
       if (dead_char) 
 	{
-	  NewMsg.hwnd = lpMsg->hwnd;
+	  NewMsg.Window = lpMsg->Window;
 	  NewMsg.wParam = dead_char;
 	  NewMsg.lParam = lpMsg->lParam;
 	  dead_char = 0;
 	  MsqPostMessage(PsGetWin32Thread()->MessageQueue, &NewMsg, FALSE);
 	}
       
-      NewMsg.hwnd = lpMsg->hwnd;
+      NewMsg.Window = lpMsg->Window;
       NewMsg.wParam = wp[0];
       NewMsg.lParam = lpMsg->lParam;
       DPRINT( "CHAR='%c' %04x %08x\n", wp[0], wp[0], lpMsg->lParam );
@@ -671,7 +671,7 @@
     {
       NewMsg.message = 
 	(lpMsg->message == WM_KEYDOWN) ? WM_DEADCHAR : WM_SYSDEADCHAR;
-      NewMsg.hwnd = lpMsg->hwnd;
+      NewMsg.Window = lpMsg->Window;
       NewMsg.wParam = wp[0];
       NewMsg.lParam = lpMsg->lParam;
       dead_char = wp[0];

reactos/subsys/win32k/ntuser
message.c 1.71.4.2 -> 1.71.4.3
diff -u -r1.71.4.2 -r1.71.4.3
--- message.c	27 Aug 2004 15:56:05 -0000	1.71.4.2
+++ message.c	31 Aug 2004 11:38:56 -0000	1.71.4.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: message.c,v 1.71.4.2 2004/08/27 15:56:05 weiden Exp $
+/* $Id: message.c,v 1.71.4.3 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -254,12 +254,11 @@
 
 
 BOOL FASTCALL
-IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, PWINDOW_OBJECT MsgWindow,
-                         LPMSG Msg, USHORT *HitTest, BOOL Remove)
+IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, PKMSG Msg, USHORT *HitTest, BOOL Remove)
 {
   PWINDOW_OBJECT Window;
   
-  if(MsgWindow == NULL)
+  if(Msg->Window == NULL)
   {
     /* let's just eat the message?! */
     return TRUE;
@@ -286,7 +285,7 @@
         if(Wnd && (Wnd != Window))
         {
           /* post the message to the other window */
-          Msg->hwnd = Wnd->Handle;
+          Msg->Window = Wnd;
           MsqPostMessage(Wnd->MessageQueue, Msg, FALSE);
           
           /* eat the message */
@@ -344,9 +343,11 @@
 
 
 VOID FASTCALL
-IntSendHitTestMessages(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, PWINDOW_OBJECT Window)
+IntSendHitTestMessages(PUSER_MESSAGE_QUEUE ThreadQueue, PKMSG Msg)
 {
-  if(!Window || ThreadQueue->CaptureWindow)
+  PWINDOW_OBJECT Window;
+  
+  if(!(Window = Msg->Window) || ThreadQueue->CaptureWindow)
   {
     return;
   }
@@ -355,12 +356,12 @@
   {
     case WM_MOUSEMOVE:
     {
-      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(HTCLIENT, Msg->message));
+      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Window->Handle, MAKELPARAM(HTCLIENT, Msg->message));
       break;
     }
     case WM_NCMOUSEMOVE:
     {
-      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(Msg->wParam, Msg->message));
+      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Window->Handle, MAKELPARAM(Msg->wParam, Msg->message));
       break;
     }
     case WM_LBUTTONDOWN:
@@ -384,7 +385,7 @@
       ObDereferenceObject(InputWindowStation);
       
       IntSendMessage(Window, WM_MOUSEMOVE, wParam, Msg->lParam);
-      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(HTCLIENT, Msg->message));
+      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Window->Handle, MAKELPARAM(HTCLIENT, Msg->message));
       break;
     }
     case WM_NCLBUTTONDOWN:
@@ -397,7 +398,7 @@
     case WM_NCXBUTTONDBLCLK:
     {
       IntSendMessage(Window, WM_NCMOUSEMOVE, (WPARAM)Msg->wParam, Msg->lParam);
-      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Msg->hwnd, MAKELPARAM(Msg->wParam, Msg->message));
+      IntSendMessage(Window, WM_SETCURSOR, (WPARAM)Window->Handle, MAKELPARAM(Msg->wParam, Msg->message));
       break;
     }
   }
@@ -405,8 +406,7 @@
 
 
 BOOL FASTCALL
-IntActivateWindowMouse(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, PWINDOW_OBJECT MsgWindow, 
-                       USHORT *HitTest)
+IntActivateWindowMouse(PUSER_MESSAGE_QUEUE ThreadQueue, PKMSG Msg, USHORT *HitTest)
 {
   PWINDOW_OBJECT Parent;
   ULONG Result;
@@ -417,9 +417,9 @@
     return TRUE;
   }
   
-  Parent = IntGetParent(MsgWindow);
+  Parent = IntGetParent(Msg->Window);
   
-  Result = IntSendMessage(MsgWindow, WM_MOUSEACTIVATE, (WPARAM)(Parent ? Parent->Handle : 0), (LPARAM)MAKELONG(*HitTest, Msg->message));
+  Result = IntSendMessage(Msg->Window, WM_MOUSEACTIVATE, (WPARAM)(Parent ? Parent->Handle : 0), (LPARAM)MAKELONG(*HitTest, Msg->message));
   /* FIXME - make sure the window still exists */
   switch (Result)
   {
@@ -428,11 +428,11 @@
     case MA_NOACTIVATE:
       break;
     case MA_ACTIVATEANDEAT:
-      IntMouseActivateWindow(IntGetDesktopWindow(), MsgWindow);
+      IntMouseActivateWindow(IntGetDesktopWindow(), Msg->Window);
       return TRUE;
     default:
       /* MA_ACTIVATE */
-      IntMouseActivateWindow(IntGetDesktopWindow(), MsgWindow);
+      IntMouseActivateWindow(IntGetDesktopWindow(), Msg->Window);
       break;
   }
   
@@ -533,7 +533,7 @@
   {
     /* According to the PSDK, WM_QUIT messages are always returned, regardless
        of the filter specified */
-    Msg->Msg.hwnd = NULL;
+    Msg->Msg.Window = NULL;
     Msg->Msg.message = WM_QUIT;
     Msg->Msg.wParam = ThreadQueue->QuitExitCode;
     Msg->Msg.lParam = 0;
@@ -595,19 +595,16 @@
   
   if(Present)
   {
-    PWINDOW_OBJECT MsgWindow;
-    
-    MessageFound:
+MessageFound:
     
-    MsgWindow = NULL;
     if(RemoveMessages)
     {
-      if(Msg->Msg.hwnd && (MsgWindow = IntGetUserObject(WINDOW, Msg->Msg.hwnd)) &&
+      if(Msg->Msg.Window &&
          Msg->Msg.message >= WM_MOUSEFIRST && Msg->Msg.message <= WM_MOUSELAST)
       {
         USHORT HitTest;
         
-        if(IntTranslateMouseMessage(ThreadQueue, MsgWindow, &Msg->Msg, &HitTest, TRUE))
+        if(IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
           /* FIXME - check message filter again, if the message doesn't match anymore,
                      search again */
         {
@@ -616,10 +613,10 @@
         }
         if(ThreadQueue->CaptureWindow == NULL)
         {
-          IntSendHitTestMessages(ThreadQueue, &Msg->Msg, MsgWindow);
+          IntSendHitTestMessages(ThreadQueue, &Msg->Msg);
           if((Msg->Msg.message != WM_MOUSEMOVE && Msg->Msg.message != WM_NCMOUSEMOVE) &&
              IS_BTN_MESSAGE(Msg->Msg.message, DOWN) &&
-             IntActivateWindowMouse(ThreadQueue, &Msg->Msg, MsgWindow, &HitTest))
+             IntActivateWindowMouse(ThreadQueue, &Msg->Msg, &HitTest))
           {
             /* eat the message, search again */
             goto CheckMessages;
@@ -628,16 +625,16 @@
       }
       else
       {
-        IntSendHitTestMessages(ThreadQueue, &Msg->Msg, MsgWindow);
+        IntSendHitTestMessages(ThreadQueue, &Msg->Msg);
       }
       
       return TRUE;
     }
     
     USHORT HitTest;
-    if((Msg->Msg.hwnd && (MsgWindow = IntGetUserObject(WINDOW, Msg->Msg.hwnd)) &&
+    if((Msg->Msg.Window &&
         Msg->Msg.message >= WM_MOUSEFIRST && Msg->Msg.message <= WM_MOUSELAST) &&
-       IntTranslateMouseMessage(ThreadQueue, MsgWindow, &Msg->Msg, &HitTest, FALSE))
+       IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, FALSE))
       /* FIXME - check message filter again, if the message doesn't match anymore,
                  search again */
     {
@@ -708,14 +705,15 @@
 
 
 NTSTATUS FASTCALL
-CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry)
+CopyMsgToKernelMem(PKMSG KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEntry,
+                   PWINDOW_OBJECT MsgWindow)
 {
   NTSTATUS Status;
   
   PVOID KernelMem;
   UINT Size;
 
-  *KernelModeMsg = *UserModeMsg;
+  MsgCopyMsgToKMsg(KernelModeMsg, UserModeMsg, MsgWindow);
 
   /* See if this message type is present in the table */
   if (NULL == MsgMemoryEntry)
@@ -764,7 +762,7 @@
 }
 
 NTSTATUS FASTCALL
-CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
+CopyMsgToUserMem(MSG *UserModeMsg, PKMSG KernelModeMsg)
 {
   NTSTATUS Status;
   PMSGMEMORY MsgMemoryEntry;
@@ -841,10 +839,16 @@
   }
 
   Win32Thread = PsGetWin32Thread();
+  
+  ASSERT(Win32Thread != NULL);
 
-  if (NULL != Win32Thread &&
-      Window->MessageQueue == Win32Thread->MessageQueue)
+  if (Window->MessageQueue == Win32Thread->MessageQueue)
     {
+      /* This case will only happen if IntSendMessageTimeout() was called from
+         inside kmode, NtUserSendMessageTimeout() will NOT call this function
+         in this case, as it returns to umode where the window message callback
+         function will be called! */
+
       /* See if this message type is present in the table */
       MsgMemoryEntry = FindMsgMemory(Msg);
       if (NULL == MsgMemoryEntry)
@@ -913,6 +917,39 @@
   return TRUE;
 }
 
+BOOL FASTCALL
+IntPostThreadMessage(PW32THREAD W32Thread,
+                     UINT Msg,
+                     WPARAM wParam,
+                     LPARAM lParam)
+{
+  MSG UserModeMsg;
+  KMSG KernelModeMsg;
+  NTSTATUS Status;
+  PMSGMEMORY MsgMemoryEntry;
+
+  UserModeMsg.hwnd = NULL;
+  UserModeMsg.message = Msg;
+  UserModeMsg.wParam = wParam;
+  UserModeMsg.lParam = lParam;
+
+  MsgMemoryEntry = FindMsgMemory(UserModeMsg.message);
+  /* FIXME - what if MsgMemoryEntry == NULL? */
+  Status = CopyMsgToKernelMem(&KernelModeMsg, &UserModeMsg, MsgMemoryEntry, NULL);
+  if(!NT_SUCCESS(Status))
+  {
+    SetLastWin32Error(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+
+  ASSERT(W32Thread->MessageQueue); /* FIXME - we should propably check this and fail gracefully */
+  
+  MsqPostMessage(W32Thread->MessageQueue, &KernelModeMsg,
+                 NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam);
+
+  return TRUE;
+}
+
 BOOL STDCALL
 IntInitMessagePumpHook()
 {

reactos/subsys/win32k/ntuser
msgqueue.c 1.100.12.2 -> 1.100.12.3
diff -u -r1.100.12.2 -r1.100.12.3
--- msgqueue.c	27 Aug 2004 15:56:05 -0000	1.100.12.2
+++ msgqueue.c	31 Aug 2004 11:38:56 -0000	1.100.12.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: msgqueue.c,v 1.100.12.2 2004/08/27 15:56:05 weiden Exp $
+/* $Id: msgqueue.c,v 1.100.12.3 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -39,7 +39,7 @@
 
 #define SYSTEM_MESSAGE_QUEUE_SIZE           (256)
 
-static MSG SystemMessageQueue[SYSTEM_MESSAGE_QUEUE_SIZE];
+static KMSG SystemMessageQueue[SYSTEM_MESSAGE_QUEUE_SIZE];
 static ULONG SystemMessageQueueHead = 0;
 static ULONG SystemMessageQueueTail = 0;
 static ULONG SystemMessageQueueCount = 0;
@@ -124,7 +124,7 @@
 }
 
 VOID FASTCALL
-MsqInsertSystemMessage(MSG* Msg)
+MsqInsertSystemMessage(PKMSG Msg)
 {
   LARGE_INTEGER LargeTickCount;
   KIRQL OldIrql;
@@ -171,7 +171,7 @@
 }
 
 BOOL FASTCALL
-MsqIsDblClk(LPMSG Msg, BOOL Remove)
+MsqIsDblClk(PKMSG Msg, BOOL Remove)
 {
    /* FIXME */
    return FALSE;
@@ -313,7 +313,7 @@
   }
   
   /* FIXME - only assign if removing? */
-  Message->Msg.hwnd = Window->Handle;
+  Message->Msg.Window = Window;
   Message->Msg.message = Msg;
   Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y);
   
@@ -418,7 +418,7 @@
   while (SystemMessageQueueCount > 0)
     {
       PUSER_MESSAGE UserMsg;
-      MSG Msg;
+      KMSG Msg;
 
       ASSERT(SystemMessageQueueHead < SYSTEM_MESSAGE_QUEUE_SIZE);
       Msg = SystemMessageQueue[SystemMessageQueueHead];
@@ -519,12 +519,12 @@
 MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   PUSER_MESSAGE_QUEUE FocusMessageQueue;
-  MSG Msg;
+  KMSG Msg;
 
   DPRINT("MsqPostKeyboardMessage(uMsg 0x%x, wParam 0x%x, lParam 0x%x)\n",
     uMsg, wParam, lParam);
 
-  Msg.hwnd = 0;
+  Msg.Window = 0;
   Msg.message = uMsg;
   Msg.wParam = wParam;
   Msg.lParam = lParam;
@@ -544,8 +544,8 @@
     
     if (FocusMessageQueue->FocusWindow != NULL)
       {
-	Msg.hwnd = FocusMessageQueue->FocusWindow->Handle;
-        DPRINT("Msg.hwnd = %x\n", Msg.hwnd);
+	Msg.Window = FocusMessageQueue->FocusWindow;
+        DPRINT("Msg.Window = %x\n", Msg.Window);
 	MsqPostMessage(FocusMessageQueue, &Msg, FALSE);
       }
     else
@@ -560,7 +560,7 @@
 {
   PW32THREAD Win32Thread;
   PW32PROCESS Win32Process;
-  MSG Mesg;
+  KMSG Mesg;
   NTSTATUS Status;
 
   ASSERT(Window);
@@ -586,7 +586,7 @@
       return;
     }
 
-  Mesg.hwnd = Window->Handle;
+  Mesg.Window = Window;
   Mesg.message = WM_HOTKEY;
   Mesg.wParam = wParam;
   Mesg.lParam = lParam;
@@ -607,7 +607,7 @@
 }
 
 PUSER_MESSAGE FASTCALL
-MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam)
+MsqCreateMessage(PKMSG Msg, BOOLEAN FreeLParam)
 {
   PUSER_MESSAGE Message;
 
@@ -618,7 +618,7 @@
     }
 
   Message->FreeLParam = FreeLParam;
-  RtlMoveMemory(&Message->Msg, Msg, sizeof(MSG));
+  Message->Msg = *Msg;
 
   return Message;
 }
@@ -644,10 +644,10 @@
     IntUnLockMessageQueue(MessageQueue);
 
     IntCallSentMessageCallback(Message->CompletionCallback,
-				Message->hWnd,
-				Message->Msg,
-				Message->CompletionCallbackContext,
-				Message->Result);
+                               Message->Window,
+                               Message->Msg,
+                               Message->CompletionCallbackContext,
+                               Message->Result);
     
     IntLockMessageQueue(MessageQueue);
   }
@@ -663,7 +663,6 @@
 BOOLEAN FASTCALL
 MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
 {
-  PWINDOW_OBJECT Window;
   PUSER_SENT_MESSAGE Message;
   PLIST_ENTRY Entry;
   LRESULT Result;
@@ -687,19 +686,16 @@
 		 &Message->ListEntry);
   
   IntUnLockMessageQueue(MessageQueue);
-  
-  Window = IntGetUserObject(WINDOW, Message->Msg.hwnd);
-  ASSERT(Window);
-  
-  ObmReferenceObject(Window);
+
+  ObmReferenceObject(Message->Msg.Window);
   
   /* Call the window procedure. */
-  Result = IntSendMessage(Window,
+  Result = IntSendMessage(Message->Msg.Window,
                           Message->Msg.message,
                           Message->Msg.wParam,
                           Message->Msg.lParam);
   
-  ObmDereferenceObject(Window);
+  ObmDereferenceObject(Message->Msg.Window);
   
   /* remove the message from the local dispatching list, because it doesn't need
      to be cleaned up on thread termination anymore */
@@ -748,7 +744,7 @@
       NotifyMessage->CompletionCallbackContext =
 	Message->CompletionCallbackContext;
       NotifyMessage->Result = Result;
-      NotifyMessage->hWnd = Message->Msg.hwnd;
+      NotifyMessage->Window = Message->Msg.Window;
       NotifyMessage->Msg = Message->Msg.message;
       MsqSendNotifyMessage(Message->SenderQueue, NotifyMessage);
     }
@@ -758,6 +754,7 @@
   {
     /* only dereference our message queue if the message has not been timed out */
     IntDereferenceMessageQueue(MessageQueue);
+    IntDereferenceMessageQueue(Message->SenderQueue);
   }
   
   /* only free the message if not freed already */
@@ -807,12 +804,13 @@
   /* FIXME - increase reference counter of sender's message queue here */
   
   Result = 0;
-  Message->Msg.hwnd = Window->Handle;
+  Message->Msg.Window = Window;
   Message->Msg.message = Msg;
   Message->Msg.wParam = wParam;
   Message->Msg.lParam = lParam;
   Message->CompletionEvent = &CompletionEvent;
   Message->Result = &Result;
+  IntReferenceMessageQueue(ThreadQueue);
   Message->SenderQueue = ThreadQueue;
   Message->CompletionCallback = NULL;
   
@@ -877,6 +875,7 @@
                 Message->Result = NULL;
                 RemoveEntryList(&Message->DispatchingListEntry);
                 IntDereferenceMessageQueue(MessageQueue);
+                IntDereferenceMessageQueue(ThreadQueue);
                 break;
               }
             Entry = Entry->Flink;
@@ -935,6 +934,7 @@
                     Message->Result = NULL;
                     RemoveEntryList(&Message->DispatchingListEntry);
                     IntDereferenceMessageQueue(MessageQueue);
+                    IntDereferenceMessageQueue(ThreadQueue);
                     break;
                   }
                 Entry = Entry->Flink;
@@ -956,7 +956,7 @@
 }
 
 VOID FASTCALL
-MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg, BOOLEAN FreeLParam)
+MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, PKMSG Msg, BOOLEAN FreeLParam)
 {
   PUSER_MESSAGE Message;
   
@@ -1008,7 +1008,7 @@
     {
       CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
 					 ListEntry);
-      if ((FilterWindow == NULL || FilterWindow->Handle == CurrentMessage->Msg.hwnd) &&
+      if ((FilterWindow == NULL || FilterWindow == CurrentMessage->Msg.Window) &&
 	  ((MsgFilterLow == 0 && MsgFilterHigh == 0) ||
 	   (MsgFilterLow <= CurrentMessage->Msg.message &&
 	    MsgFilterHigh >= CurrentMessage->Msg.message)))
@@ -1143,6 +1143,17 @@
       ExFreePool(CurrentSentMessage);
     }
   
+  /* tell other threads not to bother returning any info to us */
+  while (! IsListEmpty(&MessageQueue->DispatchingMessagesHead))
+    {
+      CurrentEntry = RemoveHeadList(&MessageQueue->DispatchingMessagesHead);
+      CurrentSentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE,
+                                             DispatchingListEntry);
+      CurrentSentMessage->CompletionEvent = NULL;
+      CurrentSentMessage->Result = NULL;
+      IntDereferenceMessageQueue(MessageQueue);
+    }
+  
   IntUnLockMessageQueue(MessageQueue);
 }
 

reactos/subsys/win32k/ntuser
ntuser.c 1.1.4.4 -> 1.1.4.5
diff -u -r1.1.4.4 -r1.1.4.5
--- ntuser.c	28 Aug 2004 20:15:45 -0000	1.1.4.4
+++ ntuser.c	31 Aug 2004 11:38:56 -0000	1.1.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: ntuser.c,v 1.1.4.4 2004/08/28 20:15:45 gvg Exp $
+/* $Id: ntuser.c,v 1.1.4.5 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -488,7 +488,7 @@
   NTUSER_COPY_BUFFER_NTERROR(&SafeClassName, UnsafeClassName, sizeof(UNICODE_STRING));
   if(!IS_ATOM(SafeClassName.Buffer))
   {
-    Status = IntSafeCopyUnicodeString(&SafeClassName, UnsafeClassName);
+    Status = IntSafeCopyUnicodeStringTerminateNULL(&SafeClassName, UnsafeClassName);
     if(!NT_SUCCESS(Status))
     {
       NTUSER_FAIL_NTERROR(Status);
@@ -1054,7 +1054,8 @@
     PVOID UserMem;
     NTSTATUS Status;
     
-    Info.Msg = Msg.Msg;
+    MsgCopyKMsgToMsg(&(Info.Msg), &(Msg.Msg));
+    
     /* See if this message type is present in the table */
     MsgMemoryEntry = FindMsgMemory(Info.Msg.message);
     if (NULL == MsgMemoryEntry)
@@ -1379,7 +1380,8 @@
     PVOID UserMem;
     NTSTATUS Status;
     
-    Info.Msg = Msg.Msg;
+    MsgCopyKMsgToMsg(&(Info.Msg), &(Msg.Msg));
+    
     /* See if this message type is present in the table */
     MsgMemoryEntry = FindMsgMemory(Info.Msg.message);
     if (NULL == MsgMemoryEntry)
@@ -1424,6 +1426,62 @@
   END_NTUSER();
 }
 
+BOOL STDCALL
+NtUserPostMessage(HWND Wnd,
+		  UINT Msg,
+		  WPARAM wParam,
+		  LPARAM lParam)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(LRESULT, 0);
+
+  /* don't handle HWND_BROADCAST in kmode, SendMessage() should obtain a list
+     of handles and then call NtUserSendMessage() for each window */
+  NTUSER_FAIL_INVALID_PARAMETER(Wnd, HWND_BROADCAST);
+  NTUSER_FAIL_INVALID_PARAMETER(Wnd, 0);
+
+  ENTER_CRITICAL_SHARED();
+  VALIDATE_USER_OBJECT(WINDOW, Wnd, Window);
+  LEAVE_CRITICAL();
+
+  END_NTUSER();
+}
+
+BOOL STDCALL
+NtUserPostThreadMessage(DWORD idThread,
+			UINT Msg,
+			WPARAM wParam,
+			LPARAM lParam)
+{
+  NTSTATUS Status;
+  PETHREAD peThread;
+  BEGIN_NTUSER(BOOL, FALSE);
+  
+  /* lookup the thread */
+  Status = PsLookupThreadByThreadId((PVOID)idThread, &peThread);
+  if(!NT_SUCCESS(Status))
+  {
+    NTUSER_FAIL_NTERROR(Status);
+  }
+  
+  if(peThread->Win32Thread == NULL)
+  {
+    /* we try to send a message to a non-win32 thread... */
+    ObDereferenceObject(peThread);
+    NTUSER_FAIL_ERROR(ERROR_ACCESS_DENIED); /* FIXME - right error code?! */
+  }
+  
+  ENTER_CRITICAL_SHARED();
+  Result = IntPostThreadMessage(peThread->Win32Thread,
+                                Msg,
+                                wParam,
+                                lParam);
+  LEAVE_CRITICAL();
+  
+  ObDereferenceObject(peThread);
+  END_NTUSER();
+}
+
 RTL_ATOM STDCALL
 NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
                          PUNICODE_STRING ClassName,
@@ -1547,6 +1605,61 @@
   END_NTUSER();
 }
 
+LRESULT STDCALL
+NtUserSendMessage(HWND Wnd,
+		  UINT Msg,
+		  WPARAM wParam,
+		  LPARAM lParam,
+                  PNTUSERSENDMESSAGEINFO UnsafeInfo)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(LRESULT, 0);
+  
+  /* don't handle HWND_BROADCAST in kmode, SendMessage() should obtain a list
+     of handles and then call NtUserSendMessage() for each window */
+  NTUSER_FAIL_INVALID_PARAMETER(Wnd, HWND_BROADCAST);
+  NTUSER_FAIL_INVALID_PARAMETER(Wnd, 0);
+  
+  /* FIXME - probe UnsafeInfo */
+  
+  UnsafeInfo->HandledByKernel = TRUE;
+  
+  ENTER_CRITICAL_SHARED();
+  VALIDATE_USER_OBJECT(WINDOW, Wnd, Window);
+  
+  if(Window->MessageQueue->Thread == PsGetCurrentThread())
+  {
+    /* return to user mode and call the window proc there */
+    if(0xFFFF0000 != ((DWORD) Window->WndProcW & 0xFFFF0000))
+    {
+      if(0xFFFF0000 != ((DWORD) Window->WndProcA & 0xFFFF0000))
+      {
+        /* Both Unicode and Ansi winprocs are real, see what usermode prefers */
+        UnsafeInfo->Proc = (UnsafeInfo->Ansi ? Window->WndProcA : Window->WndProcW);
+      }
+      else
+      {
+        /* Real Unicode winproc */
+        UnsafeInfo->Ansi = FALSE;
+        UnsafeInfo->Proc = Window->WndProcW;
+      }
+    }
+    else
+    {
+      /* Must have real Ansi winproc */
+      UnsafeInfo->Ansi = TRUE;
+      UnsafeInfo->Proc = Window->WndProcA;
+    }
+    LEAVE_CRITICAL();
+    
+    UnsafeInfo->HandledByKernel = FALSE;
+    return TRUE;
+  }
+  LEAVE_CRITICAL();
+  
+  END_NTUSER();
+}
+
 HWND STDCALL
 NtUserSetActiveWindow(HWND hWnd)
 {
@@ -1865,14 +1978,26 @@
 NtUserTranslateMessage(LPMSG lpMsg,
 		       HKL dwhkl)
 {
-  MSG SafeMsg;
-  BEGIN_BUFFERS();
+  KMSG KMsg;
+  NTUSER_USER_OBJECT(WINDOW, Window);
   BEGIN_NTUSER(BOOL, FALSE);
   
-  NTUSER_COPY_BUFFER_NTERROR(&SafeMsg, lpMsg, sizeof(MSG));
+  /* FIXME - probe lpMsg */
   
   /* FIXME - lock stuff here... */
-  Result = IntTranslateKbdMessage(&SafeMsg, dwhkl);
+  ENTER_CRITICAL_SHARED();
+  if(lpMsg->hwnd != NULL)
+  {
+    VALIDATE_USER_OBJECT(WINDOW, lpMsg->hwnd, Window);
+  }
+  else
+  {
+    Window = NULL;
+  }
+  MsgCopyMsgToKMsg(&KMsg, lpMsg, Window);
+  /* FIXME - put this outside of the lock? */
+  Result = IntTranslateKbdMessage(&KMsg, dwhkl);
+  LEAVE_CRITICAL();
   
   END_NTUSER();
 }

reactos/subsys/win32k/ntuser
painting.c 1.84.2.1 -> 1.84.2.2
diff -u -r1.84.2.1 -r1.84.2.2
--- painting.c	15 Jul 2004 20:07:18 -0000	1.84.2.1
+++ painting.c	31 Aug 2004 11:38:56 -0000	1.84.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: painting.c,v 1.84.2.1 2004/07/15 20:07:18 weiden Exp $
+ *  $Id: painting.c,v 1.84.2.2 2004/08/31 11:38:56 weiden Exp $
  *
  *  COPYRIGHT:        See COPYING in the top level directory
  *  PROJECT:          ReactOS kernel
@@ -555,7 +555,7 @@
 
 BOOL FASTCALL
 IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax,
-                   PW32THREAD Thread, MSG *Message, BOOL Remove)
+                   PW32THREAD Thread, PKMSG Message, BOOL Remove)
 {
    PWINDOW_OBJECT RepaintWnd;
    
@@ -574,7 +574,7 @@
    {
       RepaintWnd = IntFindWindowToRepaint(IntGetDesktopWindow(), PsGetWin32Thread());
    }
-   Message->hwnd = (RepaintWnd ? RepaintWnd->Handle : NULL);
+   Message->Window = RepaintWnd;
 
    if (RepaintWnd == NULL)
    {

reactos/subsys/win32k/ntuser
stubs.c 1.45.12.2 -> 1.45.12.3
diff -u -r1.45.12.2 -r1.45.12.3
--- stubs.c	27 Aug 2004 15:56:05 -0000	1.45.12.2
+++ stubs.c	31 Aug 2004 11:38:56 -0000	1.45.12.3
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.45.12.2 2004/08/27 15:56:05 weiden Exp $
+/* $Id: stubs.c,v 1.45.12.3 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -683,28 +683,6 @@
 }
 
 
-BOOL STDCALL
-NtUserPostMessage(HWND Wnd,
-		  UINT Msg,
-		  WPARAM wParam,
-		  LPARAM lParam)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-
-BOOL STDCALL
-NtUserPostThreadMessage(DWORD idThread,
-			UINT Msg,
-			WPARAM wParam,
-			LPARAM lParam)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-
 DWORD STDCALL
 NtUserQuerySendMessage(DWORD Unknown0)
 {
@@ -728,18 +706,6 @@
 }
 
 
-LRESULT STDCALL
-NtUserSendMessage(HWND Wnd,
-		  UINT Msg,
-		  WPARAM wParam,
-		  LPARAM lParam,
-                  PNTUSERSENDMESSAGEINFO UnsafeInfo)
-{
-   UNIMPLEMENTED;
-   return 0;
-}
-
-
 BOOL STDCALL
 NtUserSendMessageCallback(HWND hWnd,
 			  UINT Msg,

reactos/subsys/win32k/ntuser
timer.c 1.33.4.1 -> 1.33.4.2
diff -u -r1.33.4.1 -r1.33.4.2
--- timer.c	15 Jul 2004 20:07:18 -0000	1.33.4.1
+++ timer.c	31 Aug 2004 11:38:56 -0000	1.33.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: timer.c,v 1.33.4.1 2004/07/15 20:07:18 weiden Exp $
+/* $Id: timer.c,v 1.33.4.2 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -97,7 +97,7 @@
     MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
     EnumEntry = EnumEntry->Flink;
       
-    if (MsgTimer->Msg.hwnd == (Window ? Window->Handle : NULL) && 
+    if (MsgTimer->Msg.Window == Window &&
         MsgTimer->Msg.wParam == (WPARAM)IDEvent &&
         MsgTimer->ThreadID == ThreadID &&
         (MsgTimer->Msg.message == WM_SYSTIMER) == SysTimer)
@@ -130,7 +130,7 @@
     
     if (MsgTimer->ThreadID == ThreadID)
     {
-      if (MsgTimer->Msg.hwnd == NULL)
+      if (MsgTimer->Msg.Window == NULL)
       {
         RtlClearBits(&WindowLessTimersBitMap, ((UINT_PTR)MsgTimer->Msg.wParam) - 1, 1);   
       }
@@ -161,7 +161,7 @@
     MsgTimer = CONTAINING_RECORD(EnumEntry, MSG_TIMER_ENTRY, ListEntry);
     EnumEntry = EnumEntry->Flink;
     
-    if (MsgTimer->Msg.hwnd == Window->Handle)
+    if (MsgTimer->Msg.Window == Window)
     {
       RemoveEntryList(&MsgTimer->ListEntry);
       ExFreePool(MsgTimer);
@@ -256,7 +256,7 @@
       return 0;
     }
     
-    NewTimer->Msg.hwnd = (WindowObject ? WindowObject->Handle : NULL);
+    NewTimer->Msg.Window = WindowObject;
     NewTimer->Msg.message = (SystemTimer ? WM_SYSTIMER : WM_TIMER);
     NewTimer->Msg.wParam = (WPARAM)nIDEvent;
     NewTimer->Msg.lParam = (LPARAM)lpTimerFunc;

reactos/subsys/win32k/ntuser
window.c 1.244.2.2 -> 1.244.2.3
diff -u -r1.244.2.2 -r1.244.2.3
--- window.c	18 Jul 2004 23:44:01 -0000	1.244.2.2
+++ window.c	31 Aug 2004 11:38:56 -0000	1.244.2.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: window.c,v 1.244.2.2 2004/07/18 23:44:01 weiden Exp $
+/* $Id: window.c,v 1.244.2.3 2004/08/31 11:38:56 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -767,6 +767,7 @@
   /* Lookup and reference the class object */
   if(!IntReferenceClassByNameOrAtom(&ClassObject, ClassName, hInstance))
   {
+    DbgPrint("Failed to reference class: 0x%x, %S\n", (ClassName ? ClassName->Buffer : NULL), (ClassName ? ClassName->Buffer : L"?!"));
     ObDereferenceObject(WinStaObject);
     return NULL;
   }
CVSspam 0.2.8