Commit 088033cf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserCallNextHookEx implementation from user32.

parent 0c6d042c
......@@ -525,40 +525,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.@)
*/
BOOL WINAPI CallMsgFilterA( LPMSG msg, INT code )
......
......@@ -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)
......
......@@ -1150,6 +1150,7 @@ static struct unix_funcs unix_funcs =
NtGdiUpdateColors,
NtGdiWidenPath,
NtUserActivateKeyboardLayout,
NtUserCallNextHookEx,
NtUserCallNoParam,
NtUserCallOneParam,
NtUserCallTwoParam,
......
......@@ -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;
......
......@@ -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)
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 );
......
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