ReactOS  0.4.15-dev-5112-g22d8c0f
ime.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS IMM32
3  * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE: Implementing IME manipulation of IMM32
5  * COPYRIGHT: Copyright 1998 Patrik Stridvall
6  * Copyright 2002, 2003, 2007 CodeWeavers, Aric Stewart
7  * Copyright 2017 James Tabor <james.tabor@reactos.org>
8  * Copyright 2018 Amine Khaldi <amine.khaldi@reactos.org>
9  * Copyright 2020-2022 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
10  */
11 
12 #include "precomp.h"
13 
15 
16 RTL_CRITICAL_SECTION gcsImeDpi; // Win: gcsImeDpi
17 PIMEDPI gpImeDpiList = NULL; // Win: gpImeDpi
18 
19 // Win: ImmGetImeDpi
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 }
34 
35 // Win: UnloadIME
37 {
38  if (pImeDpi->hInst == NULL)
39  return;
40  if (bDestroy)
41  pImeDpi->ImeDestroy(0);
42  FreeLibrary(pImeDpi->hInst);
43  pImeDpi->hInst = NULL;
44 }
45 
46 // Win: InquireIme
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 }
151 
152 /* Define stub IME functions */
153 #define DEFINE_IME_ENTRY(type, name, params, optional) \
154  type APIENTRY Stub##name params { \
155  FIXME("%s: Why stub called?\n", #name); \
156  return (type)0; \
157  }
158 #include "imetable.h"
159 #undef DEFINE_IME_ENTRY
160 
161 // Win: LoadIME
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 }
230 
231 // Win: LoadImeDpi
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 }
293 
294 // Win: FindOrLoadImeDpi
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 }
307 
308 static LRESULT APIENTRY
309 ImeDpi_Escape(PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL)
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 }
319 
320 // Win: ImmUnloadIME
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 }
367 
368 // We will transport the IME menu items by using a flat memory block via
369 // a file mapping object beyond the boundary of a process.
370 
371 #define MAX_IMEMENU_BITMAP_BYTES 0xF00
372 
373 typedef struct tagIMEMENUITEM
374 {
380 
381 typedef struct tagIMEMENU
382 {
389 } IMEMENU, *PIMEMENU;
390 
391 /***********************************************************************
392  * ImmPutImeMenuItemsIntoMappedFile (IMM32.@)
393  *
394  * Called from user32.dll to transport the IME menu items by using a
395  * file mapping object. This function is provided for WM_IME_SYSTEM:IMS_GETIMEMENU
396  * handling.
397  */
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 }
472 
473 // Win: ImmGetImeMenuItemsInterProcess
476  LPVOID lpImeMenu, DWORD dwSize)
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 }
556 
557 // Win: ImmGetImeMenuItemsWorker
559 ImmGetImeMenuItemsAW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu,
560  LPVOID lpImeMenu, DWORD dwSize, BOOL bTargetIsAnsi)
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 }
691 
692 /***********************************************************************
693  * ImmInstallIMEA (IMM32.@)
694  */
695 HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
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 }
717 
718 /***********************************************************************
719  * ImmInstallIMEW (IMM32.@)
720  */
721 HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
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 }
811 
812 /***********************************************************************
813  * ImmIsIME (IMM32.@)
814  */
816 {
817  IMEINFOEX info;
818  TRACE("(%p)\n", hKL);
820 }
821 
822 /***********************************************************************
823  * ImmGetDefaultIMEWnd (IMM32.@)
824  */
826 {
827  if (!IS_IMM_MODE())
828  return NULL;
829 
830  if (hWnd == NULL)
832 
834 }
835 
836 /***********************************************************************
837  * ImmNotifyIME (IMM32.@)
838  */
839 BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
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 }
859 
860 /***********************************************************************
861  * ImmDisableLegacyIME(IMM32.@)
862  */
864 {
865  FIXME("stub\n");
866  return TRUE;
867 }
868 
869 /***********************************************************************
870  * ImmGetImeInfoEx (IMM32.@)
871  */
872 BOOL WINAPI
873 ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
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 }
912 
913 /***********************************************************************
914  * ImmLockImeDpi (IMM32.@)
915  */
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 }
941 
942 /***********************************************************************
943  * ImmUnlockImeDpi (IMM32.@)
944  */
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 }
989 
990 /***********************************************************************
991  * ImmLoadIME (IMM32.@)
992  */
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 }
1005 
1006 /***********************************************************************
1007  * ImmDisableIME (IMM32.@)
1008  */
1010 {
1012 }
1013 
1014 /***********************************************************************
1015  * ImmGetDescriptionA (IMM32.@)
1016  */
1017 UINT WINAPI ImmGetDescriptionA(HKL hKL, LPSTR lpszDescription, UINT uBufLen)
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 }
1034 
1035 /***********************************************************************
1036  * ImmGetDescriptionW (IMM32.@)
1037  */
1038 UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
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 }
1054 
1055 /***********************************************************************
1056  * ImmGetIMEFileNameA (IMM32.@)
1057  */
1058 UINT WINAPI ImmGetIMEFileNameA( HKL hKL, LPSTR lpszFileName, UINT uBufLen)
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 }
1086 
1087 /***********************************************************************
1088  * ImmGetIMEFileNameW (IMM32.@)
1089  */
1090 UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
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 }
1116 
1117 /***********************************************************************
1118  * ImmGetProperty (IMM32.@)
1119  */
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 }
1163 
1164 /***********************************************************************
1165  * ImmEscapeA (IMM32.@)
1166  */
1167 LRESULT WINAPI ImmEscapeA(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
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 }
1250 
1251 /***********************************************************************
1252  * ImmEscapeW (IMM32.@)
1253  */
1254 LRESULT WINAPI ImmEscapeW(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
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 }
1327 
1328 /***********************************************************************
1329  * ImmGetOpenStatus (IMM32.@)
1330  */
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 }
1350 
1351 /***********************************************************************
1352  * ImmSetOpenStatus (IMM32.@)
1353  */
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 }
1389 
1390 /***********************************************************************
1391  * ImmGetStatusWindowPos (IMM32.@)
1392  */
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 }
1411 
1412 /***********************************************************************
1413  * ImmSetStatusWindowPos (IMM32.@)
1414  */
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 }
1439 
1440 /***********************************************************************
1441  * ImmGetCompositionWindow (IMM32.@)
1442  */
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 }
1463 
1464 /***********************************************************************
1465  * ImmSetCompositionWindow (IMM32.@)
1466  */
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 }
1490 
1491 /***********************************************************************
1492  * ImmGetCompositionFontA (IMM32.@)
1493  */
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 }
1526 
1527 /***********************************************************************
1528  * ImmGetCompositionFontW (IMM32.@)
1529  */
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 }
1563 
1564 /***********************************************************************
1565  * ImmSetCompositionFontA (IMM32.@)
1566  */
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 }
1620 
1621 /***********************************************************************
1622  * ImmSetCompositionFontW (IMM32.@)
1623  */
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 }
1678 
1679 /***********************************************************************
1680  * ImmGetConversionListA (IMM32.@)
1681  */
1682 DWORD WINAPI
1684  DWORD dwBufLen, UINT uFlag)
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 }
1733 
1734 /***********************************************************************
1735  * ImmGetConversionListW (IMM32.@)
1736  */
1737 DWORD WINAPI
1739  DWORD dwBufLen, UINT uFlag)
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 }
1788 
1789 /***********************************************************************
1790  * ImmGetConversionStatus (IMM32.@)
1791  */
1792 BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
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 }
1810 
1811 /***********************************************************************
1812  * ImmSetConversionStatus (IMM32.@)
1813  */
1814 BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
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 }
1869 
1870 /***********************************************************************
1871  * ImmConfigureIMEA (IMM32.@)
1872  */
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 }
1923 
1924 /***********************************************************************
1925  * ImmConfigureIMEW (IMM32.@)
1926  */
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 }
1977 
1978 /***********************************************************************
1979  * ImmGetImeMenuItemsA (IMM32.@)
1980  */
1981 DWORD WINAPI
1983  LPIMEMENUITEMINFOA lpImeParentMenu,
1984  LPIMEMENUITEMINFOA lpImeMenu, DWORD dwSize)
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 }
1990 
1991 /***********************************************************************
1992  * ImmGetImeMenuItemsW (IMM32.@)
1993  */
1994 DWORD WINAPI
1996  LPIMEMENUITEMINFOW lpImeParentMenu,
1997  LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize)
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 }
2003 
2004 /***********************************************************************
2005  * ImmWINNLSEnableIME (IMM32.@)
2006  */
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 APIENTRY CandidateListAnsiToWide(const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST pWideCL, DWORD dwBufLen, UINT uCodePage)
Definition: candidate.c:84
DWORD WINAPI ImmGetImeMenuItemsA(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOA lpImeParentMenu, LPIMEMENUITEMINFOA lpImeMenu, DWORD dwSize)
Definition: ime.c:1982
LOGFONTA A
Definition: immdev.h:63
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:945
UINT uCodePage
Definition: ntuser.h:1257
BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID)
Definition: ctf.c:67
HKL WINAPI ImmInstallIMEA(LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
Definition: ime.c:695
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT cchBuff)
Definition: utils.c:33
IMEINFO ImeInfo
Definition: ntuser.h:1256
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
ULONG Win32ClientInfo[31]
Definition: compat.h:706
BYTE abItem[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:378
#define IME_ESC_SEQUENCE_TO_INTERNAL
Definition: imm.h:563
#define CloseHandle
Definition: compat.h:598
DWORD dwUIFlags
Definition: immdev.h:126
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:232
#define VALID_SMODE_CAPS
#define VALID_IME_PROP
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx)
Definition: utils.c:763
UINT WINAPI ImmGetIMEFileNameA(HKL hKL, LPSTR lpszFileName, UINT uBufLen)
Definition: ime.c:1058
long y
Definition: polytest.cpp:48
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: ime.c:1567
#define MapViewOfFile
Definition: compat.h:604
#define TCI_SRCLOCALE
Definition: wingdi.h:964
#define WideCharToMultiByte
Definition: compat.h:111
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define IME_ESC_HANJA_MODE
Definition: imm.h:569
#define LOBYTE(W)
Definition: jmemdos.c:487
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
Definition: ime.c:1331
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
BOOL Imm32StoreBitmapToBytes(HBITMAP hbm, LPBYTE pbData, DWORD cbDataMax)
Definition: utils.c:109
long x
Definition: polytest.cpp:48
BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout)
Definition: utils.c:934
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
#define MAKEWORD(a, b)
Definition: typedefs.h:248
BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: ime.c:1494
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
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)
UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
Definition: ime.c:1038
#define IMC_SETCOMPOSITIONFONT
Definition: imm.h:281
#define IS_IMM_MODE()
Definition: ntuser.h:1204
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1015
#define CP_ACP
Definition: compat.h:109
HBITMAP hbmpChecked
Definition: imm.h:129
char CHAR
Definition: xmlstorage.h:175
#define IMN_SETCOMPOSITIONWINDOW
Definition: imm.h:531
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:355
#define IR_CHANGECONVERT
Definition: immdev.h:164
#define CFS_DEFAULT
Definition: imm.h:470
#define MB_PRECOMPOSED
Definition: winnls.h:281
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:873
#define MAX_IMEMENU_BITMAP_BYTES
Definition: ime.c:371
HWND hWnd
Definition: settings.c:17
#define HIBYTE(W)
Definition: jmemdos.c:486
HANDLE HWND
Definition: compat.h:19
UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
Definition: utils.c:865
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
BOOL WINAPI ImmLoadIME(HKL hKL)
Definition: ime.c:993
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define ZeroMemory
Definition: winbase.h:1667
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
#define IGP_UI
Definition: imm.h:448
LRESULT WINAPI ImmPutImeMenuItemsIntoMappedFile(HIMC hIMC)
Definition: ime.c:398
#define IMN_SETCOMPOSITIONFONT
Definition: imm.h:530
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:565
DWORD LCID
Definition: nls.h:13
DWORD fdwConversion
Definition: immdev.h:60
BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: ime.c:1530
#define INIT_STATUSWNDPOS
Definition: immdev.h:143
PIMEDPI APIENTRY Imm32LoadImeDpi(HKL hKL, BOOL bLock)
Definition: ime.c:232
char * LPSTR
Definition: xmlstorage.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define IGP_SELECT
Definition: imm.h:450
WINE_DEFAULT_DEBUG_CHANNEL(imm)
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1814
#define DWORD
Definition: nt_native.h:44
#define IME_ESC_IME_NAME
Definition: imm.h:567
HKL hKL
Definition: precomp.h:67
int32_t INT
Definition: typedefs.h:58
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:197
#define NI_CONTEXTUPDATED
Definition: imm.h:226
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
Definition: imm.c:1121
#define IME_SYSINFO_WINLOGON
Definition: imm.h:238
INT APIENTRY Imm32ImeMenuAnsiToWide(const IMEMENUITEMINFOA *pItemA, LPIMEMENUITEMINFOW pItemW, UINT uCodePage, BOOL bBitmap)
Definition: utils.c:440
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
Definition: utils.c:45
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4177
#define CLIENTIMC_WIDE
Definition: ntuser.h:1328
DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
Definition: ime.c:1120
PIMEDPI gpImeDpiList
Definition: ime.c:17
BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: ime.c:1624
DWORD APIENTRY CandidateListWideToAnsi(const CANDIDATELIST *pWideCL, LPCANDIDATELIST pAnsiCL, DWORD dwBufLen, UINT uCodePage)
Definition: candidate.c:14
#define L(x)
Definition: ntvdm.h:50
#define IMN_SETOPENSTATUS
Definition: imm.h:528
BOOL NTAPI NtUserDisableThreadIme(DWORD dwThreadID)
Definition: ime.c:859
union _tagINPUTCONTEXT::@2000 lfFont
HBITMAP Imm32LoadBitmapFromBytes(const BYTE *pb)
Definition: utils.c:59
#define LANG_JAPANESE
Definition: nls.h:76
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:564
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
HINSTANCE hInst
Definition: ntuser.h:1254
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:554
static LRESULT APIENTRY ImeDpi_Escape(PIMEDPI pImeDpi, HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL)
Definition: ime.c:309
DWORD fdwUICaps
Definition: imm.h:161
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1354
LPSTR lpWord
Definition: dimm.idl:31
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD dwVersion
Definition: ime.c:383
struct tagIMEMENUITEM * PIMEMENUITEM
LPSTR lpReading
Definition: dimm.idl:30
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 debugstr_w
Definition: kernel32.h:32
BYTE abChecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:376
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC)
Definition: utils.c:175
struct tagIMEMENUITEMINFOW IMEMENUITEMINFOW
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define WM_IME_REPORT
Definition: immdev.h:157
#define LoadLibraryW(x)
Definition: compat.h:606
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:572
POINT ptStatusWndPos
Definition: immdev.h:58
DWORD dwItemCount
Definition: ime.c:386
#define IMN_SETSENTENCEMODE
Definition: imm.h:527
BOOL WINAPI GetClassInfoW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSW)
BOOL WINAPI ImmConfigureIMEA(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
Definition: ime.c:1873
#define INIT_LOGFONT
Definition: immdev.h:146
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:156
UINT WINAPI GetACP(VOID)
Definition: nls.c:2218
DWORD cLockObj
Definition: ntuser.h:1259
BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: ime.c:1443
LONG_PTR LPARAM
Definition: windef.h:208
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:901
LPSTR lpReading
Definition: imm.h:38
#define C_ASSERT(e)
Definition: intsafe.h:73
#define FILE_MAP_READ
Definition: compat.h:635
const char * LPCSTR
Definition: xmlstorage.h:183
#define WM_IME_SYSTEM
Definition: undocuser.h:59
DWORD HIMC
Definition: dimm.idl:75
DWORD dwType
Definition: ime.c:385
LPWSTR lpWord
Definition: imm.h:44
#define QUERY_WINDOW_DEFAULT_IME
Definition: ntuser.h:2929
#define IME_PROP_UNICODE
Definition: imm.h:393
BOOL WINAPI ImmDisableLegacyIME(void)
Definition: ime.c:863
IMEMENUITEMINFOW Info
Definition: ime.c:375
DWORD fdwSelectCaps
Definition: imm.h:163
Definition: arc.h:79
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM * pItems
Definition: usp10.c:62
HKL APIENTRY Imm32AssignNewLayout(UINT cKLs, const REG_IME *pLayouts, WORD wLangID)
Definition: utils.c:819
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: ime.c:1090
DWORD WINAPI ImmGetConversionListW(HKL hKL, HIMC hIMC, LPCWSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
Definition: ime.c:1738
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: ime.c:839
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
IMEINFOEXCLASS
Definition: ntuser.h:1195
struct tagIMEMENUITEMINFOW * LPIMEMENUITEMINFOW
HKL WINAPI ImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
Definition: ime.c:721
DWORD WINAPI ImmGetImeMenuItemsW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize)
Definition: ime.c:1995
#define IMC_SETCONVERSIONMODE
Definition: imm.h:221
__wchar_t WCHAR
Definition: xmlstorage.h:180
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
#define debugstr_a
Definition: kernel32.h:31
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:603
BOOL NTAPI NtUserGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
Definition: ime.c:1015
DWORD fdwProperty
Definition: imm.h:158
LPWSTR lpReading
Definition: imm.h:43
#define _countof(array)
Definition: sndvol32.h:68
struct tagIMEMENU IMEMENU
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:916
#define FILE_MAP_WRITE
Definition: winbase.h:154
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define IS_CICERO_MODE()
Definition: ntuser.h:1205
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
unsigned short WORD
Definition: ntddk_ex.h:93
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: utils.c:266
#define CLIENTIMC_DISABLEIME
Definition: ntuser.h:1332
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IMC_SETSTATUSWINDOWPOS
Definition: imm.h:285
WCHAR wszUIClass[16]
Definition: ntuser.h:1180
DWORD fdwConversionCaps
Definition: imm.h:159
#define SetLastError(x)
Definition: compat.h:611
BOOL APIENTRY Imm32CopyImeFile(LPWSTR pszOldFile, LPCWSTR pszNewFile)
Definition: utils.c:1031
BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi)
Definition: ime.c:47
BYTE abUnchecked[MAX_IMEMENU_BITMAP_BYTES]
Definition: ime.c:377
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define MAX_IMM_FILENAME
Definition: precomp.h:54
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
#define ImmLocalFree(lpData)
Definition: precomp.h:89
LPSTR lpWord
Definition: imm.h:39
DWORD dwFlags
Definition: ime.c:384
BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: ime.c:1393
DWORD APIENTRY ImmGetImeMenuItemsAW(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize, BOOL bTargetIsAnsi)
Definition: ime.c:559
COMPOSITIONFORM cfCompForm
Definition: immdev.h:66
int ret
DWORD dwThreadId
Definition: fdebug.c:31
struct IMEDPI * pNext
Definition: ntuser.h:1253
WCHAR szUIClass[16]
Definition: ntuser.h:1258
DWORD dwPrivateDataSize
Definition: imm.h:157
IMEMENUITEMINFOW Parent
Definition: ime.c:387
#define IGP_SETCOMPSTR
Definition: imm.h:449
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:810
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
BOOL APIENTRY Imm32LoadIME(PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi)
Definition: ime.c:162
DWORD dwFlags
Definition: ntuser.h:1260
BOOL WINAPI ImmWINNLSEnableIME(HWND hWnd, BOOL enable)
Definition: ime.c:2007
DWORD fdwInit
Definition: immdev.h:74
UINT_PTR HKL
Definition: msctf.idl:101
HANDLE NTAPI OpenFileMappingW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
Definition: filemap.c:297
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileName)
Definition: utils.c:243
#define IMC_SETSENTENCEMODE
Definition: imm.h:222
BOOL WINAPI ImmConfigureIMEW(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
Definition: ime.c:1927
unsigned char BYTE
Definition: xxhash.c:193
LRESULT WINAPI ImmEscapeW(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
Definition: ime.c:1254
BOOL WINAPI ImmIsIME(HKL hKL)
Definition: ime.c:815
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: ime.c:1415
#define KLF_REPLACELANG
Definition: winuser.h:115
#define ERR(fmt,...)
Definition: debug.h:110
WCHAR wszImeFile[80]
Definition: ntuser.h:1187
Definition: compat.h:694
BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
Definition: ime.c:1792
DWORD fdwSCSCaps
Definition: imm.h:162
struct tagIMEMENU * PIMEMENU
#define IS_IME_HKL(hKL)
Definition: input.h:88
GLboolean enable
Definition: glext.h:11120
IMEINFO ImeInfo
Definition: ntuser.h:1179
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:825
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define IGP_CONVERSION
Definition: imm.h:446
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
BOOL APIENTRY Imm32ReleaseIME(HKL hKL)
Definition: ime.c:321
LPCWSTR szPath
Definition: env.c:37
LRESULT WINAPI ImmEscapeA(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
Definition: ime.c:1167
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMN_SETCONVERSIONMODE
Definition: imm.h:526
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define IGP_PROPERTY
Definition: imm.h:445
#define INIT_COMPFORM
Definition: immdev.h:147
#define IMC_SETOPENSTATUS
Definition: imm.h:223
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
INT fLoadFlag
Definition: ntuser.h:1183
BOOL WINAPI ImmDisableIME(DWORD dwThreadId)
Definition: ime.c:1009
DWORD fdwSentence
Definition: immdev.h:61
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
#define VALID_CMODE_CAPS
LPWSTR lpWord
Definition: dimm.idl:36
const WCHAR * word
Definition: lex.c:36
#define MultiByteToWideChar
Definition: compat.h:110
#define VALID_SCS_CAPS
#define IMS_GETIMEMENU
Definition: immdev.h:41
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
DWORD dwFlags
Definition: ntuser.h:1308
HWND WINAPI GetFocus(void)
Definition: window.c:1894
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1794
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:295
PIMEDPI APIENTRY Imm32FindImeDpi(HKL hKL)
Definition: ime.c:20
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMN_SETSTATUSWINDOWPOS
Definition: imm.h:532
VOID APIENTRY Imm32FreeIME(PIMEDPI pImeDpi, BOOL bDestroy)
Definition: ime.c:36
uint32_t * LPDWORD
Definition: typedefs.h:59
HBITMAP hbmpItem
Definition: imm.h:133
#define HIWORD(l)
Definition: typedefs.h:247
FxObject * pParent
Definition: fxdpcapi.cpp:86
#define IMEDPI_FLAG_UNKNOWN
Definition: ntuser.h:1300
#define IMC_SETCOMPOSITIONWINDOW
Definition: imm.h:283
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
DWORD dwImeWinVersion
Definition: ntuser.h:1185
DWORD fdwSentenceCaps
Definition: imm.h:160
#define IME_PROP_END_UNLOAD
Definition: imm.h:213
DWORD APIENTRY Imm32GetImeMenuItemWInterProcess(HIMC hIMC, DWORD dwFlags, DWORD dwType, LPVOID lpImeParentMenu, LPVOID lpImeMenu, DWORD dwSize)
Definition: ime.c:475
static BOOL Imm32IsCrossProcessAccess(HWND hWnd)
Definition: precomp.h:108
#define IMEDPI_FLAG_LOCKED
Definition: ntuser.h:1301
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: ime.c:1467
LONG_PTR LRESULT
Definition: windef.h:209
IN PCTCH IN DWORD cch
Definition: pager.h:36
#define IS_16BIT_MODE()
Definition: precomp.h:117
HBITMAP hbmpUnchecked
Definition: imm.h:130
#define VALID_UI_CAPS
#define UnmapViewOfFile
Definition: compat.h:605
IMEMENUITEM Items[ANYSIZE_ARRAY]
Definition: ime.c:388
struct tagIMEMENUITEM IMEMENUITEM
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1024
INT APIENTRY Imm32ImeMenuWideToAnsi(const IMEMENUITEMINFOW *pItemW, LPIMEMENUITEMINFOA pItemA, UINT uCodePage)
Definition: utils.c:467
#define LOWORD(l)
Definition: pedump.c:82
#define IGP_SENTENCE
Definition: imm.h:447
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define IGP_GETIMEVERSION
Definition: imm.h:444
int(* FARPROC)()
Definition: compat.h:36
LOGFONTW W
Definition: immdev.h:64
UINT WINAPI ImmGetDescriptionA(HKL hKL, LPSTR lpszDescription, UINT uBufLen)
Definition: ime.c:1017
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:186
#define APIENTRY
Definition: api.h:79
DWORD WINAPI ImmGetConversionListA(HKL hKL, HIMC hIMC, LPCSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
Definition: ime.c:1683
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
#define VALID_SELECT_CAPS
BOOL NTAPI NtUserSetImeInfoEx(PIMEINFOEX pImeInfoEx)
Definition: ime.c:1130
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define PRIMARYLANGID(l)
Definition: nls.h:16
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:946
struct tagIMEMENUITEMINFOA IMEMENUITEMINFOA
HKL hKL
Definition: ntuser.h:1255