Commit 0826fbbb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use KeUserModeCallback for ImmProcessKey and ImmTranslateMessage calls.

parent 047d74c4
......@@ -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,
......
......@@ -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 );
}
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment