user32: Move more code out of call_window_proc.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-03-23 14:00:43 +01:00 committed by Alexandre Julliard
parent afddda2ce6
commit b8a805e2f2
2 changed files with 13 additions and 8 deletions

View File

@ -119,18 +119,12 @@ static WPARAM map_wparam_char_WtoA( WPARAM wParam, DWORD len )
/* call a 32-bit window procedure */
static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg )
{
DPI_AWARENESS_CONTEXT context;
WNDPROC proc = arg;
USER_CheckNotLock();
hwnd = WIN_GetFullHandle( hwnd );
TRACE_(relay)( "\1Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd ));
*result = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
SetThreadDpiAwarenessContext( context );
TRACE_(relay)( "\1Ret window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result );
@ -711,6 +705,10 @@ static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UIN
static void dispatch_win_proc_params( struct win_proc_params *params )
{
DPI_AWARENESS_CONTEXT context = SetThreadDpiAwarenessContext( params->dpi_awareness );
USER_CheckNotLock();
if (!params->ansi)
{
if (params->procW == WINPROC_PROC16)
@ -789,6 +787,8 @@ static void dispatch_win_proc_params( struct win_proc_params *params )
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
SetThreadDpiAwarenessContext( context );
}
@ -818,13 +818,14 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
params.is_dialog = wndPtr->dlgInfo != NULL;
WIN_ReleasePtr( wndPtr );
params.hwnd = hwnd;
params.hwnd = WIN_GetFullHandle( hwnd );
params.msg = msg;
params.wparam = wParam;
params.lparam = lParam;
params.result = result;
params.ansi = !unicode;
params.mapping = mapping;
params.dpi_awareness = GetWindowDpiAwarenessContext( params.hwnd );
if (!proc)
{
@ -855,7 +856,9 @@ static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HW
{
WINDOWPROC *proc;
info->hwnd = hwnd;
USER_CheckNotLock();
info->hwnd = WIN_GetFullHandle( hwnd );
info->msg = msg;
info->wparam = wparam;
info->lparam = lparam;
@ -863,6 +866,7 @@ static void init_win_proc_params( struct win_proc_params *info, WNDPROC func, HW
info->ansi = info->ansi_dst = ansi;
info->is_dialog = FALSE;
info->mapping = WMCHAR_MAP_CALLWINDOWPROC;
info->dpi_awareness = GetWindowDpiAwarenessContext( info->hwnd );
info->func = func;
if (!(proc = handle_to_proc( func )))

View File

@ -87,6 +87,7 @@ struct win_proc_params
BOOL ansi_dst;
BOOL is_dialog;
enum wm_char_mapping mapping;
DPI_AWARENESS_CONTEXT dpi_awareness;
WNDPROC procA;
WNDPROC procW;
};