From eda60796817fcda152d9988966ef2b91cb7dd012 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 8 Mar 2011 14:50:18 +0100 Subject: [PATCH] user.exe: Call the 16-bit hook directly in SendMessage16. --- dlls/user.exe16/hook.c | 17 +++++++++++++++++ dlls/user.exe16/message.c | 15 +-------------- dlls/user.exe16/user_private.h | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/dlls/user.exe16/hook.c b/dlls/user.exe16/hook.c index 640899eca50..105254e8b77 100644 --- a/dlls/user.exe16/hook.c +++ b/dlls/user.exe16/hook.c @@ -186,6 +186,23 @@ static LRESULT wndproc_hook_callback16( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LP return ret; } +/* helper for SendMessage16 */ +void call_WH_CALLWNDPROC_hook( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARAM lp ) +{ + CWPSTRUCT16 cwp; + struct hook16_queue_info *info = get_hook_info( FALSE ); + + if (!info->proc[WH_CALLWNDPROC - WH_MINHOOK]) return; + + cwp.hwnd = hwnd; + cwp.message = msg; + cwp.wParam = wp; + cwp.lParam = lp; + + lp = MapLS( &cwp ); + call_hook_16( WH_CALLWNDPROC, HC_ACTION, 1, lp ); + UnMapLS( lp ); +} /*********************************************************************** * call_WH_MSGFILTER diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c index b10b7619c6e..bc81d455196 100644 --- a/dlls/user.exe16/message.c +++ b/dlls/user.exe16/message.c @@ -39,19 +39,6 @@ DWORD USER16_AlertableWait = 0; struct wow_handlers32 wow_handlers32; -static LRESULT cwp_hook_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, - LRESULT *result, void *arg ) -{ - CWPSTRUCT cwp; - - cwp.hwnd = hwnd; - cwp.message = msg; - cwp.wParam = wp; - cwp.lParam = lp; - *result = 0; - return HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp, FALSE ); -} - static LRESULT send_message_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg ) { @@ -1498,7 +1485,7 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM WNDPROC16 winproc; /* first the WH_CALLWNDPROC hook */ - WINPROC_CallProc16To32A( cwp_hook_callback, hwnd16, msg, wparam, lparam, &result, NULL ); + call_WH_CALLWNDPROC_hook( hwnd16, msg, wparam, lparam ); if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWLP_WNDPROC ))) return 0; diff --git a/dlls/user.exe16/user_private.h b/dlls/user.exe16/user_private.h index d202bfe6e38..7c91afb2ce0 100644 --- a/dlls/user.exe16/user_private.h +++ b/dlls/user.exe16/user_private.h @@ -93,7 +93,7 @@ extern LRESULT WINPROC_CallProc16To32A( winproc_callback_t callback, HWND16 hwnd extern LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result, void *arg ) DECLSPEC_HIDDEN; -extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN; +extern void call_WH_CALLWNDPROC_hook( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPARAM lp ) DECLSPEC_HIDDEN; #define GET_WORD(ptr) (*(const WORD *)(ptr)) #define GET_DWORD(ptr) (*(const DWORD *)(ptr))