Commit bfa19f8c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Introduce a new ImeToAsciiEx call through NtUserMessageCall.

parent f185dc17
......@@ -455,12 +455,30 @@ BOOL WINAPI ImeProcessKey( HIMC himc, UINT vkey, LPARAM lparam, BYTE *state )
return ret;
}
UINT WINAPI ImeToAsciiEx( UINT vkey, UINT scan_code, BYTE *key_state, TRANSMSGLIST *msgs, UINT state, HIMC himc )
UINT WINAPI ImeToAsciiEx( UINT vkey, UINT vsc, BYTE *state, TRANSMSGLIST *msgs, UINT flags, HIMC himc )
{
FIXME( "vkey %u, scan_code %u, key_state %p, msgs %p, state %u, himc %p stub!\n",
vkey, scan_code, key_state, msgs, state, himc );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return 0;
struct ime_driver_call_params params = {.himc = himc, .state = state};
COMPOSITIONSTRING *compstr;
UINT count = 0;
INPUTCONTEXT *ctx;
NTSTATUS status;
TRACE( "vkey %#x, vsc %#x, state %p, msgs %p, flags %#x, himc %p\n",
vkey, vsc, state, msgs, flags, himc );
if (!(ctx = ImmLockIMC( himc ))) return 0;
if (!(compstr = ImmLockIMCC( ctx->hCompStr ))) goto done;
params.compstr = compstr;
status = NtUserMessageCall( ctx->hWnd, WINE_IME_TO_ASCII_EX, vkey, vsc, &params,
NtUserImeDriverCall, FALSE );
if (status) WARN( "WINE_IME_TO_ASCII_EX returned status %#lx\n", status );
ImmUnlockIMCC( ctx->hCompStr );
done:
ImmUnlockIMC( himc );
return count;
}
BOOL WINAPI ImeConfigure( HKL hkl, HWND hwnd, DWORD mode, void *data )
......
......@@ -721,6 +721,11 @@ static UINT nulldrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const BY
return 0;
}
static UINT nulldrv_ImeToAsciiEx( UINT vkey, UINT vsc, const BYTE *state, COMPOSITIONSTRING *compstr, HIMC himc )
{
return 0;
}
static void nulldrv_NotifyIMEStatus( HWND hwnd, UINT status )
{
}
......@@ -1084,6 +1089,11 @@ static UINT loaderdrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const
return load_driver()->pImeProcessKey( himc, wparam, lparam, state );
}
static UINT loaderdrv_ImeToAsciiEx( UINT vkey, UINT vsc, const BYTE *state, COMPOSITIONSTRING *compstr, HIMC himc )
{
return load_driver()->pImeToAsciiEx( vkey, vsc, state, compstr, himc );
}
static void loaderdrv_NotifyIMEStatus( HWND hwnd, UINT status )
{
return load_driver()->pNotifyIMEStatus( hwnd, status );
......@@ -1196,6 +1206,7 @@ static const struct user_driver_funcs lazy_load_driver =
loaderdrv_UnregisterHotKey,
loaderdrv_VkKeyScanEx,
loaderdrv_ImeProcessKey,
loaderdrv_ImeToAsciiEx,
loaderdrv_NotifyIMEStatus,
/* cursor/icon functions */
nulldrv_DestroyCursorIcon,
......@@ -1277,6 +1288,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
SET_USER_FUNC(UnregisterHotKey);
SET_USER_FUNC(VkKeyScanEx);
SET_USER_FUNC(ImeProcessKey);
SET_USER_FUNC(ImeToAsciiEx);
SET_USER_FUNC(NotifyIMEStatus);
SET_USER_FUNC(DestroyCursorIcon);
SET_USER_FUNC(SetCursor);
......
......@@ -428,6 +428,8 @@ LRESULT ime_driver_call( HWND hwnd, enum wine_ime_call call, WPARAM wparam, LPAR
{
case WINE_IME_PROCESS_KEY:
return user_driver->pImeProcessKey( params->himc, wparam, lparam, params->state );
case WINE_IME_TO_ASCII_EX:
return user_driver->pImeToAsciiEx( wparam, lparam, params->state, params->compstr, params->himc );
default:
ERR( "Unknown IME driver call %#x\n", call );
return 0;
......
......@@ -514,14 +514,6 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
return TRUE;
}
UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
TRANSMSGLIST *lpdwTransKey, UINT fuState, HIMC hIMC)
{
/* See the comment at the head of this file */
TRACE("We do no processing via this route\n");
return 0;
}
/* Interfaces to XIM and other parts of winex11drv */
NTSTATUS x11drv_ime_set_open_status( UINT open )
......
......@@ -12,4 +12,3 @@
#IME Interface
@ stdcall ImeSelect(long long)
@ stdcall ImeToAsciiEx(long long ptr ptr long long)
......@@ -3123,10 +3123,12 @@ NTSTATUS WINAPI wow64_NtUserMessageCall( UINT *args )
{
ULONG himc;
ULONG state;
ULONG compstr;
} *params32 = result_info;
struct ime_driver_call_params params;
params.himc = UlongToPtr( params32->himc );
params.state = UlongToPtr( params32->state );
params.compstr = UlongToPtr( params32->compstr );
return NtUserMessageCall( hwnd, msg, wparam, lparam, &params, type, ansi );
}
}
......
......@@ -22,6 +22,7 @@
#include <winuser.h>
#include <wingdi.h>
#include <imm.h>
#include <immdev.h>
#include <winternl.h>
/* KernelCallbackTable codes, not compatible with Windows */
......@@ -495,6 +496,7 @@ enum wine_internal_message
enum wine_ime_call
{
WINE_IME_PROCESS_KEY,
WINE_IME_TO_ASCII_EX,
};
/* NtUserImeDriverCall params */
......@@ -502,6 +504,7 @@ struct ime_driver_call_params
{
HIMC himc;
const BYTE *state;
COMPOSITIONSTRING *compstr;
};
/* internal IME private */
......
......@@ -23,6 +23,7 @@
#include "winternl.h"
#include "ntuser.h"
#include "immdev.h"
#include "ddk/d3dkmthk.h"
#include "wine/list.h"
......@@ -289,6 +290,7 @@ struct user_driver_funcs
SHORT (*pVkKeyScanEx)(WCHAR, HKL);
/* IME functions */
UINT (*pImeProcessKey)(HIMC,UINT,UINT,const BYTE*);
UINT (*pImeToAsciiEx)(UINT,UINT,const BYTE*,COMPOSITIONSTRING*,HIMC);
void (*pNotifyIMEStatus)(HWND,UINT);
/* cursor/icon functions */
void (*pDestroyCursorIcon)(HCURSOR);
......
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