From: Jacek Caban jacek@codeweavers.com
--- dlls/win32u/defwnd.c | 6 +++--- dlls/win32u/hook.c | 8 ++++---- dlls/win32u/input.c | 6 +++--- dlls/win32u/message.c | 24 ++++++++++++------------ dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 10 +++++----- 6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 3d3a40ac9e4..b9a74884c01 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -883,7 +883,7 @@ static void sys_command_size_move( HWND hwnd, WPARAM wparam ) NtUserReleaseDC( parent, hdc ); if (parent) map_window_points( 0, parent, (POINT *)&sizing_rect, 2, get_thread_dpi() );
- if (call_hooks( WH_CBT, HCBT_MOVESIZE, (WPARAM)hwnd, (LPARAM)&sizing_rect, TRUE )) + if (call_hooks( WH_CBT, HCBT_MOVESIZE, (WPARAM)hwnd, (LPARAM)&sizing_rect )) moved = FALSE;
send_message( hwnd, WM_EXITSIZEMOVE, 0, 0 ); @@ -950,7 +950,7 @@ static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
if (!is_window_enabled( hwnd )) return 0;
- if (call_hooks( WH_CBT, HCBT_SYSCOMMAND, wparam, lparam, TRUE )) + if (call_hooks( WH_CBT, HCBT_SYSCOMMAND, wparam, lparam )) return 0;
if (!user_driver->pSysCommand( hwnd, wparam, lparam )) @@ -2811,7 +2811,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, { HWND parent = get_parent( hwnd ); if (!parent) - call_hooks( WH_SHELL, HSHELL_APPCOMMAND, wparam, lparam, TRUE ); + call_hooks( WH_SHELL, HSHELL_APPCOMMAND, wparam, lparam ); else send_message( parent, msg, wparam, lparam ); break; diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 0f4ec338b77..95ce8ab7e9b 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -179,8 +179,8 @@ BOOL WINAPI NtUserCallMsgFilter( MSG *msg, INT code ) { /* FIXME: We should use NtCallbackReturn instead of passing (potentially kernel) pointer * like that, but we need to consequently use syscall thunks first for that to work. */ - if (call_hooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg, TRUE )) return TRUE; - return call_hooks( WH_MSGFILTER, code, 0, (LPARAM)msg, TRUE ); + if (call_hooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg )) return TRUE; + return call_hooks( WH_MSGFILTER, code, 0, (LPARAM)msg ); }
static UINT get_ll_hook_timeout(void) @@ -333,7 +333,7 @@ LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) return call_hook( &info ); }
-LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) +LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam ) { struct user_thread_info *thread_info = get_user_thread_info(); struct win_hook_params info; @@ -348,7 +348,7 @@ LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode }
memset( &info, 0, sizeof(info) - sizeof(info.module) ); - info.prev_unicode = unicode; + info.prev_unicode = TRUE; info.id = id;
SERVER_START_REQ( start_hook_chain ) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 1344ab997cd..ed0aa997894 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1611,7 +1611,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus ) /* call CBT hook chain */ cbt.fMouse = mouse; cbt.hWndActive = previous; - if (call_hooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hwnd, (LPARAM)&cbt, TRUE )) return FALSE; + if (call_hooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hwnd, (LPARAM)&cbt )) return FALSE;
if (is_window( previous )) { @@ -1763,7 +1763,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) }
/* call hooks */ - if (call_hooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)hwnd, (LPARAM)previous, TRUE )) return 0; + if (call_hooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)hwnd, (LPARAM)previous )) return 0;
/* activate hwndTop if needed. */ if (hwndTop != get_active_window()) @@ -1778,7 +1778,7 @@ HWND WINAPI NtUserSetFocus( HWND hwnd ) else /* NULL hwnd passed in */ { if (!previous) return 0; /* nothing to do */ - if (call_hooks( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)previous, TRUE )) return 0; + if (call_hooks( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)previous )) return 0; }
/* change focus and send messages */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 6af909b7ed5..a19b6bab230 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -1364,7 +1364,7 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar cwp.wParam = wparam; cwp.message = msg; cwp.hwnd = params->hwnd; - call_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp, unicode ); + call_hooks( WH_CALLWNDPROC, HC_ACTION, same_thread, (LPARAM)&cwp );
dispatch_win_proc_params( params, sizeof(*params) + size ); if (params != &p) free( params ); @@ -1375,7 +1375,7 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar cwpret.wParam = wparam; cwpret.message = msg; cwpret.hwnd = params->hwnd; - call_hooks( WH_CALLWNDPROCRET, HC_ACTION, same_thread, (LPARAM)&cwpret, unicode ); + call_hooks( WH_CALLWNDPROCRET, HC_ACTION, same_thread, (LPARAM)&cwpret ); return result; }
@@ -1482,7 +1482,7 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter, event.paramL = (msg->wParam & 0xFF) | (HIWORD(msg->lParam) << 8); event.paramH = msg->lParam & 0x7FFF; if (HIWORD(msg->lParam) & 0x0100) event.paramH |= 0x8000; /* special_key - bit */ - call_hooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event, TRUE ); + call_hooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event );
/* check message filters */ if (msg->message < first || msg->message > last) return FALSE; @@ -1515,10 +1515,10 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter, }
if (call_hooks( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE, - LOWORD(msg->wParam), msg->lParam, TRUE )) + LOWORD(msg->wParam), msg->lParam )) { /* skip this message */ - call_hooks( WH_CBT, HCBT_KEYSKIPPED, LOWORD(msg->wParam), msg->lParam, TRUE ); + call_hooks( WH_CBT, HCBT_KEYSKIPPED, LOWORD(msg->wParam), msg->lParam ); accept_hardware_message( hw_id ); return FALSE; } @@ -1590,7 +1590,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H event.hwnd = msg->hwnd; event.paramL = msg->pt.x; event.paramH = msg->pt.y; - call_hooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event, TRUE ); + call_hooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event );
if (!check_hwnd_filter( msg, hwnd_filter )) return FALSE;
@@ -1664,14 +1664,14 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H hook.wHitTestCode = hittest; hook.dwExtraInfo = extra_info; hook.mouseData = msg->wParam; - if (call_hooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, message, (LPARAM)&hook, TRUE )) + if (call_hooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, message, (LPARAM)&hook )) { hook.pt = msg->pt; hook.hwnd = msg->hwnd; hook.wHitTestCode = hittest; hook.dwExtraInfo = extra_info; hook.mouseData = msg->wParam; - call_hooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE ); + call_hooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook ); accept_hardware_message( hw_id ); return FALSE; } @@ -1922,7 +1922,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, hook.dwExtraInfo = msg_data->hardware.info; TRACE( "calling keyboard LL hook vk %x scan %x flags %x time %u info %lx\n", hook.vkCode, hook.scanCode, hook.flags, hook.time, hook.dwExtraInfo ); - result = call_hooks( WH_KEYBOARD_LL, HC_ACTION, info.msg.wParam, (LPARAM)&hook, TRUE ); + result = call_hooks( WH_KEYBOARD_LL, HC_ACTION, info.msg.wParam, (LPARAM)&hook ); } else if (info.msg.message == WH_MOUSE_LL && size >= sizeof(msg_data->hardware)) { @@ -1935,7 +1935,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, hook.dwExtraInfo = msg_data->hardware.info; TRACE( "calling mouse LL hook pos %d,%d data %x flags %x time %u info %lx\n", hook.pt.x, hook.pt.y, hook.mouseData, hook.flags, hook.time, hook.dwExtraInfo ); - result = call_hooks( WH_MOUSE_LL, HC_ACTION, info.msg.wParam, (LPARAM)&hook, TRUE ); + result = call_hooks( WH_MOUSE_LL, HC_ACTION, info.msg.wParam, (LPARAM)&hook ); } reply_message( &info, result, &info.msg ); continue; @@ -1965,7 +1965,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, thread_info->client_info.message_time = info.msg.time; thread_info->client_info.message_extra = msg_data->hardware.info; free( buffer ); - call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg, TRUE ); + call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg ); return 1; } continue; @@ -2018,7 +2018,7 @@ static int peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags, thread_info->client_info.message_extra = 0; thread_info->client_info.msg_source = msg_source_unavailable; free( buffer ); - call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg, TRUE ); + call_hooks( WH_GETMESSAGE, HC_ACTION, flags & PM_REMOVE, (LPARAM)msg ); return 1; }
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index a243afd668c..dcf8c901756 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -251,7 +251,7 @@ extern LRESULT handle_nc_hit_test( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
/* hook.c */ extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; -extern LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN; +extern LRESULT call_hooks( INT id, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; extern BOOL is_hooked( INT id ) DECLSPEC_HIDDEN; extern BOOL unhook_windows_hook( INT id, HOOKPROC proc ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 0eac0a6320b..b4a0256e1de 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -4040,7 +4040,7 @@ static UINT window_min_maximize( HWND hwnd, UINT cmd, RECT *rect ) wpl.length = sizeof(wpl); NtUserGetWindowPlacement( hwnd, &wpl );
- if (call_hooks( WH_CBT, HCBT_MINMAX, (WPARAM)hwnd, cmd, TRUE )) + if (call_hooks( WH_CBT, HCBT_MINMAX, (WPARAM)hwnd, cmd )) return SWP_NOSIZE | SWP_NOMOVE;
if (is_iconic( hwnd )) @@ -4752,7 +4752,7 @@ BOOL WINAPI NtUserDestroyWindow( HWND hwnd )
TRACE( "(%p)\n", hwnd );
- if (call_hooks( WH_CBT, HCBT_DESTROYWND, (WPARAM)hwnd, 0, TRUE )) return FALSE; + if (call_hooks( WH_CBT, HCBT_DESTROYWND, (WPARAM)hwnd, 0 )) return FALSE;
if (is_menu_active() == hwnd) NtUserEndMenu();
@@ -4765,7 +4765,7 @@ BOOL WINAPI NtUserDestroyWindow( HWND hwnd ) } else if (!get_window_relative( hwnd, GW_OWNER )) { - call_hooks( WH_SHELL, HSHELL_WINDOWDESTROYED, (WPARAM)hwnd, 0L, TRUE ); + call_hooks( WH_SHELL, HSHELL_WINDOWDESTROYED, (WPARAM)hwnd, 0 ); /* FIXME: clean up palette - see "Internals" p.352 */ }
@@ -5154,7 +5154,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, release_win_ptr( win ); cbtc.hwndInsertAfter = HWND_TOP; cbtc.lpcs = &cs; - if (call_hooks( WH_CBT, HCBT_CREATEWND, (WPARAM)hwnd, (LPARAM)&cbtc, TRUE )) + if (call_hooks( WH_CBT, HCBT_CREATEWND, (WPARAM)hwnd, (LPARAM)&cbtc )) { free_window_handle( hwnd ); return 0; @@ -5334,7 +5334,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name, /* Call WH_SHELL hook */
if (!(get_window_long( hwnd, GWL_STYLE ) & WS_CHILD) && !get_window_relative( hwnd, GW_OWNER )) - call_hooks( WH_SHELL, HSHELL_WINDOWCREATED, (WPARAM)hwnd, 0, TRUE ); + call_hooks( WH_SHELL, HSHELL_WINDOWCREATED, (WPARAM)hwnd, 0 );
TRACE( "created window %p\n", hwnd ); SetThreadDpiAwarenessContext( context );