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
0826fbbb
Commit
0826fbbb
authored
Jul 09, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use KeUserModeCallback for ImmProcessKey and ImmTranslateMessage calls.
parent
047d74c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
9 deletions
+57
-9
user_main.c
dlls/user32/user_main.c
+13
-2
imm.c
dlls/win32u/imm.c
+20
-0
message.c
dlls/win32u/message.c
+4
-5
ntuser_private.h
dlls/win32u/ntuser_private.h
+0
-2
ntuser.h
include/ntuser.h
+20
-0
No files found.
dlls/user32/user_main.c
View file @
0826fbbb
...
...
@@ -133,8 +133,6 @@ static NTSTATUS try_finally( NTSTATUS (CDECL *func)( void *), void *arg,
static
const
struct
user_callbacks
user_funcs
=
{
ImmProcessKey
,
ImmTranslateMessage
,
NtWaitForMultipleObjects
,
post_dde_message
,
unpack_dde_message
,
...
...
@@ -163,6 +161,17 @@ static NTSTATUS WINAPI User32DrawText( const struct draw_text_params *params, UL
return
DrawTextW
(
params
->
hdc
,
params
->
str
,
size
/
sizeof
(
WCHAR
),
params
->
rect
,
params
->
flags
);
}
static
NTSTATUS
WINAPI
User32ImmProcessKey
(
const
struct
imm_process_key_params
*
params
,
ULONG
size
)
{
return
ImmProcessKey
(
params
->
hwnd
,
params
->
hkl
,
params
->
vkey
,
params
->
key_data
,
0
);
}
static
NTSTATUS
WINAPI
User32ImmTranslateMessage
(
const
struct
imm_translate_message_params
*
params
,
ULONG
size
)
{
return
ImmTranslateMessage
(
params
->
hwnd
,
params
->
msg
,
params
->
wparam
,
params
->
key_data
);
}
static
NTSTATUS
WINAPI
User32LoadImage
(
const
struct
load_image_params
*
params
,
ULONG
size
)
{
HANDLE
ret
=
LoadImageW
(
params
->
hinst
,
params
->
name
,
params
->
type
,
...
...
@@ -206,6 +215,8 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32DrawScrollBar
,
User32DrawText
,
User32FreeCachedClipboardData
,
User32ImmProcessKey
,
User32ImmTranslateMessage
,
User32LoadDriver
,
User32LoadImage
,
User32LoadSysMenu
,
...
...
dlls/win32u/imm.c
View file @
0826fbbb
...
...
@@ -27,6 +27,7 @@
#include <pthread.h>
#include "win32u_private.h"
#include "ntuser_private.h"
#include "ddk/imm.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
imm
);
...
...
@@ -391,3 +392,22 @@ void cleanup_imm_thread(void)
NtUserDestroyInputContext
(
thread_info
->
client_info
.
default_imc
);
}
BOOL
WINAPI
ImmProcessKey
(
HWND
hwnd
,
HKL
hkl
,
UINT
vkey
,
LPARAM
key_data
,
DWORD
unknown
)
{
struct
imm_process_key_params
params
=
{
.
hwnd
=
hwnd
,
.
hkl
=
hkl
,
.
vkey
=
vkey
,
.
key_data
=
key_data
};
void
*
ret_ptr
;
ULONG
ret_len
;
return
KeUserModeCallback
(
NtUserImmProcessKey
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
BOOL
WINAPI
ImmTranslateMessage
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
key_data
)
{
struct
imm_translate_message_params
params
=
{
.
hwnd
=
hwnd
,
.
msg
=
msg
,
.
wparam
=
wparam
,
.
key_data
=
key_data
};
void
*
ret_ptr
;
ULONG
ret_len
;
return
KeUserModeCallback
(
NtUserImmTranslateMessage
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
dlls/win32u/message.c
View file @
0826fbbb
...
...
@@ -32,6 +32,7 @@
#include "hidusage.h"
#include "dbt.h"
#include "dde.h"
#include "ddk/imm.h"
#include "wine/server.h"
#include "wine/debug.h"
...
...
@@ -1362,9 +1363,8 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter,
if
(
remove
)
accept_hardware_message
(
hw_id
);
msg
->
pt
=
point_phys_to_win_dpi
(
msg
->
hwnd
,
msg
->
pt
);
if
(
remove
&&
msg
->
message
==
WM_KEYDOWN
&&
user_callbacks
)
if
(
user_callbacks
->
pImmProcessKey
(
msg
->
hwnd
,
NtUserGetKeyboardLayout
(
0
),
msg
->
wParam
,
msg
->
lParam
,
0
))
if
(
remove
&&
msg
->
message
==
WM_KEYDOWN
)
if
(
ImmProcessKey
(
msg
->
hwnd
,
NtUserGetKeyboardLayout
(
0
),
msg
->
wParam
,
msg
->
lParam
,
0
))
msg
->
wParam
=
VK_PROCESSKEY
;
return
TRUE
;
...
...
@@ -2969,8 +2969,7 @@ BOOL WINAPI NtUserTranslateMessage( const MSG *msg, UINT flags )
return
TRUE
;
case
VK_PROCESSKEY
:
return
user_callbacks
&&
user_callbacks
->
pImmTranslateMessage
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
return
ImmTranslateMessage
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
}
NtUserGetKeyboardState
(
state
);
...
...
dlls/win32u/ntuser_private.h
View file @
0826fbbb
...
...
@@ -32,8 +32,6 @@ struct hardware_msg_data;
struct
user_callbacks
{
BOOL
(
WINAPI
*
pImmProcessKey
)(
HWND
,
HKL
,
UINT
,
LPARAM
,
DWORD
);
BOOL
(
WINAPI
*
pImmTranslateMessage
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
NTSTATUS
(
WINAPI
*
pNtWaitForMultipleObjects
)(
ULONG
,
const
HANDLE
*
,
BOOLEAN
,
BOOLEAN
,
const
LARGE_INTEGER
*
);
BOOL
(
CDECL
*
post_dde_message
)(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
DWORD
dest_tid
,
DWORD
type
);
...
...
include/ntuser.h
View file @
0826fbbb
...
...
@@ -37,6 +37,8 @@ enum
NtUserDrawScrollBar
,
NtUserDrawText
,
NtUserFreeCachedClipboardData
,
NtUserImmProcessKey
,
NtUserImmTranslateMessage
,
NtUserLoadDriver
,
NtUserLoadImage
,
NtUserLoadSysMenu
,
...
...
@@ -181,6 +183,24 @@ struct free_cached_data_params
HANDLE
handle
;
};
/* NtUserImmProcessKey params */
struct
imm_process_key_params
{
HWND
hwnd
;
HKL
hkl
;
UINT
vkey
;
LPARAM
key_data
;
};
/* NtUserImmTranslateMessage params */
struct
imm_translate_message_params
{
HWND
hwnd
;
UINT
msg
;
WPARAM
wparam
;
LPARAM
key_data
;
};
/* NtUserLoadImage params */
struct
load_image_params
{
...
...
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