Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d9fc5b3f
Commit
d9fc5b3f
authored
Jul 06, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Implement input context object.
parent
87a5c1bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
205 additions
and
4 deletions
+205
-4
Makefile.in
dlls/win32u/Makefile.in
+1
-0
imm.c
dlls/win32u/imm.c
+148
-0
syscall.c
dlls/win32u/syscall.c
+4
-0
win32u.spec
dlls/win32u/win32u.spec
+4
-4
syscall.h
dlls/wow64win/syscall.h
+4
-0
user.c
dlls/wow64win/user.c
+31
-0
ntuser.h
include/ntuser.h
+13
-0
No files found.
dlls/win32u/Makefile.in
View file @
d9fc5b3f
...
...
@@ -32,6 +32,7 @@ C_SRCS = \
freetype.c
\
gdiobj.c
\
hook.c
\
imm.c
\
input.c
\
main.c
\
mapping.c
\
...
...
dlls/win32u/imm.c
0 → 100644
View file @
d9fc5b3f
/*
* Input Context implementation
*
* Copyright 2022 Jacek Caban for CodeWeavers
*
* 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 "ntuser_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
imm
);
struct
imc
{
struct
user_object
obj
;
DWORD
thread_id
;
UINT_PTR
client_ptr
;
};
static
struct
imc
*
get_imc_ptr
(
HIMC
handle
)
{
struct
imc
*
imc
=
get_user_handle_ptr
(
handle
,
NTUSER_OBJ_IMC
);
if
(
imc
&&
imc
!=
OBJ_OTHER_PROCESS
)
return
imc
;
WARN
(
"invalid handle %p
\n
"
,
handle
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
NULL
;
}
static
void
release_imc_ptr
(
struct
imc
*
imc
)
{
release_user_handle_ptr
(
imc
);
}
/******************************************************************************
* NtUserCreateInputContext (win32u.@)
*/
HIMC
WINAPI
NtUserCreateInputContext
(
UINT_PTR
client_ptr
)
{
struct
imc
*
imc
;
HIMC
handle
;
if
(
!
(
imc
=
malloc
(
sizeof
(
*
imc
)
)))
return
0
;
imc
->
client_ptr
=
client_ptr
;
imc
->
thread_id
=
GetCurrentThreadId
();
if
(
!
(
handle
=
alloc_user_handle
(
&
imc
->
obj
,
NTUSER_OBJ_IMC
)))
{
free
(
imc
);
return
0
;
}
TRACE
(
"%lx returning %p
\n
"
,
client_ptr
,
handle
);
return
handle
;
}
/******************************************************************************
* NtUserDestroyInputContext (win32u.@)
*/
BOOL
WINAPI
NtUserDestroyInputContext
(
HIMC
handle
)
{
struct
imc
*
imc
;
TRACE
(
"%p
\n
"
,
handle
);
if
(
!
(
imc
=
free_user_handle
(
handle
,
NTUSER_OBJ_IMC
)))
return
FALSE
;
if
(
imc
==
OBJ_OTHER_PROCESS
)
{
FIXME
(
"other process handle %p
\n
"
,
handle
);
return
FALSE
;
}
free
(
imc
);
return
TRUE
;
}
/******************************************************************************
* NtUserUpdateInputContext (win32u.@)
*/
BOOL
WINAPI
NtUserUpdateInputContext
(
HIMC
handle
,
UINT
attr
,
UINT_PTR
value
)
{
struct
imc
*
imc
;
BOOL
ret
=
TRUE
;
TRACE
(
"%p %u %lx
\n
"
,
handle
,
attr
,
value
);
if
(
!
(
imc
=
get_imc_ptr
(
handle
)))
return
FALSE
;
switch
(
attr
)
{
case
NtUserInputContextClientPtr
:
imc
->
client_ptr
=
value
;
break
;
default:
FIXME
(
"unknown attr %u
\n
"
,
attr
);
ret
=
FALSE
;
};
release_imc_ptr
(
imc
);
return
ret
;
}
/******************************************************************************
* NtUserQueryInputContext (win32u.@)
*/
UINT_PTR
WINAPI
NtUserQueryInputContext
(
HIMC
handle
,
UINT
attr
)
{
struct
imc
*
imc
;
UINT_PTR
ret
;
if
(
!
(
imc
=
get_imc_ptr
(
handle
)))
return
FALSE
;
switch
(
attr
)
{
case
NtUserInputContextClientPtr
:
ret
=
imc
->
client_ptr
;
break
;
case
NtUserInputContextThreadId
:
ret
=
imc
->
thread_id
;
break
;
default:
FIXME
(
"unknown attr %u
\n
"
,
attr
);
ret
=
0
;
};
release_imc_ptr
(
imc
);
return
ret
;
}
dlls/win32u/syscall.c
View file @
d9fc5b3f
...
...
@@ -111,9 +111,11 @@ static void * const syscalls[] =
NtUserCopyAcceleratorTable
,
NtUserCreateAcceleratorTable
,
NtUserCreateDesktopEx
,
NtUserCreateInputContext
,
NtUserCreateWindowStation
,
NtUserDeleteMenu
,
NtUserDestroyAcceleratorTable
,
NtUserDestroyInputContext
,
NtUserEndMenu
,
NtUserFindExistingCursorIcon
,
NtUserFindWindowEx
,
...
...
@@ -163,6 +165,7 @@ static void * const syscalls[] =
NtUserOpenDesktop
,
NtUserOpenInputDesktop
,
NtUserOpenWindowStation
,
NtUserQueryInputContext
,
NtUserRegisterRawInputDevices
,
NtUserRemoveClipboardFormatListener
,
NtUserRemoveMenu
,
...
...
@@ -183,6 +186,7 @@ static void * const syscalls[] =
NtUserThunkedMenuItemInfo
,
NtUserUnhookWinEvent
,
NtUserUnhookWindowsHookEx
,
NtUserUpdateInputContext
,
NtUserWindowFromDC
,
};
...
...
dlls/win32u/win32u.spec
View file @
d9fc5b3f
...
...
@@ -811,7 +811,7 @@
@ stub NtUserCreateDCompositionHwndTarget
@ stdcall -syscall NtUserCreateDesktopEx(ptr ptr ptr long long long)
@ stub NtUserCreateEmptyCursorObject
@ st
ub NtUserCreateInputContext
@ st
dcall -syscall NtUserCreateInputContext(ptr)
@ stub NtUserCreateLocalMemHandle
@ stub NtUserCreatePalmRejectionDelayZone
@ stdcall NtUserCreateWindowEx(long ptr ptr ptr long long long long long long long long ptr long long long long)
...
...
@@ -831,7 +831,7 @@
@ stub NtUserDestroyActivationObject
@ stdcall NtUserDestroyCursor(long long)
@ stub NtUserDestroyDCompositionHwndTarget
@ st
ub NtUserDestroyInputContext
@ st
dcall -syscall NtUserDestroyInputContext(long)
@ stdcall NtUserDestroyMenu(long)
@ stub NtUserDestroyPalmRejectionDelayZone
@ stdcall NtUserDestroyWindow(long)
...
...
@@ -1114,7 +1114,7 @@
@ stub NtUserQueryBSDRWindow
@ stub NtUserQueryDisplayConfig
@ stub NtUserQueryInformationThread
@ st
ub NtUserQueryInputContext
@ st
dcall -syscall NtUserQueryInputContext(long long)
@ stub NtUserQuerySendMessage
@ stub NtUserQueryWindow
@ stub NtUserRealChildWindowFromPoint
...
...
@@ -1293,7 +1293,7 @@
@ stub NtUserUnregisterSessionPort
@ stub NtUserUnregisterUserApiHook
@ stub NtUserUpdateDefaultDesktopThumbnail
@ st
ub NtUserUpdateInputContext
@ st
dcall -syscall NtUserUpdateInputContext(long long ptr)
@ stub NtUserUpdateInstance
@ stdcall NtUserUpdateLayeredWindow(long long ptr ptr long ptr long ptr long ptr)
@ stub NtUserUpdatePerUserSystemParameters
...
...
dlls/wow64win/syscall.h
View file @
d9fc5b3f
...
...
@@ -98,9 +98,11 @@
SYSCALL_ENTRY( NtUserCopyAcceleratorTable ) \
SYSCALL_ENTRY( NtUserCreateAcceleratorTable ) \
SYSCALL_ENTRY( NtUserCreateDesktopEx ) \
SYSCALL_ENTRY( NtUserCreateInputContext ) \
SYSCALL_ENTRY( NtUserCreateWindowStation ) \
SYSCALL_ENTRY( NtUserDeleteMenu ) \
SYSCALL_ENTRY( NtUserDestroyAcceleratorTable ) \
SYSCALL_ENTRY( NtUserDestroyInputContext ) \
SYSCALL_ENTRY( NtUserEndMenu ) \
SYSCALL_ENTRY( NtUserFindExistingCursorIcon ) \
SYSCALL_ENTRY( NtUserFindWindowEx ) \
...
...
@@ -150,6 +152,7 @@
SYSCALL_ENTRY( NtUserOpenDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserQueryInputContext ) \
SYSCALL_ENTRY( NtUserRegisterRawInputDevices ) \
SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \
SYSCALL_ENTRY( NtUserRemoveMenu ) \
...
...
@@ -170,6 +173,7 @@
SYSCALL_ENTRY( NtUserThunkedMenuItemInfo ) \
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) \
SYSCALL_ENTRY( NtUserUpdateInputContext ) \
SYSCALL_ENTRY( NtUserWindowFromDC )
#endif
/* __WOW64WIN_SYSCALL_H */
dlls/wow64win/user.c
View file @
d9fc5b3f
...
...
@@ -226,6 +226,13 @@ NTSTATUS WINAPI wow64_NtUserCreateDesktopEx( UINT *args )
return
HandleToUlong
(
ret
);
}
NTSTATUS
WINAPI
wow64_NtUserCreateInputContext
(
UINT
*
args
)
{
UINT_PTR
client_ptr
=
get_ulong
(
&
args
);
return
HandleToUlong
(
NtUserCreateInputContext
(
client_ptr
));
}
NTSTATUS
WINAPI
wow64_NtUserCreateWindowStation
(
UINT
*
args
)
{
OBJECT_ATTRIBUTES32
*
attr32
=
get_ptr
(
&
args
);
...
...
@@ -258,6 +265,13 @@ NTSTATUS WINAPI wow64_NtUserDestroyAcceleratorTable( UINT *args )
return
NtUserDestroyAcceleratorTable
(
handle
);
}
NTSTATUS
WINAPI
wow64_NtUserDestroyInputContext
(
UINT
*
args
)
{
HIMC
handle
=
get_handle
(
&
args
);
return
NtUserDestroyInputContext
(
handle
);
}
NTSTATUS
WINAPI
wow64_NtUserEndMenu
(
UINT
*
args
)
{
return
NtUserEndMenu
();
...
...
@@ -848,6 +862,14 @@ NTSTATUS WINAPI wow64_NtUserOpenWindowStation( UINT *args )
return
HandleToUlong
(
NtUserOpenWindowStation
(
objattr_32to64
(
&
attr
,
attr32
),
access
));
}
NTSTATUS
WINAPI
wow64_NtUserQueryInputContext
(
UINT
*
args
)
{
HIMC
handle
=
get_handle
(
&
args
);
UINT
attr
=
get_ulong
(
&
args
);
return
NtUserQueryInputContext
(
handle
,
attr
);
}
NTSTATUS
WINAPI
wow64_NtUserRegisterRawInputDevices
(
UINT
*
args
)
{
const
RAWINPUTDEVICE32
*
devices32
=
get_ptr
(
&
args
);
...
...
@@ -1105,6 +1127,15 @@ NTSTATUS WINAPI wow64_NtUserUnhookWindowsHookEx( UINT *args )
return
NtUserUnhookWindowsHookEx
(
handle
);
}
NTSTATUS
WINAPI
wow64_NtUserUpdateInputContext
(
UINT
*
args
)
{
HIMC
handle
=
get_handle
(
&
args
);
UINT
attr
=
get_ulong
(
&
args
);
UINT_PTR
value
=
get_ulong
(
&
args
);
return
NtUserUpdateInputContext
(
handle
,
attr
,
value
);
}
NTSTATUS
WINAPI
wow64_NtUserWindowFromDC
(
UINT
*
args
)
{
HDC
hdc
=
get_handle
(
&
args
);
...
...
include/ntuser.h
View file @
d9fc5b3f
...
...
@@ -21,6 +21,7 @@
#include <winuser.h>
#include <wingdi.h>
#include <imm.h>
#include <winternl.h>
/* KernelCallbackTable codes, not compatible with Windows */
...
...
@@ -265,6 +266,7 @@ struct send_message_callback_params
#define NTUSER_OBJ_WINPOS 0x04
#define NTUSER_OBJ_ACCEL 0x08
#define NTUSER_OBJ_HOOK 0x0f
#define NTUSER_OBJ_IMC 0x11
/* NtUserScrollWindowEx flag */
#define SW_NODCCACHE 0x8000
...
...
@@ -358,6 +360,13 @@ struct draw_scroll_bar_params
BOOL
vertical
;
};
/* NtUserUpdateInputContext param, not compatible with Window */
enum
input_context_attr
{
NtUserInputContextClientPtr
,
NtUserInputContextThreadId
,
};
/* internal messages codes */
enum
wine_internal_message
{
...
...
@@ -558,6 +567,7 @@ BOOL WINAPI NtUserCreateCaret( HWND hwnd, HBITMAP bitmap, int width, int heig
HDESK
WINAPI
NtUserCreateDesktopEx
(
OBJECT_ATTRIBUTES
*
attr
,
UNICODE_STRING
*
device
,
DEVMODEW
*
devmode
,
DWORD
flags
,
ACCESS_MASK
access
,
ULONG
heap_size
);
HIMC
WINAPI
NtUserCreateInputContext
(
UINT_PTR
client_ptr
);
HWND
WINAPI
NtUserCreateWindowEx
(
DWORD
ex_style
,
UNICODE_STRING
*
class_name
,
UNICODE_STRING
*
version
,
UNICODE_STRING
*
window_name
,
DWORD
style
,
INT
x
,
INT
y
,
INT
cx
,
INT
cy
,
...
...
@@ -570,6 +580,7 @@ HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, IN
BOOL
WINAPI
NtUserDeleteMenu
(
HMENU
menu
,
UINT
id
,
UINT
flags
);
BOOL
WINAPI
NtUserDestroyAcceleratorTable
(
HACCEL
handle
);
BOOL
WINAPI
NtUserDestroyCursor
(
HCURSOR
cursor
,
ULONG
arg
);
BOOL
WINAPI
NtUserDestroyInputContext
(
HIMC
handle
);
BOOL
WINAPI
NtUserDestroyMenu
(
HMENU
menu
);
BOOL
WINAPI
NtUserDestroyWindow
(
HWND
hwnd
);
LRESULT
WINAPI
NtUserDispatchMessage
(
const
MSG
*
msg
);
...
...
@@ -686,6 +697,7 @@ HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK ac
BOOL
WINAPI
NtUserPeekMessage
(
MSG
*
msg_out
,
HWND
hwnd
,
UINT
first
,
UINT
last
,
UINT
flags
);
BOOL
WINAPI
NtUserPostMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
BOOL
WINAPI
NtUserPostThreadMessage
(
DWORD
thread
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
);
UINT_PTR
WINAPI
NtUserQueryInputContext
(
HIMC
handle
,
UINT
attr
);
BOOL
WINAPI
NtUserRedrawWindow
(
HWND
hwnd
,
const
RECT
*
rect
,
HRGN
hrgn
,
UINT
flags
);
ATOM
WINAPI
NtUserRegisterClassExWOW
(
const
WNDCLASSEXW
*
wc
,
UNICODE_STRING
*
name
,
UNICODE_STRING
*
version
,
struct
client_menu_name
*
client_menu_name
,
DWORD
fnid
,
DWORD
flags
,
...
...
@@ -763,6 +775,7 @@ BOOL WINAPI NtUserUnhookWindowsHookEx( HHOOK handle );
BOOL
WINAPI
NtUserUnregisterClass
(
UNICODE_STRING
*
name
,
HINSTANCE
instance
,
struct
client_menu_name
*
client_menu_name
);
BOOL
WINAPI
NtUserUnregisterHotKey
(
HWND
hwnd
,
INT
id
);
BOOL
WINAPI
NtUserUpdateInputContext
(
HIMC
handle
,
UINT
attr
,
UINT_PTR
value
);
BOOL
WINAPI
NtUserUpdateLayeredWindow
(
HWND
hwnd
,
HDC
hdc_dst
,
const
POINT
*
pts_dst
,
const
SIZE
*
size
,
HDC
hdc_src
,
const
POINT
*
pts_src
,
COLORREF
key
,
const
BLENDFUNCTION
*
blend
,
DWORD
flags
,
const
RECT
*
dirty
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment