75 TRACE(
"(%p, %p)\n", hKL, pImeInfoEx);
86 pszSubKey =
L"Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM";
107 pImeInfoEx->
hkl = hKL;
125 TRACE(
"(%p)\n", hKL);
144 for (iKL = 0; iKL < cKLs; ++iKL)
159 WARN(
"Default to English US\n");
192 BOOL fOldOpen, bIsNewHKLIme =
TRUE, bIsOldHKLIme =
TRUE, bClientWide, bNewDpiWide;
193 DWORD cbNewPrivate = 0, cbOldPrivate = 0, dwOldConversion, dwOldSentence,
dwSize, dwNewSize;
204 if (hNewKL != hOldKL)
218 cbOldPrivate = pOldImeDpi->ImeInfo.dwPrivateDataSize;
220 cbNewPrivate =
max(cbNewPrivate,
sizeof(
DWORD));
221 cbOldPrivate =
max(cbOldPrivate,
sizeof(
DWORD));
223 if (pClientImc->
hKL == hOldKL)
228 pOldImeDpi->ImeSelect(hIMC,
FALSE);
230 pOldImeDpi->CtfImeSelectEx(hIMC,
FALSE, hOldKL);
247 pNewImeDpi->ImeSelect(hIMC,
TRUE);
249 pNewImeDpi->CtfImeSelectEx(hIMC,
TRUE, hNewKL);
251 pClientImc->
hKL = hNewKL;
256 dwOldConversion = pIC->fdwConversion;
257 dwOldSentence = pIC->fdwSentence;
258 fOldOpen = pIC->fOpen;
264 if (bClientWide && !bNewDpiWide)
269 pIC->lfFont.A = LogFontA;
271 pClientImc->
dwFlags &= ~CLIENTIMC_WIDE;
273 else if (!bClientWide && bNewDpiWide)
278 pIC->lfFont.W = LogFontW;
284 if (cbOldPrivate != cbNewPrivate)
292 pIC->hPrivate = hPrivate;
295#define MAX_IMCC_SIZE 0x1000
301 pIC->dwNumMsgBuf = 0;
350 if (pOldImeDpi && bIsOldHKLIme)
357 if (pNewImeDpi && bIsNewHKLIme)
360 if (pOldState != pNewState)
364 pOldState->fOpen = !!pIC->fOpen;
365 pOldState->dwConversion = pIC->fdwConversion;
366 pOldState->dwConversion &= ~IME_CMODE_EUDC;
367 pOldState->dwSentence = pIC->fdwSentence;
368 pOldState->dwInit = pIC->fdwInit;
375 pIC->
dwChange &= ~INPUTCONTEXTDX_CHANGE_FORCE_OPEN;
380 pIC->fOpen = pNewState->
fOpen;
384 pIC->fdwConversion &= ~IME_CMODE_EUDC;
386 pIC->fdwInit = pNewState->
dwInit;
396 pNewImeDpi->ImeSelect(hIMC,
TRUE);
398 pNewImeDpi->CtfImeSelectEx(hIMC,
TRUE, hNewKL);
400 pClientImc->
hKL = hNewKL;
404 if (pIC->fOpen != fOldOpen)
406 if (pIC->fdwConversion != dwOldConversion)
408 if (pIC->fdwSentence != dwOldSentence)
479 SelectLayout.
hNewKL = hKL;
480 SelectLayout.
hOldKL = hOldKL;
514 hOldIMC = pWnd->
hImc;
526 if (hwndFocus ==
hWnd)
628 for (pState = pIC->
pState; pState; pState = pNext)
630 pNext = pState->
pNext;
632 for (pSubState = pState->
pSubState; pSubState; pSubState = pSubNext)
634 pSubNext = pSubState->
pNext;
667 ERR(
"Thread mismatch\n");
674 TRACE(
"pClientImc == NULL\n");
680 ERR(
"Can't destroy for CLIENTIMC_UNKNOWN2\n");
701 if (pClientImc->
hKL == hKL)
707 pImeDpi->ImeSelect(hIMC,
FALSE);
709 pImeDpi->CtfImeSelectEx(hIMC,
FALSE, hKL);
740 DWORD dwIndex, cbPrivate;
789 cbPrivate =
sizeof(
DWORD);
814 pImeDpi->ImeSelect(hIMC,
TRUE);
816 pImeDpi->CtfImeSelectEx(hIMC,
TRUE, hKL);
820 pClientImc->
hKL = hKL;
880 ERR(
"No default IME window\n");
920 TRACE(
"(%p)\n", hIMC);
943 TRACE(
"(%p)\n", hImc);
989 TRACE(
"(%p)\n", pClientImc);
1012 TRACE(
"Not IMM mode.\n");
1027 if (!hIMC && (dwContextFlags & 1))
1060 TRACE(
"(%p)\n", hIMC);
1100 DWORD dwIndex, dwCount;
1110 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex)
1112 hIMC = phList[dwIndex];
1136 TRACE(
"(%p, %p, %d)\n",
hWnd, hIMC, fActive);
1149 pClientImc->
dwFlags &= ~CLIENTIMC_ACTIVE;
1170 dwConversion = pIC->fdwConversion;
1196 pImeDpi->ImeSetActiveContext(hIMC, fActive);
1254 static LANGID s_wKeyboardLangIdCache = 0;
1255 static UINT s_uKeyboardLayoutCPCache = 0;
1257 TRACE(
"(%u)\n", wLangId);
1259 if (wLangId == s_wKeyboardLangIdCache)
1260 return s_uKeyboardLayoutCPCache;
1265 s_wKeyboardLangIdCache = wLangId;
1267 s_uKeyboardLayoutCPCache =
wcstol(szText,
NULL, 10);
1268 return s_uKeyboardLayoutCPCache;
1282 ASSERT(dwValue == 0x100);
1311 ERR(
"ImmInitializeGlobals failed\n");
1316 ERR(
"User32InitializeImmEntryTable failed\n");
1338 TRACE(
"imm32.dll is unloaded\n");
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define UlongToHandle(ul)
#define RegCloseKey(hKey)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
HRESULT WINAPI CtfImmTIMActivate(_In_ HKL hKL)
HRESULT CtfImmTIMCreateInputContext(_In_ HIMC hIMC)
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID)
HRESULT CtfImmTIMDestroyInputContext(_In_ HIMC hIMC)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define DLL_THREAD_DETACH
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define DLL_THREAD_ATTACH
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
RTL_CRITICAL_SECTION gcsImeDpi
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD_PTR dwValue)
BOOL WINAPI ImmLoadIME(HKL hKL)
BOOL APIENTRY Imm32ReleaseIME(HKL hKL)
LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC(HIMC hIMC, BOOL fSelect)
static BOOL APIENTRY ImmInitializeGlobals(HMODULE hMod)
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
HIMC WINAPI ImmCreateContext(void)
UINT WINAPI GetKeyboardLayoutCP(_In_ LANGID wLangId)
HIMC WINAPI ImmGetContext(HWND hWnd)
static HIMC APIENTRY ImmGetSaveContext(HWND hWnd, DWORD dwContextFlags)
BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags)
static BOOL CALLBACK Imm32SelectContextProc(HIMC hIMC, LPARAM lParam)
BOOL WINAPI ImmDestroyContext(HIMC hIMC)
BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep)
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx)
BOOL WINAPI ImmDllInitialize(_In_ HINSTANCE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
static VOID APIENTRY Imm32DestroyImeModeSaver(LPINPUTCONTEXTDX pIC)
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
VOID APIENTRY Imm32UnitTest(VOID)
static BOOL CALLBACK Imm32NotifyIMEProc(HIMC hIMC, LPARAM lParam)
struct SELECT_LAYOUT * LPSELECT_LAYOUT
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
BOOL APIENTRY Imm32CreateInputContext(HIMC hIMC, LPINPUTCONTEXT pIC, PCLIENTIMC pClientImc, HKL hKL, BOOL fSelect)
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
BOOL WINAPI ImmFreeLayout(HKL hKL)
BOOL WINAPI ImmActivateLayout(HKL hKL)
BOOL WINAPI ImmSetActiveContextConsoleIME(HWND hwnd, BOOL fFlag)
ULONG_PTR gHighestUserAddress
VOID APIENTRY Imm32SelectInputContext(HKL hNewKL, HKL hOldKL, HIMC hIMC)
BOOL WINAPI ImmWINNLSGetEnableStatus(HWND hWnd)
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
#define IS_ZERO_UNEXPECTEDLY(p)
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
HRESULT APIENTRY Imm32StrToUInt(LPCWSTR pszText, LPDWORD pdwValue, ULONG nBase)
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
#define ValidateHwnd(hwnd)
#define ImmLocalFree(lpData)
BOOL APIENTRY Imm32CheckImcProcess(PIMC pIMC)
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx)
#define IS_CROSS_THREAD_HIMC(hIMC)
#define IMM_INVALID_CANDFORM
PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
#define REGKEY_KEYBOARD_LAYOUTS
#define IS_ERROR_UNEXPECTEDLY(x)
#define IS_NULL_UNEXPECTEDLY(p)
DWORD APIENTRY Imm32BuildHimcList(DWORD dwThreadId, HIMC **pphList)
#define MAX_CANDIDATEFORM
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
#define IS_CROSS_PROCESS_HWND(hWnd)
PIME_STATE APIENTRY Imm32FetchImeState(LPINPUTCONTEXTDX pIC, HKL hKL)
BOOL APIENTRY Imm32SaveImeStateSentence(LPINPUTCONTEXTDX pIC, PIME_STATE pState, HKL hKL)
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT cchBuff)
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
#define ImeDpi_IsUnicode(pImeDpi)
BOOL APIENTRY Imm32LoadImeStateSentence(LPINPUTCONTEXTDX pIC, PIME_STATE pState, HKL hKL)
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
DWORD WINAPI ImmGetIMCCLockCount(HIMCC imcc)
HIMCC WINAPI ImmCreateIMCC(DWORD size)
DWORD WINAPI ImmGetIMCCSize(HIMCC imcc)
HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
LCID WINAPI GetSystemDefaultLCID(void)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
LPVOID NTAPI LocalLock(HLOCAL hMem)
BOOL NTAPI LocalUnlock(HLOCAL hMem)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
struct tagCLIENTIMC * PCLIENTIMC
#define HKL_SWITCH_TO_NON_IME
#define CLIENTIMC_DESTROY
#define CLIENTIMC_DISABLEIME
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define CLIENTIMC_UNKNOWN2
#define ISC_SHOWUIGUIDELINE
#define ISC_SHOWUIALLCANDIDATEWINDOW
#define IME_PROP_COMPLETE_ON_UNSELECT
struct tagGUIDELINE GUIDELINE
#define INPUTCONTEXTDX_CHANGE_OPEN
#define INPUTCONTEXTDX_CHANGE_SENTENCE
#define NI_COMPOSITIONSTR
struct tagCANDIDATEINFO CANDIDATEINFO
#define INPUTCONTEXTDX_CHANGE_FORCE_OPEN
#define INPUTCONTEXTDX_CHANGE_CONVERSION
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define QUERY_WINDOW_DEFAULT_ICONTEXT
#define QUERY_WINDOW_FOCUS
DWORD NTAPI NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL)
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
BOOL NTAPI NtUserDestroyInputContext(HIMC hIMC)
@ THREADSTATE_DEFAULTINPUTCONTEXT
@ THREADSTATE_IMECOMPATFLAGS
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
HIMC NTAPI NtUserCreateInputContext(ULONG_PTR dwClientImcData)
BOOL NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
#define GetWin32ClientInfo()
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
DWORD NTAPI NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
EXTERN_C HRESULT WINAPI CtfImeSetActiveContextAlways(_In_ HIMC hIMC, _In_ BOOL fActive, _In_ HWND hWnd, _In_ HKL hKL)
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define UNREFERENCED_PARAMETER(P)
#define LANGIDFROMLCID(l)
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
struct IME_SUBSTATE * pNext
struct IME_STATE * pState
CANDIDATEFORM cfCandForm[4]
ULONG_PTR dwClientImcData
_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 GetCurrentThreadId(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define LOCALE_IDEFAULTANSICODEPAGE
#define HKEY_LOCAL_MACHINE
BOOL WINAPI IsWindow(_In_opt_ HWND)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
#define WM_IME_SETCONTEXT
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)