ReactOS 0.4.15-dev-8096-ga0eec98
imm.c File Reference
#include "precomp.h"
#include <ndk/exfuncs.h>
Include dependency graph for imm.c:

Go to the source code of this file.

Classes

struct  SELECT_LAYOUT
 

Macros

#define MAX_IMCC_SIZE   0x1000
 

Typedefs

typedef struct SELECT_LAYOUT SELECT_LAYOUT
 
typedef struct SELECT_LAYOUTLPSELECT_LAYOUT
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
static BOOL APIENTRY ImmInitializeGlobals (HMODULE hMod)
 
BOOL WINAPI ImmRegisterClient (PSHAREDINFO ptr, HINSTANCE hMod)
 
BOOL WINAPI ImmLoadLayout (HKL hKL, PIMEINFOEX pImeInfoEx)
 
BOOL WINAPI ImmFreeLayout (DWORD dwUnknown)
 
VOID APIENTRY Imm32SelectInputContext (HKL hNewKL, HKL hOldKL, HIMC hIMC)
 
static BOOL CALLBACK Imm32SelectContextProc (HIMC hIMC, LPARAM lParam)
 
static BOOL CALLBACK Imm32NotifyIMEProc (HIMC hIMC, LPARAM lParam)
 
BOOL WINAPI ImmActivateLayout (HKL hKL)
 
HIMC WINAPI ImmAssociateContext (HWND hWnd, HIMC hIMC)
 
BOOL WINAPI ImmAssociateContextEx (HWND hWnd, HIMC hIMC, DWORD dwFlags)
 
HIMC WINAPI ImmCreateContext (void)
 
static VOID APIENTRY Imm32DestroyImeModeSaver (LPINPUTCONTEXTDX pIC)
 
BOOL APIENTRY Imm32DestroyInputContext (HIMC hIMC, HKL hKL, BOOL bKeep)
 
BOOL APIENTRY Imm32CreateInputContext (HIMC hIMC, LPINPUTCONTEXT pIC, PCLIENTIMC pClientImc, HKL hKL, BOOL fSelect)
 
LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC (HIMC hIMC, BOOL fSelect)
 
BOOL WINAPI ImmDestroyContext (HIMC hIMC)
 
PCLIENTIMC WINAPI ImmLockClientImc (HIMC hImc)
 
VOID WINAPI ImmUnlockClientImc (PCLIENTIMC pClientImc)
 
static HIMC APIENTRY ImmGetSaveContext (HWND hWnd, DWORD dwContextFlags)
 
HIMC WINAPI ImmGetContext (HWND hWnd)
 
LPINPUTCONTEXT WINAPI ImmLockIMC (HIMC hIMC)
 
BOOL WINAPI ImmUnlockIMC (HIMC hIMC)
 
BOOL WINAPI ImmReleaseContext (HWND hWnd, HIMC hIMC)
 
BOOL WINAPI ImmEnumInputContext (DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
 
BOOL WINAPI ImmSetActiveContext (HWND hWnd, HIMC hIMC, BOOL fActive)
 
BOOL WINAPI ImmWINNLSGetEnableStatus (HWND hWnd)
 
BOOL WINAPI ImmSetActiveContextConsoleIME (HWND hwnd, BOOL fFlag)
 
UINT WINAPI GetKeyboardLayoutCP (_In_ LANGID wLangId)
 
VOID APIENTRY Imm32UnitTest (VOID)
 
BOOL WINAPI User32InitializeImmEntryTable (DWORD)
 
BOOL WINAPI ImmDllInitialize (_In_ HINSTANCE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
 

Variables

HMODULE ghImm32Inst = NULL
 
PSERVERINFO gpsi = NULL
 
SHAREDINFO gSharedInfo = { NULL }
 
BYTE gfImmInitialized = FALSE
 
ULONG_PTR gHighestUserAddress = 0
 

Macro Definition Documentation

◆ MAX_IMCC_SIZE

#define MAX_IMCC_SIZE   0x1000

Typedef Documentation

◆ LPSELECT_LAYOUT

◆ SELECT_LAYOUT

Function Documentation

◆ GetKeyboardLayoutCP()

UINT WINAPI GetKeyboardLayoutCP ( _In_ LANGID  wLangId)

Definition at line 1250 of file imm.c.

1251{
1252 WCHAR szText[8];
1253 static LANGID s_wKeyboardLangIdCache = 0;
1254 static UINT s_uKeyboardLayoutCPCache = 0;
1255
1256 TRACE("(%u)\n", wLangId);
1257
1258 if (wLangId == s_wKeyboardLangIdCache)
1259 return s_uKeyboardLayoutCPCache;
1260
1261 if (!GetLocaleInfoW(wLangId, LOCALE_IDEFAULTANSICODEPAGE, szText, _countof(szText)))
1262 return 0;
1263
1264 s_wKeyboardLangIdCache = wLangId;
1265 szText[_countof(szText) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
1266 s_uKeyboardLayoutCPCache = wcstol(szText, NULL, 10);
1267 return s_uKeyboardLayoutCPCache;
1268}
#define NULL
Definition: types.h:112
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1665
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
USHORT LANGID
Definition: mui.h:9
unsigned int UINT
Definition: ndis.h:50
#define UNICODE_NULL
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:38
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ Imm32CreateInputContext()

BOOL APIENTRY Imm32CreateInputContext ( HIMC  hIMC,
LPINPUTCONTEXT  pIC,
PCLIENTIMC  pClientImc,
HKL  hKL,
BOOL  fSelect 
)

Definition at line 737 of file imm.c.

738{
739 DWORD dwIndex, cbPrivate;
740 PIMEDPI pImeDpi = NULL;
742 LPCANDIDATEINFO pCI;
743 LPGUIDELINE pGL;
744
745 /* Create IC components */
747 pIC->hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
748 pIC->hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
749 pIC->hMsgBuf = ImmCreateIMCC(sizeof(UINT));
750 if (IS_NULL_UNEXPECTEDLY(pIC->hCompStr) ||
754 {
755 goto Fail;
756 }
757
758 /* Initialize IC components */
759 pCS = ImmLockIMCC(pIC->hCompStr);
760 if (IS_NULL_UNEXPECTEDLY(pCS))
761 goto Fail;
762 pCS->dwSize = sizeof(COMPOSITIONSTRING);
764
765 pCI = ImmLockIMCC(pIC->hCandInfo);
766 if (IS_NULL_UNEXPECTEDLY(pCI))
767 goto Fail;
768 pCI->dwSize = sizeof(CANDIDATEINFO);
770
771 pGL = ImmLockIMCC(pIC->hGuideLine);
772 if (IS_NULL_UNEXPECTEDLY(pGL))
773 goto Fail;
774 pGL->dwSize = sizeof(GUIDELINE);
776
777 pIC->dwNumMsgBuf = 0;
778 pIC->fOpen = FALSE;
779 pIC->fdwConversion = pIC->fdwSentence = 0;
780
781 for (dwIndex = 0; dwIndex < MAX_CANDIDATEFORM; ++dwIndex)
783
784 /* Get private data size */
785 pImeDpi = ImmLockImeDpi(hKL);
786 if (!pImeDpi)
787 {
788 cbPrivate = sizeof(DWORD);
789 }
790 else
791 {
792 /* Update CLIENTIMC */
793 pClientImc->uCodePage = pImeDpi->uCodePage;
794 if (ImeDpi_IsUnicode(pImeDpi))
795 pClientImc->dwFlags |= CLIENTIMC_WIDE;
796
797 cbPrivate = pImeDpi->ImeInfo.dwPrivateDataSize;
798 }
799
800 /* Create private data */
801 pIC->hPrivate = ImmCreateIMCC(cbPrivate);
803 goto Fail;
804
806
807 if (pImeDpi)
808 {
809 /* Select the IME */
810 if (fSelect)
811 {
812 if (IS_IME_HKL(hKL))
813 pImeDpi->ImeSelect(hIMC, TRUE);
814 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
815 pImeDpi->CtfImeSelectEx(hIMC, TRUE, hKL);
816 }
817
818 /* Set HKL */
819 pClientImc->hKL = hKL;
820
821 ImmUnlockImeDpi(pImeDpi);
822 }
823
824 return TRUE;
825
826Fail:
827 if (pImeDpi)
828 ImmUnlockImeDpi(pImeDpi);
829
830 pIC->hMsgBuf = ImmDestroyIMCC(pIC->hMsgBuf);
833 pIC->hCompStr = ImmDestroyIMCC(pIC->hCompStr);
834 return FALSE;
835}
HRESULT CtfImmTIMCreateInputContext(_In_ HIMC hIMC)
Definition: ctf.c:939
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:978
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:1007
#define IMM_INVALID_CANDFORM
Definition: precomp.h:51
#define IS_NULL_UNEXPECTEDLY(p)
Definition: precomp.h:125
#define MAX_CANDIDATEFORM
Definition: precomp.h:53
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:150
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: utils.c:1208
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: utils.c:1178
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: utils.c:1198
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: utils.c:1188
int Fail
Definition: ehthrow.cxx:24
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:138
struct tagGUIDELINE GUIDELINE
struct tagCANDIDATEINFO CANDIDATEINFO
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
#define IS_16BIT_MODE()
Definition: ntuser.h:1211
#define IS_CICERO_MODE()
Definition: ntuser.h:1210
#define DWORD
Definition: nt_native.h:44
DWORD dwIndex
Definition: dimm.idl:79
IMEINFO ImeInfo
Definition: imm32_undoc.h:63
UINT uCodePage
Definition: imm32_undoc.h:64
DWORD dwPrivateDataSize
Definition: immdev.h:21
HIMCC hPrivate
Definition: immdev.h:144
CANDIDATEFORM cfCandForm[4]
Definition: immdev.h:140
HIMCC hMsgBuf
Definition: immdev.h:146
HIMCC hCompStr
Definition: immdev.h:141
DWORD fdwConversion
Definition: immdev.h:133
HIMCC hCandInfo
Definition: immdev.h:142
HIMCC hGuideLine
Definition: immdev.h:143
DWORD fdwSentence
Definition: immdev.h:134
DWORD dwNumMsgBuf
Definition: immdev.h:145
DWORD dwSize
Definition: immdev.h:31
DWORD dwSize
Definition: immdev.h:76

Referenced by Imm32InternalLockIMC().

◆ Imm32DestroyImeModeSaver()

static VOID APIENTRY Imm32DestroyImeModeSaver ( LPINPUTCONTEXTDX  pIC)
static

Definition at line 622 of file imm.c.

623{
624 PIME_STATE pState, pNext;
625 PIME_SUBSTATE pSubState, pSubNext;
626
627 for (pState = pIC->pState; pState; pState = pNext)
628 {
629 pNext = pState->pNext;
630
631 for (pSubState = pState->pSubState; pSubState; pSubState = pSubNext)
632 {
633 pSubNext = pSubState->pNext;
634 ImmLocalFree(pSubState);
635 }
636
637 ImmLocalFree(pState);
638 }
639
640 pIC->pState = NULL;
641}
#define ImmLocalFree(lpData)
Definition: precomp.h:89
PIME_SUBSTATE pSubState
Definition: imm32_undoc.h:188
struct IME_STATE * pNext
Definition: imm32_undoc.h:182
struct IME_SUBSTATE * pNext
Definition: imm32_undoc.h:171
struct IME_STATE * pState
Definition: imm32_undoc.h:164

Referenced by Imm32DestroyInputContext().

◆ Imm32DestroyInputContext()

BOOL APIENTRY Imm32DestroyInputContext ( HIMC  hIMC,
HKL  hKL,
BOOL  bKeep 
)

Definition at line 644 of file imm.c.

645{
646 PIMEDPI pImeDpi;
648 PCLIENTIMC pClientImc;
649 PIMC pIMC;
650
651 if (hIMC == NULL)
652 return FALSE;
653
654 if (!IS_IMM_MODE())
655 {
656 TRACE("\n");
657 return FALSE;
658 }
659
660 pIMC = ValidateHandle(hIMC, TYPE_INPUTCONTEXT);
661 if (IS_NULL_UNEXPECTEDLY(pIMC))
662 return FALSE;
663
664 if (pIMC->head.pti != Imm32CurrentPti())
665 {
666 ERR("Thread mismatch\n");
667 return FALSE;
668 }
669
670 pClientImc = (PCLIENTIMC)pIMC->dwClientImcData;
671 if (pClientImc == NULL)
672 {
673 TRACE("pClientImc == NULL\n");
674 goto Finish;
675 }
676
677 if ((pClientImc->dwFlags & CLIENTIMC_UNKNOWN2) && !bKeep)
678 {
679 ERR("Can't destroy for CLIENTIMC_UNKNOWN2\n");
680 return FALSE;
681 }
682
683 if (pClientImc->dwFlags & CLIENTIMC_DESTROY)
684 return TRUE;
685
686 InterlockedIncrement(&pClientImc->cLockObj);
687
688 if (IS_NULL_UNEXPECTEDLY(pClientImc->hInputContext))
689 goto Quit;
690
691 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
692 if (IS_NULL_UNEXPECTEDLY(pIC))
693 {
694 ImmUnlockClientImc(pClientImc);
695 return FALSE;
696 }
697
699
700 if (pClientImc->hKL == hKL)
701 {
702 pImeDpi = ImmLockImeDpi(hKL);
703 if (pImeDpi)
704 {
705 if (IS_IME_HKL(hKL))
706 pImeDpi->ImeSelect(hIMC, FALSE);
707 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
708 pImeDpi->CtfImeSelectEx(hIMC, FALSE, hKL);
709
710 ImmUnlockImeDpi(pImeDpi);
711 }
712
713 pClientImc->hKL = NULL;
714 }
715
716 ImmDestroyIMCC(pIC->hPrivate);
717 ImmDestroyIMCC(pIC->hMsgBuf);
718 ImmDestroyIMCC(pIC->hGuideLine);
719 ImmDestroyIMCC(pIC->hCandInfo);
720 ImmDestroyIMCC(pIC->hCompStr);
722 ImmUnlockIMC(hIMC);
723
724Quit:
725 pClientImc->dwFlags |= CLIENTIMC_DESTROY;
726 ImmUnlockClientImc(pClientImc);
727
728Finish:
729 if (bKeep)
730 return TRUE;
731 return NtUserDestroyInputContext(hIMC);
732}
#define InterlockedIncrement
Definition: armddk.h:53
#define ERR(fmt,...)
Definition: debug.h:113
HRESULT CtfImmTIMDestroyInputContext(_In_ HIMC hIMC)
Definition: ctf.c:929
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1066
static VOID APIENTRY Imm32DestroyImeModeSaver(LPINPUTCONTEXTDX pIC)
Definition: imm.c:622
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:983
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1057
PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
Definition: utils.c:19
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
Definition: utils.c:377
struct tagCLIENTIMC * PCLIENTIMC
#define CLIENTIMC_DESTROY
Definition: imm32_undoc.h:141
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define CLIENTIMC_UNKNOWN2
Definition: imm32_undoc.h:143
BOOL NTAPI NtUserDestroyInputContext(HIMC hIMC)
Definition: ime.c:1535
#define IS_IMM_MODE()
Definition: ntuser.h:1209
@ TYPE_INPUTCONTEXT
Definition: ntuser.h:57
if(dx< 0)
Definition: linetemp.h:194
HANDLE hInputContext
Definition: imm32_undoc.h:116
Definition: ntuser.h:199
THRDESKHEAD head
Definition: ntuser.h:200
ULONG_PTR dwClientImcData
Definition: ntuser.h:202

Referenced by ImmDestroyContext(), and ImmDllInitialize().

◆ Imm32InternalLockIMC()

LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC ( HIMC  hIMC,
BOOL  fSelect 
)

Definition at line 837 of file imm.c.

838{
839 HANDLE hIC;
840 LPINPUTCONTEXT pIC = NULL;
841 PCLIENTIMC pClientImc;
842 WORD LangID;
844 HKL hOldKL, hNewKL;
845 PIMEDPI pImeDpi = NULL;
846
847 pClientImc = ImmLockClientImc(hIMC);
848 if (!pClientImc)
849 return NULL;
850
851 RtlEnterCriticalSection(&pClientImc->cs);
852
853 if (pClientImc->hInputContext)
854 {
855 pIC = LocalLock(pClientImc->hInputContext);
856 if (IS_NULL_UNEXPECTEDLY(pIC))
857 goto Failure;
858
860 goto Success;
861 }
862
865 {
866 hOldKL = GetKeyboardLayout(0);
867 LangID = LOWORD(hOldKL);
868 hNewKL = (HKL)(DWORD_PTR)MAKELONG(LangID, LangID);
869
870 pImeDpi = Imm32FindOrLoadImeDpi(hNewKL);
871 if (pImeDpi)
872 {
873 CtfImmTIMActivate(hNewKL);
874 }
875 }
876
878 {
879 ERR("No default IME window\n");
880 goto Failure;
881 }
882
883 hIC = LocalAlloc(LHND, sizeof(INPUTCONTEXTDX));
884 pIC = LocalLock(hIC);
885 if (IS_NULL_UNEXPECTEDLY(pIC))
886 {
887 LocalFree(hIC);
888 goto Failure;
889 }
890 pClientImc->hInputContext = hIC;
891
893 if (!Imm32CreateInputContext(hIMC, pIC, pClientImc, hNewKL, fSelect))
894 {
895 LocalUnlock(hIC);
896 pClientImc->hInputContext = LocalFree(hIC);
897 goto Failure;
898 }
899
900Success:
901 RtlLeaveCriticalSection(&pClientImc->cs);
902 InterlockedIncrement(&pClientImc->cLockObj);
903 ImmUnlockClientImc(pClientImc);
904 return pIC;
905
906Failure:
907 RtlLeaveCriticalSection(&pClientImc->cs);
908 ImmUnlockClientImc(pClientImc);
909 return NULL;
910}
HRESULT WINAPI CtfImmTIMActivate(_In_ HKL hKL)
Definition: ctf.c:1123
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:343
BOOL APIENTRY Imm32CreateInputContext(HIMC hIMC, LPINPUTCONTEXT pIC, PCLIENTIMC pClientImc, HKL hKL, BOOL fSelect)
Definition: imm.c:737
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:937
@ Success
Definition: eventcreate.c:712
DWORD dwThreadId
Definition: fdebug.c:31
unsigned short WORD
Definition: ntddk_ex.h:93
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
LPVOID NTAPI LocalLock(HLOCAL hMem)
Definition: heapmem.c:1616
BOOL NTAPI LocalUnlock(HLOCAL hMem)
Definition: heapmem.c:1805
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1791
UINT_PTR HKL
Definition: msctf.idl:143
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define LOWORD(l)
Definition: pedump.c:82
RTL_CRITICAL_SECTION cs
Definition: imm32_undoc.h:120
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define MAKELONG(a, b)
Definition: typedefs.h:249
@ QIC_DEFAULTWINDOWIME
Definition: undocuser.h:394
@ QIC_INPUTTHREADID
Definition: undocuser.h:393
_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
Definition: wdfusb.h:1083
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
#define LHND
Definition: winbase.h:382
HKL WINAPI GetKeyboardLayout(_In_ DWORD)

Referenced by Imm32SelectInputContext(), and ImmLockIMC().

◆ Imm32NotifyIMEProc()

static BOOL CALLBACK Imm32NotifyIMEProc ( HIMC  hIMC,
LPARAM  lParam 
)
static

Definition at line 433 of file imm.c.

434{
436 return TRUE;
437}
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD_PTR dwValue)
Definition: ime.c:907
#define NI_COMPOSITIONSTR
Definition: immdev.h:403

Referenced by ImmActivateLayout().

◆ Imm32SelectContextProc()

static BOOL CALLBACK Imm32SelectContextProc ( HIMC  hIMC,
LPARAM  lParam 
)
static

Definition at line 425 of file imm.c.

426{
428 Imm32SelectInputContext(pSelect->hNewKL, pSelect->hOldKL, hIMC);
429 return TRUE;
430}
struct SELECT_LAYOUT * LPSELECT_LAYOUT
VOID APIENTRY Imm32SelectInputContext(HKL hNewKL, HKL hOldKL, HIMC hIMC)
Definition: imm.c:182
LPFN_SELECT pSelect
Definition: handle.c:32

Referenced by ImmActivateLayout().

◆ Imm32SelectInputContext()

VOID APIENTRY Imm32SelectInputContext ( HKL  hNewKL,
HKL  hOldKL,
HIMC  hIMC 
)

Definition at line 182 of file imm.c.

183{
184 PCLIENTIMC pClientImc;
186 LPGUIDELINE pGL;
187 LPCANDIDATEINFO pCI;
189 LOGFONTA LogFontA;
190 LOGFONTW LogFontW;
191 BOOL fOldOpen, bIsNewHKLIme = TRUE, bIsOldHKLIme = TRUE, bClientWide, bNewDpiWide;
192 DWORD cbNewPrivate = 0, cbOldPrivate = 0, dwOldConversion, dwOldSentence, dwSize, dwNewSize;
193 PIMEDPI pNewImeDpi = NULL, pOldImeDpi = NULL;
194 HANDLE hPrivate;
195 PIME_STATE pNewState = NULL, pOldState = NULL;
196
197 pClientImc = ImmLockClientImc(hIMC);
198 if (IS_NULL_UNEXPECTEDLY(pClientImc))
199 return;
200
201 pNewImeDpi = ImmLockImeDpi(hNewKL);
202
203 if (hNewKL != hOldKL)
204 pOldImeDpi = ImmLockImeDpi(hOldKL);
205
206 if (pNewImeDpi)
207 {
208 cbNewPrivate = pNewImeDpi->ImeInfo.dwPrivateDataSize;
209 pClientImc->uCodePage = pNewImeDpi->uCodePage;
210 }
211 else
212 {
213 pClientImc->uCodePage = CP_ACP;
214 }
215
216 if (pOldImeDpi)
217 cbOldPrivate = pOldImeDpi->ImeInfo.dwPrivateDataSize;
218
219 cbNewPrivate = max(cbNewPrivate, sizeof(DWORD));
220 cbOldPrivate = max(cbOldPrivate, sizeof(DWORD));
221
222 if (pClientImc->hKL == hOldKL)
223 {
224 if (pOldImeDpi)
225 {
226 if (IS_IME_HKL(hOldKL))
227 pOldImeDpi->ImeSelect(hIMC, FALSE);
228 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
229 pOldImeDpi->CtfImeSelectEx(hIMC, FALSE, hOldKL);
230 }
231 pClientImc->hKL = NULL;
232 }
233
235 {
236 bIsNewHKLIme = IS_IME_HKL(hNewKL);
237 bIsOldHKLIme = IS_IME_HKL(hOldKL);
238 }
239
241 if (!pIC)
242 {
243 if (pNewImeDpi)
244 {
245 if (IS_IME_HKL(hNewKL))
246 pNewImeDpi->ImeSelect(hIMC, TRUE);
247 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
248 pNewImeDpi->CtfImeSelectEx(hIMC, TRUE, hNewKL);
249
250 pClientImc->hKL = hNewKL;
251 }
252 }
253 else
254 {
255 dwOldConversion = pIC->fdwConversion;
256 dwOldSentence = pIC->fdwSentence;
257 fOldOpen = pIC->fOpen;
258
259 if (pNewImeDpi)
260 {
261 bClientWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
262 bNewDpiWide = ImeDpi_IsUnicode(pNewImeDpi);
263 if (bClientWide && !bNewDpiWide)
264 {
265 if (pIC->fdwInit & INIT_LOGFONT)
266 {
267 LogFontWideToAnsi(&pIC->lfFont.W, &LogFontA);
268 pIC->lfFont.A = LogFontA;
269 }
270 pClientImc->dwFlags &= ~CLIENTIMC_WIDE;
271 }
272 else if (!bClientWide && bNewDpiWide)
273 {
274 if (pIC->fdwInit & INIT_LOGFONT)
275 {
276 LogFontAnsiToWide(&pIC->lfFont.A, &LogFontW);
277 pIC->lfFont.W = LogFontW;
278 }
279 pClientImc->dwFlags |= CLIENTIMC_WIDE;
280 }
281 }
282
283 if (cbOldPrivate != cbNewPrivate)
284 {
285 hPrivate = ImmReSizeIMCC(pIC->hPrivate, cbNewPrivate);
286 if (!hPrivate)
287 {
288 ImmDestroyIMCC(pIC->hPrivate);
289 hPrivate = ImmCreateIMCC(cbNewPrivate);
290 }
291 pIC->hPrivate = hPrivate;
292 }
293
294#define MAX_IMCC_SIZE 0x1000
295 dwSize = ImmGetIMCCSize(pIC->hMsgBuf);
296 if (ImmGetIMCCLockCount(pIC->hMsgBuf) || dwSize > MAX_IMCC_SIZE)
297 {
298 ImmDestroyIMCC(pIC->hMsgBuf);
299 pIC->hMsgBuf = ImmCreateIMCC(sizeof(UINT));
300 pIC->dwNumMsgBuf = 0;
301 }
302
303 dwSize = ImmGetIMCCSize(pIC->hGuideLine);
304 dwNewSize = sizeof(GUIDELINE);
305 if (ImmGetIMCCLockCount(pIC->hGuideLine) ||
306 dwSize < dwNewSize || dwSize > MAX_IMCC_SIZE)
307 {
308 ImmDestroyIMCC(pIC->hGuideLine);
309 pIC->hGuideLine = ImmCreateIMCC(dwNewSize);
310 pGL = ImmLockIMCC(pIC->hGuideLine);
311 if (pGL)
312 {
313 pGL->dwSize = dwNewSize;
314 ImmUnlockIMCC(pIC->hGuideLine);
315 }
316 }
317
318 dwSize = ImmGetIMCCSize(pIC->hCandInfo);
319 dwNewSize = sizeof(CANDIDATEINFO);
320 if (ImmGetIMCCLockCount(pIC->hCandInfo) ||
321 dwSize < dwNewSize || dwSize > MAX_IMCC_SIZE)
322 {
323 ImmDestroyIMCC(pIC->hCandInfo);
324 pIC->hCandInfo = ImmCreateIMCC(dwNewSize);
325 pCI = ImmLockIMCC(pIC->hCandInfo);
326 if (pCI)
327 {
328 pCI->dwSize = dwNewSize;
329 ImmUnlockIMCC(pIC->hCandInfo);
330 }
331 }
332
333 dwSize = ImmGetIMCCSize(pIC->hCompStr);
334 dwNewSize = sizeof(COMPOSITIONSTRING);
335 if (ImmGetIMCCLockCount(pIC->hCompStr) ||
336 dwSize < dwNewSize || dwSize > MAX_IMCC_SIZE)
337 {
338 ImmDestroyIMCC(pIC->hCompStr);
339 pIC->hCompStr = ImmCreateIMCC(dwNewSize);
340 pCS = ImmLockIMCC(pIC->hCompStr);
341 if (pCS)
342 {
343 pCS->dwSize = dwNewSize;
344 ImmUnlockIMCC(pIC->hCompStr);
345 }
346 }
347#undef MAX_IMCC_SIZE
348
349 if (pOldImeDpi && bIsOldHKLIme)
350 {
351 pOldState = Imm32FetchImeState(pIC, hOldKL);
352 if (pOldState)
353 Imm32SaveImeStateSentence(pIC, pOldState, hOldKL);
354 }
355
356 if (pNewImeDpi && bIsNewHKLIme)
357 pNewState = Imm32FetchImeState(pIC, hNewKL);
358
359 if (pOldState != pNewState)
360 {
361 if (pOldState)
362 {
363 pOldState->fOpen = !!pIC->fOpen;
364 pOldState->dwConversion = pIC->fdwConversion;
365 pOldState->dwConversion &= ~IME_CMODE_EUDC;
366 pOldState->dwSentence = pIC->fdwSentence;
367 pOldState->dwInit = pIC->fdwInit;
368 }
369
370 if (pNewState)
371 {
373 {
374 pIC->dwChange &= ~INPUTCONTEXTDX_CHANGE_FORCE_OPEN;
375 pIC->fOpen = TRUE;
376 }
377 else
378 {
379 pIC->fOpen = pNewState->fOpen;
380 }
381
382 pIC->fdwConversion = pNewState->dwConversion;
383 pIC->fdwConversion &= ~IME_CMODE_EUDC;
384 pIC->fdwSentence = pNewState->dwSentence;
385 pIC->fdwInit = pNewState->dwInit;
386 }
387 }
388
389 if (pNewState)
390 Imm32LoadImeStateSentence(pIC, pNewState, hNewKL);
391
392 if (pNewImeDpi)
393 {
394 if (IS_IME_HKL(hNewKL))
395 pNewImeDpi->ImeSelect(hIMC, TRUE);
396 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
397 pNewImeDpi->CtfImeSelectEx(hIMC, TRUE, hNewKL);
398
399 pClientImc->hKL = hNewKL;
400 }
401
402 pIC->dwChange = 0;
403 if (pIC->fOpen != fOldOpen)
405 if (pIC->fdwConversion != dwOldConversion)
407 if (pIC->fdwSentence != dwOldSentence)
409
410 ImmUnlockIMC(hIMC);
411 }
412
413 ImmUnlockImeDpi(pOldImeDpi);
414 ImmUnlockImeDpi(pNewImeDpi);
415 ImmUnlockClientImc(pClientImc);
416}
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID)
Definition: ctf.c:1079
#define CP_ACP
Definition: compat.h:109
LPINPUTCONTEXT APIENTRY Imm32InternalLockIMC(HIMC hIMC, BOOL fSelect)
Definition: imm.c:837
#define MAX_IMCC_SIZE
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
Definition: utils.c:299
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: utils.c:312
PIME_STATE APIENTRY Imm32FetchImeState(LPINPUTCONTEXTDX pIC, HKL hKL)
Definition: utils.c:552
BOOL APIENTRY Imm32SaveImeStateSentence(LPINPUTCONTEXTDX pIC, PIME_STATE pState, HKL hKL)
Definition: utils.c:608
BOOL APIENTRY Imm32LoadImeStateSentence(LPINPUTCONTEXTDX pIC, PIME_STATE pState, HKL hKL)
Definition: utils.c:596
DWORD WINAPI ImmGetIMCCLockCount(HIMCC imcc)
Definition: utils.c:1218
DWORD WINAPI ImmGetIMCCSize(HIMCC imcc)
Definition: utils.c:1236
HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
Definition: utils.c:1226
unsigned int BOOL
Definition: ntddk_ex.h:94
#define INPUTCONTEXTDX_CHANGE_OPEN
Definition: immdev.h:182
#define INPUTCONTEXTDX_CHANGE_SENTENCE
Definition: immdev.h:184
#define INIT_LOGFONT
Definition: immdev.h:176
#define INPUTCONTEXTDX_CHANGE_FORCE_OPEN
Definition: immdev.h:185
#define INPUTCONTEXTDX_CHANGE_CONVERSION
Definition: immdev.h:183
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
DWORD dwConversion
Definition: imm32_undoc.h:185
WORD fOpen
Definition: imm32_undoc.h:184
DWORD dwInit
Definition: imm32_undoc.h:187
DWORD dwSentence
Definition: imm32_undoc.h:186
#define max(a, b)
Definition: svc.c:63

Referenced by Imm32SelectContextProc().

◆ Imm32UnitTest()

VOID APIENTRY Imm32UnitTest ( VOID  )

Definition at line 1271 of file imm.c.

1272{
1273 if (0)
1274 {
1275 DWORD dwValue;
1276 WCHAR szText[64];
1277
1278 Imm32StrToUInt(L"123", &dwValue, 10);
1279 ASSERT(dwValue == 123);
1280 Imm32StrToUInt(L"100", &dwValue, 16);
1281 ASSERT(dwValue == 0x100);
1282
1283 Imm32UIntToStr(123, 10, szText, _countof(szText));
1284 ASSERT(lstrcmpW(szText, L"123") == 0);
1285 Imm32UIntToStr(0x100, 16, szText, _countof(szText));
1286 ASSERT(lstrcmpW(szText, L"100") == 0);
1287 }
1288}
HRESULT APIENTRY Imm32StrToUInt(LPCWSTR pszText, LPDWORD pdwValue, ULONG nBase)
Definition: utils.c:43
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT cchBuff)
Definition: utils.c:56
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
#define ASSERT(a)
Definition: mode.c:44
#define L(x)
Definition: ntvdm.h:50

Referenced by ImmDllInitialize().

◆ ImmActivateLayout()

BOOL WINAPI ImmActivateLayout ( HKL  hKL)

Definition at line 442 of file imm.c.

443{
444 PIMEDPI pImeDpi;
445 HKL hOldKL;
447 HWND hwndDefIME = NULL;
448 SELECT_LAYOUT SelectLayout;
449
450 hOldKL = GetKeyboardLayout(0);
451
452 if (hOldKL == hKL && !(GetWin32ClientInfo()->CI_flags & CI_IMMACTIVATE))
453 return TRUE;
454
455 ImmLoadIME(hKL);
456
457 if (hOldKL != hKL)
458 {
459 pImeDpi = ImmLockImeDpi(hOldKL);
460 if (pImeDpi)
461 {
464 else
466 ImmUnlockImeDpi(pImeDpi);
467
469 }
470
471 hwndDefIME = ImmGetDefaultIMEWnd(NULL);
472 if (IsWindow(hwndDefIME))
473 SendMessageW(hwndDefIME, WM_IME_SELECT, FALSE, (LPARAM)hOldKL);
474
475 NtUserSetThreadLayoutHandles(hKL, hOldKL);
476 }
477
478 SelectLayout.hNewKL = hKL;
479 SelectLayout.hOldKL = hOldKL;
481
482 if (IsWindow(hwndDefIME))
483 SendMessageW(hwndDefIME, WM_IME_SELECT, TRUE, (LPARAM)hKL);
484
485 return TRUE;
486}
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:890
BOOL WINAPI ImmLoadIME(HKL hKL)
Definition: ime.c:1055
static BOOL CALLBACK Imm32SelectContextProc(HIMC hIMC, LPARAM lParam)
Definition: imm.c:425
static BOOL CALLBACK Imm32NotifyIMEProc(HIMC hIMC, LPARAM lParam)
Definition: imm.c:433
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1096
#define CPS_CANCEL
Definition: imm.h:181
#define CPS_COMPLETE
Definition: imm.h:178
#define IME_PROP_COMPLETE_ON_UNSELECT
Definition: imm.h:250
DWORD NTAPI NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL)
Definition: ime.c:508
#define CI_IMMACTIVATE
Definition: ntuser.h:306
#define GetWin32ClientInfo()
Definition: ntuser.h:352
HKL hNewKL
Definition: imm.c:420
HKL hOldKL
Definition: imm.c:421
DWORD fdwProperty
Definition: immdev.h:22
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_IME_SELECT
Definition: winuser.h:1833
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ImeWnd_OnImeSystem().

◆ ImmAssociateContext()

HIMC WINAPI ImmAssociateContext ( HWND  hWnd,
HIMC  hIMC 
)

Definition at line 491 of file imm.c.

492{
493 PWND pWnd;
494 HWND hwndFocus;
495 DWORD dwValue;
496 HIMC hOldIMC;
497
498 TRACE("(%p, %p)\n", hWnd, hIMC);
499
500 if (!IS_IMM_MODE())
501 {
502 TRACE("\n");
503 return NULL;
504 }
505
506 pWnd = ValidateHwnd(hWnd);
507 if (IS_NULL_UNEXPECTEDLY(pWnd))
508 return NULL;
509
510 if (hIMC && IS_CROSS_THREAD_HIMC(hIMC))
511 return NULL;
512
513 hOldIMC = pWnd->hImc;
514 if (hOldIMC == hIMC)
515 return hIMC;
516
517 dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
518 switch (dwValue)
519 {
520 case 0:
521 return hOldIMC;
522
523 case 1:
525 if (hwndFocus == hWnd)
526 {
527 ImmSetActiveContext(hWnd, hOldIMC, FALSE);
529 }
530 return hOldIMC;
531
532 default:
533 return NULL;
534 }
535}
HWND hWnd
Definition: settings.c:17
DWORD HIMC
Definition: dimm.idl:75
HANDLE HWND
Definition: compat.h:19
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
Definition: imm.c:1124
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IS_CROSS_THREAD_HIMC(hIMC)
Definition: precomp.h:148
#define QUERY_WINDOW_FOCUS
Definition: ntuser.h:2830
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4189
DWORD NTAPI NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags)
Definition: ime.c:1702
Definition: ntuser.h:694
HIMC hImc
Definition: ntuser.h:740

Referenced by ActiveIMMApp_AssociateContext(), Test1(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmAssociateContextEx()

BOOL WINAPI ImmAssociateContextEx ( HWND  hWnd,
HIMC  hIMC,
DWORD  dwFlags 
)

Definition at line 540 of file imm.c.

541{
542 HWND hwndFocus;
544 HIMC hOldIMC = NULL;
545 DWORD dwValue;
546
547 TRACE("(%p, %p, 0x%lX)\n", hWnd, hIMC, dwFlags);
548
549 if (!IS_IMM_MODE())
550 {
551 TRACE("\n");
552 return FALSE;
553 }
554
555 if (hIMC && !(dwFlags & IACE_DEFAULT) && IS_CROSS_THREAD_HIMC(hIMC))
556 return FALSE;
557
559 pFocusWnd = ValidateHwnd(hwndFocus);
560 if (pFocusWnd)
561 hOldIMC = pFocusWnd->hImc;
562
563 dwValue = NtUserAssociateInputContext(hWnd, hIMC, dwFlags);
564 switch (dwValue)
565 {
566 case 0:
567 return TRUE;
568
569 case 1:
570 pFocusWnd = ValidateHwnd(hwndFocus);
571 if (pFocusWnd)
572 {
573 hIMC = pFocusWnd->hImc;
574 if (hIMC != hOldIMC)
575 {
576 ImmSetActiveContext(hwndFocus, hOldIMC, FALSE);
577 ImmSetActiveContext(hwndFocus, hIMC, TRUE);
578 }
579 }
580 return TRUE;
581
582 default:
583 return FALSE;
584 }
585}
HWND pFocusWnd
Definition: magnifier.c:66
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by ActiveIMMApp_AssociateContextEx().

◆ ImmCreateContext()

HIMC WINAPI ImmCreateContext ( void  )

Definition at line 590 of file imm.c.

591{
592 PCLIENTIMC pClientImc;
593 HIMC hIMC;
594
595 TRACE("()\n");
596
597 if (!IS_IMM_MODE())
598 {
599 TRACE("\n");
600 return NULL;
601 }
602
603 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
604 if (IS_NULL_UNEXPECTEDLY(pClientImc))
605 return NULL;
606
607 hIMC = NtUserCreateInputContext((ULONG_PTR)pClientImc);
608 if (IS_NULL_UNEXPECTEDLY(hIMC))
609 {
610 ImmLocalFree(pClientImc);
611 return NULL;
612 }
613
614 RtlInitializeCriticalSection(&pClientImc->cs);
615
617
618 return hIMC;
619}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:415
@ THREADSTATE_IMECOMPATFLAGS
Definition: ntuser.h:2485
HIMC NTAPI NtUserCreateInputContext(ULONG_PTR dwClientImcData)
Definition: ime.c:1606
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:240
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD dwCompatFlags
Definition: imm32_undoc.h:119
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by ActiveIMMApp_CreateContext(), AnotherThreadFunc(), ImmGetContextThreadFunc(), OnInitDialog(), Test1(), test_ImmAssociateContextEx(), test_ImmDefaultHwnd(), test_ImmDestroyContext(), test_ImmGetIMCLockCount(), test_ImmNotifyIME(), and test_InvalidIMC().

◆ ImmDestroyContext()

BOOL WINAPI ImmDestroyContext ( HIMC  hIMC)

Definition at line 915 of file imm.c.

916{
917 HKL hKL;
918
919 TRACE("(%p)\n", hIMC);
920
921 if (!IS_IMM_MODE())
922 {
923 TRACE("\n");
924 return FALSE;
925 }
926
927 if (IS_CROSS_THREAD_HIMC(hIMC))
928 return FALSE;
929
930 hKL = GetKeyboardLayout(0);
931 return Imm32DestroyInputContext(hIMC, hKL, FALSE);
932}
BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep)
Definition: imm.c:644

Referenced by ActiveIMMApp_DestroyContext(), AnotherThreadFunc(), OnInitDialog(), Test1(), test_ImmDefaultHwnd(), test_ImmDestroyContext(), test_ImmGetIMCLockCount(), test_ImmNotifyIME(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmDllInitialize()

BOOL WINAPI ImmDllInitialize ( _In_ HINSTANCE  hDll,
_In_ ULONG  dwReason,
_In_opt_ PVOID  pReserved 
)

Definition at line 1295 of file imm.c.

1299{
1300 HKL hKL;
1301 HIMC hIMC;
1302
1303 TRACE("(%p, 0x%X, %p)\n", hDll, dwReason, pReserved);
1304
1305 switch (dwReason)
1306 {
1307 case DLL_PROCESS_ATTACH:
1308 if (!ImmInitializeGlobals(hDll))
1309 {
1310 ERR("ImmInitializeGlobals failed\n");
1311 return FALSE;
1312 }
1314 {
1315 ERR("User32InitializeImmEntryTable failed\n");
1316 return FALSE;
1317 }
1318#ifndef NDEBUG
1319 Imm32UnitTest();
1320#endif
1321 break;
1322
1323 case DLL_THREAD_ATTACH:
1324 break;
1325
1326 case DLL_THREAD_DETACH:
1327 if (!IS_IMM_MODE() || NtCurrentTeb()->Win32ThreadInfo == NULL)
1328 return TRUE;
1329
1330 hKL = GetKeyboardLayout(0);
1332 Imm32DestroyInputContext(hIMC, hKL, TRUE);
1333 break;
1334
1335 case DLL_PROCESS_DETACH:
1337 TRACE("imm32.dll is unloaded\n");
1338 break;
1339 }
1340
1341 return TRUE;
1342}
DWORD dwReason
Definition: misc.cpp:154
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
static BOOL APIENTRY ImmInitializeGlobals(HMODULE hMod)
Definition: imm.c:23
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:126
VOID APIENTRY Imm32UnitTest(VOID)
Definition: imm.c:1271
#define IMM_INIT_MAGIC
Definition: precomp.h:50
@ THREADSTATE_DEFAULTINPUTCONTEXT
Definition: ntuser.h:2476
#define NtCurrentTeb
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

◆ ImmEnumInputContext()

BOOL WINAPI ImmEnumInputContext ( DWORD  dwThreadId,
IMCENUMPROC  lpfn,
LPARAM  lParam 
)

Definition at line 1096 of file imm.c.

1097{
1098 HIMC *phList;
1099 DWORD dwIndex, dwCount;
1100 BOOL ret = TRUE;
1101 HIMC hIMC;
1102
1103 TRACE("(%lu, %p, %p)\n", dwThreadId, lpfn, lParam);
1104
1105 dwCount = Imm32BuildHimcList(dwThreadId, &phList);
1106 if (IS_ZERO_UNEXPECTEDLY(dwCount))
1107 return FALSE;
1108
1109 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex)
1110 {
1111 hIMC = phList[dwIndex];
1112 ret = (*lpfn)(hIMC, lParam);
1113 if (!ret)
1114 break;
1115 }
1116
1117 ImmLocalFree(phList);
1118 return ret;
1119}
#define IS_ZERO_UNEXPECTEDLY(p)
Definition: precomp.h:129
DWORD APIENTRY Imm32BuildHimcList(DWORD dwThreadId, HIMC **pphList)
Definition: utils.c:460
int ret

Referenced by CicBridge::ActivateIMMX(), AnotherThreadFunc(), CtfAImmActivate(), CicBridge::DeactivateIMMX(), Imm32SendNotification(), ImmActivateLayout(), and OnInitDialog().

◆ ImmFreeLayout()

BOOL WINAPI ImmFreeLayout ( DWORD  dwUnknown)

Definition at line 115 of file imm.c.

116{
117 WCHAR szKBD[KL_NAMELENGTH];
118 UINT iKL, cKLs;
119 HKL hOldKL, hNewKL, *pList;
120 PIMEDPI pImeDpi;
122
123 TRACE("(0x%lX)\n", dwUnknown);
124
125 hOldKL = GetKeyboardLayout(0);
126
127 if (dwUnknown == 1)
128 {
129 if (!IS_IME_HKL(hOldKL))
130 return TRUE;
131
133
134 cKLs = GetKeyboardLayoutList(0, NULL);
135 if (cKLs)
136 {
137 pList = ImmLocalAlloc(0, cKLs * sizeof(HKL));
139 return FALSE;
140
141 cKLs = GetKeyboardLayoutList(cKLs, pList);
142 for (iKL = 0; iKL < cKLs; ++iKL)
143 {
144 if (!IS_IME_HKL(pList[iKL]))
145 {
146 LangID = LOWORD(pList[iKL]);
147 break;
148 }
149 }
150
152 }
153
154 StringCchPrintfW(szKBD, _countof(szKBD), L"%08X", LangID);
156 {
157 WARN("Default to English US\n");
158 LoadKeyboardLayoutW(L"00000409", KLF_ACTIVATE | 0x200);
159 }
160 }
161 else if (dwUnknown == 2)
162 {
164Retry:
165 for (pImeDpi = gpImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext)
166 {
167 if (Imm32ReleaseIME(pImeDpi->hKL))
168 goto Retry;
169 }
171 }
172 else
173 {
174 hNewKL = (HKL)(DWORD_PTR)dwUnknown;
175 if (IS_IME_HKL(hNewKL) && hNewKL != hOldKL)
176 Imm32ReleaseIME(hNewKL);
177 }
178
179 return TRUE;
180}
#define WARN(fmt,...)
Definition: debug.h:115
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
PIMEDPI gpImeDpiList
Definition: ime.c:17
BOOL APIENTRY Imm32ReleaseIME(HKL hKL)
Definition: ime.c:371
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1229
FxChildList * pList
#define LANGIDFROMLCID(l)
Definition: nls.h:18
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
HKL hKL
Definition: imm32_undoc.h:62
struct IMEDPI * pNext
Definition: imm32_undoc.h:60
#define KL_NAMELENGTH
Definition: winuser.h:122
#define KLF_ACTIVATE
Definition: winuser.h:111
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)

Referenced by ImeWnd_OnImeSystem().

◆ ImmGetContext()

◆ ImmGetSaveContext()

static HIMC APIENTRY ImmGetSaveContext ( HWND  hWnd,
DWORD  dwContextFlags 
)
static

Definition at line 1003 of file imm.c.

1004{
1005 HIMC hIMC;
1006 PCLIENTIMC pClientImc;
1007 PWND pWnd;
1008
1009 if (!IS_IMM_MODE())
1010 {
1011 TRACE("Not IMM mode.\n");
1012 return NULL;
1013 }
1014
1015 if (!hWnd)
1016 {
1018 goto Quit;
1019 }
1020
1021 pWnd = ValidateHwnd(hWnd);
1023 return NULL;
1024
1025 hIMC = pWnd->hImc;
1026 if (!hIMC && (dwContextFlags & 1))
1028
1029Quit:
1030 pClientImc = ImmLockClientImc(hIMC);
1031 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1032 return NULL;
1033
1034 if ((dwContextFlags & 2) && (pClientImc->dwFlags & CLIENTIMC_DISABLEIME))
1035 hIMC = NULL;
1036
1037 ImmUnlockClientImc(pClientImc);
1038 return hIMC;
1039}
#define IS_CROSS_PROCESS_HWND(hWnd)
Definition: precomp.h:149
#define CLIENTIMC_DISABLEIME
Definition: imm32_undoc.h:142
#define QUERY_WINDOW_DEFAULT_ICONTEXT
Definition: ntuser.h:2835

Referenced by ImmGetContext(), ImmSetActiveContext(), and ImmWINNLSGetEnableStatus().

◆ ImmInitializeGlobals()

static BOOL APIENTRY ImmInitializeGlobals ( HMODULE  hMod)
static

Definition at line 23 of file imm.c.

24{
27
28 if (hMod)
29 ghImm32Inst = hMod;
30
32 return TRUE;
33
35 if (NT_ERROR(status))
36 {
37 ERR("\n");
38 return FALSE;
39 }
40
41 status = NtQuerySystemInformation(SystemBasicInformation, &SysInfo, sizeof(SysInfo), NULL);
42 if (NT_ERROR(status))
43 {
44 ERR("\n");
45 return FALSE;
46 }
48
50 return TRUE;
51}
LONG NTSTATUS
Definition: precomp.h:26
HMODULE ghImm32Inst
Definition: imm.c:17
BYTE gfImmInitialized
Definition: imm.c:20
ULONG_PTR gHighestUserAddress
Definition: imm.c:21
@ SystemBasicInformation
Definition: ntddk_ex.h:11
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
Definition: ps.c:97
#define NT_ERROR(Status)
Definition: umtypes.h:106

Referenced by ImmDllInitialize(), and ImmRegisterClient().

◆ ImmLoadLayout()

BOOL WINAPI ImmLoadLayout ( HKL  hKL,
PIMEINFOEX  pImeInfoEx 
)

Definition at line 67 of file imm.c.

68{
69 DWORD cbData, dwType;
70 HKEY hKey;
72 WCHAR szLayout[MAX_PATH];
73 LPCWSTR pszSubKey;
74
75 TRACE("(%p, %p)\n", hKL, pImeInfoEx);
76
77 /* Choose a key */
78 if (IS_IME_HKL(hKL) || !IS_CICERO_MODE() || IS_16BIT_MODE()) /* Non-Cicero? */
79 {
80 StringCchPrintfW(szLayout, _countof(szLayout), L"%s\\%08lX",
82 pszSubKey = szLayout;
83 }
84 else /* Cicero */
85 {
86 pszSubKey = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM";
87 }
88
89 /* Open the key */
92 return FALSE;
93
94 /* Load "IME File" value */
95 cbData = sizeof(pImeInfoEx->wszImeFile);
96 error = RegQueryValueExW(hKey, L"IME File", NULL, &dwType,
97 (LPBYTE)pImeInfoEx->wszImeFile, &cbData);
98
99 /* Avoid buffer overrun */
100 pImeInfoEx->wszImeFile[_countof(pImeInfoEx->wszImeFile) - 1] = UNICODE_NULL;
101
103
104 if (error != ERROR_SUCCESS || dwType != REG_SZ)
105 return FALSE; /* Failed */
106
107 pImeInfoEx->hkl = hKL;
108 pImeInfoEx->fLoadFlag = 0;
109 return Imm32LoadImeVerInfo(pImeInfoEx);
110}
#define HandleToUlong(h)
Definition: basetsd.h:79
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define MAX_PATH
Definition: compat.h:34
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx)
Definition: utils.c:845
#define REGKEY_KEYBOARD_LAYOUTS
Definition: precomp.h:60
#define IS_ERROR_UNEXPECTEDLY(x)
Definition: precomp.h:141
FxAutoRegKey hKey
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
WCHAR wszImeFile[80]
Definition: imm32_undoc.h:38
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by Imm32LoadCtfIme(), and User32CallImmLoadLayoutFromKernel().

◆ ImmLockClientImc()

PCLIENTIMC WINAPI ImmLockClientImc ( HIMC  hImc)

Definition at line 937 of file imm.c.

938{
939 PIMC pIMC;
940 PCLIENTIMC pClientImc;
941
942 TRACE("(%p)\n", hImc);
943
944 if (IS_NULL_UNEXPECTEDLY(hImc))
945 return NULL;
946
947 pIMC = ValidateHandle(hImc, TYPE_INPUTCONTEXT);
948 if (!pIMC || !Imm32CheckImcProcess(pIMC))
949 return NULL;
950
951 pClientImc = (PCLIENTIMC)pIMC->dwClientImcData;
952 if (pClientImc)
953 {
954 if (pClientImc->dwFlags & CLIENTIMC_DESTROY)
955 return NULL;
956 goto Finish;
957 }
958
959 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
960 if (IS_NULL_UNEXPECTEDLY(pClientImc))
961 return NULL;
962
963 RtlInitializeCriticalSection(&pClientImc->cs);
965
967 {
968 ERR("\n");
969 ImmLocalFree(pClientImc);
970 return NULL;
971 }
972
973 pClientImc->dwFlags |= CLIENTIMC_UNKNOWN2;
974
975Finish:
976 InterlockedIncrement(&pClientImc->cLockObj);
977 return pClientImc;
978}
BOOL APIENTRY Imm32CheckImcProcess(PIMC pIMC)
Definition: utils.c:391
BOOL NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
Definition: ime.c:1762
@ UIC_CLIENTIMCDATA
Definition: undocuser.h:303

Referenced by CtfImmGenerateMessage(), CtfImmTIMCreateInputContext(), Imm32InternalLockIMC(), Imm32IsImcAnsi(), Imm32ProcessRequest(), Imm32SelectInputContext(), ImmGenerateMessage(), ImmGetAppCompatFlags(), ImmGetCandidateListAW(), ImmGetCandidateListCountAW(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetCompositionStringA(), ImmGetCompositionStringW(), ImmGetGuideLineAW(), ImmGetIMCLockCount(), ImmGetSaveContext(), ImmPostMessages(), ImmSetActiveContext(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmUnlockIMC(), and ImmWINNLSEnableIME().

◆ ImmLockIMC()

◆ ImmRegisterClient()

BOOL WINAPI ImmRegisterClient ( PSHAREDINFO  ptr,
HINSTANCE  hMod 
)

Definition at line 57 of file imm.c.

58{
61 return ImmInitializeGlobals(hMod);
62}
SHAREDINFO gSharedInfo
Definition: imm.c:19
PSERVERINFO gpsi
Definition: imm.c:18
static PVOID ptr
Definition: dispmode.c:27
PSERVERINFO psi
Definition: ntuser.h:1130

Referenced by DllMain(), and User32InitializeImmEntryTable().

◆ ImmReleaseContext()

◆ ImmSetActiveContext()

BOOL WINAPI ImmSetActiveContext ( HWND  hWnd,
HIMC  hIMC,
BOOL  fActive 
)

Definition at line 1124 of file imm.c.

1125{
1126 PCLIENTIMC pClientImc;
1127 LPINPUTCONTEXTDX pIC;
1128 PIMEDPI pImeDpi;
1129 HIMC hOldIMC;
1130 HKL hKL;
1131 BOOL fOpen = FALSE;
1132 DWORD dwConversion = 0, dwShowFlags = ISC_SHOWUIALL;
1133 HWND hwndDefIME;
1134
1135 TRACE("(%p, %p, %d)\n", hWnd, hIMC, fActive);
1136
1137 if (!IS_IMM_MODE())
1138 {
1139 TRACE("\n");
1140 return FALSE;
1141 }
1142
1143 pClientImc = ImmLockClientImc(hIMC);
1144
1145 if (!fActive)
1146 {
1147 if (pClientImc)
1148 pClientImc->dwFlags &= ~CLIENTIMC_ACTIVE;
1149 }
1150 else if (hIMC)
1151 {
1152 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1153 return FALSE;
1154
1155 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
1156 if (IS_NULL_UNEXPECTEDLY(pIC))
1157 {
1158 ImmUnlockClientImc(pClientImc);
1159 return FALSE;
1160 }
1161
1162 pIC->hWnd = hWnd;
1163 pClientImc->dwFlags |= CLIENTIMC_ACTIVE;
1164
1165 if (pIC->dwUIFlags & 2)
1167
1168 fOpen = pIC->fOpen;
1169 dwConversion = pIC->fdwConversion;
1170
1171 ImmUnlockIMC(hIMC);
1172 }
1173 else
1174 {
1175 hOldIMC = ImmGetSaveContext(hWnd, 1);
1176 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hOldIMC);
1177 if (pIC)
1178 {
1179 pIC->hWnd = hWnd;
1180 ImmUnlockIMC(hOldIMC);
1181 }
1182 }
1183
1184 hKL = GetKeyboardLayout(0);
1185 if (IS_CICERO_MODE() && !IS_16BIT_MODE())
1186 {
1187 CtfImeSetActiveContextAlways(hIMC, fActive, hWnd, hKL);
1188 hKL = GetKeyboardLayout(0);
1189 }
1190
1191 pImeDpi = ImmLockImeDpi(hKL);
1192 if (pImeDpi)
1193 {
1194 if (IS_IME_HKL(hKL))
1195 pImeDpi->ImeSetActiveContext(hIMC, fActive);
1196 ImmUnlockImeDpi(pImeDpi);
1197 }
1198
1199 if (IsWindow(hWnd))
1200 {
1201 SendMessageW(hWnd, WM_IME_SETCONTEXT, fActive, dwShowFlags);
1202 if (fActive)
1203 NtUserNotifyIMEStatus(hWnd, fOpen, dwConversion);
1204 }
1205 else if (!fActive)
1206 {
1207 hwndDefIME = ImmGetDefaultIMEWnd(NULL);
1208 if (hwndDefIME)
1209 SendMessageW(hwndDefIME, WM_IME_SETCONTEXT, 0, dwShowFlags);
1210 }
1211
1212 if (pClientImc)
1213 ImmUnlockClientImc(pClientImc);
1214
1215 return TRUE;
1216}
#define CLIENTIMC_ACTIVE
Definition: imm32_undoc.h:139
#define ISC_SHOWUIGUIDELINE
Definition: imm.h:173
#define ISC_SHOWUIALLCANDIDATEWINDOW
Definition: imm.h:174
#define ISC_SHOWUIALL
Definition: imm.h:175
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:803
EXTERN_C HRESULT WINAPI CtfImeSetActiveContextAlways(_In_ HIMC hIMC, _In_ BOOL fActive, _In_ HWND hWnd, _In_ HKL hKL)
Definition: msctfime.cpp:780
#define WM_IME_SETCONTEXT
Definition: winuser.h:1829

Referenced by ImmAssociateContext(), ImmAssociateContextEx(), ImmSetActiveContextConsoleIME(), ImmWINNLSEnableIME(), and User32SetImeActivenessOfWindow().

◆ ImmSetActiveContextConsoleIME()

BOOL WINAPI ImmSetActiveContextConsoleIME ( HWND  hwnd,
BOOL  fFlag 
)

Definition at line 1236 of file imm.c.

1237{
1238 HIMC hIMC;
1239 TRACE("(%p, %d)\n", hwnd, fFlag);
1240
1241 hIMC = ImmGetContext(hwnd);
1242 if (IS_NULL_UNEXPECTEDLY(hIMC))
1243 return FALSE;
1244 return ImmSetActiveContext(hwnd, hIMC, fFlag);
1245}
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1044
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ ImmUnlockClientImc()

◆ ImmUnlockIMC()

BOOL WINAPI ImmUnlockIMC ( HIMC  hIMC)

Definition at line 1066 of file imm.c.

1067{
1068 PCLIENTIMC pClientImc;
1069
1070 pClientImc = ImmLockClientImc(hIMC);
1071 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1072 return FALSE;
1073
1074 if (pClientImc->hInputContext)
1075 LocalUnlock(pClientImc->hInputContext);
1076
1077 InterlockedDecrement(&pClientImc->cLockObj);
1078 ImmUnlockClientImc(pClientImc);
1079 return TRUE;
1080}

Referenced by C1_OnButtonUp(), CtfImmGenerateMessage(), EDIT_WindowProc(), ImeWnd_OnImeNotify(), ImeWnd_OnImeSetContext(), ImeWnd_OnImeSystem(), Imm32CImeNonImeToggle(), Imm32CShapeToggle(), Imm32CSymbolToggle(), Imm32DestroyInputContext(), Imm32JCloseOpen(), Imm32KEnglish(), Imm32KHanjaConvert(), Imm32KShapeToggle(), Imm32OpenICAndCS(), Imm32SelectInputContext(), Imm32SendNotificationProc(), ImmGenerateMessage(), ImmGetCandidateListAW(), ImmGetCandidateListCountAW(), ImmGetCandidateWindow(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetCompositionStringA(), ImmGetCompositionStringW(), ImmGetCompositionWindow(), ImmGetConversionStatus(), ImmGetGuideLineAW(), ImmGetImeMenuItemsAW(), ImmGetOpenStatus(), ImmGetStatusWindowPos(), ImmGetVirtualKey(), ImmProcessKey(), ImmRequestMessageAW(), ImmSetActiveContext(), ImmSetCandidateWindow(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmSetCompositionStringAW(), ImmSetCompositionWindow(), ImmSetConversionStatus(), ImmSetOpenStatus(), ImmSetStatusWindowPos(), ImmTranslateMessage(), ME_HandleMessage(), T1_OnButtonUp(), T1_OnImeControl(), Test1(), test_ImmDestroyContext(), test_ImmGetIMCLockCount(), test_ImmMessages(), and test_InvalidIMC().

◆ ImmWINNLSGetEnableStatus()

BOOL WINAPI ImmWINNLSGetEnableStatus ( HWND  hWnd)

Definition at line 1222 of file imm.c.

1223{
1225 {
1227 return FALSE;
1228 }
1229
1230 return !!ImmGetSaveContext(hWnd, 2);
1231}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
Definition: utils.c:69

Referenced by WINNLSGetEnableStatus().

◆ User32InitializeImmEntryTable()

BOOL WINAPI User32InitializeImmEntryTable ( DWORD  magic)

Definition at line 126 of file imm.c.

127{
128 TRACE("Imm (%x)\n", magic);
129
130 if (magic != IMM_INIT_MAGIC)
131 return FALSE;
132
133 /* Check whether the IMM table has already been initialized */
134 if (IMM_FN(ImmWINNLSEnableIME) != IMMSTUB_ImmWINNLSEnableIME)
135 return TRUE;
136
138
139 if (ghImm32 == NULL && !gbImmInitializing)
140 {
141 WCHAR ImmFile[MAX_PATH];
142 User32GetImmFileName(ImmFile, _countof(ImmFile));
143 ghImm32 = LoadLibraryW(ImmFile);
144 if (ghImm32 == NULL)
145 {
146 ERR("Did not load imm32.dll!\n");
147 return FALSE;
148 }
149 }
150
152}
#define LoadLibraryW(x)
Definition: compat.h:747
BOOL WINAPI ImmWINNLSEnableIME(HWND hWnd, BOOL enable)
Definition: ime.c:2136
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
Definition: imm.c:57
u32_t magic(void)
#define IMM_FN(name)
Definition: user32p.h:56
BOOL gbImmInitializing
Definition: imm.c:22
HRESULT User32GetImmFileName(_Out_ LPWSTR lpBuffer, _In_ size_t cchBuffer)
Definition: imm.c:57
static BOOL IntInitializeImmEntryTable(VOID)
Definition: imm.c:70
HINSTANCE ghImm32
Definition: imm.c:20

Referenced by ImmDllInitialize().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( imm  )

Variable Documentation

◆ gfImmInitialized

BYTE gfImmInitialized = FALSE

Definition at line 20 of file imm.c.

Referenced by ImmInitializeGlobals().

◆ gHighestUserAddress

ULONG_PTR gHighestUserAddress = 0

Definition at line 21 of file imm.c.

Referenced by ImmInitializeGlobals().

◆ ghImm32Inst

◆ gpsi

PSERVERINFO gpsi = NULL

Definition at line 18 of file imm.c.

Referenced by alloc_user_entry(), CharPrevA(), co_IntCreateDefaultImeWindow(), co_IntInitializeDesktopGraphics(), co_IntSendActivateMessages(), co_IntSendMessageTimeout(), co_IntSetCaretPos(), co_IntSetupOBM(), co_IntSetWndIcons(), co_IntShellHookNotify(), co_MsqInsertMouseMessage(), co_MsqSendMessage(), co_UserCreateWindowEx(), co_UserDestroyWindow(), co_UserShowCaret(), co_WinPosSetWindowPos(), CreateSysColorObjects(), CtfImmSetLangBand(), DefWndControlColor(), DefWndGetIcon(), DefWndHandleSetCursor(), DefWndSetIcon(), DrawFocusRect(), EnumerateCallback(), free_user_entry(), GetLastInputInfo(), GetSysColor(), GetSysColorBrush(), GetSystemMetrics(), ImmCallImeConsoleIME(), ImmRegisterClient(), InitMetrics(), InitUserAtoms(), IntCheckImeShowStatus(), IntCoalesceMouseMove(), IntCreateClass(), IntCreateDesktop(), IntCreateWindow(), IntDeactivateWindow(), IntDefWindowProc(), IntDrawState(), IntFlashWindowEx(), IntGetSysColor(), IntGetSysColorBrush(), IntGetWindowContextHelpId(), IntGrayString(), IntImeWindowPosChanged(), IntIsFontRenderingEnabled(), IntIsGhostWindow(), IntLastInputTick(), IntNotifyWinEvent(), IntRealChildWindowFromPoint(), IntRemoveEvent(), IntSetCaretBlinkTime(), IntSetSrvEventMask(), IntSetSysColors(), IntTranslateKbdMessage(), IsDialogMessageW(), IsWinEventHookInstalled(), LoadSystemCursors(), LoadUserApiHook(), MENU_AdjustMenuItemRect(), MENU_CalcItemSize(), MENU_DrawMenuItem(), MENU_DrawScrollArrows(), MENU_EnsureMenuItemVisible(), MENU_InitPopup(), MouseSafetyOnDrawEnd(), NC_IconForWindow(), NotifyWinEvent(), NtUserCallHwnd(), NtUserCallHwndParam(), NtUserCallNoParam(), NtUserCallOneParam(), NtUserCreateCaret(), NtUserGetCaretBlinkTime(), NtUserGetClassName(), NtUserGetComboBoxInfo(), NtUserGetCursorInfo(), NtUserGetListBoxInfo(), NtUserInitializeClientPfnArrays(), NtUserMessageCall(), NtUserNotifyWinEvent(), NtUserProcessConnect(), NtUserSetImeOwnerWindow(), PostTimerMessages(), ProcessKeyEvent(), RealGetSystemMetrics(), RegisterControlAtoms(), SpiUpdatePerUserSystemParameters(), SystemTimerProc(), UITOOLS_DrawCheckedRect(), UpdatePerUserImmEnabling(), UserAttachThreadInput(), UserChangeDisplaySettings(), UserClipCursor(), UserDrawWindowFrame(), UserGetSystemMetrics(), UserInitialize(), UserPaintCaption(), UserPostMessage(), UserPostThreadMessage(), UserRegisterUserApiHook(), UserSendMouseInput(), UserSendNotifyMessage(), UserSetCursor(), UserSetCursorPos(), UserShowCursor(), UserUnregisterUserApiHook(), and UserUpdateMonitorSize().

◆ gSharedInfo

SHAREDINFO gSharedInfo = { NULL }