Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

immuser.h File Reference

#include <imm.h>
#include <immp.h>
#include <ime.h>
#include <imep.h>

Go to the source code of this file.

Classes

struct  tagCLIENTIMC
struct  tagIMEDPI
struct  tagIMEDPI::_tagImeFunctions
struct  tagIMEPRIVATESAVER
struct  tagIMEMODESAVER

Defines

#define InitImcCrit(pClientImc)   RtlInitializeCriticalSection(&pClientImc->cs)
#define DeleteImcCrit(pClientImc)   RtlDeleteCriticalSection(&pClientImc->cs)
#define EnterImcCrit(pClientImc)   RtlEnterCriticalSection(&pClientImc->cs)
#define LeaveImcCrit(pClientImc)   RtlLeaveCriticalSection(&pClientImc->cs)
#define IMEDPI_UNLOADED   1
#define IMEDPI_UNLOCKUNLOAD   2

Typedefs

typedef tagCLIENTIMC CLIENTIMC
typedef tagCLIENTIMCPCLIENTIMC
typedef BOOL(CALLBACK * PFNINQUIREA )(LPIMEINFO, LPSTR, DWORD)
typedef BOOL(CALLBACK * PFNINQUIREW )(LPIMEINFO, LPWSTR, DWORD)
typedef DWORD(CALLBACK * PFNCONVLISTA )(HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT)
typedef DWORD(CALLBACK * PFNCONVLISTW )(HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT)
typedef BOOL(CALLBACK * PFNREGWORDA )(LPCSTR, DWORD, LPCSTR)
typedef BOOL(CALLBACK * PFNREGWORDW )(LPCWSTR, DWORD, LPCWSTR)
typedef BOOL(CALLBACK * PFNUNREGWORDA )(LPCSTR, DWORD, LPCSTR)
typedef BOOL(CALLBACK * PFNUNREGWORDW )(LPCWSTR, DWORD, LPCWSTR)
typedef UINT(CALLBACK * PFNGETREGWORDSTYA )(UINT, LPSTYLEBUFA)
typedef UINT(CALLBACK * PFNGETREGWORDSTYW )(UINT, LPSTYLEBUFW)
typedef UINT(CALLBACK * PFNENUMREGWORDA )(REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID)
typedef UINT(CALLBACK * PFNENUMREGWORDW )(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID)
typedef BOOL(CALLBACK * PFNCONFIGURE )(HKL, HWND, DWORD, LPVOID)
typedef BOOL(CALLBACK * PFNDESTROY )(UINT)
typedef LRESULT(CALLBACK * PFNESCAPE )(HIMC, UINT, LPVOID)
typedef BOOL(CALLBACK * PFNPROCESSKEY )(HIMC, UINT, LPARAM, CONST LPBYTE)
typedef BOOL(CALLBACK * PFNSELECT )(HIMC, BOOL)
typedef BOOL(CALLBACK * PFNSETACTIVEC )(HIMC, BOOL)
typedef UINT(CALLBACK * PFNTOASCEX )(UINT, UINT, CONST LPBYTE, PTRANSMSGLIST, UINT, HIMC)
typedef BOOL(CALLBACK * PFNNOTIFY )(HIMC, DWORD, DWORD, DWORD)
typedef BOOL(CALLBACK * PFNSETCOMPSTR )(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD)
typedef DWORD(CALLBACK * PFNGETIMEMENUITEMS )(HIMC, DWORD, DWORD, LPVOID, LPVOID, DWORD)
typedef tagIMEDPI IMEDPI
typedef tagIMEDPIPIMEDPI
typedef tagIMEPRIVATESAVER IMEPRIVATEMODESAVER
typedef tagIMEPRIVATESAVERPIMEPRIVATEMODESAVER
typedef tagIMEMODESAVER IMEMODESAVER
typedef tagIMEMODESAVERPIMEMODESAVER

Functions

BOOL ImmSetActiveContext (HWND hWnd, HIMC hImc, BOOL fActivate)
BOOL WINAPI ImmLoadIME (HKL hKL)
BOOL WINAPI ImmUnloadIME (HKL hKL)
BOOL WINAPI ImmFreeLayout (DWORD dwFlag)
BOOL WINAPI ImmActivateLayout (HKL hSelKL)
BOOL WINAPI ImmLoadLayout (HKL hKL, PIMEINFOEX piiex)
BOOL WINAPI ImmDisableIme (DWORD dwThreadId)
PCLIENTIMC WINAPI ImmLockClientImc (HIMC hImc)
VOID WINAPI ImmUnlockClientImc (PCLIENTIMC pClientImc)
PIMEDPI WINAPI ImmLockImeDpi (HKL hKL)
VOID WINAPI ImmUnlockImeDpi (PIMEDPI pImeDpi)
BOOL WINAPI ImmGetImeInfoEx (PIMEINFOEX piiex, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
DWORD WINAPI ImmProcessKey (HWND hWnd, HKL hkl, UINT uVKey, LPARAM lParam, DWORD dwHotKeyID)
BOOL ImmTranslateMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
VOID ImmInitializeHotKeys (BOOL bUserLoggedOn)


Define Documentation

#define DeleteImcCrit pClientImc   )     RtlDeleteCriticalSection(&pClientImc->cs)
 

Definition at line 33 of file immuser.h.

Referenced by ImmUnlockClientImc().

#define EnterImcCrit pClientImc   )     RtlEnterCriticalSection(&pClientImc->cs)
 

Definition at line 34 of file immuser.h.

Referenced by InternalImmLockIMC().

#define IMEDPI_UNLOADED   1
 

Definition at line 63 of file immuser.h.

Referenced by ImmLockImeDpi(), ImmUnloadIME(), and ImmUnlockImeDpi().

#define IMEDPI_UNLOCKUNLOAD   2
 

Definition at line 64 of file immuser.h.

Referenced by ImmUnlockImeDpi(), and LoadImeDpi().

#define InitImcCrit pClientImc   )     RtlInitializeCriticalSection(&pClientImc->cs)
 

Definition at line 32 of file immuser.h.

Referenced by ImmCreateContext(), and ImmLockClientImc().

#define LeaveImcCrit pClientImc   )     RtlLeaveCriticalSection(&pClientImc->cs)
 

Definition at line 35 of file immuser.h.

Referenced by InternalImmLockIMC().


Typedef Documentation

typedef struct tagCLIENTIMC CLIENTIMC
 

Referenced by ImmCreateContext().

typedef struct tagIMEDPI IMEDPI
 

typedef struct tagIMEMODESAVER IMEMODESAVER
 

typedef struct tagIMEPRIVATESAVER IMEPRIVATEMODESAVER
 

typedef struct tagCLIENTIMC * PCLIENTIMC
 

Referenced by ImmEnableIME().

typedef BOOL(CALLBACK* PFNCONFIGURE)(HKL, HWND, DWORD, LPVOID)
 

Definition at line 52 of file immuser.h.

typedef DWORD(CALLBACK* PFNCONVLISTA)(HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT)
 

Definition at line 42 of file immuser.h.

typedef DWORD(CALLBACK* PFNCONVLISTW)(HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT)
 

Definition at line 43 of file immuser.h.

typedef BOOL(CALLBACK* PFNDESTROY)(UINT)
 

Definition at line 53 of file immuser.h.

typedef UINT(CALLBACK* PFNENUMREGWORDA)(REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID)
 

Definition at line 50 of file immuser.h.

typedef UINT(CALLBACK* PFNENUMREGWORDW)(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID)
 

Definition at line 51 of file immuser.h.

typedef LRESULT(CALLBACK* PFNESCAPE)(HIMC, UINT, LPVOID)
 

Definition at line 54 of file immuser.h.

typedef DWORD(CALLBACK* PFNGETIMEMENUITEMS)(HIMC, DWORD, DWORD, LPVOID, LPVOID, DWORD)
 

Definition at line 61 of file immuser.h.

typedef UINT(CALLBACK* PFNGETREGWORDSTYA)(UINT, LPSTYLEBUFA)
 

Definition at line 48 of file immuser.h.

typedef UINT(CALLBACK* PFNGETREGWORDSTYW)(UINT, LPSTYLEBUFW)
 

Definition at line 49 of file immuser.h.

typedef BOOL(CALLBACK* PFNINQUIREA)(LPIMEINFO, LPSTR, DWORD)
 

Definition at line 40 of file immuser.h.

typedef BOOL(CALLBACK* PFNINQUIREW)(LPIMEINFO, LPWSTR, DWORD)
 

Definition at line 41 of file immuser.h.

typedef BOOL(CALLBACK* PFNNOTIFY)(HIMC, DWORD, DWORD, DWORD)
 

Definition at line 59 of file immuser.h.

typedef BOOL(CALLBACK* PFNPROCESSKEY)(HIMC, UINT, LPARAM, CONST LPBYTE)
 

Definition at line 55 of file immuser.h.

typedef BOOL(CALLBACK* PFNREGWORDA)(LPCSTR, DWORD, LPCSTR)
 

Definition at line 44 of file immuser.h.

typedef BOOL(CALLBACK* PFNREGWORDW)(LPCWSTR, DWORD, LPCWSTR)
 

Definition at line 45 of file immuser.h.

typedef BOOL(CALLBACK* PFNSELECT)(HIMC, BOOL)
 

Definition at line 56 of file immuser.h.

typedef BOOL(CALLBACK* PFNSETACTIVEC)(HIMC, BOOL)
 

Definition at line 57 of file immuser.h.

typedef BOOL(CALLBACK* PFNSETCOMPSTR)(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD)
 

Definition at line 60 of file immuser.h.

typedef UINT(CALLBACK* PFNTOASCEX)(UINT, UINT, CONST LPBYTE, PTRANSMSGLIST, UINT, HIMC)
 

Definition at line 58 of file immuser.h.

typedef BOOL(CALLBACK* PFNUNREGWORDA)(LPCSTR, DWORD, LPCSTR)
 

Definition at line 46 of file immuser.h.

typedef BOOL(CALLBACK* PFNUNREGWORDW)(LPCWSTR, DWORD, LPCWSTR)
 

Definition at line 47 of file immuser.h.

typedef struct tagIMEDPI * PIMEDPI
 

Referenced by ImmCallImeConsoleIME().

typedef struct tagIMEMODESAVER * PIMEMODESAVER
 

Referenced by GetImeModeSaver().

typedef struct tagIMEPRIVATESAVER * PIMEPRIVATEMODESAVER
 

Referenced by DestroyImeModeSaver().


Function Documentation

BOOL WINAPI ImmActivateLayout HKL  hSelKL  ) 
 

Definition at line 495 of file immime.c.

References BOOL, _CLIENTINFO::CI_flags, CI_INPUTCONTEXT_REINIT, DWORD, FALSE, GetClientInfo, GetKeyboardLayout(), tagSELECTCONTEXT_ENUM::hSelKL, tagSELECTCONTEXT_ENUM::hUnSelKL, tagIMEDPI::ImeInfo, ImmEnumInputContext(), ImmGetDefaultIMEWnd(), ImmLoadIME(), ImmLockImeDpi(), ImmUnlockImeDpi(), IsWindow(), NotifyIMEProc(), NtUserSetThreadLayoutHandles(), NULL, SelectContextProc(), SendMessage(), and TRUE.

Referenced by _InitializeImmEntryTable().

00497 { 00498 HKL hUnSelKL; 00499 HWND hWndDefaultIme; 00500 SCE sce; 00501 DWORD dwCPS; 00502 PIMEDPI pImeDpi; 00503 BOOLEAN fOptimizeActivation = TRUE; 00504 00505 hUnSelKL = GetKeyboardLayout(0); 00506 00507 { 00508 PCLIENTINFO pClientInfo = GetClientInfo(); 00509 00510 if (pClientInfo->CI_flags & CI_INPUTCONTEXT_REINIT) { 00511 fOptimizeActivation = FALSE; 00512 } 00513 } 00514 00515 /* 00516 * if already current active, do nothing 00517 */ 00518 if (hUnSelKL == hSelKL && fOptimizeActivation) 00519 return TRUE; 00520 00521 ImmLoadIME(hSelKL); 00522 00523 if (hUnSelKL != hSelKL) { 00524 pImeDpi = ImmLockImeDpi(hUnSelKL); 00525 if (pImeDpi != NULL) { 00526 /* 00527 * Send out CPS_CANCEL or CPS_COMPLETE to every input 00528 * context assoicated to window(s) created by this thread. 00529 * Starting from SUR, we only assoicate input context to window created 00530 * by the same thread. 00531 */ 00532 dwCPS = (pImeDpi->ImeInfo.fdwProperty & IME_PROP_COMPLETE_ON_UNSELECT) ? CPS_COMPLETE : CPS_CANCEL; 00533 ImmUnlockImeDpi(pImeDpi); 00534 ImmEnumInputContext(0, NotifyIMEProc, dwCPS); 00535 } 00536 00537 hWndDefaultIme = ImmGetDefaultIMEWnd(NULL); 00538 00539 if (IsWindow(hWndDefaultIme)) 00540 SendMessage(hWndDefaultIme, WM_IME_SELECT, FALSE, (LPARAM)hUnSelKL); 00541 00542 /* 00543 * This is the time to update the kernel side layout handles. 00544 * We must do this before sending WM_IME_SELECT. 00545 */ 00546 NtUserSetThreadLayoutHandles(hSelKL, hUnSelKL); 00547 } 00548 00549 /* 00550 * Unselect and select input context(s). 00551 */ 00552 sce.hSelKL = hSelKL; 00553 sce.hUnSelKL = hUnSelKL; 00554 ImmEnumInputContext(0, (IMCENUMPROC)SelectContextProc, (LPARAM)&sce); 00555 00556 /* 00557 * inform UI select after all hIMC select 00558 */ 00559 if (IsWindow(hWndDefaultIme)) 00560 SendMessage(hWndDefaultIme, WM_IME_SELECT, TRUE, (LPARAM)hSelKL); 00561 00562 return (TRUE); 00563 }

BOOL WINAPI ImmDisableIme DWORD  dwThreadId  ) 
 

BOOL WINAPI ImmFreeLayout DWORD  dwFlag  ) 
 

Definition at line 416 of file immime.c.

References BOOL, FALSE, gcsImeDpi, GetKeyboardLayout(), gpImeDpi, tagIMEDPI::hKL, IFL_DEACTIVATEIME, IFL_UNLOADIME, ImmLocalAlloc(), ImmLocalFree, ImmUnloadIME(), IS_IME_KBDLAYOUT, L, LoadKeyboardLayoutW(), NULL, tagIMEDPI::pNext, TRUE, and UINT.

Referenced by _InitializeImmEntryTable().

00418 { 00419 PIMEDPI pImeDpi; 00420 HKL *phklRoot, hklCurrent; 00421 WCHAR pwszNonImeKLID[KL_NAMELENGTH]; 00422 UINT nLayouts, uNonImeKLID = 0, i; 00423 00424 hklCurrent = GetKeyboardLayout(0); 00425 00426 switch (dwFlag) { 00427 00428 case IFL_DEACTIVATEIME: 00429 /* 00430 * Do nothing if no IME to be deactivated. 00431 */ 00432 if (!IS_IME_KBDLAYOUT(hklCurrent)) 00433 return TRUE; 00434 00435 /* 00436 * Deactivate IME based layout by activating a non-IME based 00437 * keyboard layout. 00438 */ 00439 uNonImeKLID = (UINT)LANGIDFROMLCID(GetSystemDefaultLCID()); 00440 00441 nLayouts = GetKeyboardLayoutList(0, NULL); 00442 00443 if (nLayouts != 0) { 00444 phklRoot = ImmLocalAlloc(0, nLayouts * sizeof(HKL)); 00445 if (phklRoot == NULL) 00446 return FALSE; 00447 00448 nLayouts = GetKeyboardLayoutList(nLayouts, phklRoot); 00449 00450 for (i = 0; i < nLayouts && IS_IME_KBDLAYOUT(phklRoot[i]); i++) ; 00451 00452 if (i < nLayouts) 00453 uNonImeKLID = HandleToUlong(phklRoot[i]) & 0xffff; 00454 00455 ImmLocalFree(phklRoot); 00456 } 00457 00458 wsprintf(pwszNonImeKLID, L"%08x", uNonImeKLID); 00459 00460 if (LoadKeyboardLayoutW(pwszNonImeKLID, KLF_ACTIVATE) == NULL) { 00461 RIPMSG1(RIP_WARNING, "ImmFreeLayout: LoadKeyboardLayoutW(%S, KLF_ACTIVATE) failed. Trying 00000409", pwszNonImeKLID); 00462 // Somehow it failed (probably a bad setup), let's try 00463 // 409 KL, which should be installed on all localized NTs. 00464 if (LoadKeyboardLayoutW(L"00000409", KLF_ACTIVATE | KLF_FAILSAFE) == NULL) { 00465 RIPMSG0(RIP_WARNING, "LoadKeyboardLayoutW(00000409) failed either. will try NULL."); 00466 } 00467 } 00468 00469 break; 00470 00471 case IFL_UNLOADIME: 00472 RtlEnterCriticalSection(&gcsImeDpi); 00473 UnloadImeDpiLoop: 00474 for (pImeDpi = gpImeDpi; pImeDpi != NULL; pImeDpi = pImeDpi->pNext) { 00475 if (ImmUnloadIME(pImeDpi->hKL)) 00476 goto UnloadImeDpiLoop; // Rescan as list was updated. 00477 } 00478 RtlLeaveCriticalSection(&gcsImeDpi); 00479 break; 00480 00481 default: 00482 { 00483 HKL hklFlag = (HKL)LongToHandle( dwFlag ); 00484 if (IS_IME_KBDLAYOUT(hklFlag) && hklFlag != hklCurrent) { 00485 ImmUnloadIME(hklFlag); 00486 } 00487 } 00488 break; 00489 } 00490 00491 return TRUE; 00492 }

BOOL WINAPI ImmGetImeInfoEx PIMEINFOEX  piiex,
IMEINFOEXCLASS  SearchType,
PVOID  pvSearchKey
 

Definition at line 876 of file w32/ntuser/imm/misc.c.

References BOOL, FALSE, tagIMEINFOEX::hkl, ImeInfoExImeFileName, ImeInfoExKeyboardLayout, ImmAssert, IS_IME_KBDLAYOUT, NtUserGetImeInfoEx(), NULL, and tagIMEINFOEX::wszImeFile.

Referenced by _InitializeImmEntryTable(), ImmGetDescriptionA(), ImmGetDescriptionW(), ImmGetIMEFileNameA(), ImmGetIMEFileNameW(), ImmGetProperty(), ImmIMPQueryIMEW(), ImmIMPSetIMEW(), ImmInstallIMEW(), ImmIsIME(), IMPGetIMEWorker(), and LoadImeDpi().

00880 { 00881 ImmAssert(piiex != NULL && pvSearchKey != NULL); 00882 00883 switch (SearchType) { 00884 case ImeInfoExKeyboardLayout: 00885 piiex->hkl = *((HKL *)pvSearchKey); 00886 /* 00887 * Quick return for non-IME based keyboard layout 00888 */ 00889 if (!IS_IME_KBDLAYOUT(piiex->hkl)) 00890 return FALSE; 00891 break; 00892 00893 case ImeInfoExImeFileName: 00894 wcscpy(piiex->wszImeFile, (PWSTR)pvSearchKey); 00895 break; 00896 00897 default: 00898 return FALSE; 00899 } 00900 00901 return NtUserGetImeInfoEx(piiex, SearchType); 00902 }

VOID ImmInitializeHotKeys BOOL  bUserLoggedOn  ) 
 

BOOL WINAPI ImmLoadIME HKL  hKL  ) 
 

Definition at line 346 of file immime.c.

References BOOL, FALSE, ImmGetImeDpi(), IS_IME_KBDLAYOUT, LoadImeDpi(), and NULL.

Referenced by _InitializeImmEntryTable(), and ImmActivateLayout().

00348 { 00349 PIMEDPI pImeDpi; 00350 00351 /* 00352 * Non IME based keyboard layout doesn't have IMEDPI. 00353 */ 00354 if (!IS_IME_KBDLAYOUT(hKL)) 00355 return FALSE; 00356 00357 pImeDpi = ImmGetImeDpi(hKL); 00358 if (pImeDpi == NULL) 00359 pImeDpi = LoadImeDpi(hKL, FALSE); 00360 00361 return (pImeDpi != NULL); 00362 }

BOOL WINAPI ImmLoadLayout HKL  hKL,
PIMEINFOEX  piiex
 

Definition at line 38 of file layime.c.

References BOOL, DWORD, FALSE, tagIMEINFOEX::fLoadFlag, gszRegKbdLayout, gszValImeFile, tagIMEINFOEX::hkl, IM_FILE_SIZE, IMEF_NONLOAD, L, LoadVersionInfo(), MAX_PATH, NT_SUCCESS, NTSTATUS(), NULL, RtlIntegerToUnicodeString(), Status, and tagIMEINFOEX::wszImeFile.

Referenced by _InitializeImmEntryTable().

00041 { 00042 UNICODE_STRING strIme; 00043 WCHAR wszIme[MAX_PATH]; 00044 HKEY hKeyKbdLayout, hKeyIme; 00045 NTSTATUS Status; 00046 DWORD dwTmp; 00047 LONG lRet; 00048 00049 strIme.Buffer = wszIme; 00050 strIme.MaximumLength = sizeof(wszIme); 00051 00052 Status = RtlIntegerToUnicodeString(HandleToUlong(hKL), 16, &strIme); 00053 if (!NT_SUCCESS(Status)) { 00054 return(FALSE); 00055 } 00056 00057 lRet = RegOpenKey(HKEY_LOCAL_MACHINE, gszRegKbdLayout, &hKeyKbdLayout); 00058 if ( lRet != ERROR_SUCCESS ) { 00059 return(FALSE); 00060 } 00061 00062 lRet = RegOpenKey(hKeyKbdLayout, strIme.Buffer, &hKeyIme); 00063 if ( lRet != ERROR_SUCCESS ) { 00064 RegCloseKey(hKeyKbdLayout); 00065 return(FALSE); 00066 } 00067 00068 dwTmp = IM_FILE_SIZE; 00069 lRet = RegQueryValueEx(hKeyIme, 00070 gszValImeFile, 00071 NULL, 00072 NULL, 00073 (LPBYTE)piiex->wszImeFile, 00074 &dwTmp); 00075 00076 if ( lRet != ERROR_SUCCESS ) { 00077 RegCloseKey(hKeyIme); 00078 RegCloseKey(hKeyKbdLayout); 00079 return(FALSE); 00080 } 00081 00082 piiex->wszImeFile[IM_FILE_SIZE - 1] = L'\0'; 00083 00084 RegCloseKey(hKeyIme); 00085 RegCloseKey(hKeyKbdLayout); 00086 00087 piiex->hkl = hKL; 00088 piiex->fLoadFlag = IMEF_NONLOAD; 00089 00090 return LoadVersionInfo(piiex); 00091 }

PCLIENTIMC WINAPI ImmLockClientImc HIMC  hImc  ) 
 

Definition at line 689 of file w32/ntuser/imm/misc.c.

References tagCLIENTIMC::cLockObj, tagIMC::dwClientImcData, tagCLIENTIMC::dwImeCompatFlags, DWORD, HMValidateHandle(), IMCF_DEFAULTIMC, IMCF_INDESTROY, ImmLocalAlloc(), ImmLocalFree, InitImcCrit, NtUserGetThreadState(), NtUserUpdateInputContext(), NULL, NULL_HIMC, SetICF, TestICF, TestInputContextProcess(), TYPE_INPUTCONTEXT, and UpdateClientInputContext.

Referenced by CreateInputContext(), ImmEnableIME(), ImmGenerateMessage(), ImmGetAppCompatFlags(), ImmGetCandidateListCountWorker(), ImmGetCandidateListWorker(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetCompositionStringA(), ImmGetCompositionStringW(), ImmGetGuideLineWorker(), ImmGetIMCLockCount(), ImmGetSaveContext(), ImmPostMessages(), ImmRequestMessageWorker(), ImmSetActiveContext(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmUnlockIMC(), InternalImmLockIMC(), IsAnsiIMC(), MySetCompFont(), SelectInputContext(), and SetFontForMCWVERTICAL().

00691 { 00692 PIMC pImc; 00693 PCLIENTIMC pClientImc; 00694 00695 if (hImc == NULL_HIMC) 00696 return NULL; 00697 00698 pImc = HMValidateHandle((HANDLE)hImc, TYPE_INPUTCONTEXT); 00699 00700 /* 00701 * Cannot access input context from other process. 00702 */ 00703 if (pImc == NULL || !TestInputContextProcess(pImc)) 00704 return NULL; 00705 00706 pClientImc = (PCLIENTIMC)pImc->dwClientImcData; 00707 00708 if (pClientImc == NULL) { 00709 /* 00710 * We delay the creation of client side per-thread default Imc. 00711 * Now, this is the time to create it. 00712 */ 00713 pClientImc = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC)); 00714 if (pClientImc == NULL) 00715 return NULL; 00716 00717 InitImcCrit(pClientImc); 00718 pClientImc->dwImeCompatFlags = (DWORD)NtUserGetThreadState(UserThreadStateImeCompatFlags); 00719 00720 /* 00721 * Update the kernel side input context. 00722 */ 00723 if (!NtUserUpdateInputContext(hImc, 00724 UpdateClientInputContext, (ULONG_PTR)pClientImc)) { 00725 ImmLocalFree(pClientImc); 00726 return NULL; 00727 } 00728 00729 /* 00730 * Marks with default input context signature. 00731 */ 00732 SetICF(pClientImc, IMCF_DEFAULTIMC); 00733 } 00734 else if (TestICF(pClientImc, IMCF_INDESTROY)) { 00735 /* 00736 * Cannot access destroyed input context. 00737 */ 00738 return NULL; 00739 } 00740 00741 InterlockedIncrement(&pClientImc->cLockObj); 00742 00743 return pClientImc; 00744 }

PIMEDPI WINAPI ImmLockImeDpi HKL  hKL  ) 
 

Definition at line 793 of file w32/ntuser/imm/misc.c.

References tagIMEDPI::cLock, tagIMEDPI::dwFlag, gcsImeDpi, gpImeDpi, tagIMEDPI::hKL, IMEDPI_UNLOADED, NULL, and tagIMEDPI::pNext.

Referenced by _InitializeImmEntryTable(), CreateInputContext(), DestroyInputContext(), FindOrLoadImeDpi(), HotKeyIDDispatcher(), ImmActivateLayout(), ImmCallImeConsoleIME(), ImmCreateSoftKeyboard(), ImmGetImeMenuItemsWorker(), ImmNotifyIME(), ImmProcessKey(), ImmSetActiveContext(), ImmSetCompositionStringWorker(), ImmTranslateMessage(), JCloseOpen(), MakeIMENotify(), SelectInputContext(), and TransHanjaMode().

00795 { 00796 PIMEDPI pImeDpi; 00797 00798 RtlEnterCriticalSection(&gcsImeDpi); 00799 00800 pImeDpi = gpImeDpi; 00801 00802 while (pImeDpi != NULL && pImeDpi->hKL != hKL) 00803 pImeDpi = pImeDpi->pNext; 00804 00805 if (pImeDpi != NULL) { 00806 if (pImeDpi->dwFlag & IMEDPI_UNLOADED) 00807 pImeDpi = NULL; 00808 else 00809 pImeDpi->cLock++; 00810 } 00811 00812 RtlLeaveCriticalSection(&gcsImeDpi); 00813 00814 return (PIMEDPI)pImeDpi; 00815 }

DWORD WINAPI ImmProcessKey HWND  hWnd,
HKL  hkl,
UINT  uVKey,
LPARAM  lParam,
DWORD  dwHotKeyID
 

Definition at line 30 of file ntuser/imm/input.c.

References BYTE, DWORD, FALSE, GetKeyboardState, HotKeyIDDispatcher(), hWnd, tagIMEDPI::ImeInfo, tagIMEDPI::_tagImeFunctions::ImeProcessKey, ImmAssert, ImmGetAppCompatFlags(), ImmGetContext(), ImmLocalAlloc(), ImmLocalFree, ImmLockIMC(), ImmLockImeDpi(), ImmReleaseContext(), ImmTranslateMessage(), ImmUnlockIMC(), ImmUnlockImeDpi(), IPHK_HOTKEY, IPHK_PROCESSBYIME, NULL, PBYTE, tagIMEDPI::pfn, TRUE, and UINT.

Referenced by ImmCallImeConsoleIME().

00036 { 00037 HIMC hIMC = ImmGetContext(hWnd); 00038 PIMEDPI pImeDpi = ImmLockImeDpi(hkl); 00039 DWORD dwReturn = 0; 00040 #if DBG 00041 if (dwHotKeyID >= IME_KHOTKEY_FIRST && dwHotKeyID <= IME_KHOTKEY_LAST) { 00042 TAGMSG2(DBGTAG_IMM, "ImmProcessKey: Kor IME Hotkeys should not come here: dwHotKeyID=%x, uVKey=%x", dwHotKeyID, uVKey); 00043 } 00044 #endif 00045 00046 ImmAssert(dwHotKeyID != IME_KHOTKEY_ENGLISH && 00047 dwHotKeyID != IME_KHOTKEY_SHAPE_TOGGLE && 00048 dwHotKeyID != IME_KHOTKEY_HANJACONVERT); 00049 00050 // 00051 // call ImeProcessKey 00052 // 00053 if (pImeDpi != NULL) { 00054 PINPUTCONTEXT pInputContext = ImmLockIMC(hIMC); 00055 00056 if (pInputContext != NULL) { 00057 BOOLEAN fTruncateWideVK = FALSE; 00058 BOOLEAN fCallIme = TRUE; 00059 BOOLEAN fSkipThisKey = FALSE; 00060 00061 #ifdef LATER 00062 00063 // 00064 // if the current imc is not open and IME doesn't need 00065 // keys when being closed, we don't pass any keyboard 00066 // input to ime except hotkey and keys that change 00067 // the keyboard status. 00068 // 00069 if ((pImeDpi->fdwProperty & IME_PROP_NO_KEYS_ON_CLOSE) && 00070 !pInputContext->fOpen && 00071 uVKey != VK_SHIFT && 00072 uVKey != VK_CONTROL && 00073 uVKey != VK_CAPITAL && 00074 uVKey != VK_KANA && 00075 uVKey != VK_NUMLOCK && 00076 uVKey != VK_SCROLL) { 00077 // Check if Korea Hanja conversion mode 00078 if(!(pimc->fdwConvMode & IME_CMODE_HANJACONVERT)) { 00079 fCallIme = FALSE; 00080 } 00081 } 00082 else 00083 #endif 00084 // 00085 // Protect IMEs which are unaware of wide virtual keys. 00086 // 00087 if ((BYTE)uVKey == VK_PACKET && 00088 (pImeDpi->ImeInfo.fdwProperty & IME_PROP_ACCEPT_WIDE_VKEY) == 0) { 00089 00090 if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) { 00091 // 00092 // Since this IME is not ready to accept wide VKey, we should 00093 // truncate it. 00094 // 00095 fTruncateWideVK = TRUE; 00096 } 00097 else { 00098 // 00099 // Hmm, this guy is ANSI IME, and does not declare Wide Vkey awareness. 00100 // Let's guess this one is not ready to accept Wide Vkey, so let's not 00101 // pass it to this guy. 00102 // And if it is opened, we'd better skip this key for safety. 00103 // 00104 fCallIme = FALSE; 00105 if (pInputContext->fOpen) { 00106 fSkipThisKey = TRUE; 00107 } 00108 } 00109 } 00110 00111 if (fCallIme) { 00112 PBYTE pbKeyState = (PBYTE)ImmLocalAlloc(0, 256); 00113 00114 ImmAssert(fSkipThisKey == FALSE); 00115 00116 if (pbKeyState != NULL) { 00117 if (GetKeyboardState(pbKeyState)) { 00118 UINT uVKeyIme = uVKey; 00119 if (fTruncateWideVK) { 00120 uVKeyIme &= 0xffff; 00121 } 00122 if ( (*pImeDpi->pfn.ImeProcessKey)(hIMC, uVKeyIme, lParam, pbKeyState) ) { 00123 // 00124 // if the return value of ImeProcessKey is TRUE, 00125 // it means the key is the one that the ime is 00126 // waiting for. 00127 // 00128 pInputContext->fChgMsg = TRUE; 00129 pInputContext->uSavedVKey = uVKey; 00130 dwReturn |= IPHK_PROCESSBYIME; 00131 } 00132 } 00133 ImmLocalFree(pbKeyState); 00134 } 00135 } 00136 else if (fSkipThisKey) { 00137 dwReturn |= IPHK_SKIPTHISKEY; 00138 ImmAssert((dwReturn & (IPHK_PROCESSBYIME | IPHK_HOTKEY)) == 0); 00139 } 00140 ImmUnlockIMC(hIMC); 00141 } 00142 ImmUnlockImeDpi(pImeDpi); 00143 } 00144 00145 // 00146 // call hotkey handler 00147 // 00148 if (dwHotKeyID != IME_INVALID_HOTKEY && HotKeyIDDispatcher(hWnd, hIMC, hkl, dwHotKeyID)) { 00149 // Backward compat: 00150 // On Japanese system, some applications may want VK_KANJI. 00151 if ((uVKey != VK_KANJI) || 00152 (dwHotKeyID != IME_JHOTKEY_CLOSE_OPEN)) { 00153 dwReturn |= IPHK_HOTKEY; 00154 } 00155 } 00156 00157 // 00158 // some 3.x application doesn't like to see 00159 // VK_PROCESSKEY. 00160 // 00161 if (dwReturn & IPHK_PROCESSBYIME) { 00162 00163 DWORD dwImeCompat = ImmGetAppCompatFlags(hIMC); 00164 00165 if (dwImeCompat & IMECOMPAT_NOVKPROCESSKEY) { 00166 00167 // Korea 3.x application doesn't like to see dummy finalize VK_PROCESSKEY 00168 // and IME hot key. 00169 00170 if ( PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())) == LANG_KOREAN && 00171 ( (uVKey == VK_PROCESSKEY) || (dwReturn & IPHK_HOTKEY) ) ) { 00172 ImmReleaseContext(hWnd, hIMC); 00173 return dwReturn; 00174 } 00175 00176 ImmTranslateMessage(hWnd, WM_KEYDOWN, VK_PROCESSKEY, lParam); 00177 dwReturn &= ~IPHK_PROCESSBYIME; 00178 dwReturn |= IPHK_SKIPTHISKEY; 00179 } 00180 } 00181 ImmReleaseContext(hWnd, hIMC); 00182 00183 return dwReturn; 00184 }

BOOL ImmSetActiveContext HWND  hWnd,
HIMC  hImc,
BOOL  fActivate
 

Definition at line 309 of file w32/ntuser/imm/context.c.

References BOOL, ClrICF, DWORD, FALSE, GetKeyboardLayout(), GETPTI, hWnd, IGSC_DEFIMCFALLBACK, IMCF_ACTIVE, tagIMEDPI::_tagImeFunctions::ImeSetActiveContext, ImmGetDefaultIMEWnd(), ImmGetSaveContext(), ImmLockClientImc(), ImmLockIMC(), ImmLockImeDpi(), ImmUnlockClientImc(), ImmUnlockIMC(), ImmUnlockImeDpi(), IS_IME_ENABLED, IsWindow(), NtUserNotifyIMEStatus(), NULL, NULL_HIMC, tagIMEDPI::pfn, PtiCurrent, SendMessage(), SetICF, TRUE, and ValidateHwnd.

Referenced by ImmAssociateContext(), ImmAssociateContextEx(), ImmEnableIME(), and ImmSetActiveContextConsoleIME().

00313 { 00314 PCLIENTIMC pClientImc; 00315 PINPUTCONTEXT pInputContext; 00316 PIMEDPI pImeDpi; 00317 DWORD dwISC; 00318 HIMC hSaveImc; 00319 HWND hDefImeWnd; 00320 DWORD dwOpenStatus = 0; 00321 DWORD dwConversion = 0; 00322 #ifdef DEBUG 00323 PWND pWnd = ValidateHwnd(hWnd); 00324 00325 if (pWnd != NULL && GETPTI(pWnd) != PtiCurrent()) { 00326 RIPMSG1(RIP_WARNING, "hWnd (=%lx) is not of current thread.", hWnd); 00327 } 00328 #endif 00329 00330 if (!IS_IME_ENABLED()) { 00331 return FALSE; 00332 } 00333 00334 dwISC = ISC_SHOWUIALL; 00335 00336 pClientImc = ImmLockClientImc(hImc); 00337 00338 if (!fActivate) { 00339 if (pClientImc != NULL) 00340 ClrICF(pClientImc, IMCF_ACTIVE); 00341 goto NotifySetActive; 00342 } 00343 00344 if (hImc == NULL_HIMC) { 00345 hSaveImc = ImmGetSaveContext(hWnd, IGSC_DEFIMCFALLBACK); 00346 pInputContext = ImmLockIMC(hSaveImc); 00347 if (pInputContext != NULL) { 00348 pInputContext->hWnd = hWnd; 00349 ImmUnlockIMC(hSaveImc); 00350 } 00351 goto NotifySetActive; 00352 } 00353 00354 /* 00355 * Non-NULL input context, window handle have to be updated. 00356 */ 00357 if (pClientImc == NULL) 00358 return FALSE; 00359 00360 pInputContext = ImmLockIMC(hImc); 00361 if (pInputContext == NULL) { 00362 ImmUnlockClientImc(pClientImc); 00363 return FALSE; 00364 } 00365 00366 pInputContext->hWnd = hWnd; 00367 SetICF(pClientImc, IMCF_ACTIVE); 00368 00369 #ifdef LATER 00370 // Do uNumLangVKey checking later 00371 #endif 00372 00373 if (pInputContext->fdw31Compat & F31COMPAT_MCWHIDDEN) 00374 dwISC = ISC_SHOWUIALL - ISC_SHOWUICOMPOSITIONWINDOW; 00375 00376 dwOpenStatus = (DWORD)pInputContext->fOpen; 00377 dwConversion = pInputContext->fdwConversion; 00378 ImmUnlockIMC(hImc); 00379 00380 NotifySetActive: 00381 00382 pImeDpi = ImmLockImeDpi(GetKeyboardLayout(0)); 00383 if (pImeDpi != NULL) { 00384 (*pImeDpi->pfn.ImeSetActiveContext)(hImc, fActivate); 00385 ImmUnlockImeDpi(pImeDpi); 00386 } 00387 00388 /* 00389 * Notify UI 00390 */ 00391 if (IsWindow(hWnd)) { 00392 SendMessage(hWnd, WM_IME_SETCONTEXT, fActivate, dwISC); 00393 00394 /* 00395 * send notify to shell / keyboard driver 00396 */ 00397 if ( fActivate ) 00398 NtUserNotifyIMEStatus( hWnd, dwOpenStatus, dwConversion ); 00399 } 00400 else if (!fActivate) { 00401 /* 00402 * Because hWnd is not there (maybe destroyed), we send 00403 * WM_IME_SETCONTEXT to the default IME window. 00404 */ 00405 if ((hDefImeWnd = ImmGetDefaultIMEWnd(NULL)) != NULL) { 00406 SendMessage(hDefImeWnd, WM_IME_SETCONTEXT, fActivate, dwISC); 00407 } 00408 else { 00409 RIPMSG0(RIP_WARNING, 00410 "ImmSetActiveContext: can't send WM_IME_SETCONTEXT(FALSE)."); 00411 } 00412 } 00413 #ifdef DEBUG 00414 else { 00415 RIPMSG0(RIP_WARNING, 00416 "ImmSetActiveContext: can't send WM_IME_SETCONTEXT(TRUE)."); 00417 } 00418 #endif 00419 00420 #ifdef LATER 00421 // Implements ProcessIMCEvent() later. 00422 #endif 00423 00424 if (pClientImc != NULL) 00425 ImmUnlockClientImc(pClientImc); 00426 00427 return TRUE; 00428 }

BOOL ImmTranslateMessage HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 196 of file ntuser/imm/input.c.

References BOOL, BYTE, DWORD, FALSE, GetKeyboardLayout(), GetKeyboardState, GetWindowThreadProcessId(), tagIMEDPI::ImeInfo, tagIMEDPI::_tagImeFunctions::ImeToAsciiEx, ImmAssert, ImmGetContext(), ImmLocalAlloc(), ImmLocalFree, ImmLockIMC(), ImmLockIMCC(), ImmLockImeDpi(), ImmPostMessages(), ImmReleaseContext(), ImmUnlockIMC(), ImmUnlockIMCC(), ImmUnlockImeDpi(), INT, NULL, PBYTE, tagIMEDPI::pfn, ToAsciiEx(), ToUnicode(), TRANSMSGCOUNT, TRUE, and UINT.

Referenced by CharHandlerFromConsole(), and ImmProcessKey().

00201 { 00202 HIMC hImc; 00203 PINPUTCONTEXT pInputContext; 00204 BOOL fReturn = FALSE; 00205 HKL hkl; 00206 PIMEDPI pImeDpi = NULL; 00207 PBYTE pbKeyState; 00208 PTRANSMSG pTransMsg; 00209 PTRANSMSGLIST pTransMsgList; 00210 DWORD dwSize; 00211 UINT uVKey; 00212 INT iNum; 00213 00214 UNREFERENCED_PARAMETER(wParam); 00215 00216 // 00217 // we're interested in only those keyboard messages. 00218 // 00219 switch (message) { 00220 case WM_KEYDOWN: 00221 case WM_KEYUP: 00222 case WM_SYSKEYDOWN: 00223 case WM_SYSKEYUP: 00224 break; 00225 default: 00226 return FALSE; 00227 } 00228 00229 // 00230 // input context is necessary for further handling 00231 // 00232 hImc = ImmGetContext(hwnd); 00233 pInputContext = ImmLockIMC(hImc); 00234 if (pInputContext == NULL) { 00235 ImmReleaseContext(hwnd, hImc); 00236 return FALSE; 00237 } 00238 00239 // 00240 // At first, handle VK_PROCESSKEY generated by IME. 00241 // 00242 if (!pInputContext->fChgMsg) { 00243 00244 if ((iNum=pInputContext->dwNumMsgBuf) != 0) { 00245 00246 pTransMsg = (PTRANSMSG)ImmLockIMCC(pInputContext->hMsgBuf); 00247 if (pTransMsg != NULL) { 00248 ImmPostMessages(hwnd, hImc, iNum, pTransMsg); 00249 ImmUnlockIMCC(pInputContext->hMsgBuf); 00250 fReturn = TRUE; 00251 } 00252 00253 pInputContext->dwNumMsgBuf = 0; 00254 } 00255 goto ExitITM; 00256 } 00257 00258 pInputContext->fChgMsg = FALSE; 00259 00260 // 00261 // retrieve the keyboard layout and IME entry points 00262 // 00263 hkl = GetKeyboardLayout( GetWindowThreadProcessId(hwnd, NULL) ); 00264 pImeDpi = ImmLockImeDpi(hkl); 00265 if (pImeDpi == NULL) { 00266 RIPMSG1(RIP_WARNING, "ImmTranslateMessage pImeDpi is NULL(hkl=%x)", hkl); 00267 goto ExitITM; 00268 } 00269 00270 pbKeyState = ImmLocalAlloc(0, 256); 00271 if ( pbKeyState == NULL ) { 00272 RIPMSG0(RIP_WARNING, "ImmTranslateMessage out of memory" ); 00273 goto ExitITM; 00274 } 00275 00276 if (!GetKeyboardState(pbKeyState)) { 00277 RIPMSG0(RIP_WARNING, "ImmTranslateMessage GetKeyboardState() failed" ); 00278 ImmLocalFree( pbKeyState ); 00279 goto ExitITM; 00280 } 00281 00282 // 00283 // Translate the saved vkey into character code if needed 00284 // 00285 uVKey = pInputContext->uSavedVKey; 00286 00287 if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_KBD_CHAR_FIRST) { 00288 00289 if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) { 00290 WCHAR wcTemp; 00291 00292 iNum = ToUnicode(pInputContext->uSavedVKey, // virtual-key code 00293 HIWORD(lParam), // scan code 00294 pbKeyState, // key-state array 00295 &wcTemp, // buffer for translated key 00296 1, // size of buffer 00297 0); 00298 if (iNum == 1) { 00299 // 00300 // hi word : unicode character code 00301 // hi byte of lo word : zero 00302 // lo byte of lo word : virtual key 00303 // 00304 uVKey = (uVKey & 0x00ff) | ((UINT)wcTemp << 16); 00305 } 00306 00307 } else { 00308 WORD wTemp = 0; 00309 00310 iNum = ToAsciiEx(pInputContext->uSavedVKey, // virtual-key code 00311 HIWORD(lParam), // scan code 00312 pbKeyState, // key-state array 00313 &wTemp, // buffer for translated key 00314 0, // active-menu flag 00315 hkl); 00316 ImmAssert(iNum <= 2); 00317 if (iNum > 0) { 00318 // 00319 // hi word : should be zero 00320 // hi byte of lo word : character code 00321 // lo byte of lo word : virtual key 00322 // 00323 uVKey = (uVKey & 0x00FF) | ((UINT)wTemp << 8); 00324 00325 if ((BYTE)uVKey == VK_PACKET) { 00326 // 00327 // If ANSI IME is wide vkey aware, its ImeToAsciiEx will receive the uVKey 00328 // as follows: 00329 // 00330 // 31 24 23 16 15 8 7 0 00331 // +----------------+-----------------------------+-------------------+---------------+ 00332 // | 24~31:reserved | 16~23:trailing byte(if any) | 8~15:leading byte | 0~7:VK_PACKET | 00333 // +----------------+-----------------------------+-------------------+---------------+ 00334 // 00335 ImmAssert(pImeDpi->ImeInfo.fdwProperty & IME_PROP_ACCEPT_WIDE_VKEY); 00336 } 00337 else { 00338 uVKey &= 0xffff; 00339 } 00340 } 00341 } 00342 } 00343 00344 dwSize = FIELD_OFFSET(TRANSMSGLIST, TransMsg) 00345 + TRANSMSGCOUNT * sizeof(TRANSMSG); 00346 00347 pTransMsgList = (PTRANSMSGLIST)ImmLocalAlloc(0, dwSize); 00348 00349 if (pTransMsgList == NULL) { 00350 RIPMSG0(RIP_WARNING, "ImmTranslateMessage out of memory" ); 00351 ImmLocalFree(pbKeyState); 00352 goto ExitITM; 00353 } 00354 00355 pTransMsgList->uMsgCount = TRANSMSGCOUNT; 00356 iNum = (*pImeDpi->pfn.ImeToAsciiEx)(uVKey, 00357 HIWORD(lParam), 00358 pbKeyState, 00359 pTransMsgList, 00360 0, 00361 hImc); 00362 00363 if (iNum > TRANSMSGCOUNT) { 00364 00365 // 00366 // The message buffer is not big enough. IME put messages 00367 // into hMsgBuf in the input context. 00368 // 00369 00370 pTransMsg = (PTRANSMSG)ImmLockIMCC(pInputContext->hMsgBuf); 00371 if (pTransMsg != NULL) { 00372 ImmPostMessages(hwnd, hImc, iNum, pTransMsg); 00373 ImmUnlockIMCC(pInputContext->hMsgBuf); 00374 } 00375 00376 #ifdef LATER 00377 // Shouldn't we need this ? 00378 fReturn = TRUE; 00379 #endif 00380 00381 } else if (iNum > 0) { 00382 ImmPostMessages(hwnd, hImc, iNum, &pTransMsgList->TransMsg[0]); 00383 fReturn = TRUE; 00384 } 00385 00386 ImmLocalFree(pbKeyState); 00387 ImmLocalFree(pTransMsgList); 00388 00389 ExitITM: 00390 ImmUnlockImeDpi(pImeDpi); 00391 ImmUnlockIMC(hImc); 00392 ImmReleaseContext(hwnd, hImc); 00393 00394 return fReturn; 00395 }

BOOL WINAPI ImmUnloadIME HKL  hKL  ) 
 

Definition at line 365 of file immime.c.

References BOOL, tagIMEDPI::cLock, tagIMEDPI::dwFlag, FALSE, gcsImeDpi, gpImeDpi, tagIMEDPI::hKL, IMEDPI_UNLOADED, ImmLocalFree, NULL, tagIMEDPI::pNext, TRUE, and UnloadIME().

Referenced by ImmFreeLayout().

00367 { 00368 PIMEDPI pImeDpi, pImeDpiT; 00369 00370 RtlEnterCriticalSection(&gcsImeDpi); 00371 00372 pImeDpi = gpImeDpi; 00373 00374 while (pImeDpi != NULL && pImeDpi->hKL != hKL) 00375 pImeDpi = pImeDpi->pNext; 00376 00377 if (pImeDpi == NULL) { 00378 RtlLeaveCriticalSection(&gcsImeDpi); 00379 return TRUE; 00380 } 00381 else if (pImeDpi->cLock != 0) { 00382 pImeDpi->dwFlag |= IMEDPI_UNLOADED; 00383 RtlLeaveCriticalSection(&gcsImeDpi); 00384 return FALSE; 00385 } 00386 00387 /* 00388 * Unlink it. 00389 */ 00390 if (gpImeDpi == pImeDpi) { 00391 gpImeDpi = pImeDpi->pNext; 00392 } 00393 else { 00394 pImeDpiT = gpImeDpi; 00395 00396 while (pImeDpiT != NULL && pImeDpiT->pNext != pImeDpi) 00397 pImeDpiT = pImeDpiT->pNext; 00398 00399 if (pImeDpiT != NULL) 00400 pImeDpiT->pNext = pImeDpi->pNext; 00401 } 00402 00403 /* 00404 * Unload the IME DLL. 00405 */ 00406 UnloadIME(pImeDpi, TRUE); 00407 00408 ImmLocalFree(pImeDpi); 00409 00410 RtlLeaveCriticalSection(&gcsImeDpi); 00411 00412 return TRUE; 00413 }

VOID WINAPI ImmUnlockClientImc PCLIENTIMC  pClientImc  ) 
 

Definition at line 747 of file w32/ntuser/imm/misc.c.

References tagCLIENTIMC::cLockObj, DeleteImcCrit, tagCLIENTIMC::hInputContext, IMCF_INDESTROY, ImmLocalFree, NULL, TestICF, and VOID().

Referenced by CreateInputContext(), DestroyInputContext(), ImmEnableIME(), ImmGenerateMessage(), ImmGetAppCompatFlags(), ImmGetCandidateListCountWorker(), ImmGetCandidateListWorker(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetCompositionStringA(), ImmGetCompositionStringW(), ImmGetGuideLineWorker(), ImmGetIMCLockCount(), ImmGetSaveContext(), ImmPostMessages(), ImmRequestMessageWorker(), ImmSetActiveContext(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmUnlockIMC(), InternalImmLockIMC(), IsAnsiIMC(), MySetCompFont(), SelectInputContext(), and SetFontForMCWVERTICAL().

00749 { 00750 if (InterlockedDecrement(&pClientImc->cLockObj) == 0) { 00751 if (TestICF(pClientImc, IMCF_INDESTROY)) { 00752 if (pClientImc->hInputContext != NULL) 00753 LocalFree(pClientImc->hInputContext); 00754 00755 DeleteImcCrit(pClientImc); 00756 ImmLocalFree(pClientImc); 00757 } 00758 } 00759 00760 return; 00761 }

VOID WINAPI ImmUnlockImeDpi PIMEDPI  pImeDpi  ) 
 

Definition at line 824 of file w32/ntuser/imm/misc.c.

References tagIMEDPI::cLock, tagIMEDPI::dwFlag, gcsImeDpi, gpImeDpi, IMEDPI_UNLOADED, IMEDPI_UNLOCKUNLOAD, tagIMEDPI::ImeInfo, ImmLocalFree, NULL, tagIMEDPI::pNext, TRUE, UnloadIME(), and VOID().

Referenced by _InitializeImmEntryTable(), CreateInputContext(), DestroyInputContext(), HotKeyIDDispatcher(), ImmActivateLayout(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmCreateSoftKeyboard(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetImeMenuItemsWorker(), ImmGetProperty(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmNotifyIME(), ImmPenAuxInput(), ImmProcessKey(), ImmRegisterWordA(), ImmRegisterWordW(), ImmSetActiveContext(), ImmSetCompositionStringWorker(), ImmTranslateMessage(), ImmUnregisterWordA(), ImmUnregisterWordW(), JCloseOpen(), MakeIMENotify(), SelectInputContext(), and TransHanjaMode().

00826 { 00827 PIMEDPI pImeDpiT; 00828 00829 if (pImeDpi == NULL) 00830 return; 00831 00832 RtlEnterCriticalSection(&gcsImeDpi); 00833 00834 if (--pImeDpi->cLock == 0) { 00835 00836 if ((pImeDpi->dwFlag & IMEDPI_UNLOADED) || 00837 ((pImeDpi->dwFlag & IMEDPI_UNLOCKUNLOAD) && 00838 (pImeDpi->ImeInfo.fdwProperty & IME_PROP_END_UNLOAD))) 00839 { 00840 /* 00841 * Unlink it. 00842 */ 00843 if (gpImeDpi == pImeDpi) { 00844 gpImeDpi = pImeDpi->pNext; 00845 } 00846 else { 00847 pImeDpiT = gpImeDpi; 00848 00849 while (pImeDpiT != NULL && pImeDpiT->pNext != pImeDpi) 00850 pImeDpiT = pImeDpiT->pNext; 00851 00852 if (pImeDpiT != NULL) 00853 pImeDpiT->pNext = pImeDpi->pNext; 00854 } 00855 00856 /* 00857 * Unload the IME DLL. 00858 */ 00859 UnloadIME(pImeDpi, TRUE); 00860 ImmLocalFree(pImeDpi); 00861 } 00862 } 00863 00864 RtlLeaveCriticalSection(&gcsImeDpi); 00865 00866 return; 00867 }


Generated on Sat May 15 19:44:10 2004 for test by doxygen 1.3.7