From 94e06293966ac028a776445a283e7ed284648ab2 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 16 Nov 2021 12:32:55 +0100 Subject: [PATCH] win32u: Move NtUserAttachThreadInput implementation from user32. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/user32/input.c | 22 ------------------ dlls/user32/user32.spec | 2 +- dlls/win32u/Makefile.in | 1 + dlls/win32u/input.c | 49 +++++++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 9 ++++++++ include/ntuser.h | 8 +++++++ 9 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 dlls/win32u/input.c diff --git a/dlls/user32/input.c b/dlls/user32/input.c index b4e3579f5e8..1362664d0c9 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -593,28 +593,6 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) } -/********************************************************************** - * AttachThreadInput (USER32.@) - * - * Attaches the input processing mechanism of one thread to that of - * another thread. - */ -BOOL WINAPI AttachThreadInput( DWORD from, DWORD to, BOOL attach ) -{ - BOOL ret; - - SERVER_START_REQ( attach_thread_input ) - { - req->tid_from = from; - req->tid_to = to; - req->attach = attach; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - return ret; -} - - /********************************************************************** * GetKeyState (USER32.@) * diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 3825b6a4df2..34ba824dc38 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -12,7 +12,7 @@ @ stdcall AppendMenuW(long long long ptr) @ stdcall AreDpiAwarenessContextsEqual(long long) @ stdcall ArrangeIconicWindows(long) -@ stdcall AttachThreadInput(long long long) +@ stdcall AttachThreadInput(long long long) NtUserAttachThreadInput @ stdcall BeginDeferWindowPos(long) @ stdcall BeginPaint(long ptr) @ stdcall BlockInput(long) diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in index 306a3302260..96cfb4a8ea7 100644 --- a/dlls/win32u/Makefile.in +++ b/dlls/win32u/Makefile.in @@ -26,6 +26,7 @@ C_SRCS = \ font.c \ freetype.c \ gdiobj.c \ + input.c \ main.c \ mapping.c \ opentype.c \ diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c new file mode 100644 index 00000000000..0a4ebdace1d --- /dev/null +++ b/dlls/win32u/input.c @@ -0,0 +1,49 @@ +/* + * USER Input processing + * + * Copyright 1993 Bob Amstadt + * Copyright 1996 Albrecht Kleine + * Copyright 1997 David Faure + * Copyright 1998 Morten Welinder + * Copyright 1998 Ulrich Weigand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "win32u_private.h" +#include "wine/server.h" + + +/********************************************************************** + * NtUserAttachThreadInput (win32u.@) + */ +BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ) +{ + BOOL ret; + + SERVER_START_REQ( attach_thread_input ) + { + req->tid_from = from; + req->tid_to = to; + req->attach = attach; + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 3eb38177a1f..e557eade893 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -102,6 +102,7 @@ static void * const syscalls[] = NtGdiSwapBuffers, NtGdiTransformPoints, NtUserAddClipboardFormatListener, + NtUserAttachThreadInput, NtUserCloseDesktop, NtUserCloseWindowStation, NtUserCreateDesktopEx, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 256ab822803..2a627763091 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -754,7 +754,7 @@ @ stub NtUserAddVisualIdentifier @ stub NtUserAlterWindowStyle @ stub NtUserAssociateInputContext -@ stub NtUserAttachThreadInput +@ stdcall -syscall NtUserAttachThreadInput(long long long) @ stub NtUserAutoPromoteMouseInPointer @ stub NtUserAutoRotateScreen @ stub NtUserBeginLayoutUpdate diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 45685c3ba21..4f7ff8e003c 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -89,6 +89,7 @@ SYSCALL_ENTRY( NtGdiSwapBuffers ) \ SYSCALL_ENTRY( NtGdiTransformPoints ) \ SYSCALL_ENTRY( NtUserAddClipboardFormatListener ) \ + SYSCALL_ENTRY( NtUserAttachThreadInput ) \ SYSCALL_ENTRY( NtUserCloseDesktop ) \ SYSCALL_ENTRY( NtUserCloseWindowStation ) \ SYSCALL_ENTRY( NtUserCreateDesktopEx ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index c86e7062314..a783eb42229 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -228,3 +228,12 @@ NTSTATUS WINAPI wow64_NtUserRemoveClipboardFormatListener( UINT *args ) return NtUserRemoveClipboardFormatListener( hwnd ); } + +NTSTATUS WINAPI wow64_NtUserAttachThreadInput( UINT *args ) +{ + DWORD from = get_ulong( &args ); + DWORD to = get_ulong( &args ); + BOOL attach = get_ulong( &args ); + + return NtUserAttachThreadInput( from, to, attach ); +} diff --git a/include/ntuser.h b/include/ntuser.h index 9fcd94128fd..d24032d1229 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -24,6 +24,7 @@ #include BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd ); +BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ); BOOL WINAPI NtUserCloseDesktop( HDESK handle ); BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ); INT WINAPI NtUserCountClipboardFormats(void); @@ -36,6 +37,10 @@ INT WINAPI NtUserGetClipboardFormatName( UINT format, WCHAR *buffer, INT max HWND WINAPI NtUserGetClipboardOwner(void); DWORD WINAPI NtUserGetClipboardSequenceNumber(void); HWND WINAPI NtUserGetClipboardViewer(void); +INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size ); +SHORT WINAPI NtUserGetKeyState( INT vkey ); +HKL WINAPI NtUserGetKeyboardLayout( DWORD thread_id ); +BOOL WINAPI NtUserGetKeyboardState( BYTE *state ); BOOL WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *alpha, DWORD *flags ); BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, DWORD len, DWORD *needed ); @@ -45,14 +50,17 @@ HANDLE WINAPI NtUserGetProp( HWND hwnd, const WCHAR *str ); HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size ); BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); +UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access ); BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MASK access ); HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ); BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd ); HANDLE WINAPI NtUserRemoveProp( HWND hwnd, const WCHAR *str ); +BOOL WINAPI NtUserSetKeyboardState( BYTE *state ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle ); BOOL WINAPI NtUserSetThreadDesktop( HDESK handle ); +WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ); #endif /* _NTUSER_ */