ReactOS  0.4.15-dev-5131-g311fcc6
ime.c File Reference
#include "precomp.h"
#include "imetable.h"
Include dependency graph for ime.c:

Go to the source code of this file.

Classes

struct  tagIMEMENUITEM
 
struct  tagIMEMENU
 

Macros

#define VALID_IME_PROP
 
#define VALID_CMODE_CAPS
 
#define VALID_SMODE_CAPS
 
#define VALID_UI_CAPS
 
#define VALID_SCS_CAPS
 
#define VALID_SELECT_CAPS   (SELECT_CAP_CONVERSION | SELECT_CAP_SENTENCE)
 
#define DEFINE_IME_ENTRY(type, name, params, optional)
 
#define DEFINE_IME_ENTRY(type, name, params, optional)   pImeDpi->name = Stub##name;
 
#define DEFINE_IME_ENTRY(type, name, params, optional)
 
#define MAX_IMEMENU_BITMAP_BYTES   0xF00
 

Typedefs

typedef struct tagIMEMENUITEM IMEMENUITEM
 
typedef struct tagIMEMENUITEMPIMEMENUITEM
 
typedef struct tagIMEMENU IMEMENU
 
typedef struct tagIMEMENUPIMEMENU
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
PIMEDPI APIENTRY Imm32FindImeDpi (HKL hKL)
 
VOID APIENTRY Imm32FreeIME (PIMEDPI pImeDpi, BOOL bDestroy)
 
BOOL APIENTRY Imm32InquireIme (PIMEDPI pImeDpi)
 
BOOL APIENTRY Imm32LoadIME (PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi)
 
PIMEDPI APIENTRY Imm32LoadImeDpi (HKL hKL, BOOL bLock)
 
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi (HKL hKL)
 
static LRESULT APIENTRY ImeDpi_Escape (PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL)
 
BOOL APIENTRY Imm32ReleaseIME (HKL hKL)
 
LRESULT WINAPI ImmPutImeMenuItemsIntoMappedFile (HIMC hIMC)
 
DWORD APIENTRY Imm32GetImeMenuItemWInterProcess (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize)
 
DWORD APIENTRY ImmGetImeMenuItemsAW (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize, BOOL bTargetIsAnsi)
 
HKL WINAPI ImmInstallIMEA (LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
 
HKL WINAPI ImmInstallIMEW (LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
 
BOOL WINAPI ImmIsIME (HKL hKL)
 
HWND WINAPI ImmGetDefaultIMEWnd (HWND hWnd)
 
BOOL WINAPI ImmNotifyIME (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
 
BOOL WINAPI ImmDisableLegacyIME (void)
 
BOOL WINAPI ImmGetImeInfoEx (PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
 
PIMEDPI WINAPI ImmLockImeDpi (HKL hKL)
 
VOID WINAPI ImmUnlockImeDpi (PIMEDPI pImeDpi)
 
BOOL WINAPI ImmLoadIME (HKL hKL)
 
BOOL WINAPI ImmDisableIME (DWORD dwThreadId)
 
UINT WINAPI ImmGetDescriptionA (HKL hKL, LPSTR lpszDescription, UINT uBufLen)
 
UINT WINAPI ImmGetDescriptionW (HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
 
UINT WINAPI ImmGetIMEFileNameA (HKL hKL, LPSTR lpszFileName, UINT uBufLen)
 
UINT WINAPI ImmGetIMEFileNameW (HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
 
DWORD WINAPI ImmGetProperty (HKL hKL, DWORD fdwIndex)
 
LRESULT WINAPI ImmEscapeA (HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
 
LRESULT WINAPI ImmEscapeW (HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
 
BOOL WINAPI ImmGetOpenStatus (HIMC hIMC)
 
BOOL WINAPI ImmSetOpenStatus (HIMC hIMC, BOOL fOpen)
 
BOOL WINAPI ImmGetStatusWindowPos (HIMC hIMC, LPPOINT lpptPos)
 
BOOL WINAPI ImmSetStatusWindowPos (HIMC hIMC, LPPOINT lpptPos)
 
BOOL WINAPI ImmGetCompositionWindow (HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
 
BOOL WINAPI ImmSetCompositionWindow (HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
 
BOOL WINAPI ImmGetCompositionFontA (HIMC hIMC, LPLOGFONTA lplf)
 
BOOL WINAPI ImmGetCompositionFontW (HIMC hIMC, LPLOGFONTW lplf)
 
BOOL WINAPI ImmSetCompositionFontA (HIMC hIMC, LPLOGFONTA lplf)
 
BOOL WINAPI ImmSetCompositionFontW (HIMC hIMC, LPLOGFONTW lplf)
 
DWORD WINAPI ImmGetConversionListA (HKL hKL, HIMC hIMC, LPCSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
DWORD WINAPI ImmGetConversionListW (HKL hKL, HIMC hIMC, LPCWSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
BOOL WINAPI ImmGetConversionStatus (HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
 
BOOL WINAPI ImmSetConversionStatus (HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
 
BOOL WINAPI ImmConfigureIMEA (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
BOOL WINAPI ImmConfigureIMEW (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
DWORD WINAPI ImmGetImeMenuItemsA (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOA lpImeParentMenu, LPIMEMENUITEMINFOA lpImeMenu, DWORD dwSize)
 
DWORD WINAPI ImmGetImeMenuItemsW (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize)
 
BOOL WINAPI ImmWINNLSEnableIME (HWND hWnd, BOOL enable)
 

Variables

RTL_CRITICAL_SECTION gcsImeDpi
 
PIMEDPI gpImeDpiList = NULL
 

Macro Definition Documentation

◆ DEFINE_IME_ENTRY [1/3]

#define DEFINE_IME_ENTRY (   type,
  name,
  params,
  optional 
)
Value:
FIXME("%s: Why stub called?\n", #name); \
return (type)0; \
}
GLenum const GLfloat * params
Definition: glext.h:5645
Definition: name.c:38
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define APIENTRY
Definition: api.h:79

Definition at line 153 of file ime.c.

◆ DEFINE_IME_ENTRY [2/3]

#define DEFINE_IME_ENTRY (   type,
  name,
  params,
  optional 
)    pImeDpi->name = Stub##name;

Definition at line 153 of file ime.c.

◆ DEFINE_IME_ENTRY [3/3]

#define DEFINE_IME_ENTRY (   type,
  name,
  params,
  optional 
)
Value:
do { \
fn = GetProcAddress(hIME, #name); \
if (fn) pImeDpi->name = (FN_##name)fn; \
else if (!(optional)) { \
ERR("'%s' not found in the IME module '%s'.\n", #name, debugstr_w(szPath)); \
goto Failed; \
} \
} while (0);
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
#define debugstr_w
Definition: kernel32.h:32
Definition: msg.h:41
Definition: arc.h:79
LPCWSTR szPath
Definition: env.c:37
Definition: name.c:38
#define GetProcAddress(x, y)
Definition: compat.h:612
GLuint const GLchar * name
Definition: glext.h:6031

Definition at line 153 of file ime.c.

◆ MAX_IMEMENU_BITMAP_BYTES

#define MAX_IMEMENU_BITMAP_BYTES   0xF00

Definition at line 371 of file ime.c.

◆ VALID_CMODE_CAPS

#define VALID_CMODE_CAPS
Value:
IME_CMODE_NATIVE | \
IME_CMODE_KATAKANA | \
IME_CMODE_LANGUAGE | \
IME_CMODE_FULLSHAPE | \
IME_CMODE_ROMAN | \
IME_CMODE_CHARCODE | \
IME_CMODE_HANJACONVERT | \
IME_CMODE_SOFTKBD | \
IME_CMODE_NOCONVERSION | \
IME_CMODE_EUDC | \
IME_CMODE_SYMBOL | \
IME_CMODE_FIXED)
#define IME_CMODE_ALPHANUMERIC
Definition: imm.h:484

◆ VALID_IME_PROP

#define VALID_IME_PROP
Value:
IME_PROP_SPECIAL_UI | \
IME_PROP_CANDLIST_START_FROM_1 | \
IME_PROP_UNICODE | \
IME_PROP_COMPLETE_ON_UNSELECT | \
IME_PROP_END_UNLOAD | \
IME_PROP_KBD_CHAR_FIRST | \
IME_PROP_IGNORE_UPKEYS | \
IME_PROP_NEED_ALTKEY | \
IME_PROP_NO_KEYS_ON_CLOSE | \
IME_PROP_ACCEPT_WIDE_VKEY)
#define IME_PROP_AT_CARET
Definition: imm.h:390

◆ VALID_SCS_CAPS

#define VALID_SCS_CAPS
Value:
SCS_CAP_MAKEREAD | \
SCS_CAP_SETRECONVERTSTRING)
#define SCS_CAP_COMPSTR
Definition: imm.h:403

◆ VALID_SELECT_CAPS

#define VALID_SELECT_CAPS   (SELECT_CAP_CONVERSION | SELECT_CAP_SENTENCE)

◆ VALID_SMODE_CAPS

#define VALID_SMODE_CAPS
Value:
IME_SMODE_PLAURALCLAUSE | \
IME_SMODE_SINGLECONVERT | \
IME_SMODE_AUTOMATIC | \
IME_SMODE_PHRASEPREDICT | \
IME_SMODE_CONVERSATION)
#define IME_SMODE_NONE
Definition: imm.h:504

◆ VALID_UI_CAPS

#define VALID_UI_CAPS
Value:
UI_CAP_ROT90 | \
UI_CAP_ROTANY | \
UI_CAP_SOFTKBD)
#define UI_CAP_2700
Definition: imm.h:397

Typedef Documentation

◆ IMEMENU

◆ IMEMENUITEM

◆ PIMEMENU

◆ PIMEMENUITEM

Function Documentation

◆ ImeDpi_Escape()

static LRESULT APIENTRY ImeDpi_Escape ( PIMEDPI  pImeDpi,
HIMC  hIMC,
UINT  uSubFunc,
LPVOID  lpData,
HKL  hKL 
)
static

Definition at line 309 of file ime.c.

310 {
311  if (IS_IME_HKL(hKL))
312  return pImeDpi->ImeEscape(hIMC, uSubFunc, lpData);
313 
314  if (IS_CICERO_MODE())
315  return pImeDpi->CtfImeEscapeEx(hIMC, uSubFunc, lpData, hKL);
316 
317  return 0;
318 }
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
#define IS_IME_HKL(hKL)
Definition: input.h:88

Referenced by ImmEscapeA(), and ImmEscapeW().

◆ Imm32FindImeDpi()

PIMEDPI APIENTRY Imm32FindImeDpi ( HKL  hKL)

Definition at line 20 of file ime.c.

21 {
22  PIMEDPI pImeDpi;
23 
25  for (pImeDpi = gpImeDpiList; pImeDpi != NULL; pImeDpi = pImeDpi->pNext)
26  {
27  if (pImeDpi->hKL == hKL)
28  break;
29  }
31 
32  return pImeDpi;
33 }
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PIMEDPI gpImeDpiList
Definition: ime.c:17
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
struct IMEDPI * pNext
Definition: ntuser.h:1253
#define NULL
Definition: types.h:112
HKL hKL
Definition: ntuser.h:1255

Referenced by Imm32LoadImeDpi(), and ImmLoadIME().

◆ Imm32FindOrLoadImeDpi()

PIMEDPI APIENTRY Imm32FindOrLoadImeDpi ( HKL  hKL)

Definition at line 295 of file ime.c.

296 {
297  PIMEDPI pImeDpi;
298 
299  if (!IS_IME_HKL(hKL) && (!IS_CICERO_MODE() || IS_16BIT_MODE()))
300  return NULL;
301 
302  pImeDpi = ImmLockImeDpi(hKL);
303  if (pImeDpi == NULL)
304  pImeDpi = Imm32LoadImeDpi(hKL, TRUE);
305  return pImeDpi;
306 }
#define TRUE
Definition: types.h:120
PIMEDPI APIENTRY Imm32LoadImeDpi(HKL hKL, BOOL bLock)
Definition: ime.c:232
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:916
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
#define IS_IME_HKL(hKL)
Definition: input.h:88
#define NULL
Definition: types.h:112
#define IS_16BIT_MODE()
Definition: precomp.h:117

Referenced by CtfImmGetGuidAtom(), CtfImmIsGuidMapEnable(), Imm32InternalLockIMC(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetProperty(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmRegisterWordA(), ImmRegisterWordW(), ImmUnregisterWordA(), and ImmUnregisterWordW().

◆ Imm32FreeIME()

VOID APIENTRY Imm32FreeIME ( PIMEDPI  pImeDpi,
BOOL  bDestroy 
)

Definition at line 36 of file ime.c.

37 {
38  if (pImeDpi->hInst == NULL)
39  return;
40  if (bDestroy)
41  pImeDpi->ImeDestroy(0);
42  FreeLibrary(pImeDpi->hInst);
43  pImeDpi->hInst = NULL;
44 }
HINSTANCE hInst
Definition: ntuser.h:1254
#define FreeLibrary(x)
Definition: compat.h:607
#define NULL
Definition: types.h:112

Referenced by Imm32LoadImeDpi(), Imm32ReleaseIME(), and ImmUnlockImeDpi().

◆ Imm32GetImeMenuItemWInterProcess()

DWORD APIENTRY Imm32GetImeMenuItemWInterProcess ( HIMC  hIMC,
DWORD  dwFlags,
DWORD  dwType,
LPVOID  lpImeParentMenu,
LPVOID  lpImeMenu,
DWORD  dwSize 
)

Definition at line 475 of file ime.c.

477 {
478  HANDLE hMapping;
479  PIMEMENU pView;
480  DWORD i, cbView, dwItemCount, ret = 0;
481  HWND hImeWnd;
482  PIMEMENUITEM pGotItem;
483  LPIMEMENUITEMINFOW pSetInfo;
484 
486  if (!hImeWnd || !IsWindow(hImeWnd))
487  {
488  ERR("hImeWnd %p\n", hImeWnd);
489  return 0;
490  }
491 
492  dwItemCount = (lpImeMenu ? (dwSize / sizeof(IMEMENUITEMINFOW)) : 0);
493  cbView = sizeof(IMEMENU) + ((size_t)dwItemCount - 1) * sizeof(IMEMENUITEM);
494 
496 
497  // create a file mapping
499  0, cbView, L"ImmMenuInfo");
500  pView = MapViewOfFile(hMapping, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
501  if (!pView)
502  {
503  ERR("hMapping %p, pView %p\n", hMapping, pView);
504  goto Quit;
505  }
506 
507  ZeroMemory(pView, cbView);
508  pView->dwVersion = 1;
509  pView->dwFlags = dwFlags;
510  pView->dwType = dwType;
511  pView->dwItemCount = dwItemCount;
512  if (lpImeParentMenu)
513  {
514  pView->Parent = *(LPIMEMENUITEMINFOW)lpImeParentMenu;
515  pView->Parent.cbSize = sizeof(IMEMENUITEMINFOW);
516  }
517 
518  if (!SendMessageW(hImeWnd, WM_IME_SYSTEM, IMS_GETIMEMENU, (LPARAM)hIMC))
519  goto Quit;
520 
521  ret = pView->dwItemCount;
522 
523  if (!lpImeMenu)
524  goto Quit;
525 
526  for (i = 0; i < ret; ++i)
527  {
528  pGotItem = &(pView->Items[i]);
529  pSetInfo = &((LPIMEMENUITEMINFOW)lpImeMenu)[i];
530 
531  *pSetInfo = pGotItem->Info;
532 
533  // load bitmaps from bytes
534  if (pSetInfo->hbmpChecked)
535  {
536  pSetInfo->hbmpChecked = Imm32LoadBitmapFromBytes(pGotItem->abChecked);
537  }
538  if (pSetInfo->hbmpUnchecked)
539  {
540  pSetInfo->hbmpUnchecked = Imm32LoadBitmapFromBytes(pGotItem->abUnchecked);
541  }
542  if (pSetInfo->hbmpItem)
543  {
544  pSetInfo->hbmpItem = Imm32LoadBitmapFromBytes(pGotItem->abItem);
545  }
546  }
547 
548 Quit:
550  if (pView)
551  UnmapViewOfFile(pView);
552  if (hMapping)
553  CloseHandle(hMapping);
554  return ret;
555 }
BYTE abItem[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:378
#define CloseHandle
Definition: compat.h:598
#define MapViewOfFile
Definition: compat.h:604
BOOL WINAPI IsWindow(_In_opt_ HWND)
HBITMAP hbmpChecked
Definition: imm.h:129
HANDLE HWND
Definition: compat.h:19
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define ZeroMemory
Definition: winbase.h:1667
#define L(x)
Definition: ntvdm.h:50
HBITMAP Imm32LoadBitmapFromBytes(const BYTE *pb)
Definition: utils.c:59
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD dwVersion
Definition: ime.c:383
BYTE abChecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:376
struct tagIMEMENUITEMINFOW IMEMENUITEMINFOW
DWORD dwItemCount
Definition: ime.c:386
LONG_PTR LPARAM
Definition: windef.h:208
#define FILE_MAP_READ
Definition: compat.h:635
#define WM_IME_SYSTEM
Definition: undocuser.h:59
DWORD dwType
Definition: ime.c:385
IMEMENUITEMINFOW Info
Definition: ime.c:375
struct tagIMEMENUITEMINFOW * LPIMEMENUITEMINFOW
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:603
struct tagIMEMENU IMEMENU
#define FILE_MAP_WRITE
Definition: winbase.h:154
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE abUnchecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:377
DWORD dwFlags
Definition: ime.c:384
int ret
IMEMENUITEMINFOW Parent
Definition: ime.c:387
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
#define IMS_GETIMEMENU
Definition: immdev.h:41
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1794
HBITMAP hbmpItem
Definition: imm.h:133
HBITMAP hbmpUnchecked
Definition: imm.h:130
#define UnmapViewOfFile
Definition: compat.h:605
IMEMENUITEM Items[ANYSIZE_ARRAY]
Definition: ime.c:388
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define PAGE_READWRITE
Definition: nt_native.h:1304

Referenced by ImmGetImeMenuItemsAW().

◆ Imm32InquireIme()

BOOL APIENTRY Imm32InquireIme ( PIMEDPI  pImeDpi)

Definition at line 47 of file ime.c.

48 {
49  WCHAR szUIClass[64];
50  WNDCLASSW wcW;
51  DWORD dwSysInfoFlags = 0;
52  LPIMEINFO pImeInfo = &pImeDpi->ImeInfo;
53 
55  dwSysInfoFlags |= IME_SYSINFO_WINLOGON;
56 
57  if (IS_IME_HKL(pImeDpi->hKL))
58  {
59  if (!pImeDpi->ImeInquire(pImeInfo, szUIClass, dwSysInfoFlags))
60  return FALSE;
61  }
62  else if (IS_CICERO_MODE())
63  {
64  if (!pImeDpi->CtfImeInquireExW(pImeInfo, szUIClass, dwSysInfoFlags, pImeDpi->hKL))
65  return FALSE;
66  }
67  else
68  {
69  return FALSE;
70  }
71 
72  szUIClass[_countof(szUIClass) - 1] = 0;
73 
74  if (pImeInfo->dwPrivateDataSize == 0)
75  pImeInfo->dwPrivateDataSize = sizeof(DWORD);
76 
77 #define VALID_IME_PROP (IME_PROP_AT_CARET | \
78  IME_PROP_SPECIAL_UI | \
79  IME_PROP_CANDLIST_START_FROM_1 | \
80  IME_PROP_UNICODE | \
81  IME_PROP_COMPLETE_ON_UNSELECT | \
82  IME_PROP_END_UNLOAD | \
83  IME_PROP_KBD_CHAR_FIRST | \
84  IME_PROP_IGNORE_UPKEYS | \
85  IME_PROP_NEED_ALTKEY | \
86  IME_PROP_NO_KEYS_ON_CLOSE | \
87  IME_PROP_ACCEPT_WIDE_VKEY)
88 #define VALID_CMODE_CAPS (IME_CMODE_ALPHANUMERIC | \
89  IME_CMODE_NATIVE | \
90  IME_CMODE_KATAKANA | \
91  IME_CMODE_LANGUAGE | \
92  IME_CMODE_FULLSHAPE | \
93  IME_CMODE_ROMAN | \
94  IME_CMODE_CHARCODE | \
95  IME_CMODE_HANJACONVERT | \
96  IME_CMODE_SOFTKBD | \
97  IME_CMODE_NOCONVERSION | \
98  IME_CMODE_EUDC | \
99  IME_CMODE_SYMBOL | \
100  IME_CMODE_FIXED)
101 #define VALID_SMODE_CAPS (IME_SMODE_NONE | \
102  IME_SMODE_PLAURALCLAUSE | \
103  IME_SMODE_SINGLECONVERT | \
104  IME_SMODE_AUTOMATIC | \
105  IME_SMODE_PHRASEPREDICT | \
106  IME_SMODE_CONVERSATION)
107 #define VALID_UI_CAPS (UI_CAP_2700 | \
108  UI_CAP_ROT90 | \
109  UI_CAP_ROTANY | \
110  UI_CAP_SOFTKBD)
111 #define VALID_SCS_CAPS (SCS_CAP_COMPSTR | \
112  SCS_CAP_MAKEREAD | \
113  SCS_CAP_SETRECONVERTSTRING)
114 #define VALID_SELECT_CAPS (SELECT_CAP_CONVERSION | SELECT_CAP_SENTENCE)
115 
116  if (pImeInfo->fdwProperty & ~VALID_IME_PROP)
117  return FALSE;
118  if (pImeInfo->fdwConversionCaps & ~VALID_CMODE_CAPS)
119  return FALSE;
120  if (pImeInfo->fdwSentenceCaps & ~VALID_SMODE_CAPS)
121  return FALSE;
122  if (pImeInfo->fdwUICaps & ~VALID_UI_CAPS)
123  return FALSE;
124  if (pImeInfo->fdwSCSCaps & ~VALID_SCS_CAPS)
125  return FALSE;
126  if (pImeInfo->fdwSelectCaps & ~VALID_SELECT_CAPS)
127  return FALSE;
128 
129 #undef VALID_IME_PROP
130 #undef VALID_CMODE_CAPS
131 #undef VALID_SMODE_CAPS
132 #undef VALID_UI_CAPS
133 #undef VALID_SCS_CAPS
134 #undef VALID_SELECT_CAPS
135 
136  if (pImeInfo->fdwProperty & IME_PROP_UNICODE)
137  {
138  StringCchCopyW(pImeDpi->szUIClass, _countof(pImeDpi->szUIClass), szUIClass);
139  }
140  else
141  {
142  if (pImeDpi->uCodePage != GetACP() && pImeDpi->uCodePage)
143  return FALSE;
144 
146  pImeDpi->szUIClass, _countof(pImeDpi->szUIClass));
147  }
148 
149  return GetClassInfoW(pImeDpi->hInst, pImeDpi->szUIClass, &wcW);
150 }
UINT uCodePage
Definition: ntuser.h:1257
IMEINFO ImeInfo
Definition: ntuser.h:1256
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:232
#define VALID_SMODE_CAPS
#define VALID_IME_PROP
#define CP_ACP
Definition: compat.h:109
#define MB_PRECOMPOSED
Definition: winnls.h:281
char * LPSTR
Definition: xmlstorage.h:182
#define DWORD
Definition: nt_native.h:44
#define IME_SYSINFO_WINLOGON
Definition: imm.h:238
#define FALSE
Definition: types.h:117
HINSTANCE hInst
Definition: ntuser.h:1254
DWORD fdwUICaps
Definition: imm.h:161
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
BOOL WINAPI GetClassInfoW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSW)
UINT WINAPI GetACP(VOID)
Definition: nls.c:2218
#define IME_PROP_UNICODE
Definition: imm.h:393
DWORD fdwSelectCaps
Definition: imm.h:163
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD fdwProperty
Definition: imm.h:158
#define _countof(array)
Definition: sndvol32.h:68
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD fdwConversionCaps
Definition: imm.h:159
WCHAR szUIClass[16]
Definition: ntuser.h:1258
DWORD dwPrivateDataSize
Definition: imm.h:157
DWORD fdwSCSCaps
Definition: imm.h:162
#define IS_IME_HKL(hKL)
Definition: input.h:88
#define VALID_CMODE_CAPS
#define MultiByteToWideChar
Definition: compat.h:110
#define VALID_SCS_CAPS
DWORD fdwSentenceCaps
Definition: imm.h:160
#define VALID_UI_CAPS
#define VALID_SELECT_CAPS
HKL hKL
Definition: ntuser.h:1255

Referenced by Imm32LoadIME().

◆ Imm32LoadIME()

BOOL APIENTRY Imm32LoadIME ( PIMEINFOEX  pImeInfoEx,
PIMEDPI  pImeDpi 
)

Definition at line 162 of file ime.c.

163 {
165  HINSTANCE hIME;
166  FARPROC fn;
167  BOOL ret = FALSE;
168 
170  return FALSE;
171 
172  pImeDpi->hInst = hIME = LoadLibraryW(szPath);
173  if (hIME == NULL)
174  {
175  ERR("Imm32LoadIME: LoadLibraryW(%s) failed\n", debugstr_w(szPath));
176  return FALSE;
177  }
178 
179  /* Populate the table by stub IME functions */
180 #define DEFINE_IME_ENTRY(type, name, params, optional) pImeDpi->name = Stub##name;
181 #include "imetable.h"
182 #undef DEFINE_IME_ENTRY
183 
184  /* Populate the table by real IME functions */
185 #define DEFINE_IME_ENTRY(type, name, params, optional) \
186  do { \
187  fn = GetProcAddress(hIME, #name); \
188  if (fn) pImeDpi->name = (FN_##name)fn; \
189  else if (!(optional)) { \
190  ERR("'%s' not found in the IME module '%s'.\n", #name, debugstr_w(szPath)); \
191  goto Failed; \
192  } \
193  } while (0);
194 #include "imetable.h"
195 #undef DEFINE_IME_ENTRY
196 
197  if (Imm32InquireIme(pImeDpi))
198  {
199  ret = TRUE;
200  }
201  else
202  {
203  ERR("Imm32InquireIme failed\n");
204 Failed:
205  ret = FALSE;
206  FreeLibrary(pImeDpi->hInst);
207  pImeDpi->hInst = NULL;
208  }
209 
210  if (pImeInfoEx->fLoadFlag == 0)
211  {
212  if (ret)
213  {
214  C_ASSERT(sizeof(pImeInfoEx->wszUIClass) == sizeof(pImeDpi->szUIClass));
215  pImeInfoEx->ImeInfo = pImeDpi->ImeInfo;
216  RtlCopyMemory(pImeInfoEx->wszUIClass, pImeDpi->szUIClass,
217  sizeof(pImeInfoEx->wszUIClass));
218  pImeInfoEx->fLoadFlag = 2;
219  }
220  else
221  {
222  pImeInfoEx->fLoadFlag = 1;
223  }
224 
225  NtUserSetImeInfoEx(pImeInfoEx);
226  }
227 
228  return ret;
229 }
IMEINFO ImeInfo
Definition: ntuser.h:1256
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hInst
Definition: ntuser.h:1254
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define LoadLibraryW(x)
Definition: compat.h:606
#define C_ASSERT(e)
Definition: intsafe.h:73
Definition: arc.h:79
#define FreeLibrary(x)
Definition: compat.h:607
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
WCHAR wszUIClass[16]
Definition: ntuser.h:1180
BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi)
Definition: ime.c:47
int ret
WCHAR szUIClass[16]
Definition: ntuser.h:1258
BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileName)
Definition: utils.c:243
#define ERR(fmt,...)
Definition: debug.h:110
WCHAR wszImeFile[80]
Definition: ntuser.h:1187
IMEINFO ImeInfo
Definition: ntuser.h:1179
LPCWSTR szPath
Definition: env.c:37
#define NULL
Definition: types.h:112
INT fLoadFlag
Definition: ntuser.h:1183
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
int(* FARPROC)()
Definition: compat.h:36
BOOL NTAPI NtUserSetImeInfoEx(PIMEINFOEX pImeInfoEx)
Definition: ime.c:1130

Referenced by Imm32LoadImeDpi().

◆ Imm32LoadImeDpi()

PIMEDPI APIENTRY Imm32LoadImeDpi ( HKL  hKL,
BOOL  bLock 
)

Definition at line 232 of file ime.c.

233 {
234  IMEINFOEX ImeInfoEx;
235  CHARSETINFO ci;
236  PIMEDPI pImeDpiNew, pImeDpiFound;
237  UINT uCodePage;
238  LCID lcid;
239 
240  if (!ImmGetImeInfoEx(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL) ||
241  ImeInfoEx.fLoadFlag == 1)
242  {
243  return NULL;
244  }
245 
246  pImeDpiNew = ImmLocalAlloc(HEAP_ZERO_MEMORY, sizeof(IMEDPI));
247  if (pImeDpiNew == NULL)
248  return NULL;
249 
250  pImeDpiNew->hKL = hKL;
251 
252  lcid = LOWORD(hKL);
254  uCodePage = ci.ciACP;
255  else
256  uCodePage = CP_ACP;
257  pImeDpiNew->uCodePage = uCodePage;
258 
259  if (!Imm32LoadIME(&ImeInfoEx, pImeDpiNew))
260  {
261  ImmLocalFree(pImeDpiNew);
262  return FALSE;
263  }
264 
266 
267  pImeDpiFound = Imm32FindImeDpi(hKL);
268  if (pImeDpiFound)
269  {
270  if (!bLock)
271  pImeDpiFound->dwFlags &= ~IMEDPI_FLAG_LOCKED;
272 
274  Imm32FreeIME(pImeDpiNew, FALSE);
275  ImmLocalFree(pImeDpiNew);
276  return pImeDpiFound;
277  }
278  else
279  {
280  if (bLock)
281  {
282  pImeDpiNew->dwFlags |= IMEDPI_FLAG_LOCKED;
283  pImeDpiNew->cLockObj = 1;
284  }
285 
286  pImeDpiNew->pNext = gpImeDpiList;
287  gpImeDpiList = pImeDpiNew;
288 
290  return pImeDpiNew;
291  }
292 }
UINT uCodePage
Definition: ntuser.h:1257
#define TCI_SRCLOCALE
Definition: wingdi.h:964
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD LCID
Definition: nls.h:13
PIMEDPI gpImeDpiList
Definition: ime.c:17
#define FALSE
Definition: types.h:117
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1259
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
#define ImmLocalFree(lpData)
Definition: precomp.h:89
struct IMEDPI * pNext
Definition: ntuser.h:1253
BOOL APIENTRY Imm32LoadIME(PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi)
Definition: ime.c:162
DWORD dwFlags
Definition: ntuser.h:1260
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
INT fLoadFlag
Definition: ntuser.h:1183
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PIMEDPI APIENTRY Imm32FindImeDpi(HKL hKL)
Definition: ime.c:20
VOID APIENTRY Imm32FreeIME(PIMEDPI pImeDpi, BOOL bDestroy)
Definition: ime.c:36
uint32_t * LPDWORD
Definition: typedefs.h:59
#define IMEDPI_FLAG_LOCKED
Definition: ntuser.h:1301
#define LOWORD(l)
Definition: pedump.c:82
HKL hKL
Definition: ntuser.h:1255

Referenced by Imm32FindOrLoadImeDpi(), and ImmLoadIME().

◆ Imm32ReleaseIME()

BOOL APIENTRY Imm32ReleaseIME ( HKL  hKL)

Definition at line 321 of file ime.c.

322 {
323  BOOL ret = TRUE;
324  PIMEDPI pImeDpi0, pImeDpi1;
325 
327 
328  for (pImeDpi0 = gpImeDpiList; pImeDpi0; pImeDpi0 = pImeDpi0->pNext)
329  {
330  if (pImeDpi0->hKL == hKL)
331  break;
332  }
333 
334  if (!pImeDpi0)
335  goto Quit;
336 
337  if (pImeDpi0->cLockObj)
338  {
339  pImeDpi0->dwFlags |= IMEDPI_FLAG_UNKNOWN;
340  ret = FALSE;
341  goto Quit;
342  }
343 
344  if (gpImeDpiList == pImeDpi0)
345  {
346  gpImeDpiList = pImeDpi0->pNext;
347  }
348  else if (gpImeDpiList)
349  {
350  for (pImeDpi1 = gpImeDpiList; pImeDpi1; pImeDpi1 = pImeDpi1->pNext)
351  {
352  if (pImeDpi1->pNext == pImeDpi0)
353  {
354  pImeDpi1->pNext = pImeDpi0->pNext;
355  break;
356  }
357  }
358  }
359 
360  Imm32FreeIME(pImeDpi0, TRUE);
361  ImmLocalFree(pImeDpi0);
362 
363 Quit:
365  return ret;
366 }
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PIMEDPI gpImeDpiList
Definition: ime.c:17
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1259
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
struct IMEDPI * pNext
Definition: ntuser.h:1253
DWORD dwFlags
Definition: ntuser.h:1260
VOID APIENTRY Imm32FreeIME(PIMEDPI pImeDpi, BOOL bDestroy)
Definition: ime.c:36
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1300
HKL hKL
Definition: ntuser.h:1255

Referenced by ImmFreeLayout().

◆ ImmConfigureIMEA()

BOOL WINAPI ImmConfigureIMEA ( HKL  hKL,
HWND  hWnd,
DWORD  dwMode,
LPVOID  lpData 
)

Definition at line 1873 of file ime.c.

1874 {
1875  BOOL ret = FALSE;
1876  PIMEDPI pImeDpi;
1877  REGISTERWORDW RegWordW;
1878  LPREGISTERWORDA pRegWordA;
1879 
1880  TRACE("(%p, %p, 0x%lX, %p)\n", hKL, hWnd, dwMode, lpData);
1881 
1883  return FALSE;
1884 
1885  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1886  if (!pImeDpi)
1887  return FALSE;
1888 
1889  RtlZeroMemory(&RegWordW, sizeof(RegWordW));
1890 
1891  if (!ImeDpi_IsUnicode(pImeDpi) || !lpData || dwMode != IME_CONFIG_REGISTERWORD)
1892  goto DoIt;
1893 
1894  pRegWordA = lpData;
1895 
1896  if (pRegWordA->lpReading)
1897  {
1898  RegWordW.lpReading = Imm32WideFromAnsi(pRegWordA->lpReading);
1899  if (!RegWordW.lpReading)
1900  goto Quit;
1901  }
1902 
1903  if (pRegWordA->lpWord)
1904  {
1905  RegWordW.lpWord = Imm32WideFromAnsi(pRegWordA->lpWord);
1906  if (!RegWordW.lpWord)
1907  goto Quit;
1908  }
1909 
1910  lpData = &RegWordW;
1911 
1912 DoIt:
1913  SendMessageW(hWnd, WM_IME_SYSTEM, 0x1B, 0);
1914  ret = pImeDpi->ImeConfigure(hKL, hWnd, dwMode, lpData);
1915  SendMessageW(hWnd, WM_IME_SYSTEM, 0x1A, 0);
1916 
1917 Quit:
1918  ImmLocalFree(RegWordW.lpReading);
1919  ImmLocalFree(RegWordW.lpWord);
1920  ImmUnlockImeDpi(pImeDpi);
1921  return ret;
1922 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:554
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpReading
Definition: imm.h:38
#define WM_IME_SYSTEM
Definition: undocuser.h:59
#define TRACE(s)
Definition: solgame.cpp:4
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
LPSTR lpWord
Definition: imm.h:39
int ret
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPWSTR lpWord
Definition: dimm.idl:36
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
static BOOL Imm32IsCrossProcessAccess(HWND hWnd)
Definition: precomp.h:108
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:186
#define ValidateHwnd(hwnd)
Definition: precomp.h:85

Referenced by ActiveIMMApp_ConfigureIMEA(), and test_ImmIME().

◆ ImmConfigureIMEW()

BOOL WINAPI ImmConfigureIMEW ( HKL  hKL,
HWND  hWnd,
DWORD  dwMode,
LPVOID  lpData 
)

Definition at line 1927 of file ime.c.

1928 {
1929  BOOL ret = FALSE;
1930  PIMEDPI pImeDpi;
1931  REGISTERWORDA RegWordA;
1932  LPREGISTERWORDW pRegWordW;
1933 
1934  TRACE("(%p, %p, 0x%lX, %p)\n", hKL, hWnd, dwMode, lpData);
1935 
1937  return FALSE;
1938 
1939  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1940  if (!pImeDpi)
1941  return FALSE;
1942 
1943  RtlZeroMemory(&RegWordA, sizeof(RegWordA));
1944 
1945  if (ImeDpi_IsUnicode(pImeDpi) || !lpData || dwMode != IME_CONFIG_REGISTERWORD)
1946  goto DoIt;
1947 
1948  pRegWordW = lpData;
1949 
1950  if (pRegWordW->lpReading)
1951  {
1952  RegWordA.lpReading = Imm32AnsiFromWide(pRegWordW->lpReading);
1953  if (!RegWordA.lpReading)
1954  goto Quit;
1955  }
1956 
1957  if (pRegWordW->lpWord)
1958  {
1959  RegWordA.lpWord = Imm32AnsiFromWide(pRegWordW->lpWord);
1960  if (!RegWordA.lpWord)
1961  goto Quit;
1962  }
1963 
1964  lpData = &RegWordA;
1965 
1966 DoIt:
1967  SendMessageW(hWnd, WM_IME_SYSTEM, 0x1B, 0);
1968  ret = pImeDpi->ImeConfigure(hKL, hWnd, dwMode, lpData);
1969  SendMessageW(hWnd, WM_IME_SYSTEM, 0x1A, 0);
1970 
1971 Quit:
1972  ImmLocalFree(RegWordA.lpReading);
1973  ImmLocalFree(RegWordA.lpWord);
1974  ImmUnlockImeDpi(pImeDpi);
1975  return ret;
1976 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
HWND hWnd
Definition: settings.c:17
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:197
#define FALSE
Definition: types.h:117
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:554
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpWord
Definition: dimm.idl:31
LPSTR lpReading
Definition: dimm.idl:30
#define WM_IME_SYSTEM
Definition: undocuser.h:59
LPWSTR lpWord
Definition: imm.h:44
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR lpReading
Definition: imm.h:43
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
static BOOL Imm32IsCrossProcessAccess(HWND hWnd)
Definition: precomp.h:108
#define ValidateHwnd(hwnd)
Definition: precomp.h:85

Referenced by ActiveIMMApp_ConfigureIMEW(), ImeWnd_OnImeSystem(), and test_ImmIME().

◆ ImmDisableIME()

BOOL WINAPI ImmDisableIME ( DWORD  dwThreadId)

Definition at line 1009 of file ime.c.

1010 {
1012 }
BOOL NTAPI NtUserDisableThreadIme(DWORD dwThreadID)
Definition: ime.c:859
DWORD dwThreadId
Definition: fdebug.c:31

Referenced by ActiveIMMApp_DisableIME(), and test_default_ime_disabled_cb().

◆ ImmDisableLegacyIME()

BOOL WINAPI ImmDisableLegacyIME ( void  )

Definition at line 863 of file ime.c.

864 {
865  FIXME("stub\n");
866  return TRUE;
867 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmEscapeA()

LRESULT WINAPI ImmEscapeA ( HKL  hKL,
HIMC  hIMC,
UINT  uSubFunc,
LPVOID  lpData 
)

Definition at line 1167 of file ime.c.

1168 {
1169  LRESULT ret;
1170  PIMEDPI pImeDpi;
1171  INT cch;
1172  CHAR szA[MAX_IMM_FILENAME];
1173  WCHAR szW[MAX_IMM_FILENAME];
1174 
1175  TRACE("(%p, %p, %u, %p)\n", hKL, hIMC, uSubFunc, lpData);
1176 
1177  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1178  if (!pImeDpi)
1179  return 0;
1180 
1181  if (!ImeDpi_IsUnicode(pImeDpi) || !lpData)
1182  {
1183  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1184  ImmUnlockImeDpi(pImeDpi);
1185  return ret;
1186  }
1187 
1188  switch (uSubFunc)
1189  {
1191  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1192 
1193  cch = 0;
1194  if (HIWORD(ret))
1195  szW[cch++] = HIWORD(ret);
1196  if (LOWORD(ret))
1197  szW[cch++] = LOWORD(ret);
1198 
1199  cch = WideCharToMultiByte(pImeDpi->uCodePage, 0, szW, cch, szA, _countof(szA),
1200  NULL, NULL);
1201  switch (cch)
1202  {
1203  case 1:
1204  ret = MAKEWORD(szA[0], 0);
1205  break;
1206  case 2:
1207  ret = MAKEWORD(szA[1], szA[0]);
1208  break;
1209  case 3:
1210  ret = MAKELONG(MAKEWORD(szA[2], szA[1]), MAKEWORD(szA[0], 0));
1211  break;
1212  case 4:
1213  ret = MAKELONG(MAKEWORD(szA[3], szA[2]), MAKEWORD(szA[1], szA[0]));
1214  break;
1215  default:
1216  ret = 0;
1217  break;
1218  }
1219  break;
1220 
1222  case IME_ESC_IME_NAME:
1224  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szW, hKL);
1225  if (ret)
1226  {
1227  szW[_countof(szW) - 1] = 0;
1228  WideCharToMultiByte(pImeDpi->uCodePage, 0, szW, -1,
1229  lpData, MAX_IMM_FILENAME, NULL, NULL);
1230  ((LPSTR)lpData)[MAX_IMM_FILENAME - 1] = 0;
1231  }
1232  break;
1233 
1235  case IME_ESC_HANJA_MODE:
1237  lpData, -1, szW, _countof(szW));
1238  szW[_countof(szW) - 1] = 0;
1239  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szW, hKL);
1240  break;
1241 
1242  default:
1243  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1244  break;
1245  }
1246 
1247  ImmUnlockImeDpi(pImeDpi);
1248  return ret;
1249 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
UINT uCodePage
Definition: ntuser.h:1257
#define IME_ESC_SEQUENCE_TO_INTERNAL
Definition: imm.h:563
#define WideCharToMultiByte
Definition: compat.h:111
#define IME_ESC_HANJA_MODE
Definition: imm.h:569
#define MAKEWORD(a, b)
Definition: typedefs.h:248
char CHAR
Definition: xmlstorage.h:175
#define MB_PRECOMPOSED
Definition: winnls.h:281
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:565
char * LPSTR
Definition: xmlstorage.h:182
#define IME_ESC_IME_NAME
Definition: imm.h:567
int32_t INT
Definition: typedefs.h:58
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:564
static LRESULT APIENTRY ImeDpi_Escape(PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL)
Definition: ime.c:309
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:572
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define MAX_IMM_FILENAME
Definition: precomp.h:54
int ret
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LRESULT
Definition: windef.h:209
IN PCTCH IN DWORD cch
Definition: pager.h:36
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ActiveIMMApp_EscapeA().

◆ ImmEscapeW()

LRESULT WINAPI ImmEscapeW ( HKL  hKL,
HIMC  hIMC,
UINT  uSubFunc,
LPVOID  lpData 
)

Definition at line 1254 of file ime.c.

1255 {
1256  LRESULT ret;
1257  PIMEDPI pImeDpi;
1258  INT cch;
1259  CHAR szA[MAX_IMM_FILENAME];
1260  WCHAR szW[MAX_IMM_FILENAME];
1261  WORD word;
1262 
1263  TRACE("(%p, %p, %u, %p)\n", hKL, hIMC, uSubFunc, lpData);
1264 
1265  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1266  if (!pImeDpi)
1267  return 0;
1268 
1269  if (ImeDpi_IsUnicode(pImeDpi) || !lpData)
1270  {
1271  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1272  ImmUnlockImeDpi(pImeDpi);
1273  return ret;
1274  }
1275 
1276  switch (uSubFunc)
1277  {
1279  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1280 
1281  word = LOWORD(ret);
1282  cch = 0;
1283  if (HIBYTE(word))
1284  szA[cch++] = HIBYTE(word);
1285  if (LOBYTE(word))
1286  szA[cch++] = LOBYTE(word);
1287 
1289  szA, cch, szW, _countof(szW));
1290  switch (cch)
1291  {
1292  case 1: ret = szW[0]; break;
1293  case 2: ret = MAKELONG(szW[1], szW[0]); break;
1294  default: ret = 0; break;
1295  }
1296  break;
1297 
1299  case IME_ESC_IME_NAME:
1301  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szA, hKL);
1302  if (ret)
1303  {
1304  szA[_countof(szA) - 1] = 0;
1306  szA, -1, lpData, MAX_IMM_FILENAME);
1307  ((LPWSTR)lpData)[MAX_IMM_FILENAME - 1] = 0;
1308  }
1309  break;
1310 
1312  case IME_ESC_HANJA_MODE:
1313  WideCharToMultiByte(pImeDpi->uCodePage, 0,
1314  lpData, -1, szA, _countof(szA), NULL, NULL);
1315  szA[_countof(szA) - 1] = 0;
1316  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, szA, hKL);
1317  break;
1318 
1319  default:
1320  ret = ImeDpi_Escape(pImeDpi, hIMC, uSubFunc, lpData, hKL);
1321  break;
1322  }
1323 
1324  ImmUnlockImeDpi(pImeDpi);
1325  return ret;
1326 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
UINT uCodePage
Definition: ntuser.h:1257
#define IME_ESC_SEQUENCE_TO_INTERNAL
Definition: imm.h:563
#define WideCharToMultiByte
Definition: compat.h:111
#define IME_ESC_HANJA_MODE
Definition: imm.h:569
#define LOBYTE(W)
Definition: jmemdos.c:487
char CHAR
Definition: xmlstorage.h:175
#define MB_PRECOMPOSED
Definition: winnls.h:281
#define HIBYTE(W)
Definition: jmemdos.c:486
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:565
#define IME_ESC_IME_NAME
Definition: imm.h:567
int32_t INT
Definition: typedefs.h:58
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:564
static LRESULT APIENTRY ImeDpi_Escape(PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL)
Definition: ime.c:309
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:572
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
unsigned short WORD
Definition: ntddk_ex.h:93
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define MAX_IMM_FILENAME
Definition: precomp.h:54
int ret
#define NULL
Definition: types.h:112
const WCHAR * word
Definition: lex.c:36
#define MultiByteToWideChar
Definition: compat.h:110
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
IN PCTCH IN DWORD cch
Definition: pager.h:36
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ActiveIMMApp_EscapeW(), and User32DoImeHelp().

◆ ImmGetCompositionFontA()

BOOL WINAPI ImmGetCompositionFontA ( HIMC  hIMC,
LPLOGFONTA  lplf 
)

Definition at line 1494 of file ime.c.

1495 {
1496  PCLIENTIMC pClientImc;
1497  BOOL ret = FALSE, bWide;
1498  LPINPUTCONTEXT pIC;
1499 
1500  TRACE("(%p, %p)\n", hIMC, lplf);
1501 
1502  pClientImc = ImmLockClientImc(hIMC);
1503  if (pClientImc == NULL)
1504  return FALSE;
1505 
1506  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1507  ImmUnlockClientImc(pClientImc);
1508 
1509  pIC = ImmLockIMC(hIMC);
1510  if (pIC == NULL)
1511  return FALSE;
1512 
1513  if (pIC->fdwInit & INIT_LOGFONT)
1514  {
1515  if (bWide)
1516  LogFontWideToAnsi(&pIC->lfFont.W, lplf);
1517  else
1518  *lplf = pIC->lfFont.A;
1519 
1520  ret = TRUE;
1521  }
1522 
1523  ImmUnlockIMC(hIMC);
1524  return ret;
1525 }
LOGFONTA A
Definition: immdev.h:63
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define CLIENTIMC_WIDE
Definition: ntuser.h:1328
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define INIT_LOGFONT
Definition: immdev.h:146
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
#define TRACE(s)
Definition: solgame.cpp:4
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: utils.c:266
union _tagINPUTCONTEXT::@2001 lfFont
int ret
DWORD fdwInit
Definition: immdev.h:74
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1308
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
LOGFONTW W
Definition: immdev.h:64
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946

Referenced by ActiveIMMApp_GetCompositionFontA(), ImeWnd_OnImeControl(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmGetCompositionFontW()

BOOL WINAPI ImmGetCompositionFontW ( HIMC  hIMC,
LPLOGFONTW  lplf 
)

Definition at line 1530 of file ime.c.

1531 {
1532  PCLIENTIMC pClientImc;
1533  BOOL bWide;
1534  LPINPUTCONTEXT pIC;
1535  BOOL ret = FALSE;
1536 
1537  TRACE("(%p, %p)\n", hIMC, lplf);
1538 
1539  pClientImc = ImmLockClientImc(hIMC);
1540  if (pClientImc == NULL)
1541  return FALSE;
1542 
1543  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1544  ImmUnlockClientImc(pClientImc);
1545 
1546  pIC = ImmLockIMC(hIMC);
1547  if (pIC == NULL)
1548  return FALSE;
1549 
1550  if (pIC->fdwInit & INIT_LOGFONT)
1551  {
1552  if (bWide)
1553  *lplf = pIC->lfFont.W;
1554  else
1555  LogFontAnsiToWide(&pIC->lfFont.A, lplf);
1556 
1557  ret = TRUE;
1558  }
1559 
1560  ImmUnlockIMC(hIMC);
1561  return ret;
1562 }
LOGFONTA A
Definition: immdev.h:63
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
Definition: utils.c:253
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define CLIENTIMC_WIDE
Definition: ntuser.h:1328
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define INIT_LOGFONT
Definition: immdev.h:146
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
#define TRACE(s)
Definition: solgame.cpp:4
union _tagINPUTCONTEXT::@2001 lfFont
int ret
DWORD fdwInit
Definition: immdev.h:74
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1308
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
LOGFONTW W
Definition: immdev.h:64
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946

Referenced by ActiveIMMApp_GetCompositionFontW(), and ImeWnd_OnImeControl().

◆ ImmGetCompositionWindow()

BOOL WINAPI ImmGetCompositionWindow ( HIMC  hIMC,
LPCOMPOSITIONFORM  lpCompForm 
)

Definition at line 1443 of file ime.c.

1444 {
1445  LPINPUTCONTEXT pIC;
1446  BOOL ret = FALSE;
1447 
1448  TRACE("(%p, %p)\n", hIMC, lpCompForm);
1449 
1450  pIC = ImmLockIMC(hIMC);
1451  if (!pIC)
1452  return FALSE;
1453 
1454  if (pIC->fdwInit & INIT_COMPFORM)
1455  {
1456  *lpCompForm = pIC->cfCompForm;
1457  ret = TRUE;
1458  }
1459 
1460  ImmUnlockIMC(hIMC);
1461  return ret;
1462 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
COMPOSITIONFORM cfCompForm
Definition: immdev.h:66
int ret
DWORD fdwInit
Definition: immdev.h:74
#define INIT_COMPFORM
Definition: immdev.h:147
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_GetCompositionWindow(), ImeWnd_OnImeSystem(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmGetConversionListA()

DWORD WINAPI ImmGetConversionListA ( HKL  hKL,
HIMC  hIMC,
LPCSTR  pSrc,
LPCANDIDATELIST  lpDst,
DWORD  dwBufLen,
UINT  uFlag 
)

Definition at line 1683 of file ime.c.

1685 {
1686  DWORD ret = 0;
1687  UINT cb;
1688  LPWSTR pszSrcW = NULL;
1689  LPCANDIDATELIST pCL = NULL;
1690  PIMEDPI pImeDpi;
1691 
1692  TRACE("(%p, %p, %s, %p, %lu, 0x%lX)\n", hKL, hIMC, debugstr_a(pSrc),
1693  lpDst, dwBufLen, uFlag);
1694 
1695  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1696  if (pImeDpi == NULL)
1697  return 0;
1698 
1699  if (!ImeDpi_IsUnicode(pImeDpi))
1700  {
1701  ret = pImeDpi->ImeConversionList(hIMC, pSrc, lpDst, dwBufLen, uFlag);
1702  ImmUnlockImeDpi(pImeDpi);
1703  return ret;
1704  }
1705 
1706  if (pSrc)
1707  {
1708  pszSrcW = Imm32WideFromAnsi(pSrc);
1709  if (pszSrcW == NULL)
1710  goto Quit;
1711  }
1712 
1713  cb = pImeDpi->ImeConversionList(hIMC, pszSrcW, NULL, 0, uFlag);
1714  if (cb == 0)
1715  goto Quit;
1716 
1717  pCL = ImmLocalAlloc(0, cb);
1718  if (pCL == NULL)
1719  goto Quit;
1720 
1721  cb = pImeDpi->ImeConversionList(hIMC, pszSrcW, pCL, cb, uFlag);
1722  if (cb == 0)
1723  goto Quit;
1724 
1725  ret = CandidateListWideToAnsi(pCL, lpDst, dwBufLen, CP_ACP);
1726 
1727 Quit:
1728  ImmLocalFree(pszSrcW);
1729  ImmLocalFree(pCL);
1730  ImmUnlockImeDpi(pImeDpi);
1731  return ret;
1732 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
DWORD APIENTRY CandidateListWideToAnsi(const CANDIDATELIST *pWideCL, LPCANDIDATELIST pAnsiCL, DWORD dwBufLen, UINT uCodePage)
Definition: candidate.c:14
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:186

Referenced by ActiveIMMApp_GetConversionListA().

◆ ImmGetConversionListW()

DWORD WINAPI ImmGetConversionListW ( HKL  hKL,
HIMC  hIMC,
LPCWSTR  pSrc,
LPCANDIDATELIST  lpDst,
DWORD  dwBufLen,
UINT  uFlag 
)

Definition at line 1738 of file ime.c.

1740 {
1741  DWORD ret = 0;
1742  INT cb;
1743  PIMEDPI pImeDpi;
1744  LPCANDIDATELIST pCL = NULL;
1745  LPSTR pszSrcA = NULL;
1746 
1747  TRACE("(%p, %p, %s, %p, %lu, 0x%lX)\n", hKL, hIMC, debugstr_w(pSrc),
1748  lpDst, dwBufLen, uFlag);
1749 
1750  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1751  if (!pImeDpi)
1752  return 0;
1753 
1754  if (ImeDpi_IsUnicode(pImeDpi))
1755  {
1756  ret = pImeDpi->ImeConversionList(hIMC, pSrc, lpDst, dwBufLen, uFlag);
1757  ImmUnlockImeDpi(pImeDpi);
1758  return ret;
1759  }
1760 
1761  if (pSrc)
1762  {
1763  pszSrcA = Imm32AnsiFromWide(pSrc);
1764  if (pszSrcA == NULL)
1765  goto Quit;
1766  }
1767 
1768  cb = pImeDpi->ImeConversionList(hIMC, pszSrcA, NULL, 0, uFlag);
1769  if (cb == 0)
1770  goto Quit;
1771 
1772  pCL = ImmLocalAlloc(0, cb);
1773  if (!pCL)
1774  goto Quit;
1775 
1776  cb = pImeDpi->ImeConversionList(hIMC, pszSrcA, pCL, cb, uFlag);
1777  if (!cb)
1778  goto Quit;
1779 
1780  ret = CandidateListAnsiToWide(pCL, lpDst, dwBufLen, CP_ACP);
1781 
1782 Quit:
1783  ImmLocalFree(pszSrcA);
1784  ImmLocalFree(pCL);
1785  ImmUnlockImeDpi(pImeDpi);
1786  return ret;
1787 }
DWORD APIENTRY CandidateListAnsiToWide(const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST pWideCL, DWORD dwBufLen, UINT uCodePage)
Definition: candidate.c:84
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
char * LPSTR
Definition: xmlstorage.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
int32_t INT
Definition: typedefs.h:58
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:197
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
#define NULL
Definition: types.h:112
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295

Referenced by ActiveIMMApp_GetConversionListW().

◆ ImmGetConversionStatus()

BOOL WINAPI ImmGetConversionStatus ( HIMC  hIMC,
LPDWORD  lpfdwConversion,
LPDWORD  lpfdwSentence 
)

Definition at line 1792 of file ime.c.

1793 {
1794  LPINPUTCONTEXT pIC;
1795 
1796  TRACE("(%p %p %p)\n", hIMC, lpfdwConversion, lpfdwSentence);
1797 
1798  pIC = ImmLockIMC(hIMC);
1799  if (!pIC)
1800  return FALSE;
1801 
1802  if (lpfdwConversion)
1803  *lpfdwConversion = pIC->fdwConversion;
1804  if (lpfdwSentence)
1805  *lpfdwSentence = pIC->fdwSentence;
1806 
1807  ImmUnlockIMC(hIMC);
1808  return TRUE;
1809 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
DWORD fdwConversion
Definition: immdev.h:60
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
DWORD fdwSentence
Definition: immdev.h:61
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_GetConversionStatus(), ImeWnd_OnImeControl(), ImeWnd_OnImeSystem(), and test_ImmThreads().

◆ ImmGetDefaultIMEWnd()

◆ ImmGetDescriptionA()

UINT WINAPI ImmGetDescriptionA ( HKL  hKL,
LPSTR  lpszDescription,
UINT  uBufLen 
)

Definition at line 1017 of file ime.c.

1018 {
1019  IMEINFOEX info;
1020  size_t cch;
1021 
1022  TRACE("(%p,%p,%d)\n", hKL, lpszDescription, uBufLen);
1023 
1024  if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_HKL(hKL))
1025  return 0;
1026 
1027  StringCchLengthW(info.wszImeDescription, _countof(info.wszImeDescription), &cch);
1028  cch = WideCharToMultiByte(CP_ACP, 0, info.wszImeDescription, (INT)cch,
1029  lpszDescription, uBufLen, NULL, NULL);
1030  if (uBufLen)
1031  lpszDescription[cch] = 0;
1032  return (UINT)cch;
1033 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
int32_t INT
Definition: typedefs.h:58
static struct _test_info info[]
Definition: SetCursorPos.c:19
#define TRACE(s)
Definition: solgame.cpp:4
#define _countof(array)
Definition: sndvol32.h:68
#define IS_IME_HKL(hKL)
Definition: input.h:88
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
IN PCTCH IN DWORD cch
Definition: pager.h:36

Referenced by ActiveIMMApp_GetDescriptionA(), and test_ImmGetDescription().

◆ ImmGetDescriptionW()

UINT WINAPI ImmGetDescriptionW ( HKL  hKL,
LPWSTR  lpszDescription,
UINT  uBufLen 
)

Definition at line 1038 of file ime.c.

1039 {
1040  IMEINFOEX info;
1041  size_t cch;
1042 
1043  TRACE("(%p, %p, %d)\n", hKL, lpszDescription, uBufLen);
1044 
1045  if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_HKL(hKL))
1046  return 0;
1047 
1048  if (uBufLen != 0)
1049  StringCchCopyW(lpszDescription, uBufLen, info.wszImeDescription);
1050 
1051  StringCchLengthW(info.wszImeDescription, _countof(info.wszImeDescription), &cch);
1052  return (UINT)cch;
1053 }
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
static struct _test_info info[]
Definition: SetCursorPos.c:19
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define TRACE(s)
Definition: solgame.cpp:4
#define _countof(array)
Definition: sndvol32.h:68
#define IS_IME_HKL(hKL)
Definition: input.h:88
unsigned int UINT
Definition: ndis.h:50
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
IN PCTCH IN DWORD cch
Definition: pager.h:36

Referenced by ActiveIMMApp_GetDescriptionW(), and test_ImmGetDescription().

◆ ImmGetIMEFileNameA()

UINT WINAPI ImmGetIMEFileNameA ( HKL  hKL,
LPSTR  lpszFileName,
UINT  uBufLen 
)

Definition at line 1058 of file ime.c.

1059 {
1060  BOOL bDefUsed;
1061  IMEINFOEX info;
1062  size_t cch;
1063 
1064  TRACE("(%p, %p, %u)\n", hKL, lpszFileName, uBufLen);
1065 
1066  if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_HKL(hKL))
1067  {
1068  if (uBufLen > 0)
1069  lpszFileName[0] = 0;
1070  return 0;
1071  }
1072 
1073  StringCchLengthW(info.wszImeFile, _countof(info.wszImeFile), &cch);
1074 
1075  cch = WideCharToMultiByte(CP_ACP, 0, info.wszImeFile, (INT)cch,
1076  lpszFileName, uBufLen, NULL, &bDefUsed);
1077  if (uBufLen == 0)
1078  return (UINT)cch;
1079 
1080  if (cch > uBufLen - 1)
1081  cch = uBufLen - 1;
1082 
1083  lpszFileName[cch] = 0;
1084  return (UINT)cch;
1085 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
int32_t INT
Definition: typedefs.h:58
unsigned int BOOL
Definition: ntddk_ex.h:94
static struct _test_info info[]
Definition: SetCursorPos.c:19
#define TRACE(s)
Definition: solgame.cpp:4
#define _countof(array)
Definition: sndvol32.h:68
#define IS_IME_HKL(hKL)
Definition: input.h:88
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
IN PCTCH IN DWORD cch
Definition: pager.h:36

Referenced by ActiveIMMApp_GetIMEFileNameA().

◆ ImmGetIMEFileNameW()

UINT WINAPI ImmGetIMEFileNameW ( HKL  hKL,
LPWSTR  lpszFileName,
UINT  uBufLen 
)

Definition at line 1090 of file ime.c.

1091 {
1092  IMEINFOEX info;
1093  size_t cch;
1094 
1095  TRACE("(%p, %p, %u)\n", hKL, lpszFileName, uBufLen);
1096 
1097  if (!ImmGetImeInfoEx(&info, ImeInfoExKeyboardLayout, &hKL) || !IS_IME_HKL(hKL))
1098  {
1099  if (uBufLen > 0)
1100  lpszFileName[0] = 0;
1101  return 0;
1102  }
1103 
1104  StringCchLengthW(info.wszImeFile, _countof(info.wszImeFile), &cch);
1105  if (uBufLen == 0)
1106  return (UINT)cch;
1107 
1108  StringCchCopyNW(lpszFileName, uBufLen, info.wszImeFile, cch);
1109 
1110  if (cch > uBufLen - 1)
1111  cch = uBufLen - 1;
1112 
1113  lpszFileName[cch] = 0;
1114  return (UINT)cch;
1115 }
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
static struct _test_info info[]
Definition: SetCursorPos.c:19
#define TRACE(s)
Definition: solgame.cpp:4
#define _countof(array)
Definition: sndvol32.h:68
#define IS_IME_HKL(hKL)
Definition: input.h:88
unsigned int UINT
Definition: ndis.h:50
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
IN PCTCH IN DWORD cch
Definition: pager.h:36

Referenced by ActiveIMMApp_GetIMEFileNameW().

◆ ImmGetImeInfoEx()

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

Definition at line 873 of file ime.c.

874 {
875  HKL hKL;
876  if (SearchType == ImeInfoExKeyboardLayout || SearchType == ImeInfoExKeyboardLayoutTFS)
877  {
878  hKL = *(HKL*)pvSearchKey;
879  pImeInfoEx->hkl = hKL;
880 
881  if (SearchType == ImeInfoExKeyboardLayoutTFS)
882  {
883  if (!IS_IME_HKL(hKL))
884  {
887  {
888  return FALSE;
889  }
890  }
891 
892  SearchType = ImeInfoExKeyboardLayout;
893  }
894  else
895  {
896  if (!IS_IME_HKL(hKL))
897  return FALSE;
898  }
899  }
900  else if (SearchType == ImeInfoExImeFileName)
901  {
902  StringCchCopyW(pImeInfoEx->wszImeFile, _countof(pImeInfoEx->wszImeFile),
903  pvSearchKey);
904  }
905  else
906  {
907  return FALSE;
908  }
909 
910  return NtUserGetImeInfoEx(pImeInfoEx, SearchType);
911 }
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID)
Definition: ctf.c:67
#define FALSE
Definition: types.h:117
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
BOOL NTAPI NtUserGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
Definition: ime.c:1015
#define _countof(array)
Definition: sndvol32.h:68
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
UINT_PTR HKL
Definition: msctf.idl:101
WCHAR wszImeFile[80]
Definition: ntuser.h:1187
#define IS_IME_HKL(hKL)
Definition: input.h:88
#define IS_16BIT_MODE()
Definition: precomp.h:117

Referenced by Imm32LoadImeDpi(), ImmGetDescriptionA(), ImmGetDescriptionW(), ImmGetIMEFileNameA(), ImmGetIMEFileNameW(), ImmGetProperty(), ImmInstallIMEW(), ImmIsIME(), and User32CreateImeUIWindow().

◆ ImmGetImeMenuItemsA()

DWORD WINAPI ImmGetImeMenuItemsA ( HIMC  hIMC,
DWORD  dwFlags,
DWORD  dwType,
LPIMEMENUITEMINFOA  lpImeParentMenu,
LPIMEMENUITEMINFOA  lpImeMenu,
DWORD  dwSize 
)

Definition at line 1982 of file ime.c.

1985 {
1986  TRACE("(%p, 0x%lX, 0x%lX, %p, %p, 0x%lX)\n",
1987  hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize);
1988  return ImmGetImeMenuItemsAW(hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize, TRUE);
1989 }
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4
DWORD APIENTRY ImmGetImeMenuItemsAW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize, BOOL bTargetIsAnsi)
Definition: ime.c:559
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by ActiveIMMApp_GetImeMenuItemsA(), and test_InvalidIMC().

◆ ImmGetImeMenuItemsAW()

DWORD APIENTRY ImmGetImeMenuItemsAW ( HIMC  hIMC,
DWORD  dwFlags,
DWORD  dwType,
LPVOID  lpImeParentMenu,
LPVOID  lpImeMenu,
DWORD  dwSize,
BOOL  bTargetIsAnsi 
)

Definition at line 559 of file ime.c.

561 {
562  DWORD ret = 0, cbTotal, dwProcessId, dwThreadId, iItem;
563  LPINPUTCONTEXT pIC;
564  PIMEDPI pImeDpi = NULL;
565  IMEMENUITEMINFOA ParentA;
566  IMEMENUITEMINFOW ParentW;
567  LPIMEMENUITEMINFOA pItemA;
568  LPIMEMENUITEMINFOW pItemW;
569  LPVOID pNewItems = NULL, pNewParent = NULL;
570  BOOL bImcIsAnsi;
571  HKL hKL;
572 
573  if (!hIMC)
574  return 0;
575 
576  dwProcessId = (DWORD)NtUserQueryInputContext(hIMC, QIC_INPUTPROCESSID);
577  if (dwProcessId == 0)
578  return 0;
579 
580  if (dwProcessId != GetCurrentProcessId())
581  {
582  if (bTargetIsAnsi)
583  return 0;
584  return Imm32GetImeMenuItemWInterProcess(hIMC, dwFlags, dwType, lpImeParentMenu,
585  lpImeMenu, dwSize);
586  }
587 
588  pIC = ImmLockIMC(hIMC);
589  if (pIC == NULL)
590  return 0;
591 
593  if (dwThreadId == 0)
594  {
595  ImmUnlockIMC(hIMC);
596  return 0;
597  }
598 
600  pImeDpi = ImmLockImeDpi(hKL);
601  if (!pImeDpi)
602  {
603  ImmUnlockIMC(hIMC);
604  return 0;
605  }
606 
607  bImcIsAnsi = Imm32IsImcAnsi(hIMC);
608 
609  if (bImcIsAnsi != bTargetIsAnsi)
610  {
611  if (bTargetIsAnsi)
612  {
613  if (lpImeParentMenu)
614  pNewParent = &ParentW;
615 
616  if (lpImeMenu)
617  {
618  cbTotal = ((dwSize / sizeof(IMEMENUITEMINFOA)) * sizeof(IMEMENUITEMINFOW));
619  pNewItems = ImmLocalAlloc(0, cbTotal);
620  if (!pNewItems)
621  goto Quit;
622  }
623  }
624  else
625  {
626  if (lpImeParentMenu)
627  pNewParent = &ParentA;
628 
629  if (lpImeMenu)
630  {
631  cbTotal = ((dwSize / sizeof(IMEMENUITEMINFOW)) * sizeof(IMEMENUITEMINFOA));
632  pNewItems = ImmLocalAlloc(0, cbTotal);
633  if (!pNewItems)
634  goto Quit;
635  }
636  }
637  }
638  else
639  {
640  pNewItems = lpImeMenu;
641  pNewParent = lpImeParentMenu;
642  }
643 
644  ret = pImeDpi->ImeGetImeMenuItems(hIMC, dwFlags, dwType, pNewParent, pNewItems, dwSize);
645  if (!ret || !lpImeMenu)
646  goto Quit;
647 
648  if (bImcIsAnsi != bTargetIsAnsi)
649  {
650  if (bTargetIsAnsi)
651  {
652  if (pNewParent)
653  Imm32ImeMenuWideToAnsi(pNewParent, lpImeParentMenu, CP_ACP);
654 
655  pItemW = pNewItems;
656  pItemA = lpImeMenu;
657  for (iItem = 0; iItem < ret; ++iItem, ++pItemW, ++pItemA)
658  {
659  if (!Imm32ImeMenuWideToAnsi(pItemW, pItemA, CP_ACP))
660  {
661  ret = 0;
662  break;
663  }
664  }
665  }
666  else
667  {
668  if (pNewParent)
669  Imm32ImeMenuAnsiToWide(pNewParent, lpImeParentMenu, pImeDpi->uCodePage, TRUE);
670 
671  pItemA = pNewItems;
672  pItemW = lpImeMenu;
673  for (iItem = 0; iItem < dwSize; ++iItem, ++pItemA, ++pItemW)
674  {
675  if (!Imm32ImeMenuAnsiToWide(pItemA, pItemW, pImeDpi->uCodePage, TRUE))
676  {
677  ret = 0;
678  break;
679  }
680  }
681  }
682  }
683 
684 Quit:
685  if (pNewItems != lpImeMenu)
686  ImmLocalFree(pNewItems);
687  ImmUnlockImeDpi(pImeDpi);
688  ImmUnlockIMC(hIMC);
689  return ret;
690 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
UINT uCodePage
Definition: ntuser.h:1257
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
#define DWORD
Definition: nt_native.h:44
INT APIENTRY Imm32ImeMenuAnsiToWide(const IMEMENUITEMINFOA *pItemA, LPIMEMENUITEMINFOW pItemW, UINT uCodePage, BOOL bBitmap)
Definition: utils.c:440
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC)
Definition: utils.c:175
struct tagIMEMENUITEMINFOW IMEMENUITEMINFOW
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:916
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
DWORD dwThreadId
Definition: fdebug.c:31
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
UINT_PTR HKL
Definition: msctf.idl:101
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define NULL
Definition: types.h:112
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1794
DWORD APIENTRY Imm32GetImeMenuItemWInterProcess(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize)
Definition: ime.c:475
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
INT APIENTRY Imm32ImeMenuWideToAnsi(const IMEMENUITEMINFOW *pItemW, LPIMEMENUITEMINFOA pItemA, UINT uCodePage)
Definition: utils.c:467
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
struct tagIMEMENUITEMINFOA IMEMENUITEMINFOA

Referenced by ImmGetImeMenuItemsA(), and ImmGetImeMenuItemsW().

◆ ImmGetImeMenuItemsW()

DWORD WINAPI ImmGetImeMenuItemsW ( HIMC  hIMC,
DWORD  dwFlags,
DWORD  dwType,
LPIMEMENUITEMINFOW  lpImeParentMenu,
LPIMEMENUITEMINFOW  lpImeMenu,
DWORD  dwSize 
)

Definition at line 1995 of file ime.c.

1998 {
1999  TRACE("(%p, 0x%lX, 0x%lX, %p, %p, 0x%lX)\n",
2000  hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize);
2001  return ImmGetImeMenuItemsAW(hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize, FALSE);
2002 }
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
DWORD APIENTRY ImmGetImeMenuItemsAW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize, BOOL bTargetIsAnsi)
Definition: ime.c:559
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by ActiveIMMApp_GetImeMenuItemsW(), and ImmPutImeMenuItemsIntoMappedFile().

◆ ImmGetOpenStatus()

BOOL WINAPI ImmGetOpenStatus ( HIMC  hIMC)

Definition at line 1331 of file ime.c.

1332 {
1333  BOOL ret;
1334  LPINPUTCONTEXT pIC;
1335 
1336  TRACE("(%p)\n", hIMC);
1337 
1338  if (!hIMC)
1339  return FALSE;
1340 
1341  pIC = ImmLockIMC(hIMC);
1342  if (!pIC)
1343  return FALSE;
1344 
1345  ret = pIC->fOpen;
1346 
1347  ImmUnlockIMC(hIMC);
1348  return ret;
1349 }
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
int ret
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_GetOpenStatus(), ImeWnd_OnImeControl(), Imm32JCloseOpen(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmGetProperty()

DWORD WINAPI ImmGetProperty ( HKL  hKL,
DWORD  fdwIndex 
)

Definition at line 1120 of file ime.c.

1121 {
1122  IMEINFOEX ImeInfoEx;
1123  LPIMEINFO pImeInfo;
1124  DWORD dwValue;
1125  PIMEDPI pImeDpi = NULL;
1126 
1127  TRACE("(%p, %lu)\n", hKL, fdwIndex);
1128 
1129  if (!ImmGetImeInfoEx(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL))
1130  return FALSE;
1131 
1132  if (fdwIndex == IGP_GETIMEVERSION)
1133  return ImeInfoEx.dwImeWinVersion;
1134 
1135  if (ImeInfoEx.fLoadFlag != 2)
1136  {
1137  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1138  if (pImeDpi == NULL)
1139  return FALSE;
1140 
1141  pImeInfo = &pImeDpi->ImeInfo;
1142  }
1143  else
1144  {
1145  pImeInfo = &ImeInfoEx.ImeInfo;
1146  }
1147 
1148  switch (fdwIndex)
1149  {
1150  case IGP_PROPERTY: dwValue = pImeInfo->fdwProperty; break;
1151  case IGP_CONVERSION: dwValue = pImeInfo->fdwConversionCaps; break;
1152  case IGP_SENTENCE: dwValue = pImeInfo->fdwSentenceCaps; break;
1153  case IGP_UI: dwValue = pImeInfo->fdwUICaps; break;
1154  case IGP_SETCOMPSTR: dwValue = pImeInfo->fdwSCSCaps; break;
1155  case IGP_SELECT: dwValue = pImeInfo->fdwSelectCaps; break;
1156  default: dwValue = 0; break;
1157  }
1158 
1159  if (pImeDpi)
1160  ImmUnlockImeDpi(pImeDpi);
1161  return dwValue;
1162 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
IMEINFO ImeInfo
Definition: ntuser.h:1256
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
#define IGP_UI
Definition: imm.h:448
#define IGP_SELECT
Definition: imm.h:450
#define FALSE
Definition: types.h:117
DWORD fdwUICaps
Definition: imm.h:161
DWORD fdwSelectCaps
Definition: imm.h:163
#define TRACE(s)
Definition: solgame.cpp:4
DWORD fdwProperty
Definition: imm.h:158
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD fdwConversionCaps
Definition: imm.h:159
#define IGP_SETCOMPSTR
Definition: imm.h:449
DWORD fdwSCSCaps
Definition: imm.h:162
IMEINFO ImeInfo
Definition: ntuser.h:1179
#define IGP_CONVERSION
Definition: imm.h:446
#define IGP_PROPERTY
Definition: imm.h:445
#define NULL
Definition: types.h:112
INT fLoadFlag
Definition: ntuser.h:1183
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
DWORD fdwSentenceCaps
Definition: imm.h:160
DWORD dwImeWinVersion
Definition: ntuser.h:1185
#define IGP_SENTENCE
Definition: imm.h:447
#define IGP_GETIMEVERSION
Definition: imm.h:444

Referenced by ActiveIMMApp_GetProperty(), and test_ImmGetCompositionString().

◆ ImmGetStatusWindowPos()

BOOL WINAPI ImmGetStatusWindowPos ( HIMC  hIMC,
LPPOINT  lpptPos 
)

Definition at line 1393 of file ime.c.

1394 {
1395  LPINPUTCONTEXT pIC;
1396  BOOL ret;
1397 
1398  TRACE("(%p, %p)\n", hIMC, lpptPos);
1399 
1400  pIC = ImmLockIMC(hIMC);
1401  if (pIC == NULL)
1402  return FALSE;
1403 
1404  ret = !!(pIC->fdwInit & INIT_STATUSWNDPOS);
1405  if (ret)
1406  *lpptPos = pIC->ptStatusWndPos;
1407 
1408  ImmUnlockIMC(hIMC);
1409  return ret;
1410 }
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define INIT_STATUSWNDPOS
Definition: immdev.h:143
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
POINT ptStatusWndPos
Definition: immdev.h:58
#define TRACE(s)
Definition: solgame.cpp:4
int ret
DWORD fdwInit
Definition: immdev.h:74
#define NULL
Definition: types.h:112
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_GetStatusWindowPos(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmInstallIMEA()

HKL WINAPI ImmInstallIMEA ( LPCSTR  lpszIMEFileName,
LPCSTR  lpszLayoutText 
)

Definition at line 695 of file ime.c.

696 {
697  HKL hKL = NULL;
698  LPWSTR pszFileNameW = NULL, pszLayoutTextW = NULL;
699 
700  TRACE("(%s, %s)\n", debugstr_a(lpszIMEFileName), debugstr_a(lpszLayoutText));
701 
702  pszFileNameW = Imm32WideFromAnsi(lpszIMEFileName);
703  if (!pszFileNameW)
704  goto Quit;
705 
706  pszLayoutTextW = Imm32WideFromAnsi(lpszLayoutText);
707  if (!pszLayoutTextW)
708  goto Quit;
709 
710  hKL = ImmInstallIMEW(pszFileNameW, pszLayoutTextW);
711 
712 Quit:
713  ImmLocalFree(pszFileNameW);
714  ImmLocalFree(pszLayoutTextW);
715  return hKL;
716 }
#define TRACE(s)
Definition: solgame.cpp:4
HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
Definition: ime.c:721
#define debugstr_a
Definition: kernel32.h:31
#define ImmLocalFree(lpData)
Definition: precomp.h:89
UINT_PTR HKL
Definition: msctf.idl:101
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:186

Referenced by ActiveIMMApp_InstallIMEA().

◆ ImmInstallIMEW()

HKL WINAPI ImmInstallIMEW ( LPCWSTR  lpszIMEFileName,
LPCWSTR  lpszLayoutText 
)

Definition at line 721 of file ime.c.

722 {
723  WCHAR szImeFileName[MAX_PATH], szImeDestPath[MAX_PATH], szImeKey[20];
724  IMEINFOEX InfoEx;
725  LPWSTR pchFilePart;
726  UINT iLayout, cLayouts;
727  HKL hNewKL;
728  WORD wLangID;
729  PREG_IME pLayouts = NULL;
730 
731  TRACE("(%s, %s)\n", debugstr_w(lpszIMEFileName), debugstr_w(lpszLayoutText));
732 
733  GetFullPathNameW(lpszIMEFileName, _countof(szImeFileName), szImeFileName, &pchFilePart);
734  CharUpperW(szImeFileName);
735  if (!pchFilePart)
736  return NULL;
737 
738  /* Load the IME version info */
739  InfoEx.hkl = hNewKL = NULL;
740  StringCchCopyW(InfoEx.wszImeFile, _countof(InfoEx.wszImeFile), pchFilePart);
741  if (Imm32LoadImeVerInfo(&InfoEx) && InfoEx.hkl)
742  wLangID = LOWORD(InfoEx.hkl);
743  else
744  return NULL;
745 
746  /* Get the IME layouts from registry */
747  cLayouts = Imm32GetImeLayout(NULL, 0);
748  if (cLayouts)
749  {
750  pLayouts = ImmLocalAlloc(0, cLayouts * sizeof(REG_IME));
751  if (!pLayouts || !Imm32GetImeLayout(pLayouts, cLayouts))
752  {
753  ImmLocalFree(pLayouts);
754  return NULL;
755  }
756 
757  for (iLayout = 0; iLayout < cLayouts; ++iLayout)
758  {
759  if (lstrcmpiW(pLayouts[iLayout].szFileName, pchFilePart) == 0)
760  {
761  if (wLangID != LOWORD(pLayouts[iLayout].hKL))
762  goto Quit; /* The language is different */
763 
764  hNewKL = pLayouts[iLayout].hKL; /* Found */
765  break;
766  }
767  }
768  }
769 
770  /* If the IME for the specified filename is valid, then unload it now */
771  if (ImmGetImeInfoEx(&InfoEx, ImeInfoExImeFileName, pchFilePart) &&
772  !UnloadKeyboardLayout(InfoEx.hkl))
773  {
774  hNewKL = NULL;
775  goto Quit;
776  }
777 
778  Imm32GetSystemLibraryPath(szImeDestPath, _countof(szImeDestPath), pchFilePart);
779  CharUpperW(szImeDestPath);
780 
781  /* If the source and the destination pathnames were different, then copy the IME file */
782  if (lstrcmpiW(szImeFileName, szImeDestPath) != 0 &&
783  !Imm32CopyImeFile(szImeFileName, szImeDestPath))
784  {
785  hNewKL = NULL;
786  goto Quit;
787  }
788 
789  if (hNewKL == NULL)
790  hNewKL = Imm32AssignNewLayout(cLayouts, pLayouts, wLangID);
791 
792  if (hNewKL)
793  {
794  /* Write the IME layout to registry */
795  if (Imm32WriteImeLayout(hNewKL, pchFilePart, lpszLayoutText))
796  {
797  /* Load the keyboard layout */
798  Imm32UIntToStr((DWORD)(DWORD_PTR)hNewKL, 16, szImeKey, _countof(szImeKey));
799  hNewKL = LoadKeyboardLayoutW(szImeKey, KLF_REPLACELANG);
800  }
801  else
802  {
803  hNewKL = NULL;
804  }
805  }
806 
807 Quit:
808  ImmLocalFree(pLayouts);
809  return hNewKL;
810 }
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT cchBuff)
Definition: utils.c:33
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx)
Definition: utils.c:763
BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout)
Definition: utils.c:934
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
Definition: utils.c:865
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
HKL hKL
Definition: precomp.h:67
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define debugstr_w
Definition: kernel32.h:32
HKL APIENTRY Imm32AssignNewLayout(UINT cKLs, const REG_IME *pLayouts, WORD wLangID)
Definition: utils.c:819
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL APIENTRY Imm32CopyImeFile(LPWSTR pszOldFile, LPCWSTR pszNewFile)
Definition: utils.c:1031
#define ImmLocalFree(lpData)
Definition: precomp.h:89
UINT_PTR HKL
Definition: msctf.idl:101
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileName)
Definition: utils.c:243
#define KLF_REPLACELANG
Definition: winuser.h:115
WCHAR wszImeFile[80]
Definition: ntuser.h:1187
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ActiveIMMApp_InstallIMEW(), and ImmInstallIMEA().

◆ ImmIsIME()

BOOL WINAPI ImmIsIME ( HKL  hKL)

Definition at line 815 of file ime.c.

816 {
817  IMEINFOEX info;
818  TRACE("(%p)\n", hKL);
820 }
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
static struct _test_info info[]
Definition: SetCursorPos.c:19
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActiveIMMApp_IsIME(), and Imm32JCloseOpen().

◆ ImmLoadIME()

BOOL WINAPI ImmLoadIME ( HKL  hKL)

Definition at line 993 of file ime.c.

994 {
995  PIMEDPI pImeDpi;
996 
997  if (!IS_IME_HKL(hKL) && (!IS_CICERO_MODE() || IS_16BIT_MODE()))
998  return FALSE;
999 
1000  pImeDpi = Imm32FindImeDpi(hKL);
1001  if (pImeDpi == NULL)
1002  pImeDpi = Imm32LoadImeDpi(hKL, FALSE);
1003  return (pImeDpi != NULL);
1004 }
PIMEDPI APIENTRY Imm32LoadImeDpi(HKL hKL, BOOL bLock)
Definition: ime.c:232
#define FALSE
Definition: types.h:117
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
#define IS_IME_HKL(hKL)
Definition: input.h:88
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindImeDpi(HKL hKL)
Definition: ime.c:20
#define IS_16BIT_MODE()
Definition: precomp.h:117

Referenced by CtfLoadThreadLayout(), and ImmActivateLayout().

◆ ImmLockImeDpi()

PIMEDPI WINAPI ImmLockImeDpi ( HKL  hKL)

Definition at line 916 of file ime.c.

917 {
918  PIMEDPI pImeDpi = NULL;
919 
920  TRACE("(%p)\n", hKL);
921 
923 
924  /* Find by hKL */
925  for (pImeDpi = gpImeDpiList; pImeDpi; pImeDpi = pImeDpi->pNext)
926  {
927  if (pImeDpi->hKL == hKL) /* found */
928  {
929  /* lock if possible */
930  if (pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN)
931  pImeDpi = NULL;
932  else
933  ++(pImeDpi->cLockObj);
934  break;
935  }
936  }
937 
939  return pImeDpi;
940 }
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PIMEDPI gpImeDpiList
Definition: ime.c:17
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1259
#define TRACE(s)
Definition: solgame.cpp:4
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
struct IMEDPI * pNext
Definition: ntuser.h:1253
DWORD dwFlags
Definition: ntuser.h:1260
#define NULL
Definition: types.h:112
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1300
HKL hKL
Definition: ntuser.h:1255

Referenced by Imm32CreateInputContext(), Imm32DestroyInputContext(), Imm32FindOrLoadImeDpi(), Imm32MakeIMENotify(), Imm32ProcessHotKey(), Imm32SelectInputContext(), ImmActivateLayout(), ImmGetImeMenuItemsAW(), ImmNotifyIME(), ImmProcessKey(), ImmSetActiveContext(), ImmSetCompositionStringAW(), ImmTranslateMessage(), and User32CreateImeUIWindow().

◆ ImmNotifyIME()

BOOL WINAPI ImmNotifyIME ( HIMC  hIMC,
DWORD  dwAction,
DWORD  dwIndex,
DWORD  dwValue 
)

Definition at line 839 of file ime.c.

840 {
841  HKL hKL;
842  PIMEDPI pImeDpi;
843  BOOL ret;
844 
845  TRACE("(%p, %lu, %lu, %lu)\n", hIMC, dwAction, dwIndex, dwValue);
846 
847  if (hIMC && Imm32IsCrossThreadAccess(hIMC))
848  return FALSE;
849 
850  hKL = GetKeyboardLayout(0);
851  pImeDpi = ImmLockImeDpi(hKL);
852  if (pImeDpi == NULL)
853  return FALSE;
854 
855  ret = pImeDpi->NotifyIME(hIMC, dwAction, dwIndex, dwValue);
856  ImmUnlockImeDpi(pImeDpi);
857  return ret;
858 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:916
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
int ret
UINT_PTR HKL
Definition: msctf.idl:101
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define NULL
Definition: types.h:112

Referenced by ActiveIMMApp_NotifyIME(), Imm32NotifyIMEProc(), ImmSystemHandler(), test_ImmGetCompositionString(), and test_ImmNotifyIME().

◆ ImmPutImeMenuItemsIntoMappedFile()

LRESULT WINAPI ImmPutImeMenuItemsIntoMappedFile ( HIMC  hIMC)

Definition at line 398 of file ime.c.

399 {
400  LRESULT ret = FALSE;
401  HANDLE hMapping;
402  PIMEMENU pView;
404  DWORD i, cItems, cbItems = 0;
405 
406  hMapping = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, L"ImmMenuInfo");
407  pView = MapViewOfFile(hMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);
408  if (!pView || pView->dwVersion != 1)
409  {
410  ERR("hMapping %p, pView %p\n", hMapping, pView);
411  goto Quit;
412  }
413 
414  if (pView->Parent.cbSize > 0)
415  pParent = &pView->Parent;
416 
417  if (pView->dwItemCount > 0)
418  {
419  cbItems = pView->dwItemCount * sizeof(IMEMENUITEMINFOW);
421  if (!pItems)
422  {
423  ERR("!pItems\n");
424  goto Quit;
425  }
426  }
427 
428  cItems = ImmGetImeMenuItemsW(hIMC, pView->dwFlags, pView->dwType, pParent, pItems, cbItems);
429  pView->dwItemCount = cItems;
430  if (cItems == 0)
431  goto Quit;
432 
433  if (pItems)
434  {
435  for (i = 0; i < cItems; ++i)
436  {
437  pView->Items[i].Info = pItems[i];
438 
439  // store bitmaps to bytes
440  if (pItems[i].hbmpChecked)
441  {
442  Imm32StoreBitmapToBytes(pItems[i].hbmpChecked, pView->Items[i].abChecked,
444  DeleteObject(pItems[i].hbmpChecked);
445  }
446  if (pItems[i].hbmpUnchecked)
447  {
448  Imm32StoreBitmapToBytes(pItems[i].hbmpUnchecked, pView->Items[i].abUnchecked,
450  DeleteObject(pItems[i].hbmpUnchecked);
451  }
452  if (pItems[i].hbmpItem)
453  {
454  Imm32StoreBitmapToBytes(pItems[i].hbmpItem, pView->Items[i].abItem,
456  DeleteObject(pItems[i].hbmpItem);
457  }
458  }
459  }
460 
461  ret = TRUE;
462 
463 Quit:
464  if (pItems)
466  if (pView)
467  UnmapViewOfFile(pView);
468  if (hMapping)
469  CloseHandle(hMapping);
470  return ret;
471 }
BYTE abItem[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:378
#define CloseHandle
Definition: compat.h:598
#define MapViewOfFile
Definition: compat.h:604
BOOL Imm32StoreBitmapToBytes(HBITMAP hbm, LPBYTE pbData, DWORD cbDataMax)
Definition: utils.c:109
#define TRUE
Definition: types.h:120
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
#define MAX_IMEMENU_BITMAP_BYTES
Definition: ime.c:371
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
DWORD dwVersion
Definition: ime.c:383
BYTE abChecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:376
struct tagIMEMENUITEMINFOW IMEMENUITEMINFOW
DWORD dwItemCount
Definition: ime.c:386
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:156
DWORD dwType
Definition: ime.c:385
IMEMENUITEMINFOW Info
Definition: ime.c:375
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM * pItems
Definition: usp10.c:62
DWORD WINAPI ImmGetImeMenuItemsW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize)
Definition: ime.c:1995
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE abUnchecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:377
#define ImmLocalFree(lpData)
Definition: precomp.h:89
DWORD dwFlags
Definition: ime.c:384
int ret
IMEMENUITEMINFOW Parent
Definition: ime.c:387
HANDLE NTAPI OpenFileMappingW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
Definition: filemap.c:297
#define ERR(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
FxObject * pParent
Definition: fxdpcapi.cpp:86
LONG_PTR LRESULT
Definition: windef.h:209
#define UnmapViewOfFile
Definition: compat.h:605
IMEMENUITEM Items[ANYSIZE_ARRAY]
Definition: ime.c:388

Referenced by ImeWnd_OnImeSystem().

◆ ImmSetCompositionFontA()

BOOL WINAPI ImmSetCompositionFontA ( HIMC  hIMC,
LPLOGFONTA  lplf 
)

Definition at line 1567 of file ime.c.

1568 {
1569  LOGFONTW lfW;
1570  PCLIENTIMC pClientImc;
1571  BOOL bWide;
1572  LPINPUTCONTEXTDX pIC;
1573  LCID lcid;
1574  HWND hWnd;
1575  PTEB pTeb;
1576 
1577  TRACE("(%p, %p)\n", hIMC, lplf);
1578 
1579  if (Imm32IsCrossThreadAccess(hIMC))
1580  return FALSE;
1581 
1582  pClientImc = ImmLockClientImc(hIMC);
1583  if (pClientImc == NULL)
1584  return FALSE;
1585 
1586  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1587  ImmUnlockClientImc(pClientImc);
1588 
1589  if (bWide)
1590  {
1591  LogFontAnsiToWide(lplf, &lfW);
1592  return ImmSetCompositionFontW(hIMC, &lfW);
1593  }
1594 
1595  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
1596  if (pIC == NULL)
1597  return FALSE;
1598 
1599  pTeb = NtCurrentTeb();
1600  if (pTeb->Win32ClientInfo[2] < 0x400)
1601  {
1602  lcid = GetSystemDefaultLCID();
1603  if (PRIMARYLANGID(lcid) == LANG_JAPANESE && !(pIC->dwUIFlags & 2) &&
1604  pIC->cfCompForm.dwStyle != CFS_DEFAULT)
1605  {
1607  }
1608  }
1609 
1610  pIC->lfFont.A = *lplf;
1611  pIC->fdwInit |= INIT_LOGFONT;
1612  hWnd = pIC->hWnd;
1613 
1614  ImmUnlockIMC(hIMC);
1615 
1618  return TRUE;
1619 }
ULONG Win32ClientInfo[31]
Definition: compat.h:706
DWORD dwUIFlags
Definition: immdev.h:126
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
Definition: utils.c:253
#define TRUE
Definition: types.h:120
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMC_SETCOMPOSITIONFONT
Definition: imm.h:281
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define IR_CHANGECONVERT
Definition: immdev.h:164
#define CFS_DEFAULT
Definition: imm.h:470
HWND hWnd
Definition: settings.c:17
#define IMN_SETCOMPOSITIONFONT
Definition: imm.h:530
DWORD LCID
Definition: nls.h:13
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define CLIENTIMC_WIDE
Definition: ntuser.h:1328
BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: ime.c:1624
#define LANG_JAPANESE
Definition: nls.h:76
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_IME_REPORT
Definition: immdev.h:157
#define INIT_LOGFONT
Definition: immdev.h:146
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
#define TRACE(s)
Definition: solgame.cpp:4
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
Definition: compat.h:694
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1308
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
#define PRIMARYLANGID(l)
Definition: nls.h:16
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946

Referenced by ActiveIMMApp_SetCompositionFontA(), ImeWnd_OnImeControl(), ImmSetCompositionFontW(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmSetCompositionFontW()

BOOL WINAPI ImmSetCompositionFontW ( HIMC  hIMC,
LPLOGFONTW  lplf 
)

Definition at line 1624 of file ime.c.

1625 {
1626  LOGFONTA lfA;
1627  PCLIENTIMC pClientImc;
1628  BOOL bWide;
1629  HWND hWnd;
1630  LPINPUTCONTEXTDX pIC;
1631  PTEB pTeb;
1632  LCID lcid;
1633 
1634  TRACE("(%p, %p)\n", hIMC, lplf);
1635 
1636  if (Imm32IsCrossThreadAccess(hIMC))
1637  return FALSE;
1638 
1639  pClientImc = ImmLockClientImc(hIMC);
1640  if (pClientImc == NULL)
1641  return FALSE;
1642 
1643  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1644  ImmUnlockClientImc(pClientImc);
1645 
1646  if (!bWide)
1647  {
1648  LogFontWideToAnsi(lplf, &lfA);
1649  return ImmSetCompositionFontA(hIMC, &lfA);
1650  }
1651 
1652  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
1653  if (pIC == NULL)
1654  return FALSE;
1655 
1656  pTeb = NtCurrentTeb();
1657  if (pTeb->Win32ClientInfo[2] < 0x400)
1658  {
1659  lcid = GetSystemDefaultLCID();
1660  if (PRIMARYLANGID(lcid) == LANG_JAPANESE &&
1661  !(pIC->dwUIFlags & 2) &&
1662  pIC->cfCompForm.dwStyle != CFS_DEFAULT)
1663  {
1665  }
1666  }
1667 
1668  pIC->lfFont.W = *lplf;
1669  pIC->fdwInit |= INIT_LOGFONT;
1670  hWnd = pIC->hWnd;
1671 
1672  ImmUnlockIMC(hIMC);
1673 
1676  return TRUE;
1677 }
ULONG Win32ClientInfo[31]
Definition: compat.h:706
DWORD dwUIFlags
Definition: immdev.h:126
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: ime.c:1567
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
#define TRUE
Definition: types.h:120
#define IMC_SETCOMPOSITIONFONT
Definition: imm.h:281
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define IR_CHANGECONVERT
Definition: immdev.h:164
#define CFS_DEFAULT
Definition: imm.h:470
HWND hWnd
Definition: settings.c:17
#define IMN_SETCOMPOSITIONFONT
Definition: imm.h:530
DWORD LCID
Definition: nls.h:13
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define CLIENTIMC_WIDE
Definition: ntuser.h:1328
#define LANG_JAPANESE
Definition: nls.h:76
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_IME_REPORT
Definition: immdev.h:157
#define INIT_LOGFONT
Definition: immdev.h:146
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
#define TRACE(s)
Definition: solgame.cpp:4
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: utils.c:266
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
Definition: compat.h:694
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1308
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
#define PRIMARYLANGID(l)
Definition: nls.h:16
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946

Referenced by ActiveIMMApp_SetCompositionFontW(), ImeWnd_OnImeControl(), ImeWnd_OnImeSystem(), and ImmSetCompositionFontA().

◆ ImmSetCompositionWindow()

BOOL WINAPI ImmSetCompositionWindow ( HIMC  hIMC,
LPCOMPOSITIONFORM  lpCompForm 
)

Definition at line 1467 of file ime.c.

1468 {
1469  LPINPUTCONTEXT pIC;
1470  HWND hWnd;
1471 
1472  if (Imm32IsCrossThreadAccess(hIMC))
1473  return FALSE;
1474 
1475  pIC = ImmLockIMC(hIMC);
1476  if (pIC == NULL)
1477  return FALSE;
1478 
1479  pIC->cfCompForm = *lpCompForm;
1480  pIC->fdwInit |= INIT_COMPFORM;
1481 
1482  hWnd = pIC->hWnd;
1483 
1484  ImmUnlockIMC(hIMC);
1485 
1488  return TRUE;
1489 }
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define IMN_SETCOMPOSITIONWINDOW
Definition: imm.h:531
HWND hWnd
Definition: settings.c:17
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define FALSE
Definition: types.h:117
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
COMPOSITIONFORM cfCompForm
Definition: immdev.h:66
DWORD fdwInit
Definition: immdev.h:74
#define INIT_COMPFORM
Definition: immdev.h:147
#define NULL
Definition: types.h:112
#define IMC_SETCOMPOSITIONWINDOW
Definition: imm.h:283
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_SetCompositionWindow(), ImeWnd_OnImeControl(), ImeWnd_OnImeSetContext(), ImeWnd_OnImeSystem(), ImmGetContextThreadFunc(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmSetConversionStatus()

BOOL WINAPI ImmSetConversionStatus ( HIMC  hIMC,
DWORD  fdwConversion,
DWORD  fdwSentence 
)

Definition at line 1814 of file ime.c.

1815 {
1816  HKL hKL;
1817  LPINPUTCONTEXT pIC;
1818  DWORD dwOldConversion, dwOldSentence;
1819  BOOL fOpen = FALSE, fConversionChange = FALSE, fSentenceChange = FALSE, fUseCicero = FALSE;
1820  HWND hWnd;
1821 
1822  TRACE("(%p, 0x%lX, 0x%lX)\n", hIMC, fdwConversion, fdwSentence);
1823 
1824  hKL = GetKeyboardLayout(0);
1825  if (!IS_IME_HKL(hKL) && IS_CICERO_MODE() && !IS_16BIT_MODE())
1826  fUseCicero = TRUE;
1827 
1828  if (Imm32IsCrossThreadAccess(hIMC))
1829  return FALSE;
1830 
1831  pIC = ImmLockIMC(hIMC);
1832  if (pIC == NULL)
1833  return FALSE;
1834 
1835  if (pIC->fdwConversion != fdwConversion)
1836  {
1837  dwOldConversion = pIC->fdwConversion;
1838  pIC->fdwConversion = fdwConversion;
1839  fConversionChange = TRUE;
1840  }
1841 
1842  if (pIC->fdwSentence != fdwSentence)
1843  {
1844  dwOldSentence = pIC->fdwSentence;
1845  pIC->fdwSentence = fdwSentence;
1846  fSentenceChange = TRUE;
1847  }
1848 
1849  hWnd = pIC->hWnd;
1850  fOpen = pIC->fOpen;
1851  ImmUnlockIMC(hIMC);
1852 
1853  if (fConversionChange || fUseCicero)
1854  {
1855  Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldConversion,
1857  if (fConversionChange)
1858  NtUserNotifyIMEStatus(hWnd, fOpen, fdwConversion);
1859  }
1860 
1861  if (fSentenceChange || fUseCicero)
1862  {
1863  Imm32MakeIMENotify(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldSentence,
1865  }
1866 
1867  return TRUE;
1868 }
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
HWND hWnd
Definition: settings.c:17
DWORD fdwConversion
Definition: immdev.h:60
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IMN_SETSENTENCEMODE
Definition: imm.h:527
#define TRACE(s)
Definition: solgame.cpp:4
#define IMC_SETCONVERSIONMODE
Definition: imm.h:221
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:810
UINT_PTR HKL
Definition: msctf.idl:101
#define IMC_SETSENTENCEMODE
Definition: imm.h:222
#define IS_IME_HKL(hKL)
Definition: input.h:88
#define IMN_SETCONVERSIONMODE
Definition: imm.h:526
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define NULL
Definition: types.h:112
DWORD fdwSentence
Definition: immdev.h:61
#define IS_16BIT_MODE()
Definition: precomp.h:117
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_SetConversionStatus(), ImeWnd_OnImeControl(), Imm32CShapeToggle(), Imm32CSymbolToggle(), Imm32KEnglish(), Imm32KHanjaConvert(), Imm32KShapeToggle(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmSetOpenStatus()

BOOL WINAPI ImmSetOpenStatus ( HIMC  hIMC,
BOOL  fOpen 
)

Definition at line 1354 of file ime.c.

1355 {
1356  DWORD dwConversion;
1357  LPINPUTCONTEXT pIC;
1358  HWND hWnd;
1359  BOOL bHasChange = FALSE;
1360 
1361  TRACE("(%p, %d)\n", hIMC, fOpen);
1362 
1363  if (Imm32IsCrossThreadAccess(hIMC))
1364  return FALSE;
1365 
1366  pIC = ImmLockIMC(hIMC);
1367  if (pIC == NULL)
1368  return FALSE;
1369 
1370  if (pIC->fOpen != fOpen)
1371  {
1372  pIC->fOpen = fOpen;
1373  hWnd = pIC->hWnd;
1374  dwConversion = pIC->fdwConversion;
1375  bHasChange = TRUE;
1376  }
1377 
1378  ImmUnlockIMC(hIMC);
1379 
1380  if (bHasChange)
1381  {
1384  NtUserNotifyIMEStatus(hWnd, fOpen, dwConversion);
1385  }
1386 
1387  return TRUE;
1388 }
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
HWND hWnd
Definition: settings.c:17
DWORD fdwConversion
Definition: immdev.h:60
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define IMN_SETOPENSTATUS
Definition: imm.h:528
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:810
#define IMC_SETOPENSTATUS
Definition: imm.h:223
#define NULL
Definition: types.h:112
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_SetOpenStatus(), ImeWnd_OnImeControl(), ImeWnd_OnImeSystem(), Imm32CShapeToggle(), Imm32CSymbolToggle(), Imm32ImeNonImeToggle(), Imm32JCloseOpen(), Imm32KEnglish(), Imm32KShapeToggle(), ImmGetContextThreadFunc(), Test1(), test_ime_processkey(), test_ImmDefaultHwnd(), test_ImmMessages(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmSetStatusWindowPos()

BOOL WINAPI ImmSetStatusWindowPos ( HIMC  hIMC,
LPPOINT  lpptPos 
)

Definition at line 1415 of file ime.c.

1416 {
1417  LPINPUTCONTEXT pIC;
1418  HWND hWnd;
1419 
1420  TRACE("(%p, {%ld, %ld})\n", hIMC, lpptPos->x, lpptPos->y);
1421 
1422  if (Imm32IsCrossThreadAccess(hIMC))
1423  return FALSE;
1424 
1425  pIC = ImmLockIMC(hIMC);
1426  if (!pIC)
1427  return FALSE;
1428 
1429  hWnd = pIC->hWnd;
1430  pIC->ptStatusWndPos = *lpptPos;
1431  pIC->fdwInit |= INIT_STATUSWNDPOS;
1432 
1433  ImmUnlockIMC(hIMC);
1434 
1437  return TRUE;
1438 }
long y
Definition: polytest.cpp:48
BOOL APIENTRY Imm32MakeIMENotify(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
Definition: utils.c:368
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
HWND hWnd
Definition: settings.c:17
#define INIT_STATUSWNDPOS
Definition: immdev.h:143
#define NI_CONTEXTUPDATED
Definition: imm.h:226
#define FALSE
Definition: types.h:117
POINT ptStatusWndPos
Definition: immdev.h:58
#define TRACE(s)
Definition: solgame.cpp:4
#define IMC_SETSTATUSWINDOWPOS
Definition: imm.h:285
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
DWORD fdwInit
Definition: immdev.h:74
#define IMN_SETSTATUSWINDOWPOS
Definition: imm.h:532
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024

Referenced by ActiveIMMApp_SetStatusWindowPos(), ImeWnd_OnImeControl(), ImmGetContextThreadFunc(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmUnlockImeDpi()

VOID WINAPI ImmUnlockImeDpi ( PIMEDPI  pImeDpi)

Definition at line 945 of file ime.c.

946 {
947  PIMEDPI *ppEntry;
948 
949  TRACE("(%p)\n", pImeDpi);
950 
951  if (pImeDpi == NULL)
952  return;
953 
955 
956  /* unlock */
957  --(pImeDpi->cLockObj);
958  if (pImeDpi->cLockObj != 0)
959  {
961  return;
962  }
963 
964  if ((pImeDpi->dwFlags & IMEDPI_FLAG_UNKNOWN) == 0)
965  {
966  if ((pImeDpi->dwFlags & IMEDPI_FLAG_LOCKED) == 0 ||
967  (pImeDpi->ImeInfo.fdwProperty & IME_PROP_END_UNLOAD) == 0)
968  {
970  return;
971  }
972  }
973 
974  /* Remove from list */
975  for (ppEntry = &gpImeDpiList; *ppEntry; ppEntry = &((*ppEntry)->pNext))
976  {
977  if (*ppEntry == pImeDpi) /* found */
978  {
979  *ppEntry = pImeDpi->pNext;
980  break;
981  }
982  }
983 
984  Imm32FreeIME(pImeDpi, TRUE);
985  ImmLocalFree(pImeDpi);
986 
988 }
IMEINFO ImeInfo
Definition: ntuser.h:1256
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PIMEDPI gpImeDpiList
Definition: ime.c:17
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD cLockObj
Definition: ntuser.h:1259
#define TRACE(s)
Definition: solgame.cpp:4
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
DWORD fdwProperty
Definition: imm.h:158
#define ImmLocalFree(lpData)
Definition: precomp.h:89
struct IMEDPI * pNext
Definition: ntuser.h:1253
DWORD dwFlags
Definition: ntuser.h:1260
#define NULL
Definition: types.h:112
VOID APIENTRY Imm32FreeIME(PIMEDPI pImeDpi, BOOL bDestroy)
Definition: ime.c:36
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1300
#define IME_PROP_END_UNLOAD
Definition: imm.h:213
#define IMEDPI_FLAG_LOCKED
Definition: ntuser.h:1301

Referenced by CtfImmGetGuidAtom(), CtfImmIsGuidMapEnable(), Imm32CreateInputContext(), Imm32DestroyInputContext(), Imm32MakeIMENotify(), Imm32ProcessHotKey(), Imm32SelectInputContext(), ImmActivateLayout(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetImeMenuItemsAW(), ImmGetProperty(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmNotifyIME(), ImmProcessKey(), ImmRegisterWordA(), ImmRegisterWordW(), ImmSetActiveContext(), ImmSetCompositionStringAW(), ImmTranslateMessage(), ImmUnregisterWordA(), ImmUnregisterWordW(), and User32CreateImeUIWindow().

◆ ImmWINNLSEnableIME()

BOOL WINAPI ImmWINNLSEnableIME ( HWND  hWnd,
BOOL  enable 
)

Definition at line 2007 of file ime.c.

2008 {
2009  HIMC hIMC;
2010  PCLIENTIMC pClientImc;
2011  HWND hImeWnd;
2012  BOOL bImeWnd, ret;
2013 
2014  TRACE("(%p, %d)\n", hWnd, enable);
2015 
2017  {
2019  return FALSE;
2020  }
2021 
2023  if (!hIMC)
2024  return FALSE;
2025 
2026  pClientImc = ImmLockClientImc(hIMC);
2027  if (!pClientImc)
2028  return FALSE;
2029 
2030  ret = !(pClientImc->dwFlags & CLIENTIMC_DISABLEIME);
2031  if (!!enable == ret)
2032  {
2033  ImmUnlockClientImc(pClientImc);
2034  return ret;
2035  }
2036 
2037  if (!IsWindow(hWnd))
2038  hWnd = GetFocus();
2039 
2040  hImeWnd = ImmGetDefaultIMEWnd(hWnd);
2041  bImeWnd = IsWindow(hImeWnd);
2042  if (bImeWnd)
2043  ImmSetActiveContext(hWnd, (enable ? NULL : hIMC), FALSE);
2044 
2045  if (enable)
2046  pClientImc->dwFlags &= ~CLIENTIMC_DISABLEIME;
2047  else
2048  pClientImc->dwFlags |= CLIENTIMC_DISABLEIME;
2049 
2050  ImmUnlockClientImc(pClientImc);
2051 
2052  if (bImeWnd)
2053  ImmSetActiveContext(hWnd, (enable ? hIMC : NULL), TRUE);
2054 
2055  return ret;
2056 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:232
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
Definition: imm.c:1121
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
Definition: utils.c:45
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
#define CLIENTIMC_DISABLEIME
Definition: ntuser.h:1332
#define SetLastError(x)
Definition: compat.h:611
int ret
GLboolean enable
Definition: glext.h:11120
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:825
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1308
HWND WINAPI GetFocus(void)
Definition: window.c:1894
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946

Referenced by IntInitializeImmEntryTable(), User32InitializeImmEntryTable(), and WINNLSEnableIME().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( imm  )

Variable Documentation

◆ gcsImeDpi

◆ gpImeDpiList

PIMEDPI gpImeDpiList = NULL