Commit 439cdf49 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move more logic from dispatch_win_proc_params.

parent 9b38ff96
......@@ -719,78 +719,24 @@ void dispatch_win_proc_params( struct win_proc_params *params )
if (params->procW == WINPROC_PROC16)
WINPROC_CallProcWtoA( wow_handlers.call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
else if (params->is_dialog)
{
if (!params->ansi_dst)
{
if (params->procW)
else if (!params->ansi_dst)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procW );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
else
{
if (params->procA)
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procA );
else
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
}
}
else if (params->procW)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procW );
else if (params->procA)
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procA );
else if (!params->ansi_dst)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
else
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
}
else
{
if (params->procA == WINPROC_PROC16)
wow_handlers.call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
else if (params->is_dialog)
{
if (!params->ansi_dst)
{
if (params->procW)
else if (!params->ansi_dst)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procW, params->mapping );
else
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func, params->mapping );
}
else
{
if (params->procA)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procA );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
}
else if (params->procA)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procA );
else if (params->procW)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procW, params->mapping );
else if (!params->ansi_dst)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func, params->mapping );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
SetThreadDpiAwarenessContext( context );
......
......@@ -201,7 +201,7 @@ BOOL is_winproc_unicode( WNDPROC proc, BOOL def_val )
return ptr->procW != NULL;
}
void get_winproc_params( struct win_proc_params *params )
void get_winproc_params( struct win_proc_params *params, BOOL fixup_ansi_dst )
{
WINDOWPROC *proc = get_winproc_ptr( params->func );
......@@ -217,7 +217,24 @@ void get_winproc_params( struct win_proc_params *params )
{
params->procA = proc->procA;
params->procW = proc->procW;
if (fixup_ansi_dst)
{
if (params->ansi)
{
if (params->procA) params->ansi_dst = TRUE;
else if (params->procW) params->ansi_dst = FALSE;
}
else
{
if (params->procW) params->ansi_dst = FALSE;
else if (params->procA) params->ansi_dst = TRUE;
}
}
}
if (!params->procA) params->procA = params->func;
if (!params->procW) params->procW = params->func;
}
DLGPROC get_dialog_proc( HWND hwnd, enum dialog_proc_type type )
......
......@@ -202,11 +202,10 @@ static BOOL init_win_proc_params( struct win_proc_params *params, HWND hwnd, UIN
params->wparam = wparam;
params->lparam = lparam;
params->ansi = params->ansi_dst = ansi;
params->is_dialog = FALSE;
params->needs_unpack = FALSE;
params->mapping = WMCHAR_MAP_CALLWINDOWPROC;
params->dpi_awareness = get_window_dpi_awareness_context( params->hwnd );
get_winproc_params( params );
get_winproc_params( params, TRUE );
return TRUE;
}
......@@ -214,6 +213,7 @@ static BOOL init_window_call_params( struct win_proc_params *params, HWND hwnd,
LPARAM lParam, LRESULT *result, BOOL ansi,
enum wm_char_mapping mapping )
{
BOOL is_dialog;
WND *win;
user_check_not_lock();
......@@ -227,11 +227,10 @@ static BOOL init_window_call_params( struct win_proc_params *params, HWND hwnd,
}
params->func = win->winproc;
params->ansi_dst = !(win->flags & WIN_ISUNICODE);
params->is_dialog = win->dlgInfo != NULL;
is_dialog = win->dlgInfo != NULL;
release_win_ptr( win );
params->hwnd = get_full_window_handle( hwnd );
get_winproc_params( params );
params->msg = msg;
params->wparam = wParam;
params->lparam = lParam;
......@@ -240,6 +239,7 @@ static BOOL init_window_call_params( struct win_proc_params *params, HWND hwnd,
params->needs_unpack = FALSE;
params->mapping = mapping;
params->dpi_awareness = get_window_dpi_awareness_context( params->hwnd );
get_winproc_params( params, !is_dialog );
return TRUE;
}
......
......@@ -235,7 +235,7 @@ WORD get_class_word( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
DLGPROC get_dialog_proc( HWND hwnd, enum dialog_proc_type type ) DECLSPEC_HIDDEN;
ATOM get_int_atom_value( UNICODE_STRING *name ) DECLSPEC_HIDDEN;
WNDPROC get_winproc( WNDPROC proc, BOOL ansi ) DECLSPEC_HIDDEN;
void get_winproc_params( struct win_proc_params *params ) DECLSPEC_HIDDEN;
void get_winproc_params( struct win_proc_params *params, BOOL fixup_ansi_dst ) DECLSPEC_HIDDEN;
struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
BOOL needs_ime_window( HWND hwnd ) DECLSPEC_HIDDEN;
......
......@@ -146,7 +146,6 @@ struct win_proc_params
LRESULT *result;
BOOL ansi;
BOOL ansi_dst;
BOOL is_dialog;
BOOL needs_unpack;
enum wm_char_mapping mapping;
DPI_AWARENESS_CONTEXT dpi_awareness;
......
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