Commit afddda2c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Use dispatch_win_proc_params in CallWindowProc.

parent a821155f
...@@ -850,6 +850,37 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, ...@@ -850,6 +850,37 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
} }
static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HWND hwnd, UINT msg,
WPARAM wparam, LPARAM lparam, LRESULT *result, BOOL ansi )
{
WINDOWPROC *proc;
info->hwnd = hwnd;
info->msg = msg;
info->wparam = wparam;
info->lparam = lparam;
info->result = result;
info->ansi = info->ansi_dst = ansi;
info->is_dialog = FALSE;
info->mapping = WMCHAR_MAP_CALLWINDOWPROC;
info->func = func;
if (!(proc = handle_to_proc( func )))
{
info->procW = info->procA = NULL;
}
else if (proc == WINPROC_PROC16)
{
info->procW = info->procA = WINPROC_PROC16;
}
else
{
info->procA = proc->procA;
info->procW = proc->procW;
}
}
/********************************************************************** /**********************************************************************
* CallWindowProcA (USER32.@) * CallWindowProcA (USER32.@)
* *
...@@ -874,27 +905,14 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, ...@@ -874,27 +905,14 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
* *
* ECMA-234, Win32 * ECMA-234, Win32
*/ */
LRESULT WINAPI CallWindowProcA( LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
WNDPROC func, /* [in] window procedure */ {
HWND hwnd, /* [in] target window */ struct win_proc_params params;
UINT msg, /* [in] message */
WPARAM wParam, /* [in] message dependent parameter */
LPARAM lParam /* [in] message dependent parameter */
) {
WINDOWPROC *proc;
LRESULT result; LRESULT result;
if (!func) return 0; if (!func) return 0;
init_win_proc_params( &params, func, hwnd, msg, wParam, lParam, &result, TRUE );
if (!(proc = handle_to_proc( func ))) dispatch_win_proc_params( &params );
call_window_proc( hwnd, msg, wParam, lParam, &result, func );
else if (proc == WINPROC_PROC16)
wow_handlers.call_window_proc( hwnd, msg, wParam, lParam, &result, func );
else if (proc->procA)
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procA );
else
WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, &result,
proc->procW, WMCHAR_MAP_CALLWINDOWPROC );
return result; return result;
} }
...@@ -904,22 +922,14 @@ LRESULT WINAPI CallWindowProcA( ...@@ -904,22 +922,14 @@ LRESULT WINAPI CallWindowProcA(
* *
* See CallWindowProcA. * See CallWindowProcA.
*/ */
LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
WPARAM wParam, LPARAM lParam )
{ {
WINDOWPROC *proc; struct win_proc_params params;
LRESULT result; LRESULT result;
if (!func) return 0; if (!func) return 0;
init_win_proc_params( &params, func, hwnd, msg, wParam, lParam, &result, FALSE );
if (!(proc = handle_to_proc( func ))) dispatch_win_proc_params( &params );
call_window_proc( hwnd, msg, wParam, lParam, &result, func );
else if (proc == WINPROC_PROC16)
WINPROC_CallProcWtoA( wow_handlers.call_window_proc, hwnd, msg, wParam, lParam, &result, func );
else if (proc->procW)
call_window_proc( hwnd, msg, wParam, lParam, &result, proc->procW );
else
WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, &result, proc->procA );
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment