From 23499a2d4d133f5f006d8c190945f2db98b6e259 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Fri, 24 Dec 2010 12:11:10 +0000 Subject: [PATCH] [win32k] - Remove co_IntPostOrSendMessage and use co_IntSendMessageNoWait where possible svn path=/trunk/; revision=50121 --- .../win32/win32k/include/msgqueue.h | 5 --- .../subsystems/win32/win32k/ntuser/desktop.c | 6 +-- .../subsystems/win32/win32k/ntuser/focus.c | 8 ++-- .../subsystems/win32/win32k/ntuser/message.c | 41 ------------------- 4 files changed, 5 insertions(+), 55 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/msgqueue.h b/reactos/subsystems/win32/win32k/include/msgqueue.h index 7c84ed0d4ae..f153314c421 100644 --- a/reactos/subsystems/win32/win32k/include/msgqueue.h +++ b/reactos/subsystems/win32/win32k/include/msgqueue.h @@ -180,11 +180,6 @@ co_IntSendMessage(HWND hWnd, WPARAM wParam, LPARAM lParam); LRESULT FASTCALL -co_IntPostOrSendMessage(HWND hWnd, - UINT Msg, - WPARAM wParam, - LPARAM lParam); -LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index b4a4e20fb39..336f48d28ae 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -740,11 +740,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam) for (; *cursor; cursor++) { - DPRINT("Sending notify\n"); - co_IntPostOrSendMessage(*cursor, - MsgType, - Message, - lParam); + co_IntSendMessageNoWait(*cursor, MsgType, Message, lParam); } ExFreePool(HwndList); diff --git a/reactos/subsystems/win32/win32k/ntuser/focus.c b/reactos/subsystems/win32/win32k/ntuser/focus.c index 414b1523bf7..21d4f73d6a8 100644 --- a/reactos/subsystems/win32/win32k/ntuser/focus.c +++ b/reactos/subsystems/win32/win32k/ntuser/focus.c @@ -77,7 +77,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) if (WindowPrev) UserRefObjectCo(WindowPrev, &RefPrev); /* Send palette messages */ - if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) + if (co_IntSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) { UserPostMessage( HWND_BROADCAST, WM_PALETTEISCHANGING, @@ -166,7 +166,7 @@ co_IntSendKillFocusMessages(HWND hWndPrev, HWND hWnd) if (hWndPrev) { IntNotifyWinEvent(EVENT_OBJECT_FOCUS, NULL, OBJID_CLIENT, CHILDID_SELF, 0); - co_IntPostOrSendMessage(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0); + co_IntSendMessageNoWait(hWndPrev, WM_KILLFOCUS, (WPARAM)hWnd, 0); } } @@ -177,7 +177,7 @@ co_IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd) { PWND pWnd = UserGetWindowObject(hWnd); IntNotifyWinEvent(EVENT_OBJECT_FOCUS, pWnd, OBJID_CLIENT, CHILDID_SELF, 0); - co_IntPostOrSendMessage(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0); + co_IntSendMessageNoWait(hWnd, WM_SETFOCUS, (WPARAM)hWndPrev, 0); } } @@ -579,7 +579,7 @@ NtUserSetCapture(HWND hWnd) if (Window) IntNotifyWinEvent(EVENT_SYSTEM_CAPTURESTART, Window, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI); - co_IntPostOrSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); + co_IntSendMessageNoWait(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd); ThreadQueue->CaptureWindow = hWnd; RETURN( hWndPrev); diff --git a/reactos/subsystems/win32/win32k/ntuser/message.c b/reactos/subsystems/win32/win32k/ntuser/message.c index 1de7a949d54..8f8eec23cd3 100644 --- a/reactos/subsystems/win32/win32k/ntuser/message.c +++ b/reactos/subsystems/win32/win32k/ntuser/message.c @@ -1404,47 +1404,6 @@ CLEANUP: END_CLEANUP; } -/* 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 -co_IntPostOrSendMessage( HWND hWnd, - UINT Msg, - WPARAM wParam, - LPARAM lParam ) -{ - ULONG_PTR Result; - PTHREADINFO pti; - PWND Window; - - if ( hWnd == HWND_BROADCAST ) - { - return 0; - } - - if(!(Window = UserGetWindowObject(hWnd))) - { - return 0; - } - - pti = PsGetCurrentThreadWin32Thread(); - - if ( Window->head.pti->MessageQueue != pti->MessageQueue && - FindMsgMemory(Msg) == 0 ) - { - Result = UserPostMessage(hWnd, Msg, wParam, lParam); - } - else - { - if ( !co_IntSendMessageTimeoutSingle(hWnd, Msg, wParam, lParam, SMTO_NORMAL, 0, &Result) ) - { - Result = 0; - } - } - - return (LRESULT)Result; -} - LRESULT FASTCALL co_IntDoSendMessage( HWND hWnd, UINT Msg,