Commit 84acfd91 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Return result from dispatch_win_proc_params.

parent b96f70a9
......@@ -586,11 +586,10 @@ static LRESULT dispatch_send_message( struct win_proc_params *params, WPARAM wpa
thread_info->recursion_count++;
params->result = &retval;
thread_info->msg_source = msg_source_unavailable;
SPY_EnterMessage( SPY_SENDMESSAGE, params->hwnd, params->msg, params->wparam, params->lparam );
dispatch_win_proc_params( params );
retval = dispatch_win_proc_params( params );
SPY_ExitMessage( SPY_RESULT_OK, params->hwnd, params->msg, retval, params->wparam, params->lparam );
thread_info->msg_source = prev_source;
......@@ -850,10 +849,9 @@ static LRESULT dispatch_message( const MSG *msg, BOOL ansi )
if (!NtUserMessageCall( msg->hwnd, msg->message, msg->wParam, msg->lParam,
&params, NtUserGetDispatchParams, ansi )) return 0;
params.result = &retval;
SPY_EnterMessage( SPY_DISPATCHMESSAGE, msg->hwnd, msg->message, msg->wParam, msg->lParam );
dispatch_win_proc_params( &params );
retval = dispatch_win_proc_params( &params );
SPY_ExitMessage( SPY_RESULT_OK, msg->hwnd, msg->message, retval, msg->wParam, msg->lParam );
return retval;
}
......
......@@ -72,7 +72,7 @@ extern LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UIN
extern INT_PTR WINPROC_CallDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
extern INT_PTR WINPROC_CallDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
extern void winproc_init(void) DECLSPEC_HIDDEN;
extern void dispatch_win_proc_params( struct win_proc_params *params ) DECLSPEC_HIDDEN;
extern LRESULT dispatch_win_proc_params( struct win_proc_params *params ) DECLSPEC_HIDDEN;
extern ATOM get_class_info( HINSTANCE instance, const WCHAR *name, WNDCLASSEXW *info,
UNICODE_STRING *name_str, BOOL ansi ) DECLSPEC_HIDDEN;
......
......@@ -712,36 +712,38 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN
}
void dispatch_win_proc_params( struct win_proc_params *params )
LRESULT dispatch_win_proc_params( struct win_proc_params *params )
{
DPI_AWARENESS_CONTEXT context = SetThreadDpiAwarenessContext( params->dpi_awareness );
LRESULT result = 0;
if (!params->ansi)
{
if (params->procW == WINPROC_PROC16)
WINPROC_CallProcWtoA( wow_handlers.call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
params->lparam, &result, params->func );
else if (!params->ansi_dst)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procW );
&result, params->procW );
else
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procA );
params->lparam, &result, params->procA );
}
else
{
if (params->procA == WINPROC_PROC16)
wow_handlers.call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
&result, params->func );
else if (!params->ansi_dst)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procW, params->mapping );
params->lparam, &result, params->procW, params->mapping );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procA );
&result, params->procA );
}
SetThreadDpiAwarenessContext( context );
return result;
}
/* make sure that there is space for 'size' bytes in buffer, growing it if needed */
......@@ -1201,7 +1203,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
&params->lparam, &buffer, size ))
return 0;
dispatch_win_proc_params( params );
result = dispatch_win_proc_params( params );
NtUserMessageCall( params->hwnd, params->msg, params->wparam, params->lparam,
(void *)result, NtUserWinProcResult, FALSE );
......@@ -1210,7 +1212,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
}
else
{
dispatch_win_proc_params( params );
result = dispatch_win_proc_params( params );
if (result_ptr)
{
*result_ptr = result;
......@@ -1254,14 +1256,11 @@ BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params,
LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
struct win_proc_params params;
LRESULT result;
params.func = func;
params.result = &result;
if (!NtUserMessageCall( hwnd, msg, wParam, lParam, &params, NtUserCallWindowProc, TRUE ))
return 0;
dispatch_win_proc_params( &params );
return result;
return dispatch_win_proc_params( &params );
}
......@@ -1273,14 +1272,11 @@ LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam
LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
struct win_proc_params params;
LRESULT result;
params.func = func;
params.result = &result;
if (!NtUserMessageCall( hwnd, msg, wParam, lParam, &params, NtUserCallWindowProc, FALSE ))
return 0;
dispatch_win_proc_params( &params );
return result;
return dispatch_win_proc_params( &params );
}
......
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