From 05db9f63e1319c7b35ba2fe997f87c487d75fcc1 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 16 Nov 2021 12:33:36 +0100 Subject: [PATCH] win32u: Move NtUserSetKeyboardState implementation from user32. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/user32/input.c | 17 ----------------- dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 16 ++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 7 +++++++ 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 08b5cffaa5f..fc6b6fa5822 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -593,23 +593,6 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) } -/********************************************************************** - * SetKeyboardState (USER32.@) - */ -BOOL WINAPI SetKeyboardState( LPBYTE state ) -{ - BOOL ret; - - SERVER_START_REQ( set_key_state ) - { - wine_server_add_data( req, state, 256 ); - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - return ret; -} - - /********************************************************************** * VkKeyScanA (USER32.@) * diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index c4013b3dcfa..e48f30b46ca 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -673,7 +673,7 @@ @ stdcall SetForegroundWindow(long) @ stdcall SetGestureConfig(ptr long long ptr long) @ stdcall SetInternalWindowPos(long long ptr ptr) -@ stdcall SetKeyboardState(ptr) +@ stdcall SetKeyboardState(ptr) NtUserSetKeyboardState @ stdcall SetLastErrorEx(long long) @ stdcall SetLayeredWindowAttributes(ptr long long long) @ stdcall SetLogonNotifyWindow(long long) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 4e790257ab1..feab4693fad 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -93,3 +93,19 @@ BOOL WINAPI NtUserGetKeyboardState( BYTE *state ) SERVER_END_REQ; return ret; } + +/********************************************************************** + * NtUserSetKeyboardState (win32u.@) + */ +BOOL WINAPI NtUserSetKeyboardState( BYTE *state ) +{ + BOOL ret; + + SERVER_START_REQ( set_key_state ) + { + wine_server_add_data( req, state, 256 ); + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index a7c08c5cef6..d1ddc429061 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -123,6 +123,7 @@ static void * const syscalls[] = NtUserOpenWindowStation, NtUserRemoveClipboardFormatListener, NtUserRemoveProp, + NtUserSetKeyboardState, NtUserSetObjectInformation, NtUserSetProcessWindowStation, NtUserSetProp, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index e4b31efe436..df48dfe9586 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1202,7 +1202,7 @@ @ stub NtUserSetInteractiveControlFocus @ stub NtUserSetInteractiveCtrlRotationAngle @ stub NtUserSetInternalWindowPos -@ stub NtUserSetKeyboardState +@ stdcall -syscall NtUserSetKeyboardState(ptr) @ stub NtUserSetLayeredWindowAttributes @ stub NtUserSetMagnificationDesktopMagnifierOffsetsDWMUpdated @ stub NtUserSetManipulationInputTarget diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 7c2ccbe63c7..09a281b5d14 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -110,6 +110,7 @@ SYSCALL_ENTRY( NtUserOpenWindowStation ) \ SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \ SYSCALL_ENTRY( NtUserRemoveProp ) \ + SYSCALL_ENTRY( NtUserSetKeyboardState ) \ SYSCALL_ENTRY( NtUserSetObjectInformation ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetProp ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index a563e78a8f5..4c47b8937cf 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -251,3 +251,10 @@ NTSTATUS WINAPI wow64_NtUserGetKeyboardState( UINT *args ) return NtUserGetKeyboardState( state ); } + +NTSTATUS WINAPI wow64_NtUserSetKeyboardState( UINT *args ) +{ + BYTE *state = get_ptr( &args ); + + return NtUserSetKeyboardState( state ); +}