winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2022
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1495 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Move call_hooks implementation from user32.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: d9f21fcca5376f47b842f3d061674898eb0db310 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d9f21fcca5376f47b842f3d0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 16:02:46 2022 +0100 win32u: Move call_hooks implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/hook.c | 155 ++----------------------------------------- dlls/win32u/hook.c | 51 ++++++++++++++ dlls/win32u/sysparams.c | 5 ++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 1 + 5 files changed, 65 insertions(+), 148 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index 41307270880..783ded6c12a 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -124,17 +124,6 @@ static const char * const hook_names[WH_WINEVENT - WH_MINHOOK + 1] = }; -/*********************************************************************** - * get_ll_hook_timeout - * - */ -static UINT get_ll_hook_timeout(void) -{ - /* FIXME: should retrieve LowLevelHooksTimeout in HKEY_CURRENT_USER\Control Panel\Desktop */ - return 2000; -} - - /*********************************************************************** * set_windows_hook * @@ -334,149 +323,19 @@ void *get_hook_proc( void *proc, const WCHAR *module, HMODULE *free_module ) return (char *)mod + (ULONG_PTR)proc; } -/*********************************************************************** - * call_hook - * - * Call hook either in current thread or send message to the destination - * thread. - */ -static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARAM lparam ) -{ - DWORD_PTR ret = 0; - - if (info->tid) - { - struct hook_extra_info h_extra; - h_extra.handle = info->handle; - h_extra.lparam = lparam; - - TRACE( "calling hook in thread %04x %s code %x wp %lx lp %lx\n", - info->tid, hook_names[info->id-WH_MINHOOK], code, wparam, lparam ); - - switch(info->id) - { - case WH_KEYBOARD_LL: - MSG_SendInternalMessageTimeout( info->pid, info->tid, WM_WINE_KEYBOARD_LL_HOOK, - wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, - get_ll_hook_timeout(), &ret ); - break; - case WH_MOUSE_LL: - MSG_SendInternalMessageTimeout( info->pid, info->tid, WM_WINE_MOUSE_LL_HOOK, - wparam, (LPARAM)&h_extra, SMTO_ABORTIFHUNG, - get_ll_hook_timeout(), &ret ); - break; - default: - ERR("Unknown hook id %d\n", info->id); - assert(0); - break; - } - } - else if (info->proc) - { - struct user_thread_info *thread_info = get_user_thread_info(); - HMODULE free_module = 0; - - /* - * Windows protects from stack overflow in recursive hook calls. Different Windows - * allow different depths. - */ - if (thread_info->hook_call_depth >= 25) - { - WARN("Too many hooks called recursively, skipping call.\n"); - return 0; - } - - TRACE( "calling hook %p %s code %x wp %lx lp %lx module %s\n", - info->proc, hook_names[info->id-WH_MINHOOK], code, wparam, - lparam, debugstr_w(info->module) ); - - if (!info->module[0] || - (info->proc = get_hook_proc( info->proc, info->module, &free_module )) != NULL) - { - HHOOK prev = thread_info->hook; - BOOL prev_unicode = thread_info->hook_unicode; - - thread_info->hook = info->handle; - thread_info->hook_unicode = info->next_unicode; - thread_info->hook_call_depth++; - ret = call_hook_proc( info->proc, info->id, code, wparam, lparam, - info->prev_unicode, info->next_unicode ); - thread_info->hook = prev; - thread_info->hook_unicode = prev_unicode; - thread_info->hook_call_depth--; - - if (free_module) FreeLibrary(free_module); - } - } - - if (info->id == WH_KEYBOARD_LL || info->id == WH_MOUSE_LL) - NtUserCallOneParam( 1, NtUserIncrementKeyStateCounter ); /* force refreshing the key state cache */ - - return ret; -} - - -/*********************************************************************** - * HOOK_IsHooked - */ -static BOOL HOOK_IsHooked( INT id ) -{ - struct user_thread_info *thread_info = get_user_thread_info(); - - if (!thread_info->active_hooks) return TRUE; - return (thread_info->active_hooks & (1 << (id - WH_MINHOOK))) != 0; -} - /*********************************************************************** * HOOK_CallHooks */ LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) { - struct user_thread_info *thread_info = get_user_thread_info(); - struct hook_info info; - DWORD_PTR ret; - - USER_CheckNotLock(); - - if (!HOOK_IsHooked( id )) - { - TRACE( "skipping hook %s mask %x\n", hook_names[id-WH_MINHOOK], thread_info->active_hooks ); - return 0; - } - - ZeroMemory( &info, sizeof(info) - sizeof(info.module) ); - info.prev_unicode = unicode; - info.id = id; - - SERVER_START_REQ( start_hook_chain ) - { - req->id = info.id; - req->event = EVENT_MIN; - wine_server_set_reply( req, info.module, sizeof(info.module)-sizeof(WCHAR) ); - if (!wine_server_call( req )) - { - info.module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0; - info.handle = wine_server_ptr_handle( reply->handle ); - info.pid = reply->pid; - info.tid = reply->tid; - info.proc = wine_server_get_ptr( reply->proc ); - info.next_unicode = reply->unicode; - thread_info->active_hooks = reply->active_hooks; - } - } - SERVER_END_REQ; - - if (!info.tid && !info.proc) return 0; - ret = call_hook( &info, code, wparam, lparam ); - - SERVER_START_REQ( finish_hook_chain ) - { - req->id = id; - wine_server_call( req ); - } - SERVER_END_REQ; - return ret; + struct win_hook_params params; + params.id = id; + params.code = code; + params.wparam = wparam; + params.lparam = lparam; + params.next_unicode = unicode; + return NtUserCallOneParam( (UINT_PTR)¶ms, NtUserCallHooks ); } diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 26f84cf654d..e1851aa896a 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -324,6 +324,57 @@ 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 ) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + struct win_hook_params info; + DWORD_PTR ret; + + user_check_not_lock(); + + if (!is_hooked( id )) + { + TRACE( "skipping hook %s mask %x\n", hook_names[id-WH_MINHOOK], thread_info->active_hooks ); + return 0; + } + + memset( &info, 0, sizeof(info) - sizeof(info.module) ); + info.prev_unicode = unicode; + info.id = id; + + SERVER_START_REQ( start_hook_chain ) + { + req->id = info.id; + req->event = EVENT_MIN; + wine_server_set_reply( req, info.module, sizeof(info.module)-sizeof(WCHAR) ); + if (!wine_server_call( req )) + { + info.module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0; + info.handle = wine_server_ptr_handle( reply->handle ); + info.pid = reply->pid; + info.tid = reply->tid; + info.proc = wine_server_get_ptr( reply->proc ); + info.next_unicode = reply->unicode; + thread_info->active_hooks = reply->active_hooks; + } + } + SERVER_END_REQ; + if (!info.tid && !info.proc) return 0; + + info.code = code; + info.wparam = wparam; + info.lparam = lparam; + ret = call_hook( &info ); + + SERVER_START_REQ( finish_hook_chain ) + { + req->id = id; + wine_server_call( req ); + } + SERVER_END_REQ; + return ret; +} + /*********************************************************************** * NtUserSetWinEventHook (win32u.@) */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index df35262d520..b5d82748c71 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4579,6 +4579,11 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserMessageBeep: return message_beep( arg ); /* temporary exports */ + case NtUserCallHooks: + { + const struct win_hook_params *params = (struct win_hook_params *)arg; + call_hooks( params->id, params->code, params->wparam, params->lparam, params->next_unicode ); + } case NtUserFlushWindowSurfaces: flush_window_surfaces( arg ); return 0; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 6d72ab5286f..1447469c19d 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -255,6 +255,7 @@ extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) 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 BOOL unhook_windows_hook( INT id, HOOKPROC proc ) DECLSPEC_HIDDEN; /* input.c */ diff --git a/include/ntuser.h b/include/ntuser.h index cbb4311fed1..9eb311b3e52 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -107,6 +107,7 @@ enum NtUserMessageBeep, NtUserRealizePalette, /* temporary exports */ + NtUserCallHooks, NtUserFlushWindowSurfaces, NtUserGetDeskPattern, NtUserHandleInternalMessage,
1
0
0
0
Jacek Caban : win32u: Move NtUserCallNextHookEx implementation from user32.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: 088033cfb655123fb0daef2c0347e38c26801a19 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=088033cfb655123fb0daef2c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 16:02:27 2022 +0100 win32u: Move NtUserCallNextHookEx implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/hook.c | 34 ---------------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/gdiobj.c | 1 + dlls/win32u/hook.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 1 + 8 files changed, 47 insertions(+), 36 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index d5c357dc216..41307270880 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -524,40 +524,6 @@ BOOL WINAPI UnhookWindowsHook( INT id, HOOKPROC proc ) } -/*********************************************************************** - * CallNextHookEx (USER32.@) - */ -LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) -{ - struct user_thread_info *thread_info = get_user_thread_info(); - struct hook_info info; - - ZeroMemory( &info, sizeof(info) - sizeof(info.module) ); - - SERVER_START_REQ( get_hook_info ) - { - req->handle = wine_server_user_handle( thread_info->hook ); - req->get_next = 1; - req->event = EVENT_MIN; - wine_server_set_reply( req, info.module, sizeof(info.module)-sizeof(WCHAR) ); - if (!wine_server_call_err( req )) - { - info.module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0; - info.handle = wine_server_ptr_handle( reply->handle ); - info.id = reply->id; - info.pid = reply->pid; - info.tid = reply->tid; - info.proc = wine_server_get_ptr( reply->proc ); - info.next_unicode = reply->unicode; - } - } - SERVER_END_REQ; - - info.prev_unicode = thread_info->hook_unicode; - return call_hook( &info, code, wparam, lparam ); -} - - /*********************************************************************** * CallMsgFilterA (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index a2976c5653a..fc2a7b1d50f 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -28,7 +28,7 @@ @ stdcall CallMsgFilter(ptr long) CallMsgFilterA @ stdcall CallMsgFilterA(ptr long) @ stdcall CallMsgFilterW(ptr long) -@ stdcall CallNextHookEx(long long long long) +@ stdcall CallNextHookEx(long long long long) NtUserCallNextHookEx @ stdcall CallWindowProcA(ptr long long long long) @ stdcall CallWindowProcW(ptr long long long long) @ stdcall CascadeChildWindows(long long) diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 1d54865bf46..4075c202eaf 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1150,6 +1150,7 @@ static struct unix_funcs unix_funcs = NtGdiUpdateColors, NtGdiWidenPath, NtUserActivateKeyboardLayout, + NtUserCallNextHookEx, NtUserCallNoParam, NtUserCallOneParam, NtUserCallTwoParam, diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 6c17e1d8eac..26f84cf654d 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -256,6 +256,42 @@ static LRESULT call_hook( struct win_hook_params *info ) return ret; } +/*********************************************************************** + * NtUserCallNextHookEx (win32u.@) + */ +LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + struct win_hook_params info; + + memset( &info, 0, sizeof(info) - sizeof(info.module) ); + + SERVER_START_REQ( get_hook_info ) + { + req->handle = wine_server_user_handle( thread_info->hook ); + req->get_next = 1; + req->event = EVENT_MIN; + wine_server_set_reply( req, info.module, sizeof(info.module)-sizeof(WCHAR) ); + if (!wine_server_call_err( req )) + { + info.module[wine_server_reply_size(req) / sizeof(WCHAR)] = 0; + info.handle = wine_server_ptr_handle( reply->handle ); + info.id = reply->id; + info.pid = reply->pid; + info.tid = reply->tid; + info.proc = wine_server_get_ptr( reply->proc ); + info.next_unicode = reply->unicode; + } + } + SERVER_END_REQ; + + info.code = code; + info.wparam = wparam; + info.lparam = lparam; + info.prev_unicode = thread_info->hook_unicode; + return call_hook( &info ); +} + LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) { struct win_hook_params info; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 08de34b6f61..1c220163d50 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -777,7 +777,7 @@ @ stub NtUserCallHwndParamLockSafe @ stub NtUserCallHwndSafe @ stub NtUserCallMsgFilter -@ stub NtUserCallNextHookEx +@ stdcall NtUserCallNextHookEx(long long long long) @ stdcall NtUserCallNoParam(long) @ stdcall NtUserCallOneParam(long long) @ stdcall NtUserCallTwoParam(long long long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 54b8c11f318..6d72ab5286f 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -183,6 +183,7 @@ struct unix_funcs BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc ); BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc ); HKL (WINAPI *pNtUserActivateKeyboardLayout)( HKL layout, UINT flags ); + LRESULT (WINAPI *pNtUserCallNextHookEx)( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ); ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code ); ULONG_PTR (WINAPI *pNtUserCallOneParam)( ULONG_PTR arg, ULONG code ); ULONG_PTR (WINAPI *pNtUserCallTwoParam)( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index ca69422f086..9ea7ed0c09b 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -701,6 +701,12 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ) return unix_funcs->pNtUserActivateKeyboardLayout( layout, flags ); } +LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) +{ + if (!unix_funcs) return 0; + return unix_funcs->pNtUserCallNextHookEx( hhook, code, wparam, lparam ); +} + ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) { if (!unix_funcs) return 0; diff --git a/include/ntuser.h b/include/ntuser.h index 5ea1b40eae7..cbb4311fed1 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -191,6 +191,7 @@ BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd ); BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ); NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4, ULONG thread_id, ULONG count, HWND *buffer, ULONG *size ); +LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ); ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ); ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ); ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code );
1
0
0
0
Jacek Caban : win32u: Move call_current_hook implementation from user32.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: 0c6d042cc3b1b2cbfb702bb3d199cc7a83e6cbd2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c6d042cc3b1b2cbfb702bb3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 16:02:12 2022 +0100 win32u: Move call_current_hook implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/hook.c | 46 ++++++---------- dlls/user32/message.c | 13 ++--- dlls/user32/user_main.c | 2 + dlls/user32/user_private.h | 16 ++---- dlls/win32u/hook.c | 121 ++++++++++++++++++++++++++++++++++++++++++- dlls/win32u/message.c | 8 +++ dlls/win32u/ntuser_private.h | 7 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 19 ++++++- 9 files changed, 179 insertions(+), 54 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0c6d042cc3b1b2cbfb70…
1
0
0
0
Jacek Caban : win32u: Partially move handle_internal_message from user32.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: fcc1581938aa84aff86357ba3154775353ff8c9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fcc1581938aa84aff86357ba…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Feb 25 16:01:15 2022 +0100 win32u: Partially move handle_internal_message from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 21 ++------------------- dlls/user32/message.c | 22 +++++++++------------- dlls/win32u/driver.c | 1 + dlls/win32u/message.c | 28 ++++++++++++++++++++++++++++ dlls/win32u/ntuser_private.h | 3 +++ dlls/win32u/sysparams.c | 5 +++++ include/ntuser.h | 1 + 7 files changed, 49 insertions(+), 32 deletions(-) diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index d7609ba7faf..37e896210d1 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -124,11 +124,6 @@ static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y ) return TRUE; } -static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip ) -{ - return TRUE; -} - static void CDECL nulldrv_UpdateClipboard(void) { } @@ -230,11 +225,6 @@ static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWIN return TRUE; } -static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) -{ - return 0; -} - static BOOL CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, RECT *visible_rect, struct window_surface **surface ) @@ -262,11 +252,6 @@ static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y ) return load_driver()->pSetCursorPos( x, y ); } -static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip ) -{ - return load_driver()->pClipCursor( clip ); -} - static void CDECL loaderdrv_UpdateClipboard(void) { load_driver()->pUpdateClipboard(); @@ -327,7 +312,7 @@ static struct user_driver_funcs lazy_load_driver = NULL, NULL, loaderdrv_SetCursorPos, - loaderdrv_ClipCursor, + NULL, /* clipboard functions */ loaderdrv_UpdateClipboard, /* display modes */ @@ -354,7 +339,7 @@ static struct user_driver_funcs lazy_load_driver = nulldrv_ShowWindow, nulldrv_SysCommand, loaderdrv_UpdateLayeredWindow, - nulldrv_WindowMessage, + NULL, nulldrv_WindowPosChanging, nulldrv_WindowPosChanged, /* system parameters */ @@ -382,7 +367,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0) SET_USER_FUNC(SetCursorPos); - SET_USER_FUNC(ClipCursor); SET_USER_FUNC(UpdateClipboard); SET_USER_FUNC(CreateDesktopWindow); SET_USER_FUNC(CreateWindow); @@ -402,7 +386,6 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v SET_USER_FUNC(ShowWindow); SET_USER_FUNC(SysCommand); SET_USER_FUNC(UpdateLayeredWindow); - SET_USER_FUNC(WindowMessage); SET_USER_FUNC(WindowPosChanging); SET_USER_FUNC(WindowPosChanged); #undef SET_USER_FUNC diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 828915605f6..4ed55425d5d 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1855,7 +1855,7 @@ static void reply_message( struct received_message_info *info, LRESULT result, B * * Handle an internal Wine message instead of calling the window proc. */ -static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { switch(msg) { @@ -1885,22 +1885,18 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR return call_current_hook( h_extra->handle, HC_ACTION, wparam, h_extra->lparam ); } - case WM_WINE_CLIPCURSOR: - if (wparam) - { - RECT rect; - GetClipCursor( &rect ); - return USER_Driver->pClipCursor( &rect ); - } - return USER_Driver->pClipCursor( NULL ); case WM_WINE_UPDATEWINDOWSTATE: update_window_state( hwnd ); return 0; default: - if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) - return USER_Driver->pWindowMessage( hwnd, msg, wparam, lparam ); - FIXME( "unknown internal message %x\n", msg ); - return 0; + { + MSG m; + m.hwnd = hwnd; + m.message = msg; + m.wParam = wparam; + m.lParam = lparam; + return NtUserCallOneParam( (UINT_PTR)&m, NtUserHandleInternalMessage ); + } } } diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 3b75c7b1d31..c926bec1ab1 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -1065,6 +1065,7 @@ static const struct user_driver_funcs lazy_load_driver = /* windowing functions */ .pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx, .pScrollDC = nulldrv_ScrollDC, + .pWindowMessage = nulldrv_WindowMessage, /* system parameters */ .pSystemParametersInfo = nulldrv_SystemParametersInfo, /* vulkan support */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index bc11400eaf3..e9eb7d29acf 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -26,7 +26,35 @@ #include "win32u_private.h" #include "wine/server.h" +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(msg); + + +/*********************************************************************** + * handle_internal_message + * + * Handle an internal Wine message instead of calling the window proc. + */ +LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + switch(msg) + { + case WM_WINE_CLIPCURSOR: + if (wparam) + { + RECT rect; + get_clip_cursor( &rect ); + return user_driver->pClipCursor( &rect ); + } + return user_driver->pClipCursor( NULL ); + default: + if (msg >= WM_WINE_FIRST_DRIVER_MSG && msg <= WM_WINE_LAST_DRIVER_MSG) + return user_driver->pWindowMessage( hwnd, msg, wparam, lparam ); + FIXME( "unknown internal message %x\n", msg ); + return 0; + } +} /********************************************************************** * NtUserGetGUIThreadInfo (win32u.@) diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 00e571f6460..ca5068c02f6 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -131,6 +131,9 @@ struct user_key_state_info /* cursoricon.c */ HICON alloc_cursoricon_handle( BOOL is_icon ) DECLSPEC_HIDDEN; +/* message.c */ +LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; + /* window.c */ HANDLE alloc_user_handle( struct user_object *ptr, unsigned int type ) DECLSPEC_HIDDEN; void *free_user_handle( HANDLE handle, unsigned int type ) DECLSPEC_HIDDEN; diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 4eaaceb2892..df35262d520 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4584,6 +4584,11 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) return 0; case NtUserGetDeskPattern: return get_entry( &entry_DESKPATTERN, 256, (WCHAR *)arg ); + case NtUserHandleInternalMessage: + { + MSG *msg = (MSG *)arg; + return handle_internal_message( msg->hwnd, msg->message, msg->wParam, msg->lParam ); + } case NtUserIncrementKeyStateCounter: return InterlockedAdd( &global_key_state_counter, arg ); case NtUserLock: diff --git a/include/ntuser.h b/include/ntuser.h index c999be08c75..6919de56fa4 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -92,6 +92,7 @@ enum /* temporary exports */ NtUserFlushWindowSurfaces, NtUserGetDeskPattern, + NtUserHandleInternalMessage, NtUserIncrementKeyStateCounter, NtUserLock, NtUserNextThreadWindow,
1
0
0
0
Sven Baars : crypt32/tests: Fix a memory leak (Valgrind).
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: 36378958f72284523cd35eb33d56b7d74ef645e5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=36378958f72284523cd35eb3…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Fri Feb 18 23:30:33 2022 +0100 crypt32/tests: Fix a memory leak (Valgrind). Signed-off-by: Sven Baars <sbaars(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/tests/cert.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c index 99b9487be46..608d2c8c1b7 100644 --- a/dlls/crypt32/tests/cert.c +++ b/dlls/crypt32/tests/cert.c @@ -4318,6 +4318,7 @@ static void test_VerifySignature(void) BCryptDestroyHash(bhash); done: BCryptCloseAlgorithmProvider(alg, 0); + BCryptDestroyKey(bkey); LocalFree(info); CertFreeCertificateContext(cert);
1
0
0
0
Sven Baars : ntoskrnl.exe/tests: Let CertCloseStore() delete the certificate context.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: d78f234a108acaf78674559de84bdc89c0937f52 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d78f234a108acaf78674559d…
Author: Sven Baars <sbaars(a)codeweavers.com> Date: Fri Feb 18 23:26:30 2022 +0100 ntoskrnl.exe/tests: Let CertCloseStore() delete the certificate context. This should fix test failures caused by ef437b41eebcb54a3576741fc52dbc29caa1590f. Signed-off-by: Sven Baars <sbaars(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 6207ce00ccb..13d1af4e7cd 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -233,15 +233,11 @@ static void testsign_cleanup(struct testsign_context *ctx) ret = CertFreeCertificateContext(ctx->cert); ok(ret, "Failed to free certificate, error %u\n", GetLastError()); - ret = CertDeleteCertificateFromStore(ctx->root_cert); - ok(ret, "Failed to remove certificate, error %u\n", GetLastError()); ret = CertFreeCertificateContext(ctx->root_cert); ok(ret, "Failed to free certificate context, error %u\n", GetLastError()); ret = CertCloseStore(ctx->root_store, CERT_CLOSE_STORE_CHECK_FLAG); ok(ret, "Failed to close store, error %u\n", GetLastError()); - ret = CertDeleteCertificateFromStore(ctx->publisher_cert); - ok(ret, "Failed to remove certificate, error %u\n", GetLastError()); ret = CertFreeCertificateContext(ctx->publisher_cert); ok(ret, "Failed to free certificate context, error %u\n", GetLastError()); ret = CertCloseStore(ctx->publisher_store, CERT_CLOSE_STORE_CHECK_FLAG);
1
0
0
0
Alexandre Julliard : include: Update __MSABI_LONG definition for WINE_NO_LONG_TYPES support.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: 09e233790ee2d9773a914e2ad2689fa637e9c45c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09e233790ee2d9773a914e2a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 25 12:02:52 2022 +0100 include: Update __MSABI_LONG definition for WINE_NO_LONG_TYPES support. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/verrsrc.h | 2 +- include/winnt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/verrsrc.h b/include/verrsrc.h index fa5c26c94fd..e13165a7d2e 100644 --- a/include/verrsrc.h +++ b/include/verrsrc.h @@ -22,7 +22,7 @@ /* Macro to deal with LP64 <=> LLP64 differences in numeric constants with 'l' modifier */ #ifndef __MSABI_LONG -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) # define __MSABI_LONG(x) x ## l # else # define __MSABI_LONG(x) x diff --git a/include/winnt.h b/include/winnt.h index bd64b092369..079858d2f7d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -604,7 +604,7 @@ typedef DWORD FLONG; /* Macro to deal with LP64 <=> LLP64 differences in numeric constants with 'l' modifier */ #ifndef __MSABI_LONG -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) # define __MSABI_LONG(x) x ## l # else # define __MSABI_LONG(x) x
1
0
0
0
Eric Pouech : dwrite/tests: Enable compilation with long types.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: b70375e60b53c32d751e5d2ef53b27d482b9b2e3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b70375e60b53c32d751e5d2e…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Fri Feb 25 21:00:29 2022 +0300 dwrite/tests: Enable compilation with long types. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/Makefile.in | 1 - dlls/dwrite/tests/analyzer.c | 196 ++--- dlls/dwrite/tests/font.c | 1885 ++++++++++++++++++++--------------------- dlls/dwrite/tests/layout.c | 1428 +++++++++++++++---------------- 4 files changed, 1753 insertions(+), 1757 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b70375e60b53c32d751e…
1
0
0
0
Eric Pouech : dpnet/tests: Enable compilation with long types.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: 2c878d54d43f1e7d7ca213fb6e378998016c6048 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2c878d54d43f1e7d7ca213fb…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Thu Feb 24 11:28:26 2022 +0100 dpnet/tests: Enable compilation with long types. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dpnet/tests/Makefile.in | 1 - dlls/dpnet/tests/address.c | 194 +++++++++++------------ dlls/dpnet/tests/client.c | 362 +++++++++++++++++++++---------------------- dlls/dpnet/tests/server.c | 82 +++++----- dlls/dpnet/tests/thread.c | 108 ++++++------- 5 files changed, 373 insertions(+), 374 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2c878d54d43f1e7d7ca2…
1
0
0
0
Eric Pouech : dpnet/tests: Use correct integral type.
by Alexandre Julliard
25 Feb '22
25 Feb '22
Module: wine Branch: master Commit: e32c74d85fa0c42f1454f7eb603754fae900e78b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e32c74d85fa0c42f1454f7eb…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Thu Feb 24 11:28:20 2022 +0100 dpnet/tests: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dpnet/tests/server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/dpnet/tests/server.c b/dlls/dpnet/tests/server.c index 4314c69ccc1..3d59d746fba 100644 --- a/dlls/dpnet/tests/server.c +++ b/dlls/dpnet/tests/server.c @@ -418,7 +418,8 @@ done: /* taken from programs/winetest/main.c */ BOOL is_stub_dll(const char *filename) { - DWORD size, ver; + UINT size; + DWORD ver; BOOL isstub = FALSE; char *p, *data;
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
150
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200