win32u: Move NtUserUnhookWindowsHookEx implementation from user32.

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-02-16 12:31:04 +01:00 committed by Alexandre Julliard
parent fcf7d2a140
commit 6490088e74
8 changed files with 32 additions and 24 deletions

View File

@ -538,27 +538,6 @@ BOOL WINAPI UnhookWindowsHook( INT id, HOOKPROC proc )
}
/***********************************************************************
* UnhookWindowsHookEx (USER32.@)
*/
BOOL WINAPI UnhookWindowsHookEx( HHOOK hhook )
{
BOOL ret;
SERVER_START_REQ( remove_hook )
{
req->handle = wine_server_user_handle( hhook );
req->id = 0;
ret = !wine_server_call_err( req );
if (ret) get_user_thread_info()->active_hooks = reply->active_hooks;
}
SERVER_END_REQ;
if (!ret && GetLastError() == ERROR_INVALID_HANDLE) SetLastError( ERROR_INVALID_HOOK_HANDLE );
return ret;
}
/***********************************************************************
* CallNextHookEx (USER32.@)
*/

View File

@ -772,7 +772,7 @@
# @ stub TranslateMessageEx
@ stdcall UnhookWinEvent(long) NtUserUnhookWinEvent
@ stdcall UnhookWindowsHook(long ptr)
@ stdcall UnhookWindowsHookEx(long)
@ stdcall UnhookWindowsHookEx(long) NtUserUnhookWindowsHookEx
@ stdcall UnionRect(ptr ptr ptr)
@ stdcall UnloadKeyboardLayout(long)
@ stub UnlockWindowStation

View File

@ -126,6 +126,25 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO
return handle;
}
/***********************************************************************
* NtUserUnhookWindowsHookEx (win32u.@)
*/
BOOL WINAPI NtUserUnhookWindowsHookEx( HHOOK handle )
{
NTSTATUS status;
SERVER_START_REQ( remove_hook )
{
req->handle = wine_server_user_handle( handle );
req->id = 0;
status = wine_server_call_err( req );
if (!status) get_user_thread_info()->active_hooks = reply->active_hooks;
}
SERVER_END_REQ;
if (status == STATUS_INVALID_HANDLE) SetLastError( ERROR_INVALID_HOOK_HANDLE );
return !status;
}
/***********************************************************************
* NtUserSetWinEventHook (win32u.@)
*/

View File

@ -143,6 +143,7 @@ static void * const syscalls[] =
NtUserSetWinEventHook,
NtUserSetWindowsHookEx,
NtUserUnhookWinEvent,
NtUserUnhookWindowsHookEx,
};
static BYTE arguments[ARRAY_SIZE(syscalls)];

View File

@ -1285,7 +1285,7 @@
@ stub NtUserTranslateMessage
@ stub NtUserUndelegateInput
@ stdcall -syscall NtUserUnhookWinEvent(long)
@ stub NtUserUnhookWindowsHookEx
@ stdcall -syscall NtUserUnhookWindowsHookEx(long)
@ stub NtUserUnloadKeyboardLayout
@ stub NtUserUnlockWindowStation
@ stub NtUserUnregisterClass

View File

@ -129,6 +129,7 @@
SYSCALL_ENTRY( NtUserSetThreadDesktop ) \
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
SYSCALL_ENTRY( NtUserUnhookWinEvent )
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
SYSCALL_ENTRY( NtUserUnhookWindowsHookEx )
#endif /* __WOW64WIN_SYSCALL_H */

View File

@ -408,3 +408,10 @@ NTSTATUS WINAPI wow64_NtUserSetWindowsHookEx( UINT *args )
tid, id, proc, ansi );
return HandleToUlong( ret );
}
NTSTATUS WINAPI wow64_NtUserUnhookWindowsHookEx( UINT *args )
{
HHOOK handle = get_handle( &args );
return NtUserUnhookWindowsHookEx( handle );
}

View File

@ -204,6 +204,7 @@ BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID pt
INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
WCHAR *str, int size, UINT flags, HKL layout );
BOOL WINAPI NtUserUnhookWinEvent( HWINEVENTHOOK hEventHook );
BOOL WINAPI NtUserUnhookWindowsHookEx( HHOOK handle );
BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id );
WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout );