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
f5b3283e
Commit
f5b3283e
authored
Jul 08, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move window input context handling from imm32.
parent
3e8a4b67
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
207 additions
and
154 deletions
+207
-154
imm.c
dlls/imm32/imm.c
+99
-153
imm.c
dlls/win32u/imm.c
+69
-0
ntuser_private.h
dlls/win32u/ntuser_private.h
+1
-0
syscall.c
dlls/win32u/syscall.c
+1
-0
sysparams.c
dlls/win32u/sysparams.c
+1
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
win32u_private.h
dlls/win32u/win32u_private.h
+4
-0
window.c
dlls/win32u/window.c
+5
-0
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+9
-0
ntuser.h
include/ntuser.h
+16
-0
No files found.
dlls/imm32/imm.c
View file @
f5b3283e
This diff is collapsed.
Click to expand it.
dlls/win32u/imm.c
View file @
f5b3283e
...
...
@@ -146,3 +146,72 @@ UINT_PTR WINAPI NtUserQueryInputContext( HIMC handle, UINT attr )
release_imc_ptr
(
imc
);
return
ret
;
}
/******************************************************************************
* NtUserAssociateInputContext (win32u.@)
*/
UINT
WINAPI
NtUserAssociateInputContext
(
HWND
hwnd
,
HIMC
ctx
,
ULONG
flags
)
{
WND
*
win
;
UINT
ret
=
AICR_OK
;
TRACE
(
"%p %p %x
\n
"
,
hwnd
,
ctx
,
flags
);
switch
(
flags
)
{
case
0
:
case
IACE_IGNORENOCONTEXT
:
case
IACE_DEFAULT
:
break
;
default:
FIXME
(
"unknown flags 0x%x
\n
"
,
flags
);
return
AICR_FAILED
;
}
if
(
flags
==
IACE_DEFAULT
)
{
if
(
!
(
ctx
=
get_default_input_context
()))
return
AICR_FAILED
;
}
else
if
(
ctx
)
{
if
(
NtUserQueryInputContext
(
ctx
,
NtUserInputContextThreadId
)
!=
GetCurrentThreadId
())
return
AICR_FAILED
;
}
if
(
!
(
win
=
get_win_ptr
(
hwnd
))
||
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
return
AICR_FAILED
;
if
(
ctx
&&
win
->
tid
!=
GetCurrentThreadId
())
ret
=
AICR_FAILED
;
else
if
(
flags
!=
IACE_IGNORENOCONTEXT
||
win
->
imc
)
{
if
(
win
->
imc
!=
ctx
&&
get_focus
()
==
hwnd
)
ret
=
AICR_FOCUS_CHANGED
;
win
->
imc
=
ctx
;
}
release_win_ptr
(
win
);
return
ret
;
}
HIMC
get_default_input_context
(
void
)
{
struct
ntuser_thread_info
*
thread_info
=
NtUserGetThreadInfo
();
if
(
!
thread_info
->
default_imc
)
thread_info
->
default_imc
=
NtUserCreateInputContext
(
0
);
return
thread_info
->
default_imc
;
}
HIMC
get_window_input_context
(
HWND
hwnd
)
{
WND
*
win
;
HIMC
ret
;
if
(
!
(
win
=
get_win_ptr
(
hwnd
))
||
win
==
WND_OTHER_PROCESS
||
win
==
WND_DESKTOP
)
{
SetLastError
(
ERROR_INVALID_WINDOW_HANDLE
);
return
0
;
}
ret
=
win
->
imc
;
release_win_ptr
(
win
);
return
ret
;
}
dlls/win32u/ntuser_private.h
View file @
f5b3283e
...
...
@@ -105,6 +105,7 @@ typedef struct tagWND
HICON
hIcon
;
/* window's icon */
HICON
hIconSmall
;
/* window's small icon */
HICON
hIconSmall2
;
/* window's secondary small icon, derived from hIcon */
HIMC
imc
;
/* window's input context */
UINT
dpi
;
/* window DPI */
DPI_AWARENESS
dpi_awareness
;
/* DPI awareness */
struct
window_surface
*
surface
;
/* Window surface if any */
...
...
dlls/win32u/syscall.c
View file @
f5b3283e
...
...
@@ -101,6 +101,7 @@ static void * const syscalls[] =
NtGdiSwapBuffers
,
NtGdiTransformPoints
,
NtUserAddClipboardFormatListener
,
NtUserAssociateInputContext
,
NtUserAttachThreadInput
,
NtUserBuildHwndList
,
NtUserCallMsgFilter
,
...
...
dlls/win32u/sysparams.c
View file @
f5b3283e
...
...
@@ -4818,6 +4818,7 @@ static void thread_detach(void)
free
(
thread_info
->
rawinput
);
destroy_thread_windows
();
NtUserDestroyInputContext
(
thread_info
->
client_info
.
default_imc
);
NtClose
(
thread_info
->
server_queue
);
exiting_thread_id
=
0
;
...
...
dlls/win32u/win32u.spec
View file @
f5b3283e
...
...
@@ -753,7 +753,7 @@
@ stdcall -syscall NtUserAddClipboardFormatListener(long)
@ stub NtUserAddVisualIdentifier
@ stub NtUserAlterWindowStyle
@ st
ub NtUserAssociateInputContext
@ st
dcall -syscall NtUserAssociateInputContext(long long long)
@ stdcall -syscall NtUserAttachThreadInput(long long long)
@ stub NtUserAutoPromoteMouseInPointer
@ stub NtUserAutoRotateScreen
...
...
dlls/win32u/win32u_private.h
View file @
f5b3283e
...
...
@@ -392,6 +392,10 @@ extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM l
extern
LRESULT
call_hooks
(
INT
id
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
unicode
)
DECLSPEC_HIDDEN
;
extern
BOOL
unhook_windows_hook
(
INT
id
,
HOOKPROC
proc
)
DECLSPEC_HIDDEN
;
/* imm.c */
extern
HIMC
get_default_input_context
(
void
)
DECLSPEC_HIDDEN
;
extern
HIMC
get_window_input_context
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
/* input.c */
extern
BOOL
destroy_caret
(
void
)
DECLSPEC_HIDDEN
;
extern
LONG
global_key_state_counter
DECLSPEC_HIDDEN
;
...
...
dlls/win32u/window.c
View file @
f5b3283e
...
...
@@ -5163,6 +5163,8 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
if
(
win
->
dwStyle
&
WS_SYSMENU
)
NtUserSetSystemMenu
(
hwnd
,
0
);
win
->
imc
=
get_default_input_context
();
/* call the WH_CBT hook */
release_win_ptr
(
win
);
...
...
@@ -5387,6 +5389,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
case
NtUserCallHwnd_GetWindowDpiAwarenessContext
:
return
(
ULONG_PTR
)
get_window_dpi_awareness_context
(
hwnd
);
case
NtUserCallHwnd_GetWindowInputContext
:
return
HandleToUlong
(
get_window_input_context
(
hwnd
));
case
NtUserCallHwnd_GetWindowTextLength
:
return
get_server_window_text
(
hwnd
,
NULL
,
0
);
...
...
dlls/wow64win/syscall.h
View file @
f5b3283e
...
...
@@ -88,6 +88,7 @@
SYSCALL_ENTRY( NtGdiSwapBuffers ) \
SYSCALL_ENTRY( NtGdiTransformPoints ) \
SYSCALL_ENTRY( NtUserAddClipboardFormatListener ) \
SYSCALL_ENTRY( NtUserAssociateInputContext ) \
SYSCALL_ENTRY( NtUserAttachThreadInput ) \
SYSCALL_ENTRY( NtUserBuildHwndList ) \
SYSCALL_ENTRY( NtUserCallMsgFilter ) \
...
...
dlls/wow64win/user.c
View file @
f5b3283e
...
...
@@ -111,6 +111,15 @@ NTSTATUS WINAPI wow64_NtUserAddClipboardFormatListener( UINT *args )
return
NtUserAddClipboardFormatListener
(
hwnd
);
}
NTSTATUS
WINAPI
wow64_NtUserAssociateInputContext
(
UINT
*
args
)
{
HWND
hwnd
=
get_handle
(
&
args
);
HIMC
ctx
=
get_handle
(
&
args
);
ULONG
flags
=
get_ulong
(
&
args
);
return
NtUserAssociateInputContext
(
hwnd
,
ctx
,
flags
);
}
NTSTATUS
WINAPI
wow64_NtUserAttachThreadInput
(
UINT
*
args
)
{
DWORD
from
=
get_ulong
(
&
args
);
...
...
include/ntuser.h
View file @
f5b3283e
...
...
@@ -63,6 +63,7 @@ struct ntuser_thread_info
ULONG_PTR
message_extra
;
/* value for GetMessageExtraInfo */
HWND
top_window
;
/* desktop window */
HWND
msg_window
;
/* HWND_MESSAGE parent window */
HIMC
default_imc
;
/* default input context */
void
*
client_imm
;
/* client IMM thread info */
};
...
...
@@ -368,6 +369,14 @@ enum input_context_attr
NtUserInputContextThreadId
,
};
/* NtUserAssociateInputContext result */
enum
associate_input_context_result
{
AICR_OK
,
AICR_FOCUS_CHANGED
,
AICR_FAILED
,
};
/* internal messages codes */
enum
wine_internal_message
{
...
...
@@ -546,6 +555,7 @@ struct packed_MDICREATESTRUCTW
HKL
WINAPI
NtUserActivateKeyboardLayout
(
HKL
layout
,
UINT
flags
);
BOOL
WINAPI
NtUserAddClipboardFormatListener
(
HWND
hwnd
);
UINT
WINAPI
NtUserAssociateInputContext
(
HWND
hwnd
,
HIMC
ctx
,
ULONG
flags
);
BOOL
WINAPI
NtUserAttachThreadInput
(
DWORD
from
,
DWORD
to
,
BOOL
attach
);
HDC
WINAPI
NtUserBeginPaint
(
HWND
hwnd
,
PAINTSTRUCT
*
ps
);
NTSTATUS
WINAPI
NtUserBuildHwndList
(
HDESK
desktop
,
ULONG
unk2
,
ULONG
unk3
,
ULONG
unk4
,
...
...
@@ -1049,6 +1059,7 @@ enum
NtUserCallHwnd_GetParent
,
NtUserCallHwnd_GetWindowContextHelpId
,
NtUserCallHwnd_GetWindowDpiAwarenessContext
,
NtUserCallHwnd_GetWindowInputContext
,
NtUserCallHwnd_GetWindowTextLength
,
NtUserCallHwnd_IsWindow
,
NtUserCallHwnd_IsWindowEnabled
,
...
...
@@ -1088,6 +1099,11 @@ static inline DPI_AWARENESS_CONTEXT NtUserGetWindowDpiAwarenessContext( HWND hwn
NtUserCallHwnd_GetWindowDpiAwarenessContext
);
}
static
inline
HIMC
NtUserGetWindowInputContext
(
HWND
hwnd
)
{
return
UlongToHandle
(
NtUserCallHwnd
(
hwnd
,
NtUserCallHwnd_GetWindowInputContext
));
}
static
inline
INT
NtUserGetWindowTextLength
(
HWND
hwnd
)
{
return
NtUserCallHwnd
(
hwnd
,
NtUserCallHwnd_GetWindowTextLength
);
...
...
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