ReactOS 0.4.16-dev-297-gc569aee
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 (HKL hKL)
 
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 1251 of file imm.c.

1252{
1253 WCHAR szText[8];
1254 static LANGID s_wKeyboardLangIdCache = 0;
1255 static UINT s_uKeyboardLayoutCPCache = 0;
1256
1257 TRACE("(%u)\n", wLangId);
1258
1259 if (wLangId == s_wKeyboardLangIdCache)
1260 return s_uKeyboardLayoutCPCache;
1261
1262 if (!GetLocaleInfoW(wLangId, LOCALE_IDEFAULTANSICODEPAGE, szText, _countof(szText)))
1263 return 0;
1264
1265 s_wKeyboardLangIdCache = wLangId;
1266 szText[_countof(szText) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
1267 s_uKeyboardLayoutCPCache = wcstol(szText, NULL, 10);
1268 return s_uKeyboardLayoutCPCache;
1269}
#define NULL
Definition: types.h:112
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1666
_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:40
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ Imm32CreateInputContext()

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

Definition at line 738 of file imm.c.

739{
740 DWORD dwIndex, cbPrivate;
741 PIMEDPI pImeDpi = NULL;
743 LPCANDIDATEINFO pCI;
744 LPGUIDELINE pGL;
745
746 /* Create IC components */
748 pIC->hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
749 pIC->hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
750 pIC->hMsgBuf = ImmCreateIMCC(sizeof(UINT));
751 if (IS_NULL_UNEXPECTEDLY(pIC->hCompStr) ||
755 {
756 goto Fail;
757 }
758
759 /* Initialize IC components */
760 pCS = ImmLockIMCC(pIC->hCompStr);
761 if (IS_NULL_UNEXPECTEDLY(pCS))
762 goto Fail;
763 pCS->dwSize = sizeof(COMPOSITIONSTRING);
765
766 pCI = ImmLockIMCC(pIC->hCandInfo);
767 if (IS_NULL_UNEXPECTEDLY(pCI))
768 goto Fail;
769 pCI->dwSize = sizeof(CANDIDATEINFO);
771
772 pGL = ImmLockIMCC(pIC->hGuideLine);
773 if (IS_NULL_UNEXPECTEDLY(pGL))
774 goto Fail;
775 pGL->dwSize = sizeof(GUIDELINE);
777
778 pIC->dwNumMsgBuf = 0;
779 pIC->fOpen = FALSE;
780 pIC->fdwConversion = pIC->fdwSentence = 0;
781
782 for (dwIndex = 0; dwIndex < MAX_CANDIDATEFORM; ++dwIndex)
784
785 /* Get private data size */
786 pImeDpi = ImmLockImeDpi(hKL);
787 if (!pImeDpi)
788 {
789 cbPrivate = sizeof(DWORD);
790 }
791 else
792 {
793 /* Update CLIENTIMC */
794 pClientImc->uCodePage = pImeDpi->uCodePage;
795 if (ImeDpi_IsUnicode(pImeDpi))
796 pClientImc->dwFlags |= CLIENTIMC_WIDE;
797
798 cbPrivate = pImeDpi->ImeInfo.dwPrivateDataSize;
799 }
800
801 /* Create private data */
802 pIC->hPrivate = ImmCreateIMCC(cbPrivate);
804 goto Fail;
805
807
808 if (pImeDpi)
809 {
810 /* Select the IME */
811 if (fSelect)
812 {
813 if (IS_IME_HKL(hKL))
814 pImeDpi->ImeSelect(hIMC, TRUE);
815 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
816 pImeDpi->CtfImeSelectEx(hIMC, TRUE, hKL);
817 }
818
819 /* Set HKL */
820 pClientImc->hKL = hKL;
821
822 ImmUnlockImeDpi(pImeDpi);
823 }
824
825 return TRUE;
826
827Fail:
828 if (pImeDpi)
829 ImmUnlockImeDpi(pImeDpi);
830
831 pIC->hMsgBuf = ImmDestroyIMCC(pIC->hMsgBuf);
834 pIC->hCompStr = ImmDestroyIMCC(pIC->hCompStr);
835 return FALSE;
836}
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:142
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:67
UINT uCodePage
Definition: imm32_undoc.h:68
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 623 of file imm.c.

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

Referenced by Imm32DestroyInputContext().

◆ Imm32DestroyInputContext()

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

Definition at line 645 of file imm.c.

646{
647 PIMEDPI pImeDpi;
649 PCLIENTIMC pClientImc;
650 PIMC pIMC;
651
652 if (hIMC == NULL)
653 return FALSE;
654
655 if (!IS_IMM_MODE())
656 {
657 TRACE("\n");
658 return FALSE;
659 }
660
661 pIMC = ValidateHandle(hIMC, TYPE_INPUTCONTEXT);
662 if (IS_NULL_UNEXPECTEDLY(pIMC))
663 return FALSE;
664
665 if (pIMC->head.pti != Imm32CurrentPti())
666 {
667 ERR("Thread mismatch\n");
668 return FALSE;
669 }
670
671 pClientImc = (PCLIENTIMC)pIMC->dwClientImcData;
672 if (pClientImc == NULL)
673 {
674 TRACE("pClientImc == NULL\n");
675 goto Finish;
676 }
677
678 if ((pClientImc->dwFlags & CLIENTIMC_UNKNOWN2) && !bKeep)
679 {
680 ERR("Can't destroy for CLIENTIMC_UNKNOWN2\n");
681 return FALSE;
682 }
683
684 if (pClientImc->dwFlags & CLIENTIMC_DESTROY)
685 return TRUE;
686
687 InterlockedIncrement(&pClientImc->cLockObj);
688
689 if (IS_NULL_UNEXPECTEDLY(pClientImc->hInputContext))
690 goto Quit;
691
692 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
693 if (IS_NULL_UNEXPECTEDLY(pIC))
694 {
695 ImmUnlockClientImc(pClientImc);
696 return FALSE;
697 }
698
700
701 if (pClientImc->hKL == hKL)
702 {
703 pImeDpi = ImmLockImeDpi(hKL);
704 if (pImeDpi)
705 {
706 if (IS_IME_HKL(hKL))
707 pImeDpi->ImeSelect(hIMC, FALSE);
708 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
709 pImeDpi->CtfImeSelectEx(hIMC, FALSE, hKL);
710
711 ImmUnlockImeDpi(pImeDpi);
712 }
713
714 pClientImc->hKL = NULL;
715 }
716
717 ImmDestroyIMCC(pIC->hPrivate);
718 ImmDestroyIMCC(pIC->hMsgBuf);
719 ImmDestroyIMCC(pIC->hGuideLine);
720 ImmDestroyIMCC(pIC->hCandInfo);
721 ImmDestroyIMCC(pIC->hCompStr);
723 ImmUnlockIMC(hIMC);
724
725Quit:
726 pClientImc->dwFlags |= CLIENTIMC_DESTROY;
727 ImmUnlockClientImc(pClientImc);
728
729Finish:
730 if (bKeep)
731 return TRUE;
732 return NtUserDestroyInputContext(hIMC);
733}
#define InterlockedIncrement
Definition: armddk.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT CtfImmTIMDestroyInputContext(_In_ HIMC hIMC)
Definition: ctf.c:929
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1067
static VOID APIENTRY Imm32DestroyImeModeSaver(LPINPUTCONTEXTDX pIC)
Definition: imm.c:623
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:984
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1058
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:145
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define CLIENTIMC_UNKNOWN2
Definition: imm32_undoc.h:147
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:120
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 838 of file imm.c.

839{
840 HANDLE hIC;
841 LPINPUTCONTEXT pIC = NULL;
842 PCLIENTIMC pClientImc;
843 WORD LangID;
845 HKL hOldKL, hNewKL;
846 PIMEDPI pImeDpi = NULL;
847
848 pClientImc = ImmLockClientImc(hIMC);
849 if (!pClientImc)
850 return NULL;
851
852 RtlEnterCriticalSection(&pClientImc->cs);
853
854 if (pClientImc->hInputContext)
855 {
856 pIC = LocalLock(pClientImc->hInputContext);
857 if (IS_NULL_UNEXPECTEDLY(pIC))
858 goto Failure;
859
861 goto Success;
862 }
863
866 {
867 hOldKL = GetKeyboardLayout(0);
868 LangID = LOWORD(hOldKL);
870
871 pImeDpi = Imm32FindOrLoadImeDpi(hNewKL);
872 if (pImeDpi)
873 {
874 CtfImmTIMActivate(hNewKL);
875 }
876 }
877
879 {
880 ERR("No default IME window\n");
881 goto Failure;
882 }
883
884 hIC = LocalAlloc(LHND, sizeof(INPUTCONTEXTDX));
885 pIC = LocalLock(hIC);
886 if (IS_NULL_UNEXPECTEDLY(pIC))
887 {
888 LocalFree(hIC);
889 goto Failure;
890 }
891 pClientImc->hInputContext = hIC;
892
894 if (!Imm32CreateInputContext(hIMC, pIC, pClientImc, hNewKL, fSelect))
895 {
896 LocalUnlock(hIC);
897 pClientImc->hInputContext = LocalFree(hIC);
898 goto Failure;
899 }
900
901Success:
902 RtlLeaveCriticalSection(&pClientImc->cs);
903 InterlockedIncrement(&pClientImc->cLockObj);
904 ImmUnlockClientImc(pClientImc);
905 return pIC;
906
907Failure:
908 RtlLeaveCriticalSection(&pClientImc->cs);
909 ImmUnlockClientImc(pClientImc);
910 return NULL;
911}
#define UlongToHandle(ul)
Definition: basetsd.h:97
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:738
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:938
@ 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:124
#define MAKELONG(a, b)
Definition: typedefs.h:249
@ QIC_DEFAULTWINDOWIME
Definition: undocuser.h:400
@ QIC_INPUTTHREADID
Definition: undocuser.h:399
_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:408
HKL WINAPI GetKeyboardLayout(_In_ DWORD)

Referenced by Imm32SelectInputContext(), and ImmLockIMC().

◆ Imm32NotifyIMEProc()

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

Definition at line 434 of file imm.c.

435{
437 return TRUE;
438}
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 426 of file imm.c.

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

Referenced by ImmActivateLayout().

◆ Imm32SelectInputContext()

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

Definition at line 183 of file imm.c.

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

Referenced by Imm32SelectContextProc().

◆ Imm32UnitTest()

VOID APIENTRY Imm32UnitTest ( VOID  )

Definition at line 1272 of file imm.c.

1273{
1274 if (0)
1275 {
1276 DWORD dwValue;
1277 WCHAR szText[64];
1278
1279 Imm32StrToUInt(L"123", &dwValue, 10);
1280 ASSERT(dwValue == 123);
1281 Imm32StrToUInt(L"100", &dwValue, 16);
1282 ASSERT(dwValue == 0x100);
1283
1284 Imm32UIntToStr(123, 10, szText, _countof(szText));
1285 ASSERT(lstrcmpW(szText, L"123") == 0);
1286 Imm32UIntToStr(0x100, 16, szText, _countof(szText));
1287 ASSERT(lstrcmpW(szText, L"100") == 0);
1288 }
1289}
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:4243
#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 443 of file imm.c.

444{
445 PIMEDPI pImeDpi;
446 HKL hOldKL;
448 HWND hwndDefIME = NULL;
449 SELECT_LAYOUT SelectLayout;
450
451 hOldKL = GetKeyboardLayout(0);
452
453 if (hOldKL == hKL && !(GetWin32ClientInfo()->CI_flags & CI_IMMACTIVATE))
454 return TRUE;
455
456 ImmLoadIME(hKL);
457
458 if (hOldKL != hKL)
459 {
460 pImeDpi = ImmLockImeDpi(hOldKL);
461 if (pImeDpi)
462 {
465 else
467 ImmUnlockImeDpi(pImeDpi);
468
470 }
471
472 hwndDefIME = ImmGetDefaultIMEWnd(NULL);
473 if (IsWindow(hwndDefIME))
474 SendMessageW(hwndDefIME, WM_IME_SELECT, FALSE, (LPARAM)hOldKL);
475
476 NtUserSetThreadLayoutHandles(hKL, hOldKL);
477 }
478
479 SelectLayout.hNewKL = hKL;
480 SelectLayout.hOldKL = hOldKL;
482
483 if (IsWindow(hwndDefIME))
484 SendMessageW(hwndDefIME, WM_IME_SELECT, TRUE, (LPARAM)hKL);
485
486 return TRUE;
487}
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:426
static BOOL CALLBACK Imm32NotifyIMEProc(HIMC hIMC, LPARAM lParam)
Definition: imm.c:434
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1097
#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:421
HKL hOldKL
Definition: imm.c:422
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:1836
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 492 of file imm.c.

493{
494 PWND pWnd;
495 HWND hwndFocus;
496 DWORD dwValue;
497 HIMC hOldIMC;
498
499 TRACE("(%p, %p)\n", hWnd, hIMC);
500
501 if (!IS_IMM_MODE())
502 {
503 TRACE("\n");
504 return NULL;
505 }
506
507 pWnd = ValidateHwnd(hWnd);
508 if (IS_NULL_UNEXPECTEDLY(pWnd))
509 return NULL;
510
511 if (hIMC && IS_CROSS_THREAD_HIMC(hIMC))
512 return NULL;
513
514 hOldIMC = pWnd->hImc;
515 if (hOldIMC == hIMC)
516 return hIMC;
517
518 dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
519 switch (dwValue)
520 {
521 case 0:
522 return hOldIMC;
523
524 case 1:
526 if (hwndFocus == hWnd)
527 {
528 ImmSetActiveContext(hWnd, hOldIMC, FALSE);
530 }
531 return hOldIMC;
532
533 default:
534 return NULL;
535 }
536}
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:1125
#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:4194
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 541 of file imm.c.

542{
543 HWND hwndFocus;
545 HIMC hOldIMC = NULL;
546 DWORD dwValue;
547
548 TRACE("(%p, %p, 0x%lX)\n", hWnd, hIMC, dwFlags);
549
550 if (!IS_IMM_MODE())
551 {
552 TRACE("\n");
553 return FALSE;
554 }
555
556 if (hIMC && !(dwFlags & IACE_DEFAULT) && IS_CROSS_THREAD_HIMC(hIMC))
557 return FALSE;
558
560 pFocusWnd = ValidateHwnd(hwndFocus);
561 if (pFocusWnd)
562 hOldIMC = pFocusWnd->hImc;
563
564 dwValue = NtUserAssociateInputContext(hWnd, hIMC, dwFlags);
565 switch (dwValue)
566 {
567 case 0:
568 return TRUE;
569
570 case 1:
571 pFocusWnd = ValidateHwnd(hwndFocus);
572 if (pFocusWnd)
573 {
574 hIMC = pFocusWnd->hImc;
575 if (hIMC != hOldIMC)
576 {
577 ImmSetActiveContext(hwndFocus, hOldIMC, FALSE);
578 ImmSetActiveContext(hwndFocus, hIMC, TRUE);
579 }
580 }
581 return TRUE;
582
583 default:
584 return FALSE;
585 }
586}
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 591 of file imm.c.

592{
593 PCLIENTIMC pClientImc;
594 HIMC hIMC;
595
596 TRACE("()\n");
597
598 if (!IS_IMM_MODE())
599 {
600 TRACE("\n");
601 return NULL;
602 }
603
604 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
605 if (IS_NULL_UNEXPECTEDLY(pClientImc))
606 return NULL;
607
608 hIMC = NtUserCreateInputContext((ULONG_PTR)pClientImc);
609 if (IS_NULL_UNEXPECTEDLY(hIMC))
610 {
611 ImmLocalFree(pClientImc);
612 return NULL;
613 }
614
615 RtlInitializeCriticalSection(&pClientImc->cs);
616
618
619 return hIMC;
620}
#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:123
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 916 of file imm.c.

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

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 1296 of file imm.c.

1300{
1301 HKL hKL;
1302 HIMC hIMC;
1303
1304 TRACE("(%p, 0x%X, %p)\n", hDll, dwReason, pReserved);
1305
1306 switch (dwReason)
1307 {
1308 case DLL_PROCESS_ATTACH:
1309 if (!ImmInitializeGlobals(hDll))
1310 {
1311 ERR("ImmInitializeGlobals failed\n");
1312 return FALSE;
1313 }
1315 {
1316 ERR("User32InitializeImmEntryTable failed\n");
1317 return FALSE;
1318 }
1319#ifndef NDEBUG
1320 Imm32UnitTest();
1321#endif
1322 break;
1323
1324 case DLL_THREAD_ATTACH:
1325 break;
1326
1327 case DLL_THREAD_DETACH:
1328 if (!IS_IMM_MODE() || NtCurrentTeb()->Win32ThreadInfo == NULL)
1329 return TRUE;
1330
1331 hKL = GetKeyboardLayout(0);
1333 Imm32DestroyInputContext(hIMC, hKL, TRUE);
1334 break;
1335
1336 case DLL_PROCESS_DETACH:
1338 TRACE("imm32.dll is unloaded\n");
1339 break;
1340 }
1341
1342 return TRUE;
1343}
DWORD dwReason
Definition: misc.cpp:141
#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:1272
#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 1097 of file imm.c.

1098{
1099 HIMC *phList;
1100 DWORD dwIndex, dwCount;
1101 BOOL ret = TRUE;
1102 HIMC hIMC;
1103
1104 TRACE("(%lu, %p, %p)\n", dwThreadId, lpfn, lParam);
1105
1106 dwCount = Imm32BuildHimcList(dwThreadId, &phList);
1107 if (IS_ZERO_UNEXPECTEDLY(dwCount))
1108 return FALSE;
1109
1110 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex)
1111 {
1112 hIMC = phList[dwIndex];
1113 ret = (*lpfn)(hIMC, lParam);
1114 if (!ret)
1115 break;
1116 }
1117
1118 ImmLocalFree(phList);
1119 return ret;
1120}
#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 ( HKL  hKL)

Definition at line 117 of file imm.c.

118{
119 WCHAR szKBD[KL_NAMELENGTH];
120 UINT iKL, cKLs;
121 HKL hOldKL, *pList;
122 PIMEDPI pImeDpi;
124
125 TRACE("(%p)\n", hKL);
126
127 hOldKL = GetKeyboardLayout(0);
128
129 if (hKL == HKL_SWITCH_TO_NON_IME)
130 {
131 if (!IS_IME_HKL(hOldKL))
132 return TRUE;
133
135
136 cKLs = GetKeyboardLayoutList(0, NULL);
137 if (cKLs)
138 {
139 pList = ImmLocalAlloc(0, cKLs * sizeof(HKL));
141 return FALSE;
142
143 cKLs = GetKeyboardLayoutList(cKLs, pList);
144 for (iKL = 0; iKL < cKLs; ++iKL)
145 {
146 if (!IS_IME_HKL(pList[iKL]))
147 {
148 LangID = LOWORD(pList[iKL]);
149 break;
150 }
151 }
152
154 }
155
156 StringCchPrintfW(szKBD, _countof(szKBD), L"%08X", LangID);
158 {
159 WARN("Default to English US\n");
160 LoadKeyboardLayoutW(L"00000409", KLF_ACTIVATE | 0x200);
161 }
162 }
163 else if (hKL == HKL_RELEASE_IME)
164 {
166Retry:
167 for (pImeDpi = gpImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext)
168 {
169 if (Imm32ReleaseIME(pImeDpi->hKL))
170 goto Retry;
171 }
173 }
174 else
175 {
176 if (IS_IME_HKL(hKL) && hKL != hOldKL)
177 Imm32ReleaseIME(hKL);
178 }
179
180 return TRUE;
181}
#define WARN(fmt,...)
Definition: precomp.h:61
_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:1230
FxChildList * pList
#define HKL_SWITCH_TO_NON_IME
Definition: imm32_undoc.h:28
#define HKL_RELEASE_IME
Definition: imm32_undoc.h:29
#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:66
struct IMEDPI * pNext
Definition: imm32_undoc.h:64
#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 1004 of file imm.c.

1005{
1006 HIMC hIMC;
1007 PCLIENTIMC pClientImc;
1008 PWND pWnd;
1009
1010 if (!IS_IMM_MODE())
1011 {
1012 TRACE("Not IMM mode.\n");
1013 return NULL;
1014 }
1015
1016 if (!hWnd)
1017 {
1019 goto Quit;
1020 }
1021
1022 pWnd = ValidateHwnd(hWnd);
1024 return NULL;
1025
1026 hIMC = pWnd->hImc;
1027 if (!hIMC && (dwContextFlags & 1))
1029
1030Quit:
1031 pClientImc = ImmLockClientImc(hIMC);
1032 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1033 return NULL;
1034
1035 if ((dwContextFlags & 2) && (pClientImc->dwFlags & CLIENTIMC_DISABLEIME))
1036 hIMC = NULL;
1037
1038 ImmUnlockClientImc(pClientImc);
1039 return hIMC;
1040}
#define IS_CROSS_PROCESS_HWND(hWnd)
Definition: precomp.h:149
#define CLIENTIMC_DISABLEIME
Definition: imm32_undoc.h:146
#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:42
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 938 of file imm.c.

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

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 1125 of file imm.c.

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

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

◆ ImmSetActiveContextConsoleIME()

BOOL WINAPI ImmSetActiveContextConsoleIME ( HWND  hwnd,
BOOL  fFlag 
)

Definition at line 1237 of file imm.c.

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

◆ ImmUnlockClientImc()

◆ ImmUnlockIMC()

BOOL WINAPI ImmUnlockIMC ( HIMC  hIMC)

Definition at line 1067 of file imm.c.

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

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 1223 of file imm.c.

1224{
1226 {
1228 return FALSE;
1229 }
1230
1231 return !!ImmGetSaveContext(hWnd, 2);
1232}
#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
#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 }