20 HKL hOldKL, LayoutList[32], hFoundKL =
NULL;
21 UINT iLayout, nLayoutCount;
32 for (iLayout = 0; iLayout < nLayoutCount; ++iLayout)
34 if (LayoutList[iLayout] == hOldKL)
45 for (iLayout = 0; iLayout < nLayoutCount; ++iLayout)
47 if (bNowIME ==
ImmIsIME(LayoutList[iLayout]))
52 hFoundKL = LayoutList[iLayout];
58 if (hFoundKL && hKL != hFoundKL)
103 DWORD dwConversion, dwSentence;
134 DWORD dwConversion, dwSentence;
191 DWORD dwConversion, dwSentence;
214 DWORD dwConversion, dwSentence;
232 DWORD dwConversion, dwSentence;
292 WARN(
"0x%X\n", dwHotKeyID);
314 case WM_IME_STARTCOMPOSITION:
case WM_IME_ENDCOMPOSITION:
378 LPRECONVERTSTRING pRS;
379 LPIMECHARPOSITION pICP;
383 static const size_t acbData[7 * 2] =
387 sizeof(RECONVERTSTRING),
sizeof(RECONVERTSTRING),
388 sizeof(IMECHARPOSITION),
sizeof(RECONVERTSTRING),
391 sizeof(RECONVERTSTRING),
sizeof(RECONVERTSTRING),
392 sizeof(IMECHARPOSITION),
sizeof(RECONVERTSTRING),
395 if (dwCommand == 0 || dwCommand > IMR_DOCUMENTFEED)
397 ERR(
"Out of boundary\n");
401 dwSize = acbData[bAnsiAPI * 7 + dwCommand - 1];
411 case IMR_RECONVERTSTRING:
case IMR_DOCUMENTFEED:
413 if (pRS && (pRS->dwVersion != 0 || pRS->dwSize <
sizeof(RECONVERTSTRING)))
415 ERR(
"Invalid pRS\n");
420 case IMR_CONFIRMRECONVERTSTRING:
422 if (!pRS || pRS->dwVersion != 0)
424 ERR(
"Invalid pRS\n");
445 case IMR_COMPOSITIONFONT:
446 if (bAnsiAPI == bAnsiWnd)
458 case IMR_RECONVERTSTRING:
case IMR_CONFIRMRECONVERTSTRING:
case IMR_DOCUMENTFEED:
459 if (bAnsiAPI == bAnsiWnd || !
pData)
475 if (dwCommand == IMR_CONFIRMRECONVERTSTRING)
484 case IMR_QUERYCHARPOSITION:
485 if (bAnsiAPI == bAnsiWnd)
489 dwCharPos = pICP->dwCharPos;
522 WARN(
"0x%X\n", dwCommand);
534 if (bAnsiAPI == bAnsiWnd)
540 case IMR_COMPOSITIONFONT:
547 case IMR_RECONVERTSTRING:
case IMR_DOCUMENTFEED:
551 if (
ret <
sizeof(RECONVERTSTRING))
566 case IMR_QUERYCHARPOSITION:
567 pICP->dwCharPos = dwCharPos;
571 WARN(
"0x%X\n", dwCommand);
576 if (pTempData !=
pData)
632 TRACE(
"(0x%lX, %p, %p, %p)\n", dwHotKey, lpuModifiers, lpuVKey, lphKL);
633 if (lpuModifiers && lpuVKey)
643 TRACE(
"(%p)\n", hwndIme);
658 TRACE(
"(%p, 0x%lX)\n",
hWnd, dwHotKeyID);
699 TRACE(
"(%p)\n", hIMC);
724 TRACE(
"(%p, %p, 0x%X, %p, 0x%lX)\n",
hWnd, hKL, vKey,
lParam, dwHotKeyID);
734 if ((
LOBYTE(vKey) == VK_PACKET) &&
753 if (pImeDpi->ImeProcessKey(hIMC,
vk,
lParam, KeyState))
801 ret &= ~IPHK_PROCESSBYIME;
846 DWORD dwIndex, dwCount, cbTrans;
850 TRACE(
"(%p)\n", hIMC);
875 cbTrans = dwCount *
sizeof(
TRANSMSG);
882#ifdef IMM_WIN3_SUPPORT
892 dwCount = WINNLSTranslateMessage(dwCount, pTrans, hIMC, bAnsi, wLang);
900 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem)
932#ifdef IMM_WIN3_SUPPORT
947 dwCount = WINNLSTranslateMessage(dwCount, pNewTransMsg, hIMC, bAnsi, Lang);
951 pNewTransMsg = lpTransMsg;
958 pItem = pNewTransMsg;
959 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem)
967#ifdef IMM_WIN3_SUPPORT
968 if (pNewTransMsg != lpTransMsg)
979#define MSG_COUNT 0x100
986 BYTE abKeyState[256];
1016 dwCount = pIC->dwNumMsgBuf;
1027 pIC->dwNumMsgBuf = 0;
1061 if ((
BYTE)
vk == VK_PACKET)
1082 kret = pImeDpi->ImeToAsciiEx(
vk,
HIWORD(lKeyData), abKeyState,
pList, 0, hIMC);
1172 uVK = *puVK = (
wParam & 0xFF);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
BOOL WINAPI CtfImmIsCiceroStartedInThread(VOID)
LRESULT CtfImmSetLangBand(_In_ HWND hWnd, _In_ BOOL fSet)
DWORD g_aimm_compat_flags
BOOL WINAPI ImmIsIME(HKL hKL)
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD_PTR dwValue)
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
HIMC WINAPI ImmGetContext(HWND hWnd)
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
#define IS_ZERO_UNEXPECTEDLY(p)
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
#define LANGID_CHINESE_SIMPLIFIED
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
LPVOID FASTCALL ValidateHandleNoErr(HANDLE hObject, UINT uType)
#define ValidateHwnd(hwnd)
#define ImmLocalFree(lpData)
#define IS_CROSS_THREAD_HIMC(hIMC)
PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
#define ValidateHwndNoErr(hwnd)
#define LANGID_CHINESE_TRADITIONAL
DWORD APIENTRY Imm32ReconvertAnsiFromWide(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, UINT uCodePage)
#define INVALID_HOTKEY_ID
#define IS_NULL_UNEXPECTEDLY(p)
#define ImeDpi_IsUnicode(pImeDpi)
LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage)
DWORD APIENTRY Imm32ReconvertWideFromAnsi(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, UINT uCodePage)
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
LCID WINAPI GetSystemDefaultLCID(void)
struct _tagTRANSMSG TRANSMSG
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define IME_HOTKEY_PRIVATE_LAST
#define IME_JHOTKEY_CLOSE_OPEN
#define IME_KHOTKEY_HANJACONVERT
#define IME_CMODE_HANJACONVERT
#define IME_THOTKEY_IME_NONIME_TOGGLE
#define IME_CHOTKEY_SYMBOL_TOGGLE
#define IME_CHOTKEY_IME_NONIME_TOGGLE
#define IMN_SETSENTENCEMODE
#define IME_ESC_PRIVATE_HOTKEY
#define IME_KHOTKEY_SHAPE_TOGGLE
#define IME_THOTKEY_SHAPE_TOGGLE
#define IME_HOTKEY_PRIVATE_FIRST
#define IME_KHOTKEY_ENGLISH
#define IMN_SETOPENSTATUS
#define IME_CMODE_FULLSHAPE
#define IME_THOTKEY_SYMBOL_TOGGLE
#define IME_CHOTKEY_SHAPE_TOGGLE
#define IMN_SETCONVERSIONMODE
#define INPUTCONTEXTDX_CHANGE_OPEN
#define INPUTCONTEXTDX_CHANGE_SENTENCE
#define NI_COMPOSITIONSTR
#define IMS_COMPLETECOMPSTR
#define IMS_UNSETLANGBAND
#define IME_PROP_ACCEPT_WIDE_VKEY
#define INPUTCONTEXTDX_CHANGE_FORCE_OPEN
#define INPUTCONTEXTDX_CHANGE_CONVERSION
#define IME_PROP_NEED_ALTKEY
#define IMS_SENDNOTIFICATION
#define IME_PROP_KBD_CHAR_FIRST
#define IME_PROP_IGNORE_UPKEYS
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
DWORD NTAPI NtUserGetAppImeLevel(HWND hWnd)
@ THREADSTATE_OLDKEYBOARDLAYOUT
BOOL NTAPI NtUserGetImeHotKey(DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, LPHKL lphKL)
#define GetWin32ClientInfo()
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
#define WNDS_ANSIWINDOWPROC
#define VK_DBE_ENTERCONFIGMODE
#define VK_DBE_ENTERWORDREGISTERMODE
#define VK_DBE_NOCODEINPUT
BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyData)
static BOOL APIENTRY ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
LRESULT APIENTRY ImmRequestMessageAW(HIMC hIMC, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
LRESULT WINAPI ImmRequestMessageW(HIMC hIMC, WPARAM wParam, LPARAM lParam)
BOOL APIENTRY Imm32JCloseOpen(HIMC hIMC, HKL hKL, HWND hWnd)
BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
BOOL WINAPI ImmGetHotKey(IN DWORD dwHotKey, OUT LPUINT lpuModifiers, OUT LPUINT lpuVKey, OUT LPHKL lphKL)
DWORD WINAPI ImmCallImeConsoleIME(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam, _Out_ LPUINT puVK)
DWORD WINAPI ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID)
UINT WINAPI ImmGetVirtualKey(HWND hWnd)
BOOL APIENTRY Imm32CSymbolToggle(HIMC hIMC, HKL hKL, HWND hWnd)
UINT WINAPI ImmWINNLSGetIMEHotkey(HWND hwndIme)
BOOL APIENTRY Imm32ImeNonImeToggle(HIMC hIMC, HKL hKL, HWND hWnd, BOOL bNowIME, LANGID LangID)
LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam)
BOOL WINAPI ImmIsUIMessageW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
VOID APIENTRY ImmPostMessages(HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg)
DWORD WINAPI ImmGetAppCompatFlags(HIMC hIMC)
BOOL APIENTRY Imm32CShapeToggle(HIMC hIMC, HKL hKL, HWND hWnd)
BOOL APIENTRY Imm32ProcessHotKey(HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID)
BOOL APIENTRY Imm32KEnglish(HIMC hIMC)
BOOL APIENTRY Imm32SendNotification(BOOL bProcess)
BOOL WINAPI ImmIsUIMessageA(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI ImmRequestMessageA(HIMC hIMC, WPARAM wParam, LPARAM lParam)
BOOL APIENTRY Imm32KShapeToggle(HIMC hIMC)
BOOL APIENTRY Imm32CImeNonImeToggle(HIMC hIMC, HKL hKL, HWND hWnd, LANGID LangID)
static BOOL CALLBACK Imm32SendNotificationProc(_In_ HIMC hIMC, _In_ LPARAM lParam)
LRESULT APIENTRY Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bAnsiAPI)
BOOL APIENTRY Imm32KHanjaConvert(HIMC hIMC)
BOOL WINAPI ImmSimulateHotKey(HWND hWnd, DWORD dwHotKeyID)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
EXTERN_C HRESULT WINAPI CtfImeProcessCicHotkey(_In_ HIMC hIMC, _In_ UINT vKey, _In_ LPARAM lParam)
#define UNREFERENCED_PARAMETER(P)
#define offsetof(TYPE, MEMBER)
#define LANGIDFROMLCID(l)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define RtlCopyMemory(Destination, Source, Length)
#define IPHK_PROCESSBYIME
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
BOOL WINAPI IsWindow(_In_opt_ HWND)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI ToUnicode(_In_ UINT wVirtKey, _In_ UINT wScanCode, _In_reads_bytes_opt_(256) CONST BYTE *lpKeyState, _Out_writes_(cchBuff) LPWSTR pwszBuff, _In_ int cchBuff, _In_ UINT wFlags)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
#define WM_IME_SETCONTEXT
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
#define WM_IME_COMPOSITIONFULL
int WINAPI ToAsciiEx(_In_ UINT, _In_ UINT, _In_reads_opt_(256) CONST BYTE *, _Out_ LPWORD, _In_ UINT, _In_opt_ HKL)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)