ReactOS  0.4.15-dev-3177-gd6a0299
imm32_undoc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL WINAPI ImmGetImeInfoEx (PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
 
PCLIENTIMC WINAPI ImmLockClientImc (HIMC hImc)
 
VOID WINAPI ImmUnlockClientImc (PCLIENTIMC pClientImc)
 
PIMEDPI WINAPI ImmLockImeDpi (HKL hKL)
 
VOID WINAPI ImmUnlockImeDpi (PIMEDPI pImeDpi)
 

Function Documentation

◆ ImmGetImeInfoEx()

BOOL WINAPI ImmGetImeInfoEx ( PIMEINFOEX  pImeInfoEx,
IMEINFOEXCLASS  SearchType,
PVOID  pvSearchKey 
)

Definition at line 366 of file ime.c.

367 {
368  BOOL bDisabled = FALSE;
369  HKL hKL;
370  PTEB pTeb;
371 
372  switch (SearchType)
373  {
375  break;
376 
377  case ImeInfoExImeWindow:
378  bDisabled = CtfImmIsTextFrameServiceDisabled();
379  SearchType = ImeInfoExKeyboardLayout;
380  break;
381 
383  StringCchCopyW(pImeInfoEx->wszImeFile, _countof(pImeInfoEx->wszImeFile),
384  pvSearchKey);
385  goto Quit;
386  }
387 
388  hKL = *(HKL*)pvSearchKey;
389  pImeInfoEx->hkl = hKL;
390 
391  if (!IS_IME_HKL(hKL))
392  {
394  {
395  pTeb = NtCurrentTeb();
396  if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->W32ClientInfo[0] & 2)
397  return FALSE;
398  if (!bDisabled)
399  goto Quit;
400  }
401  return FALSE;
402  }
403 
404 Quit:
405  return NtUserGetImeInfoEx(pImeInfoEx, SearchType);
406 }
ULONG Win32ClientInfo[31]
Definition: compat.h:706
PSERVERINFO g_psi
Definition: imm.c:18
#define FALSE
Definition: types.h:117
DWORD dwSRVIFlags
Definition: ntuser.h:1013
unsigned int BOOL
Definition: ntddk_ex.h:94
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define IS_IME_HKL(hkl)
Definition: ntuser.h:1193
#define _countof(array)
Definition: sndvol32.h:68
UINT_PTR HKL
Definition: msctf.idl:101
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID)
Definition: ime.c:354
WCHAR wszImeFile[80]
Definition: ntuser.h:1178
BOOL APIENTRY NtUserGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
Definition: ime.c:106
Definition: compat.h:694
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define SRVINFO_CICERO_ENABLED
Definition: ntuser.h:921

Referenced by Ime32LoadImeDpi(), ImmGetDescriptionA(), ImmGetDescriptionW(), ImmGetIMEFileNameA(), ImmGetIMEFileNameW(), ImmGetProperty(), and ImmIsIME().

◆ ImmLockClientImc()

PCLIENTIMC WINAPI ImmLockClientImc ( HIMC  hImc)

Definition at line 444 of file imm.c.

445 {
446  PCLIENTIMC pClientImc;
447 
448  TRACE("(%p)\n", hImc);
449 
450  if (hImc == NULL)
451  return NULL;
452 
453  pClientImc = Imm32GetClientImcCache();
454  if (!pClientImc)
455  {
456  pClientImc = Imm32HeapAlloc(HEAP_ZERO_MEMORY, sizeof(CLIENTIMC));
457  if (!pClientImc)
458  return NULL;
459 
460  RtlInitializeCriticalSection(&pClientImc->cs);
461 
462  // FIXME: NtUserGetThreadState and enum ThreadStateRoutines are broken.
463  pClientImc->unknown = NtUserGetThreadState(13);
464 
465  if (!NtUserUpdateInputContext(hImc, 0, pClientImc))
466  {
467  Imm32HeapFree(pClientImc);
468  return NULL;
469  }
470 
471  pClientImc->dwFlags |= CLIENTIMC_UNKNOWN2;
472  }
473  else
474  {
475  if (pClientImc->dwFlags & CLIENTIMC_UNKNOWN1)
476  return NULL;
477  }
478 
479  InterlockedIncrement(&pClientImc->cLockObj);
480  return pClientImc;
481 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
LPVOID APIENTRY Imm32HeapAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:107
#define Imm32HeapFree(lpData)
Definition: precomp.h:77
LONG cLockObj
Definition: ntuser.h:1294
#define CLIENTIMC_UNKNOWN2
Definition: ntuser.h:1316
DWORD unknown
Definition: ntuser.h:1296
#define CLIENTIMC_UNKNOWN1
Definition: ntuser.h:1314
DWORD NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD Unknown1, LPVOID pClientImc)
Definition: ntstubs.c:351
#define TRACE(s)
Definition: solgame.cpp:4
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
RTL_CRITICAL_SECTION cs
Definition: ntuser.h:1297
#define InterlockedIncrement
Definition: armddk.h:53
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD dwFlags
Definition: ntuser.h:1295
static PCLIENTIMC APIENTRY Imm32GetClientImcCache(void)
Definition: imm.c:435

Referenced by Imm32GetContextEx(), Imm32PostMessages(), ImmGenerateMessage(), ImmGetCandidateListAW(), ImmGetCandidateListCountAW(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetGuideLineAW(), ImmGetIMCLockCount(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), and ImmUnlockIMC().

◆ ImmLockImeDpi()

PIMEDPI WINAPI ImmLockImeDpi ( HKL  hKL)

Definition at line 411 of file ime.c.

412 {
413  PIMEDPI pImeDpi = NULL;
414 
415  TRACE("(%p)\n", hKL);
416 
418 
419  /* Find by hKL */
420  for (pImeDpi = g_pImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext)
421  {
422  if (pImeDpi->hKL == hKL) /* found */
423  {
424  /* lock if possible */
425  if (pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN)
426  pImeDpi = NULL;
427  else
428  ++(pImeDpi->cLockObj);
429  break;
430  }
431  }
432 
434  return pImeDpi;
435 }
RTL_CRITICAL_SECTION g_csImeDpi
Definition: ime.c:17
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1246
#define TRACE(s)
Definition: solgame.cpp:4
struct IMEDPI * pNext
Definition: ntuser.h:1240
PIMEDPI g_pImeDpiList
Definition: ime.c:18
DWORD dwFlags
Definition: ntuser.h:1247
#define NULL
Definition: types.h:112
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1287
HKL hKL
Definition: ntuser.h:1242

Referenced by Imm32CleanupContext(), Imm32NotifyAction(), Imm32ProcessHotKey(), ImmLockOrLoadImeDpi(), ImmNotifyIME(), ImmProcessKey(), and ImmTranslateMessage().

◆ ImmUnlockClientImc()

VOID WINAPI ImmUnlockClientImc ( PCLIENTIMC  pClientImc)

Definition at line 486 of file imm.c.

487 {
488  LONG cLocks;
489  HIMC hImc;
490 
491  TRACE("(%p)\n", pClientImc);
492 
493  cLocks = InterlockedDecrement(&pClientImc->cLockObj);
494  if (cLocks != 0 || !(pClientImc->dwFlags & CLIENTIMC_UNKNOWN1))
495  return;
496 
497  hImc = pClientImc->hImc;
498  if (hImc)
499  LocalFree(hImc);
500 
501  RtlDeleteCriticalSection(&pClientImc->cs);
502  Imm32HeapFree(pClientImc);
503 }
HIMC hImc
Definition: ntuser.h:1293
#define Imm32HeapFree(lpData)
Definition: precomp.h:77
LONG cLockObj
Definition: ntuser.h:1294
static LONG cLocks
Definition: compobj.c:119
long LONG
Definition: pedump.c:60
DWORD HIMC
Definition: dimm.idl:75
#define CLIENTIMC_UNKNOWN1
Definition: ntuser.h:1314
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
RTL_CRITICAL_SECTION cs
Definition: ntuser.h:1297
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
DWORD dwFlags
Definition: ntuser.h:1295
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

Referenced by Imm32CleanupContext(), Imm32GetContextEx(), Imm32PostMessages(), ImmGenerateMessage(), ImmGetCandidateListAW(), ImmGetCandidateListCountAW(), ImmGetCompositionFontA(), ImmGetCompositionFontW(), ImmGetGuideLineAW(), ImmGetIMCLockCount(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmUnlockIMC(), and START_TEST().

◆ ImmUnlockImeDpi()

VOID WINAPI ImmUnlockImeDpi ( PIMEDPI  pImeDpi)

Definition at line 440 of file ime.c.

441 {
442  PIMEDPI *ppEntry;
443 
444  TRACE("(%p)\n", pImeDpi);
445 
446  if (pImeDpi == NULL)
447  return;
448 
450 
451  /* unlock */
452  --(pImeDpi->cLockObj);
453  if (pImeDpi->cLockObj != 0)
454  {
456  return;
457  }
458 
459  if ((pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN) == 0)
460  {
461  if ((pImeDpi->dwFlags & IMEDPI_FLAG_LOCKED) == 0 ||
462  (pImeDpi->ImeInfo.fdwProperty & IME_PROP_END_UNLOAD) == 0)
463  {
465  return;
466  }
467  }
468 
469  /* Remove from list */
470  for (ppEntry = &g_pImeDpiList; *ppEntry; ppEntry = &((*ppEntry)->pNext))
471  {
472  if (*ppEntry == pImeDpi) /* found */
473  {
474  *ppEntry = pImeDpi->pNext;
475  break;
476  }
477  }
478 
479  Imm32FreeImeDpi(pImeDpi, TRUE);
480  Imm32HeapFree(pImeDpi);
481 
483 }
IMEINFO ImeInfo
Definition: ntuser.h:1243
RTL_CRITICAL_SECTION g_csImeDpi
Definition: ime.c:17
#define Imm32HeapFree(lpData)
Definition: precomp.h:77
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1246
VOID APIENTRY Imm32FreeImeDpi(PIMEDPI pImeDpi, BOOL bDestroy)
Definition: ime.c:35
#define TRACE(s)
Definition: solgame.cpp:4
DWORD fdwProperty
Definition: imm.h:158
struct IMEDPI * pNext
Definition: ntuser.h:1240
PIMEDPI g_pImeDpiList
Definition: ime.c:18
DWORD dwFlags
Definition: ntuser.h:1247
#define IME_PROP_END_UNLOAD
Definition: imm.h:216
#define NULL
Definition: types.h:112
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1287
#define IMEDPI_FLAG_LOCKED
Definition: ntuser.h:1288

Referenced by Imm32CleanupContext(), Imm32NotifyAction(), Imm32ProcessHotKey(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetProperty(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmNotifyIME(), ImmProcessKey(), ImmRegisterWordA(), ImmRegisterWordW(), ImmTranslateMessage(), ImmUnregisterWordA(), and ImmUnregisterWordW().