Alexandre Julliard : user.exe: Call the 16-bit hook directly in SendMessage16.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 11:03:51 CST 2011


Module: wine
Branch: master
Commit: eda60796817fcda152d9988966ef2b91cb7dd012
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eda60796817fcda152d9988966ef2b91cb7dd012

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar  8 14:50:18 2011 +0100

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 640899e..105254e 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 b10b761..bc81d45 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 d202bfe..7c91afb 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))




More information about the wine-cvs mailing list