ReactOS 0.4.15-dev-5669-g09dde2c
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)
 
static VOID APIENTRY Imm32CiceroSetActiveContext (HIMC hIMC, BOOL fActive, HWND hWnd, 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)
 
HWND WINAPI ImmCreateSoftKeyboard (UINT uType, UINT hOwner, int x, int y)
 
BOOL WINAPI ImmDestroySoftKeyboard (HWND hSoftWnd)
 
BOOL WINAPI ImmShowSoftKeyboard (HWND hSoftWnd, int nCmdShow)
 
BOOL WINAPI ImmDisableTextFrameService (DWORD dwThreadId)
 
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)
 
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

◆ Imm32CiceroSetActiveContext()

static VOID APIENTRY Imm32CiceroSetActiveContext ( HIMC  hIMC,
BOOL  fActive,
HWND  hWnd,
HKL  hKL 
)
static

Definition at line 495 of file imm.c.

496{
497 TRACE("We have to do something\n");
498}
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ImmSetActiveContext().

◆ Imm32CreateInputContext()

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

Definition at line 749 of file imm.c.

750{
751 DWORD dwIndex, cbPrivate;
752 PIMEDPI pImeDpi = NULL;
754 LPCANDIDATEINFO pCI;
755 LPGUIDELINE pGL;
756
757 /* Create IC components */
759 pIC->hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
760 pIC->hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
761 pIC->hMsgBuf = ImmCreateIMCC(sizeof(UINT));
762 if (IS_NULL_UNEXPECTEDLY(pIC->hCompStr) ||
766 {
767 goto Fail;
768 }
769
770 /* Initialize IC components */
771 pCS = ImmLockIMCC(pIC->hCompStr);
772 if (IS_NULL_UNEXPECTEDLY(pCS))
773 goto Fail;
774 pCS->dwSize = sizeof(COMPOSITIONSTRING);
776
777 pCI = ImmLockIMCC(pIC->hCandInfo);
778 if (IS_NULL_UNEXPECTEDLY(pCI))
779 goto Fail;
780 pCI->dwSize = sizeof(CANDIDATEINFO);
782
783 pGL = ImmLockIMCC(pIC->hGuideLine);
784 if (IS_NULL_UNEXPECTEDLY(pGL))
785 goto Fail;
786 pGL->dwSize = sizeof(GUIDELINE);
788
789 pIC->dwNumMsgBuf = 0;
790 pIC->fOpen = FALSE;
791 pIC->fdwConversion = pIC->fdwSentence = 0;
792
793 for (dwIndex = 0; dwIndex < MAX_CANDIDATEFORM; ++dwIndex)
795
796 /* Get private data size */
797 pImeDpi = ImmLockImeDpi(hKL);
798 if (!pImeDpi)
799 {
800 cbPrivate = sizeof(DWORD);
801 }
802 else
803 {
804 /* Update CLIENTIMC */
805 pClientImc->uCodePage = pImeDpi->uCodePage;
806 if (ImeDpi_IsUnicode(pImeDpi))
807 pClientImc->dwFlags |= CLIENTIMC_WIDE;
808
809 cbPrivate = pImeDpi->ImeInfo.dwPrivateDataSize;
810 }
811
812 /* Create private data */
813 pIC->hPrivate = ImmCreateIMCC(cbPrivate);
815 goto Fail;
816
818
819 if (pImeDpi)
820 {
821 /* Select the IME */
822 if (fSelect)
823 {
824 if (IS_IME_HKL(hKL))
825 pImeDpi->ImeSelect(hIMC, TRUE);
826 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
827 pImeDpi->CtfImeSelectEx(hIMC, TRUE, hKL);
828 }
829
830 /* Set HKL */
831 pClientImc->hKL = hKL;
832
833 ImmUnlockImeDpi(pImeDpi);
834 }
835
836 return TRUE;
837
838Fail:
839 if (pImeDpi)
840 ImmUnlockImeDpi(pImeDpi);
841
842 pIC->hMsgBuf = ImmDestroyIMCC(pIC->hMsgBuf);
845 pIC->hCompStr = ImmDestroyIMCC(pIC->hCompStr);
846 return FALSE;
847}
HRESULT APIENTRY CtfImmTIMCreateInputContext(HIMC hIMC)
Definition: ctf.c:50
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IS_IME_HKL(hKL)
Definition: input.h:88
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:987
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:1016
#define IMM_INVALID_CANDFORM
Definition: precomp.h:51
#define IS_NULL_UNEXPECTEDLY(p)
Definition: precomp.h:120
#define MAX_CANDIDATEFORM
Definition: precomp.h:53
#define IS_16BIT_MODE()
Definition: precomp.h:146
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:145
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
struct tagGUIDELINE GUIDELINE
struct tagCANDIDATEINFO CANDIDATEINFO
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
#define IS_CICERO_MODE()
Definition: ntuser.h:1233
#define CLIENTIMC_WIDE
Definition: ntuser.h:1356
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
DWORD dwIndex
Definition: dimm.idl:79
IMEINFO ImeInfo
Definition: ntuser.h:1284
UINT uCodePage
Definition: ntuser.h:1285
DWORD dwPrivateDataSize
Definition: imm.h:157
HIMCC hPrivate
Definition: immdev.h:71
CANDIDATEFORM cfCandForm[4]
Definition: immdev.h:67
HIMCC hMsgBuf
Definition: immdev.h:73
HIMCC hCompStr
Definition: immdev.h:68
DWORD fdwConversion
Definition: immdev.h:60
HIMCC hCandInfo
Definition: immdev.h:69
HIMCC hGuideLine
Definition: immdev.h:70
DWORD fdwSentence
Definition: immdev.h:61
DWORD dwNumMsgBuf
Definition: immdev.h:72
DWORD dwSize
Definition: imm.h:205
UINT uCodePage
Definition: ntuser.h:1339
DWORD dwFlags
Definition: ntuser.h:1336
DWORD dwSize
Definition: imm.h:195

Referenced by Imm32InternalLockIMC().

◆ Imm32DestroyImeModeSaver()

static VOID APIENTRY Imm32DestroyImeModeSaver ( LPINPUTCONTEXTDX  pIC)
static

Definition at line 634 of file imm.c.

635{
636 PIME_STATE pState, pNext;
637 PIME_SUBSTATE pSubState, pSubNext;
638
639 for (pState = pIC->pState; pState; pState = pNext)
640 {
641 pNext = pState->pNext;
642
643 for (pSubState = pState->pSubState; pSubState; pSubState = pSubNext)
644 {
645 pSubNext = pSubState->pNext;
646 ImmLocalFree(pSubState);
647 }
648
649 ImmLocalFree(pState);
650 }
651
652 pIC->pState = NULL;
653}
#define ImmLocalFree(lpData)
Definition: precomp.h:89
PIME_SUBSTATE pSubState
Definition: immdev.h:220
struct IME_STATE * pNext
Definition: immdev.h:214
struct IME_SUBSTATE * pNext
Definition: immdev.h:203
struct IME_STATE * pState
Definition: immdev.h:134

Referenced by Imm32DestroyInputContext().

◆ Imm32DestroyInputContext()

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

Definition at line 656 of file imm.c.

657{
658 PIMEDPI pImeDpi;
660 PCLIENTIMC pClientImc;
661 PIMC pIMC;
662
663 if (hIMC == NULL)
664 return FALSE;
665
666 if (!IS_IMM_MODE())
667 {
668 TRACE("\n");
669 return FALSE;
670 }
671
672 pIMC = ValidateHandle(hIMC, TYPE_INPUTCONTEXT);
673 if (IS_NULL_UNEXPECTEDLY(pIMC))
674 return FALSE;
675
676 if (pIMC->head.pti != Imm32CurrentPti())
677 {
678 ERR("Thread mismatch\n");
679 return FALSE;
680 }
681
682 pClientImc = (PCLIENTIMC)pIMC->dwClientImcData;
683 if (pClientImc == NULL)
684 {
685 TRACE("pClientImc == NULL\n");
686 goto Finish;
687 }
688
689 if ((pClientImc->dwFlags & CLIENTIMC_UNKNOWN2) && !bKeep)
690 {
691 ERR("Can't destroy for CLIENTIMC_UNKNOWN2\n");
692 return FALSE;
693 }
694
695 if (pClientImc->dwFlags & CLIENTIMC_DESTROY)
696 return TRUE;
697
698 InterlockedIncrement(&pClientImc->cLockObj);
699
700 if (IS_NULL_UNEXPECTEDLY(pClientImc->hInputContext))
701 goto Quit;
702
703 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
704 if (IS_NULL_UNEXPECTEDLY(pIC))
705 {
706 ImmUnlockClientImc(pClientImc);
707 return FALSE;
708 }
709
711
712 if (pClientImc->hKL == hKL)
713 {
714 pImeDpi = ImmLockImeDpi(hKL);
715 if (pImeDpi)
716 {
717 if (IS_IME_HKL(hKL))
718 pImeDpi->ImeSelect(hIMC, FALSE);
719 else if (IS_CICERO_MODE() && !IS_16BIT_MODE())
720 pImeDpi->CtfImeSelectEx(hIMC, FALSE, hKL);
721
722 ImmUnlockImeDpi(pImeDpi);
723 }
724
725 pClientImc->hKL = NULL;
726 }
727
728 ImmDestroyIMCC(pIC->hPrivate);
729 ImmDestroyIMCC(pIC->hMsgBuf);
730 ImmDestroyIMCC(pIC->hGuideLine);
731 ImmDestroyIMCC(pIC->hCandInfo);
732 ImmDestroyIMCC(pIC->hCompStr);
734 ImmUnlockIMC(hIMC);
735
736Quit:
737 pClientImc->dwFlags |= CLIENTIMC_DESTROY;
738 ImmUnlockClientImc(pClientImc);
739
740Finish:
741 if (bKeep)
742 return TRUE;
743 return NtUserDestroyInputContext(hIMC);
744}
#define InterlockedIncrement
Definition: armddk.h:53
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT APIENTRY CtfImmTIMDestroyInputContext(HIMC hIMC)
Definition: ctf.c:41
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1079
static VOID APIENTRY Imm32DestroyImeModeSaver(LPINPUTCONTEXTDX pIC)
Definition: imm.c:634
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:996
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1070
PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
Definition: utils.c:19
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
Definition: utils.c:377
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
struct tagCLIENTIMC * PCLIENTIMC
#define CLIENTIMC_DESTROY
Definition: ntuser.h:1359
BOOL NTAPI NtUserDestroyInputContext(HIMC hIMC)
Definition: ime.c:1542
#define IS_IMM_MODE()
Definition: ntuser.h:1232
#define CLIENTIMC_UNKNOWN2
Definition: ntuser.h:1361
@ TYPE_INPUTCONTEXT
Definition: ntuser.h:57
if(dx< 0)
Definition: linetemp.h:194
HANDLE hInputContext
Definition: ntuser.h:1334
LONG cLockObj
Definition: ntuser.h:1335
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 850 of file imm.c.

851{
852 HANDLE hIC;
853 LPINPUTCONTEXT pIC = NULL;
854 PCLIENTIMC pClientImc;
855 WORD LangID;
857 HKL hOldKL, hNewKL;
858 PIMEDPI pImeDpi = NULL;
859
860 pClientImc = ImmLockClientImc(hIMC);
861 if (IS_NULL_UNEXPECTEDLY(pClientImc))
862 return NULL;
863
864 RtlEnterCriticalSection(&pClientImc->cs);
865
866 if (pClientImc->hInputContext)
867 {
868 pIC = LocalLock(pClientImc->hInputContext);
869 if (IS_NULL_UNEXPECTEDLY(pIC))
870 goto Failure;
871
873 goto Success;
874 }
875
878 {
879 hOldKL = GetKeyboardLayout(0);
880 LangID = LOWORD(hOldKL);
881 hNewKL = (HKL)(DWORD_PTR)MAKELONG(LangID, LangID);
882
883 pImeDpi = Imm32FindOrLoadImeDpi(hNewKL);
884 if (pImeDpi)
885 {
886 CtfImmTIMActivate(hNewKL);
887 }
888 }
889
891 {
892 ERR("No default IME window\n");
893 goto Failure;
894 }
895
896 hIC = LocalAlloc(LHND, sizeof(INPUTCONTEXTDX));
897 pIC = LocalLock(hIC);
898 if (IS_NULL_UNEXPECTEDLY(pIC))
899 {
900 LocalFree(hIC);
901 goto Failure;
902 }
903 pClientImc->hInputContext = hIC;
904
906 if (!Imm32CreateInputContext(hIMC, pIC, pClientImc, hNewKL, fSelect))
907 {
908 LocalUnlock(hIC);
909 pClientImc->hInputContext = LocalFree(hIC);
910 goto Failure;
911 }
912
913Success:
914 RtlLeaveCriticalSection(&pClientImc->cs);
915 InterlockedIncrement(&pClientImc->cLockObj);
916 ImmUnlockClientImc(pClientImc);
917 return pIC;
918
919Failure:
920 RtlLeaveCriticalSection(&pClientImc->cs);
921 ImmUnlockClientImc(pClientImc);
922 return NULL;
923}
HRESULT WINAPI CtfImmTIMActivate(HKL hKL)
Definition: ctf.c:75
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:749
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:950
@ 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:1373
LPVOID NTAPI LocalLock(HLOCAL hMem)
Definition: heapmem.c:1599
BOOL NTAPI LocalUnlock(HLOCAL hMem)
Definition: heapmem.c:1788
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1798
UINT_PTR HKL
Definition: msctf.idl:104
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: ntuser.h:1338
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 439 of file imm.c.

440{
442 return TRUE;
443}
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: ime.c:907
#define NI_COMPOSITIONSTR
Definition: imm.h:298

Referenced by ImmActivateLayout().

◆ Imm32SelectContextProc()

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

Definition at line 431 of file imm.c.

432{
434 Imm32SelectInputContext(pSelect->hNewKL, pSelect->hOldKL, hIMC);
435 return TRUE;
436}
struct SELECT_LAYOUT * LPSELECT_LAYOUT
VOID APIENTRY Imm32SelectInputContext(HKL hNewKL, HKL hOldKL, HIMC hIMC)
Definition: imm.c:188
LPFN_SELECT pSelect
Definition: handle.c:32

Referenced by ImmActivateLayout().

◆ Imm32SelectInputContext()

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

Definition at line 188 of file imm.c.

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

Referenced by Imm32SelectContextProc().

◆ Imm32UnitTest()

VOID APIENTRY Imm32UnitTest ( VOID  )

Definition at line 1300 of file imm.c.

1301{
1302 if (0)
1303 {
1304 DWORD dwValue;
1305 WCHAR szText[64];
1306
1307 Imm32StrToUInt(L"123", &dwValue, 10);
1308 ASSERT(dwValue == 123);
1309 Imm32StrToUInt(L"100", &dwValue, 16);
1310 ASSERT(dwValue == 0x100);
1311
1312 Imm32UIntToStr(123, 10, szText, _countof(szText));
1313 ASSERT(lstrcmpW(szText, L"123") == 0);
1314 Imm32UIntToStr(0x100, 16, szText, _countof(szText));
1315 ASSERT(lstrcmpW(szText, L"100") == 0);
1316 }
1317}
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 lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define ASSERT(a)
Definition: mode.c:44
#define L(x)
Definition: ntvdm.h:50
#define _countof(array)
Definition: sndvol32.h:68
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by ImmDllInitialize().

◆ ImmActivateLayout()

BOOL WINAPI ImmActivateLayout ( HKL  hKL)

Definition at line 448 of file imm.c.

449{
450 PIMEDPI pImeDpi;
451 HKL hOldKL;
453 HWND hwndDefIME = NULL;
454 SELECT_LAYOUT SelectLayout;
455
456 hOldKL = GetKeyboardLayout(0);
457
458 if (hOldKL == hKL && !(GetWin32ClientInfo()->CI_flags & CI_IMMACTIVATE))
459 return TRUE;
460
461 ImmLoadIME(hKL);
462
463 if (hOldKL != hKL)
464 {
465 pImeDpi = ImmLockImeDpi(hOldKL);
466 if (pImeDpi)
467 {
470 else
472 ImmUnlockImeDpi(pImeDpi);
473
475 }
476
477 hwndDefIME = ImmGetDefaultIMEWnd(NULL);
478 if (IsWindow(hwndDefIME))
479 SendMessageW(hwndDefIME, WM_IME_SELECT, FALSE, (LPARAM)hOldKL);
480
481 NtUserSetThreadLayoutHandles(hKL, hOldKL);
482 }
483
484 SelectLayout.hNewKL = hKL;
485 SelectLayout.hOldKL = hOldKL;
487
488 if (IsWindow(hwndDefIME))
489 SendMessageW(hwndDefIME, WM_IME_SELECT, TRUE, (LPARAM)hKL);
490
491 return TRUE;
492}
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:890
BOOL WINAPI ImmLoadIME(HKL hKL)
Definition: ime.c:1064
static BOOL CALLBACK Imm32SelectContextProc(HIMC hIMC, LPARAM lParam)
Definition: imm.c:431
static BOOL CALLBACK Imm32NotifyIMEProc(HIMC hIMC, LPARAM lParam)
Definition: imm.c:439
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1148
#define CPS_CANCEL
Definition: imm.h:315
#define CPS_COMPLETE
Definition: imm.h:312
#define IME_PROP_COMPLETE_ON_UNSELECT
Definition: imm.h:394
DWORD NTAPI NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL)
Definition: ime.c:520
#define CI_IMMACTIVATE
Definition: ntuser.h:305
#define GetWin32ClientInfo()
Definition: ntuser.h:347
HKL hNewKL
Definition: imm.c:426
HKL hOldKL
Definition: imm.c:427
DWORD fdwProperty
Definition: imm.h:158
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_IME_SELECT
Definition: winuser.h:1823
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 503 of file imm.c.

504{
505 PWND pWnd;
506 HWND hwndFocus;
507 DWORD dwValue;
508 HIMC hOldIMC;
509
510 TRACE("(%p, %p)\n", hWnd, hIMC);
511
512 if (!IS_IMM_MODE())
513 {
514 TRACE("\n");
515 return NULL;
516 }
517
518 pWnd = ValidateHwnd(hWnd);
519 if (IS_NULL_UNEXPECTEDLY(pWnd))
520 return NULL;
521
522 if (hIMC && IS_CROSS_THREAD_HIMC(hIMC))
523 return NULL;
524
525 hOldIMC = pWnd->hImc;
526 if (hOldIMC == hIMC)
527 return hIMC;
528
529 dwValue = NtUserAssociateInputContext(hWnd, hIMC, 0);
530 switch (dwValue)
531 {
532 case 0:
533 return hOldIMC;
534
535 case 1:
537 if (hwndFocus == hWnd)
538 {
539 ImmSetActiveContext(hWnd, hOldIMC, FALSE);
541 }
542 return hOldIMC;
543
544 default:
545 return NULL;
546 }
547}
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:1176
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IS_CROSS_THREAD_HIMC(hIMC)
Definition: precomp.h:143
#define QUERY_WINDOW_FOCUS
Definition: ntuser.h:2953
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4185
DWORD NTAPI NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags)
Definition: ime.c:1709
Definition: ntuser.h:689
HIMC hImc
Definition: ntuser.h:735

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

◆ ImmAssociateContextEx()

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

Definition at line 552 of file imm.c.

553{
554 HWND hwndFocus;
556 HIMC hOldIMC = NULL;
557 DWORD dwValue;
558
559 TRACE("(%p, %p, 0x%lX)\n", hWnd, hIMC, dwFlags);
560
561 if (!IS_IMM_MODE())
562 {
563 TRACE("\n");
564 return FALSE;
565 }
566
567 if (hIMC && !(dwFlags & IACE_DEFAULT) && IS_CROSS_THREAD_HIMC(hIMC))
568 return FALSE;
569
571 pFocusWnd = ValidateHwnd(hwndFocus);
572 if (pFocusWnd)
573 hOldIMC = pFocusWnd->hImc;
574
575 dwValue = NtUserAssociateInputContext(hWnd, hIMC, dwFlags);
576 switch (dwValue)
577 {
578 case 0:
579 return TRUE;
580
581 case 1:
582 pFocusWnd = ValidateHwnd(hwndFocus);
583 if (pFocusWnd)
584 {
585 hIMC = pFocusWnd->hImc;
586 if (hIMC != hOldIMC)
587 {
588 ImmSetActiveContext(hwndFocus, hOldIMC, FALSE);
589 ImmSetActiveContext(hwndFocus, hIMC, TRUE);
590 }
591 }
592 return TRUE;
593
594 default:
595 return FALSE;
596 }
597}
#define IACE_DEFAULT
Definition: imm.h:582
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 602 of file imm.c.

603{
604 PCLIENTIMC pClientImc;
605 HIMC hIMC;
606
607 TRACE("()\n");
608
609 if (!IS_IMM_MODE())
610 {
611 TRACE("\n");
612 return NULL;
613 }
614
615 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
616 if (IS_NULL_UNEXPECTEDLY(pClientImc))
617 return NULL;
618
619 hIMC = NtUserCreateInputContext((ULONG_PTR)pClientImc);
620 if (IS_NULL_UNEXPECTEDLY(hIMC))
621 {
622 ImmLocalFree(pClientImc);
623 return NULL;
624 }
625
626 RtlInitializeCriticalSection(&pClientImc->cs);
627
629
630 return hIMC;
631}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:415
@ THREADSTATE_IMECOMPATFLAGS
Definition: ntuser.h:2608
HIMC NTAPI NtUserCreateInputContext(ULONG_PTR dwClientImcData)
Definition: ime.c:1613
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:232
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD dwCompatFlags
Definition: ntuser.h:1337
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().

◆ ImmCreateSoftKeyboard()

HWND WINAPI ImmCreateSoftKeyboard ( UINT  uType,
UINT  hOwner,
int  x,
int  y 
)

Definition at line 1109 of file imm.c.

1110{
1111 FIXME("(%d, %d, %d, %d): stub\n", uType, hOwner, x, y);
1113 return 0;
1114}
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ ImmDestroyContext()

BOOL WINAPI ImmDestroyContext ( HIMC  hIMC)

Definition at line 928 of file imm.c.

929{
930 HKL hKL;
931
932 TRACE("(%p)\n", hIMC);
933
934 if (!IS_IMM_MODE())
935 {
936 TRACE("\n");
937 return FALSE;
938 }
939
940 if (IS_CROSS_THREAD_HIMC(hIMC))
941 return FALSE;
942
943 hKL = GetKeyboardLayout(0);
944 return Imm32DestroyInputContext(hIMC, hKL, FALSE);
945}
BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC, HKL hKL, BOOL bKeep)
Definition: imm.c:656

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

◆ ImmDestroySoftKeyboard()

BOOL WINAPI ImmDestroySoftKeyboard ( HWND  hSoftWnd)

Definition at line 1119 of file imm.c.

1120{
1121 TRACE("(%p)\n", hSoftWnd);
1122 return DestroyWindow(hSoftWnd);
1123}
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( DWORD  dwThreadId)

Definition at line 1139 of file imm.c.

1140{
1141 FIXME("Stub\n");
1142 return FALSE;
1143}

◆ ImmDllInitialize()

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

Definition at line 1324 of file imm.c.

1328{
1329 HKL hKL;
1330 HIMC hIMC;
1331
1332 TRACE("(%p, 0x%X, %p)\n", hDll, dwReason, pReserved);
1333
1334 switch (dwReason)
1335 {
1336 case DLL_PROCESS_ATTACH:
1337 if (!ImmInitializeGlobals(hDll))
1338 {
1339 ERR("ImmInitializeGlobals failed\n");
1340 return FALSE;
1341 }
1343 {
1344 ERR("User32InitializeImmEntryTable failed\n");
1345 return FALSE;
1346 }
1347#ifndef NDEBUG
1348 Imm32UnitTest();
1349#endif
1350 break;
1351
1352 case DLL_THREAD_ATTACH:
1353 break;
1354
1355 case DLL_THREAD_DETACH:
1356 if (!IS_IMM_MODE() || NtCurrentTeb()->Win32ThreadInfo == NULL)
1357 return TRUE;
1358
1359 hKL = GetKeyboardLayout(0);
1361 Imm32DestroyInputContext(hIMC, hKL, TRUE);
1362 break;
1363
1364 case DLL_PROCESS_DETACH:
1366 TRACE("imm32.dll is unloaded\n");
1367 break;
1368 }
1369
1370 return TRUE;
1371}
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:24
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:126
VOID APIENTRY Imm32UnitTest(VOID)
Definition: imm.c:1300
#define IMM_INIT_MAGIC
Definition: precomp.h:50
@ THREADSTATE_DEFAULTINPUTCONTEXT
Definition: ntuser.h:2599
#define NtCurrentTeb
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

◆ ImmEnumInputContext()

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

Definition at line 1148 of file imm.c.

1149{
1150 HIMC *phList;
1151 DWORD dwIndex, dwCount;
1152 BOOL ret = TRUE;
1153 HIMC hIMC;
1154
1155 TRACE("(%lu, %p, %p)\n", dwThreadId, lpfn, lParam);
1156
1157 dwCount = Imm32BuildHimcList(dwThreadId, &phList);
1158 if (IS_ZERO_UNEXPECTEDLY(dwCount))
1159 return FALSE;
1160
1161 for (dwIndex = 0; dwIndex < dwCount; ++dwIndex)
1162 {
1163 hIMC = phList[dwIndex];
1164 ret = (*lpfn)(hIMC, lParam);
1165 if (!ret)
1166 break;
1167 }
1168
1169 ImmLocalFree(phList);
1170 return ret;
1171}
#define IS_ZERO_UNEXPECTEDLY(p)
Definition: precomp.h:124
DWORD APIENTRY Imm32BuildHimcList(DWORD dwThreadId, HIMC **pphList)
Definition: utils.c:460
int ret

Referenced by AnotherThreadFunc(), Imm32SendNotification(), ImmActivateLayout(), and OnInitDialog().

◆ ImmFreeLayout()

BOOL WINAPI ImmFreeLayout ( DWORD  dwUnknown)

Definition at line 120 of file imm.c.

121{
122 WCHAR szKBD[KL_NAMELENGTH];
123 UINT iKL, cKLs;
124 HKL hOldKL, hNewKL, *pList;
125 PIMEDPI pImeDpi;
127
128 TRACE("(0x%lX)\n", dwUnknown);
129
130 hOldKL = GetKeyboardLayout(0);
131
132 if (dwUnknown == 1)
133 {
134 if (!IS_IME_HKL(hOldKL))
135 return TRUE;
136
138
139 cKLs = GetKeyboardLayoutList(0, NULL);
140 if (cKLs)
141 {
142 pList = ImmLocalAlloc(0, cKLs * sizeof(HKL));
144 return FALSE;
145
146 cKLs = GetKeyboardLayoutList(cKLs, pList);
147 for (iKL = 0; iKL < cKLs; ++iKL)
148 {
149 if (!IS_IME_HKL(pList[iKL]))
150 {
151 LangID = LOWORD(pList[iKL]);
152 break;
153 }
154 }
155
157 }
158
159 StringCchPrintfW(szKBD, _countof(szKBD), L"%08X", LangID);
161 {
162 WARN("Default to English US\n");
163 LoadKeyboardLayoutW(L"00000409", KLF_ACTIVATE | 0x200);
164 }
165 }
166 else if (dwUnknown == 2)
167 {
169Retry:
170 for (pImeDpi = gpImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext)
171 {
172 if (Imm32ReleaseIME(pImeDpi->hKL))
173 goto Retry;
174 }
176 }
177 else
178 {
179 hNewKL = (HKL)(DWORD_PTR)dwUnknown;
180 if (IS_IME_HKL(hNewKL) && hNewKL != hOldKL)
181 Imm32ReleaseIME(hNewKL);
182 }
183
184 return TRUE;
185}
#define WARN(fmt,...)
Definition: debug.h:112
_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
FxChildList * pList
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
#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: ntuser.h:1283
struct IMEDPI * pNext
Definition: ntuser.h:1281
WORD LANGID
Definition: typedefs.h:81
#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 1016 of file imm.c.

1017{
1018 HIMC hIMC;
1019 PCLIENTIMC pClientImc;
1020 PWND pWnd;
1021
1022 if (!IS_IMM_MODE())
1023 {
1024 TRACE("Not IMM mode.\n");
1025 return NULL;
1026 }
1027
1028 if (!hWnd)
1029 {
1031 goto Quit;
1032 }
1033
1034 pWnd = ValidateHwnd(hWnd);
1036 return NULL;
1037
1038 hIMC = pWnd->hImc;
1039 if (!hIMC && (dwContextFlags & 1))
1041
1042Quit:
1043 pClientImc = ImmLockClientImc(hIMC);
1044 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1045 return NULL;
1046
1047 if ((dwContextFlags & 2) && (pClientImc->dwFlags & CLIENTIMC_DISABLEIME))
1048 hIMC = NULL;
1049
1050 ImmUnlockClientImc(pClientImc);
1051 return hIMC;
1052}
#define IS_CROSS_PROCESS_HWND(hWnd)
Definition: precomp.h:144
#define QUERY_WINDOW_DEFAULT_ICONTEXT
Definition: ntuser.h:2958
#define CLIENTIMC_DISABLEIME
Definition: ntuser.h:1360

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

◆ ImmInitializeGlobals()

static BOOL APIENTRY ImmInitializeGlobals ( HMODULE  hMod)
static

Definition at line 24 of file imm.c.

25{
28
29 if (hMod)
30 ghImm32Inst = hMod;
31
33 return TRUE;
34
36 if (NT_ERROR(status))
37 {
38 ERR("\n");
39 return FALSE;
40 }
41
42 status = NtQuerySystemInformation(SystemBasicInformation, &SysInfo, sizeof(SysInfo), NULL);
43 if (NT_ERROR(status))
44 {
45 ERR("\n");
46 return FALSE;
47 }
49
51 return TRUE;
52}
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 68 of file imm.c.

69{
70 DWORD cbData, dwType;
71 HKEY hLayoutKey;
72 LONG error;
73 WCHAR szLayout[MAX_PATH];
74
75 TRACE("(%p, %p)\n", hKL, pImeInfoEx);
76
77 ZeroMemory(pImeInfoEx, sizeof(IMEINFOEX));
78
79 if (IS_IME_HKL(hKL) || !IS_CICERO_MODE() || IS_16BIT_MODE())
80 {
81 StringCchPrintfW(szLayout, _countof(szLayout), L"%s\\%08lX",
83
84 error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szLayout, 0, KEY_READ, &hLayoutKey);
86 return FALSE;
87 }
88 else
89 {
92 return FALSE;
93 }
94
95 cbData = sizeof(pImeInfoEx->wszImeFile);
96 error = RegQueryValueExW(hLayoutKey, L"Ime File", NULL, &dwType,
97 (LPBYTE)pImeInfoEx->wszImeFile, &cbData);
98 pImeInfoEx->wszImeFile[_countof(pImeInfoEx->wszImeFile) - 1] = UNICODE_NULL;
99
100 RegCloseKey(hLayoutKey);
101
102 pImeInfoEx->fLoadFlag = 0;
103
105 return FALSE;
106
107 if (dwType != REG_SZ)
108 {
109 ERR("\n");
110 return FALSE;
111 }
112
113 pImeInfoEx->hkl = hKL;
114 return Imm32LoadImeVerInfo(pImeInfoEx);
115}
#define HandleToUlong(h)
Definition: basetsd.h:79
#define RegCloseKey(hKey)
Definition: registry.h:47
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
#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:136
#define REGKEY_IMM
Definition: precomp.h:61
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
INT fLoadFlag
Definition: ntuser.h:1211
WCHAR wszImeFile[80]
Definition: ntuser.h:1215
unsigned char * LPBYTE
Definition: typedefs.h:53
#define ZeroMemory
Definition: winbase.h:1670
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by User32CallImmLoadLayoutFromKernel().

◆ ImmLockClientImc()

PCLIENTIMC WINAPI ImmLockClientImc ( HIMC  hImc)

Definition at line 950 of file imm.c.

951{
952 PIMC pIMC;
953 PCLIENTIMC pClientImc;
954
955 TRACE("(%p)\n", hImc);
956
957 if (IS_NULL_UNEXPECTEDLY(hImc))
958 return NULL;
959
960 pIMC = ValidateHandle(hImc, TYPE_INPUTCONTEXT);
961 if (IS_NULL_UNEXPECTEDLY(pIMC) || !Imm32CheckImcProcess(pIMC))
962 return NULL;
963
964 pClientImc = (PCLIENTIMC)pIMC->dwClientImcData;
965 if (pClientImc)
966 {
967 if (pClientImc->dwFlags & CLIENTIMC_DESTROY)
968 return NULL;
969 goto Finish;
970 }
971
972 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
973 if (IS_NULL_UNEXPECTEDLY(pClientImc))
974 return NULL;
975
976 RtlInitializeCriticalSection(&pClientImc->cs);
978
980 {
981 ERR("\n");
982 ImmLocalFree(pClientImc);
983 return NULL;
984 }
985
986 pClientImc->dwFlags |= CLIENTIMC_UNKNOWN2;
987
988Finish:
989 InterlockedIncrement(&pClientImc->cLockObj);
990 return pClientImc;
991}
BOOL APIENTRY Imm32CheckImcProcess(PIMC pIMC)
Definition: utils.c:391
BOOL NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
Definition: ime.c:1769
@ UIC_CLIENTIMCDATA
Definition: undocuser.h:303

Referenced by 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 58 of file imm.c.

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

Referenced by DllMain(), and User32InitializeImmEntryTable().

◆ ImmReleaseContext()

◆ ImmSetActiveContext()

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

Definition at line 1176 of file imm.c.

1177{
1178 PCLIENTIMC pClientImc;
1179 LPINPUTCONTEXTDX pIC;
1180 PIMEDPI pImeDpi;
1181 HIMC hOldIMC;
1182 HKL hKL;
1183 BOOL fOpen = FALSE;
1184 DWORD dwConversion = 0, dwShowFlags = ISC_SHOWUIALL;
1185 HWND hwndDefIME;
1186
1187 TRACE("(%p, %p, %d)\n", hWnd, hIMC, fActive);
1188
1189 if (!IS_IMM_MODE())
1190 {
1191 TRACE("\n");
1192 return FALSE;
1193 }
1194
1195 pClientImc = ImmLockClientImc(hIMC);
1196
1197 if (!fActive)
1198 {
1199 if (pClientImc)
1200 pClientImc->dwFlags &= ~CLIENTIMC_ACTIVE;
1201 }
1202 else if (hIMC)
1203 {
1204 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1205 return FALSE;
1206
1207 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
1208 if (IS_NULL_UNEXPECTEDLY(pIC))
1209 {
1210 ImmUnlockClientImc(pClientImc);
1211 return FALSE;
1212 }
1213
1214 pIC->hWnd = hWnd;
1215 pClientImc->dwFlags |= CLIENTIMC_ACTIVE;
1216
1217 if (pIC->dwUIFlags & 2)
1219
1220 fOpen = pIC->fOpen;
1221 dwConversion = pIC->fdwConversion;
1222
1223 ImmUnlockIMC(hIMC);
1224 }
1225 else
1226 {
1227 hOldIMC = ImmGetSaveContext(hWnd, 1);
1228 pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hOldIMC);
1229 if (pIC)
1230 {
1231 pIC->hWnd = hWnd;
1232 ImmUnlockIMC(hOldIMC);
1233 }
1234 }
1235
1236 hKL = GetKeyboardLayout(0);
1237 if (IS_CICERO_MODE() && !IS_16BIT_MODE())
1238 {
1239 Imm32CiceroSetActiveContext(hIMC, fActive, hWnd, hKL);
1240 hKL = GetKeyboardLayout(0);
1241 }
1242
1243 pImeDpi = ImmLockImeDpi(hKL);
1244 if (pImeDpi)
1245 {
1246 if (IS_IME_HKL(hKL))
1247 pImeDpi->ImeSetActiveContext(hIMC, fActive);
1248 ImmUnlockImeDpi(pImeDpi);
1249 }
1250
1251 if (IsWindow(hWnd))
1252 {
1253 SendMessageW(hWnd, WM_IME_SETCONTEXT, fActive, dwShowFlags);
1254 if (fActive)
1255 NtUserNotifyIMEStatus(hWnd, fOpen, dwConversion);
1256 }
1257 else if (!fActive)
1258 {
1259 hwndDefIME = ImmGetDefaultIMEWnd(NULL);
1260 if (hwndDefIME)
1261 SendMessageW(hwndDefIME, WM_IME_SETCONTEXT, 0, dwShowFlags);
1262 }
1263
1264 if (pClientImc)
1265 ImmUnlockClientImc(pClientImc);
1266
1267 return TRUE;
1268}
static VOID APIENTRY Imm32CiceroSetActiveContext(HIMC hIMC, BOOL fActive, HWND hWnd, HKL hKL)
Definition: imm.c:495
#define ISC_SHOWUIGUIDELINE
Definition: imm.h:306
#define ISC_SHOWUIALLCANDIDATEWINDOW
Definition: imm.h:307
#define ISC_SHOWUIALL
Definition: imm.h:308
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:814
#define CLIENTIMC_ACTIVE
Definition: ntuser.h:1357
DWORD dwUIFlags
Definition: immdev.h:132
#define WM_IME_SETCONTEXT
Definition: winuser.h:1819

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

◆ ImmSetActiveContextConsoleIME()

BOOL WINAPI ImmSetActiveContextConsoleIME ( HWND  hwnd,
BOOL  fFlag 
)

Definition at line 1288 of file imm.c.

1289{
1290 HIMC hIMC;
1291 TRACE("(%p, %d)\n", hwnd, fFlag);
1292
1293 hIMC = ImmGetContext(hwnd);
1294 if (IS_NULL_UNEXPECTEDLY(hIMC))
1295 return FALSE;
1296 return ImmSetActiveContext(hwnd, hIMC, fFlag);
1297}
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1057
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ ImmShowSoftKeyboard()

BOOL WINAPI ImmShowSoftKeyboard ( HWND  hSoftWnd,
int  nCmdShow 
)

Definition at line 1128 of file imm.c.

1129{
1130 TRACE("(%p, %d)\n", hSoftWnd, nCmdShow);
1131 if (hSoftWnd)
1132 return ShowWindow(hSoftWnd, nCmdShow);
1133 return FALSE;
1134}
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)

◆ ImmUnlockClientImc()

VOID WINAPI ImmUnlockClientImc ( PCLIENTIMC  pClientImc)

◆ ImmUnlockIMC()

BOOL WINAPI ImmUnlockIMC ( HIMC  hIMC)

◆ ImmWINNLSGetEnableStatus()

BOOL WINAPI ImmWINNLSGetEnableStatus ( HWND  hWnd)

Definition at line 1274 of file imm.c.

1275{
1277 {
1279 return FALSE;
1280 }
1281
1282 return !!ImmGetSaveContext(hWnd, 2);
1283}
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:2145
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
Definition: imm.c:58
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

HMODULE ghImm32Inst = NULL

Definition at line 17 of file imm.c.

Referenced by ImmInitializeGlobals().

◆ 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(), ImmRegisterClient(), InitMetrics(), InitUserAtoms(), IntCheckImeShowStatus(), IntCoalesceMouseMove(), IntCreateClass(), IntCreateDesktop(), IntCreateWindow(), IntDeactivateWindow(), IntDefWindowProc(), IntDrawState(), IntFlashWindowEx(), IntGetSysColor(), IntGetSysColorBrush(), IntGetWindowContextHelpId(), IntGrayString(), 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 }