Module: wine Branch: master Commit: f371309f6d12273c889ebb9d6be1c8bcb613450a URL: https://gitlab.winehq.org/wine/wine/-/commit/f371309f6d12273c889ebb9d6be1c8b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Sun Dec 4 18:59:10 2022 +0100
include: Fix ImeToAsciiEx declaration.
---
dlls/imm32/imm.c | 14 ++++---------- dlls/imm32/tests/imm32.c | 6 ------ dlls/winemac.drv/ime.c | 14 ++++---------- dlls/winex11.drv/ime.c | 8 +------- include/immdev.h | 15 ++++++++++++++- 5 files changed, 23 insertions(+), 34 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index c4c495e86a5..57d00dd4984 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -68,7 +68,7 @@ typedef struct _tagImmHkl{ LRESULT (WINAPI *pImeEscape)(HIMC, UINT, void *); BOOL (WINAPI *pImeSelect)(HIMC, BOOL); BOOL (WINAPI *pImeSetActiveContext)(HIMC, BOOL); - UINT (WINAPI *pImeToAsciiEx)(UINT, UINT, const BYTE *, DWORD *, UINT, HIMC); + UINT (WINAPI *pImeToAsciiEx)(UINT, UINT, const BYTE *, TRANSMSGLIST *, UINT, HIMC); BOOL (WINAPI *pNotifyIME)(HIMC, DWORD, DWORD, DWORD); BOOL (WINAPI *pImeRegisterWord)(const WCHAR *, DWORD, const WCHAR *); BOOL (WINAPI *pImeUnregisterWord)(const WCHAR *, DWORD, const WCHAR *); @@ -97,12 +97,6 @@ typedef struct tagInputContextData
#define WINE_IMC_VALID_MAGIC 0x56434D49
-typedef struct _tagTRANSMSG { - UINT message; - WPARAM wParam; - LPARAM lParam; -} TRANSMSG, *LPTRANSMSG; - struct coinit_spy { IInitializeSpy IInitializeSpy_iface; @@ -3004,7 +2998,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD HIMC imc = ImmGetContext(hwnd); BYTE state[256]; UINT scancode; - LPVOID list = 0; + TRANSMSGLIST *list = NULL; UINT msg_count; UINT uVirtKey; static const DWORD list_count = 10; @@ -3020,7 +3014,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD scancode = lKeyData >> 0x10 & 0xff;
list = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list_count * sizeof(TRANSMSG) + sizeof(DWORD)); - ((DWORD*)list)[0] = list_count; + list->uMsgCount = list_count;
if (data->immKbd->imeInfo.fdwProperty & IME_PROP_KBD_CHAR_FIRST) { @@ -3040,7 +3034,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD if (msg_count && msg_count <= list_count) { UINT i; - LPTRANSMSG msgs = (LPTRANSMSG)((LPBYTE)list + sizeof(DWORD)); + LPTRANSMSG msgs = list->TransMsg;
for (i = 0; i < msg_count; i++) ImmInternalPostIMEMessage(data, msgs[i].message, msgs[i].wParam, msgs[i].lParam); diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index e6d51a1329e..a97457320ce 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -93,12 +93,6 @@ typedef struct } u; } TEST_INPUT;
-typedef struct _tagTRANSMSG { - UINT message; - WPARAM wParam; - LPARAM lParam; -} TRANSMSG, *LPTRANSMSG; - static UINT (WINAPI *pSendInput) (UINT, INPUT*, size_t);
static LRESULT CALLBACK get_msg_filter(int nCode, WPARAM wParam, LPARAM lParam) diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index 7c0495a6fd5..5780c942283 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -52,12 +52,6 @@ typedef struct _IMEPRIVATE { UINT repeat; } IMEPRIVATE, *LPIMEPRIVATE;
-typedef struct _tagTRANSMSG { - UINT message; - WPARAM wParam; - LPARAM lParam; -} TRANSMSG, *LPTRANSMSG; - static const WCHAR UI_CLASS_NAME[] = {'W','i','n','e',' ','M','a','c',' ','I','M','E',0};
static HIMC *hSelectedFrom = NULL; @@ -454,15 +448,15 @@ static void GenerateIMEMessage(HIMC hIMC, UINT msg, WPARAM wParam, LPARAM lParam UnlockRealIMC(hIMC); }
-static BOOL GenerateMessageToTransKey(LPDWORD lpTransBuf, UINT *uNumTranMsgs, +static BOOL GenerateMessageToTransKey(TRANSMSGLIST *lpTransBuf, UINT *uNumTranMsgs, UINT msg, WPARAM wParam, LPARAM lParam) { LPTRANSMSG ptr;
- if (*uNumTranMsgs + 1 >= (UINT)*lpTransBuf) + if (*uNumTranMsgs + 1 >= lpTransBuf->uMsgCount) return FALSE;
- ptr = (LPTRANSMSG)(lpTransBuf + 1 + *uNumTranMsgs * 3); + ptr = lpTransBuf->TransMsg + *uNumTranMsgs; ptr->message = msg; ptr->wParam = wParam; ptr->lParam = lParam; @@ -652,7 +646,7 @@ BOOL WINAPI ImeSetActiveContext(HIMC hIMC, BOOL fFlag) }
UINT WINAPI ImeToAsciiEx(UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState, - LPDWORD lpdwTransKey, UINT fuState, HIMC hIMC) + TRANSMSGLIST *lpdwTransKey, UINT fuState, HIMC hIMC) { struct process_text_input_params params; UINT vkey; diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c index ef498760a60..a293daa6ad9 100644 --- a/dlls/winex11.drv/ime.c +++ b/dlls/winex11.drv/ime.c @@ -56,12 +56,6 @@ typedef struct _IMEPRIVATE { HWND hwndDefault; } IMEPRIVATE, *LPIMEPRIVATE;
-typedef struct _tagTRANSMSG { - UINT message; - WPARAM wParam; - LPARAM lParam; -} TRANSMSG, *LPTRANSMSG; - static const WCHAR UI_CLASS_NAME[] = {'W','i','n','e','X','1','1','I','M','E',0};
static HIMC *hSelectedFrom = NULL; @@ -618,7 +612,7 @@ BOOL WINAPI ImeSetActiveContext(HIMC hIMC,BOOL fFlag) }
UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState, - LPDWORD lpdwTransKey, UINT fuState, HIMC hIMC) + TRANSMSGLIST *lpdwTransKey, UINT fuState, HIMC hIMC) { /* See the comment at the head of this file */ TRACE("We do no processing via this route\n"); diff --git a/include/immdev.h b/include/immdev.h index eb6591d1e74..350adf00a8b 100644 --- a/include/immdev.h +++ b/include/immdev.h @@ -107,6 +107,19 @@ typedef struct tagCANDIDATEINFO DWORD dwPrivateOffset; } CANDIDATEINFO, *LPCANDIDATEINFO;
+typedef struct tagTRANSMSG +{ + UINT message; + WPARAM wParam; + LPARAM lParam; +} TRANSMSG, *LPTRANSMSG; + +typedef struct tagTRANSMSGLIST +{ + UINT uMsgCount; + TRANSMSG TransMsg[1]; +} TRANSMSGLIST, *LPTRANSMSGLIST; + LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC); BOOL WINAPI ImmUnlockIMC(HIMC); DWORD WINAPI ImmGetIMCLockCount(HIMC); @@ -162,7 +175,7 @@ LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID); BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, const LPBYTE); BOOL WINAPI ImeSelect(HIMC, BOOL); BOOL WINAPI ImeSetActiveContext(HIMC, BOOL); -UINT WINAPI ImeToAsciiEx(UINT, UINT, const LPBYTE, LPDWORD, UINT, HIMC); +UINT WINAPI ImeToAsciiEx(UINT, UINT, const LPBYTE, LPTRANSMSGLIST, UINT, HIMC); BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD); BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR); BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR);