Commit in reactos/subsys/win32k on MAIN
include/msgqueue.h+9-41.31 -> 1.32
ntuser/focus.c+10-101.19 -> 1.20
      /message.c+47-61.56 -> 1.57
      /msgqueue.c+3-31.82 -> 1.83
+69-23
4 modified files
post focus messages to different threads

reactos/subsys/win32k/include
msgqueue.h 1.31 -> 1.32
diff -u -r1.31 -r1.32
--- msgqueue.h	7 Apr 2004 21:12:08 -0000	1.31
+++ msgqueue.h	13 Apr 2004 13:50:31 -0000	1.32
@@ -144,12 +144,17 @@
 MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
 VOID FASTCALL
 MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
-LRESULT STDCALL
+LRESULT FASTCALL
 IntSendMessage(HWND hWnd,
 		UINT Msg,
 		WPARAM wParam,
 		LPARAM lParam);
-LRESULT STDCALL
+LRESULT FASTCALL
+IntPostOrSendMessage(HWND hWnd,
+		     UINT Msg,
+		     WPARAM wParam,
+		     LPARAM lParam);
+LRESULT FASTCALL
 IntSendMessageTimeout(HWND hWnd,
                       UINT Msg,
                       WPARAM wParam,
@@ -162,9 +167,9 @@
 BOOL FASTCALL
 IntTranslateKbdMessage(LPMSG lpMsg, HKL dwhkl);
 
-VOID STDCALL
+VOID FASTCALL
 MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
-VOID STDCALL
+VOID FASTCALL
 MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
 VOID FASTCALL
 MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg);

reactos/subsys/win32k/ntuser
focus.c 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- focus.c	24 Feb 2004 13:27:03 -0000	1.19
+++ focus.c	13 Apr 2004 13:50:31 -0000	1.20
@@ -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: focus.c,v 1.19 2004/02/24 13:27:03 weiden Exp $
+ * $Id: focus.c,v 1.20 2004/04/13 13:50:31 weiden Exp $
  */
 
 #include <win32k/win32k.h>
@@ -58,8 +58,8 @@
 {
    if (hWndPrev)
    {
-      IntSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, 0);
-      IntSendMessage(hWndPrev, WM_ACTIVATE,
+      IntPostOrSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, 0);
+      IntPostOrSendMessage(hWndPrev, WM_ACTIVATE,
          MAKEWPARAM(WA_INACTIVE, NtUserGetWindowLong(hWndPrev, GWL_STYLE, FALSE) & WS_MINIMIZE),
          (LPARAM)hWnd);
    }
@@ -71,9 +71,9 @@
    if (hWnd)
    {
       /* Send palette messages */
-      if (IntSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
+      if (IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
       {
-         IntSendMessage(HWND_BROADCAST, WM_PALETTEISCHANGING,
+         IntPostOrSendMessage(HWND_BROADCAST, WM_PALETTEISCHANGING,
             (WPARAM)hWnd, 0);
       }
 
@@ -83,9 +83,9 @@
 
       /* FIXME: IntIsWindow */
 
-      IntSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == NtUserGetForegroundWindow()), 0);
+      IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == NtUserGetForegroundWindow()), 0);
       /* FIXME: WA_CLICKACTIVE */
-      IntSendMessage(hWnd, WM_ACTIVATE,
+      IntPostOrSendMessage(hWnd, WM_ACTIVATE,
          MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
                     NtUserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE),
          (LPARAM)hWndPrev);
@@ -97,7 +97,7 @@
 {
    if (hWndPrev)
    {
-      IntSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0);
+      IntPostOrSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0);
    }
 }
 
@@ -106,7 +106,7 @@
 {
    if (hWnd)
    {
-      IntSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0);
+      IntPostOrSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0);
    }
 }
 
@@ -411,7 +411,7 @@
       }
    }
    hWndPrev = ThreadQueue->CaptureWindow;
-   IntSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
+   IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
    IntLockMessageQueue(ThreadQueue);
    ThreadQueue->CaptureWindow = hWnd;
    IntUnLockMessageQueue(ThreadQueue);

reactos/subsys/win32k/ntuser
message.c 1.56 -> 1.57
diff -u -r1.56 -r1.57
--- message.c	7 Apr 2004 21:12:40 -0000	1.56
+++ message.c	13 Apr 2004 13:50:31 -0000	1.57
@@ -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.56 2004/04/07 21:12:40 gvg Exp $
+/* $Id: message.c,v 1.57 2004/04/13 13:50:31 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -373,7 +373,7 @@
   return Present;
 }
 
-static BOOL STDCALL
+static BOOL FASTCALL
 IntWaitMessage(HWND Wnd,
                 UINT MsgFilterMin,
                 UINT MsgFilterMax)
@@ -651,7 +651,7 @@
     }
 }
 
-static FASTCALL NTSTATUS
+static NTSTATUS FASTCALL
 PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
   NCCALCSIZE_PARAMS *UnpackedParams;
@@ -711,7 +711,7 @@
   return STATUS_INVALID_PARAMETER;
 }
 
-LRESULT STDCALL
+LRESULT FASTCALL
 IntSendMessage(HWND hWnd,
                UINT Msg,
                WPARAM wParam,
@@ -725,7 +725,7 @@
   return 0;
 }
 
-static LRESULT STDCALL
+static LRESULT FASTCALL
 IntSendMessageTimeoutSingle(HWND hWnd,
                             UINT Msg,
                             WPARAM wParam,
@@ -826,7 +826,7 @@
   return TRUE;
 }
 
-LRESULT STDCALL
+LRESULT FASTCALL
 IntSendMessageTimeout(HWND hWnd,
                       UINT Msg,
                       WPARAM wParam,
@@ -924,6 +924,47 @@
   return STATUS_SUCCESS;
 }
 
+/* This function posts a message if the destination's message queue belongs to
+   another thread, otherwise it sends the message. It does not support broadcast
+   messages! */
+LRESULT FASTCALL
+IntPostOrSendMessage(HWND hWnd,
+                     UINT Msg,
+                     WPARAM wParam,
+                     LPARAM lParam)
+{
+  LRESULT Result;
+  PWINDOW_OBJECT Window;
+  
+  if(hWnd == HWND_BROADCAST)
+  {
+    return 0;
+  }
+  
+  Window = IntGetWindowObject(hWnd);
+  if(!Window)
+  {
+    SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+    return 0;
+  }
+  
+  if(Window->MessageQueue != PsGetWin32Thread()->MessageQueue)
+  {
+    Result = NtUserPostMessage(hWnd, Msg, wParam, lParam);
+  }
+  else
+  {
+    if(!IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0, &Result))
+    {
+      Result = 0;
+    }
+  }
+  
+  IntReleaseWindowObject(Window);
+  
+  return Result;
+}
+
 static NTSTATUS FASTCALL
 CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
 {

reactos/subsys/win32k/ntuser
msgqueue.c 1.82 -> 1.83
diff -u -r1.82 -r1.83
--- msgqueue.c	9 Apr 2004 20:03:19 -0000	1.82
+++ msgqueue.c	13 Apr 2004 13:50:31 -0000	1.83
@@ -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.82 2004/04/09 20:03:19 navaraf Exp $
+/* $Id: msgqueue.c,v 1.83 2004/04/13 13:50:31 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -682,7 +682,7 @@
   return(FALSE);
 }
 
-VOID STDCALL
+VOID FASTCALL
 MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   PUSER_MESSAGE_QUEUE FocusMessageQueue;
@@ -722,7 +722,7 @@
   }
 }
 
-VOID STDCALL
+VOID FASTCALL
 MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
 {
   PWINDOW_OBJECT Window;
CVSspam 0.2.8