ReactOS  0.4.15-dev-4853-g3a72a52
keymsg.c File Reference
#include "precomp.h"
Include dependency graph for keymsg.c:

Go to the source code of this file.

Classes

struct  IMM_UNKNOWN_PROCESS1
 

Macros

#define MSG_COUNT   0x100
 

Typedefs

typedef struct IMM_UNKNOWN_PROCESS1 IMM_UNKNOWN_PROCESS1
 
typedef struct IMM_UNKNOWN_PROCESS1PIMM_UNKNOWN_PROCESS1
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
BOOL APIENTRY Imm32ImeNonImeToggle (HIMC hIMC, HKL hKL, HWND hWnd, LANGID LangID)
 
BOOL APIENTRY Imm32CShapeToggle (HIMC hIMC, HKL hKL, HWND hWnd)
 
BOOL APIENTRY Imm32CSymbolToggle (HIMC hIMC, HKL hKL, HWND hWnd)
 
BOOL APIENTRY Imm32JCloseOpen (HIMC hIMC, HKL hKL, HWND hWnd)
 
BOOL APIENTRY Imm32KShapeToggle (HIMC hIMC)
 
BOOL APIENTRY Imm32KHanjaConvert (HIMC hIMC)
 
BOOL APIENTRY Imm32KEnglish (HIMC hIMC)
 
BOOL APIENTRY Imm32ProcessHotKey (HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID)
 
static BOOL APIENTRY ImmIsUIMessageAW (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
 
static DWORD WINAPI Imm32UnknownProcess1Proc (LPVOID arg)
 
LRESULT APIENTRY Imm32UnknownProcess1 (HWND hWnd, BOOL fFlag)
 
static BOOL CALLBACK Imm32SendChangeProc (HIMC hIMC, LPARAM lParam)
 
BOOL APIENTRY Imm32SendChange (BOOL bProcess)
 
VOID APIENTRY Imm32RequestError (DWORD dwError)
 
LRESULT APIENTRY Imm32ProcessRequest (HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bAnsiAPI)
 
LRESULT APIENTRY ImmRequestMessageAW (HIMC hIMC, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
 
BOOL WINAPI ImmIsUIMessageA (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmIsUIMessageW (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmGetHotKey (IN DWORD dwHotKey, OUT LPUINT lpuModifiers, OUT LPUINT lpuVKey, OUT LPHKL lphKL)
 
UINT WINAPI ImmWINNLSGetIMEHotkey (HWND hwndIme)
 
BOOL WINAPI ImmSimulateHotKey (HWND hWnd, DWORD dwHotKeyID)
 
UINT WINAPI ImmGetVirtualKey (HWND hWnd)
 
DWORD WINAPI ImmProcessKey (HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID)
 
LRESULT WINAPI ImmSystemHandler (HIMC hIMC, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmGenerateMessage (HIMC hIMC)
 
VOID APIENTRY Imm32PostMessages (HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg)
 
BOOL WINAPI ImmTranslateMessage (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyData)
 
LRESULT WINAPI ImmRequestMessageA (HIMC hIMC, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ImmRequestMessageW (HIMC hIMC, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ImmSendMessageToActiveDefImeWndW (UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Macro Definition Documentation

◆ MSG_COUNT

#define MSG_COUNT   0x100

Typedef Documentation

◆ IMM_UNKNOWN_PROCESS1

◆ PIMM_UNKNOWN_PROCESS1

Function Documentation

◆ Imm32CShapeToggle()

BOOL APIENTRY Imm32CShapeToggle ( HIMC  hIMC,
HKL  hKL,
HWND  hWnd 
)

Definition at line 47 of file keymsg.c.

48 {
49  LPINPUTCONTEXT pIC;
50  BOOL fOpen;
51  DWORD dwConversion, dwSentence;
52 
53  if (hWnd == NULL || !IS_IME_HKL(hKL))
54  return FALSE;
55 
56  pIC = ImmLockIMC(hIMC);
57  if (pIC == NULL)
58  return TRUE;
59 
60  fOpen = pIC->fOpen;
61  if (fOpen)
62  {
63  dwConversion = (pIC->fdwConversion ^ IME_CMODE_FULLSHAPE);
64  dwSentence = pIC->fdwSentence;
65  }
66 
67  ImmUnlockIMC(hIMC);
68 
69  if (fOpen)
70  ImmSetConversionStatus(hIMC, dwConversion, dwSentence);
71  else
72  ImmSetOpenStatus(hIMC, TRUE);
73 
74  return TRUE;
75 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define IS_IME_HKL(hkl)
Definition: ntuser.h:1203
#define IME_CMODE_FULLSHAPE
Definition: imm.h:493
unsigned long DWORD
Definition: ntddk_ex.h:95
#define NULL
Definition: types.h:112
DWORD fdwSentence
Definition: immdev.h:44
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32ProcessHotKey().

◆ Imm32CSymbolToggle()

BOOL APIENTRY Imm32CSymbolToggle ( HIMC  hIMC,
HKL  hKL,
HWND  hWnd 
)

Definition at line 77 of file keymsg.c.

78 {
79  LPINPUTCONTEXT pIC;
80  BOOL fOpen;
81  DWORD dwConversion, dwSentence;
82 
83  if (hWnd == NULL || !IS_IME_HKL(hKL))
84  return FALSE;
85 
86  pIC = ImmLockIMC(hIMC);
87  if (pIC == NULL)
88  return TRUE;
89 
90  fOpen = pIC->fOpen;
91  if (fOpen)
92  {
93  dwConversion = (pIC->fdwConversion ^ IME_CMODE_SYMBOL);
94  dwSentence = pIC->fdwSentence;
95  }
96 
97  ImmUnlockIMC(hIMC);
98 
99  if (fOpen)
100  ImmSetConversionStatus(hIMC, dwConversion, dwSentence);
101  else
102  ImmSetOpenStatus(hIMC, TRUE);
103 
104  return TRUE;
105 }
#define IME_CMODE_SYMBOL
Definition: imm.h:500
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define IS_IME_HKL(hkl)
Definition: ntuser.h:1203
unsigned long DWORD
Definition: ntddk_ex.h:95
#define NULL
Definition: types.h:112
DWORD fdwSentence
Definition: immdev.h:44
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32ProcessHotKey().

◆ Imm32ImeNonImeToggle()

BOOL APIENTRY Imm32ImeNonImeToggle ( HIMC  hIMC,
HKL  hKL,
HWND  hWnd,
LANGID  LangID 
)

Definition at line 16 of file keymsg.c.

17 {
18  LPINPUTCONTEXT pIC;
19  BOOL fOpen;
20 
21  if (hWnd != NULL)
22  return FALSE;
23 
24  if (!IS_IME_HKL(hKL) || LOWORD(hKL) != LangID)
25  {
26  FIXME("We have to do something here\n");
27  return TRUE;
28  }
29 
30  pIC = ImmLockIMC(hIMC);
31  if (pIC == NULL)
32  return TRUE;
33 
34  fOpen = pIC->fOpen;
35  ImmUnlockIMC(hIMC);
36 
37  if (!fOpen)
38  {
39  ImmSetOpenStatus(hIMC, TRUE);
40  return TRUE;
41  }
42 
43  FIXME("We have to do something here\n");
44  return TRUE;
45 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define FIXME(fmt,...)
Definition: debug.h:111
#define IS_IME_HKL(hkl)
Definition: ntuser.h:1203
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1075
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032
#define LOWORD(l)
Definition: pedump.c:82

Referenced by Imm32ProcessHotKey().

◆ Imm32JCloseOpen()

BOOL APIENTRY Imm32JCloseOpen ( HIMC  hIMC,
HKL  hKL,
HWND  hWnd 
)

Definition at line 107 of file keymsg.c.

108 {
109  BOOL fOpen;
110 
111  if (ImmIsIME(hKL) && LOWORD(hKL) == LANGID_JAPANESE)
112  {
113  fOpen = ImmGetOpenStatus(hIMC);
114  ImmSetOpenStatus(hIMC, !fOpen);
115  return TRUE;
116  }
117 
118  FIXME("We have to do something here\n");
119  return TRUE;
120 }
#define LANGID_JAPANESE
Definition: precomp.h:58
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
Definition: ime.c:1144
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL WINAPI ImmIsIME(HKL hKL)
Definition: ime.c:628
#define LOWORD(l)
Definition: pedump.c:82

Referenced by Imm32ProcessHotKey().

◆ Imm32KEnglish()

BOOL APIENTRY Imm32KEnglish ( HIMC  hIMC)

Definition at line 161 of file keymsg.c.

162 {
163  LPINPUTCONTEXT pIC;
164  DWORD dwConversion, dwSentence;
165  BOOL fOpen;
166 
167  pIC = ImmLockIMC(hIMC);
168  if (pIC == NULL)
169  return FALSE;
170 
171  dwConversion = (pIC->fdwConversion ^ IME_CMODE_NATIVE);
172  dwSentence = pIC->fdwSentence;
173  ImmSetConversionStatus(hIMC, dwConversion, dwSentence);
174 
175  fOpen = ((pIC->fdwConversion & (IME_CMODE_FULLSHAPE | IME_CMODE_NATIVE)) != 0);
176  ImmSetOpenStatus(hIMC, fOpen);
177 
178  ImmUnlockIMC(hIMC);
179  return TRUE;
180 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define FALSE
Definition: types.h:117
#define IME_CMODE_NATIVE
Definition: imm.h:485
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define IME_CMODE_FULLSHAPE
Definition: imm.h:493
unsigned long DWORD
Definition: ntddk_ex.h:95
#define NULL
Definition: types.h:112
DWORD fdwSentence
Definition: immdev.h:44
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32ProcessHotKey().

◆ Imm32KHanjaConvert()

BOOL APIENTRY Imm32KHanjaConvert ( HIMC  hIMC)

Definition at line 144 of file keymsg.c.

145 {
146  LPINPUTCONTEXT pIC;
147  DWORD dwConversion, dwSentence;
148 
149  pIC = ImmLockIMC(hIMC);
150  if (!pIC)
151  return FALSE;
152 
153  dwConversion = (pIC->fdwConversion ^ IME_CMODE_HANJACONVERT);
154  dwSentence = pIC->fdwSentence;
155  ImmUnlockIMC(hIMC);
156 
157  ImmSetConversionStatus(hIMC, dwConversion, dwSentence);
158  return TRUE;
159 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IME_CMODE_HANJACONVERT
Definition: imm.h:496
DWORD fdwSentence
Definition: immdev.h:44
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32ProcessHotKey().

◆ Imm32KShapeToggle()

BOOL APIENTRY Imm32KShapeToggle ( HIMC  hIMC)

Definition at line 122 of file keymsg.c.

123 {
124  LPINPUTCONTEXT pIC;
125  DWORD dwConversion, dwSentence;
126 
127  pIC = ImmLockIMC(hIMC);
128  if (pIC == NULL)
129  return FALSE;
130 
131  dwConversion = (pIC->fdwConversion ^ IME_CMODE_FULLSHAPE);
132  dwSentence = pIC->fdwSentence;
133  ImmSetConversionStatus(hIMC, dwConversion, dwSentence);
134 
136  ImmSetOpenStatus(hIMC, TRUE);
137  else
138  ImmSetOpenStatus(hIMC, FALSE);
139 
140  ImmUnlockIMC(hIMC);
141  return TRUE;
142 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define FALSE
Definition: types.h:117
#define IME_CMODE_NATIVE
Definition: imm.h:485
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
#define IME_CMODE_FULLSHAPE
Definition: imm.h:493
unsigned long DWORD
Definition: ntddk_ex.h:95
#define NULL
Definition: types.h:112
DWORD fdwSentence
Definition: immdev.h:44
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32ProcessHotKey().

◆ Imm32PostMessages()

VOID APIENTRY Imm32PostMessages ( HWND  hwnd,
HIMC  hIMC,
DWORD  dwCount,
LPTRANSMSG  lpTransMsg 
)

Definition at line 857 of file keymsg.c.

858 {
859  DWORD dwIndex;
860  PCLIENTIMC pClientImc;
861  LPTRANSMSG pNewTransMsg = lpTransMsg, pItem;
862  BOOL bAnsi;
863 
864  pClientImc = ImmLockClientImc(hIMC);
865  if (pClientImc == NULL)
866  return;
867 
868  bAnsi = !(pClientImc->dwFlags & CLIENTIMC_WIDE);
869  ImmUnlockClientImc(pClientImc);
870 
871 #ifdef IMM_WIN3_SUPPORT
872  if (GetWin32ClientInfo()->dwExpWinVer < _WIN32_WINNT_NT4) /* old version (3.x)? */
873  {
875  WORD Lang = PRIMARYLANGID(LangID);
876 
877  /* translate the messages if Japanese or Korean */
878  if (Lang == LANG_JAPANESE ||
879  (Lang == LANG_KOREAN && NtUserGetAppImeLevel(hwnd) == 3))
880  {
881  DWORD cbTransMsg = dwCount * sizeof(TRANSMSG);
882  pNewTransMsg = ImmLocalAlloc(0, cbTransMsg);
883  if (pNewTransMsg)
884  {
885  RtlCopyMemory(pNewTransMsg, lpTransMsg, cbTransMsg);
886  dwCount = ImmNt3Trans(dwCount, pNewTransMsg, hIMC, bAnsi, Lang);
887  }
888  else
889  {
890  pNewTransMsg = lpTransMsg;
891  }
892  }
893  }
894 #endif
895 
896  /* post them */
897  pItem = pNewTransMsg;
898  for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem)
899  {
900  if (bAnsi)
901  PostMessageA(hwnd, pItem->message, pItem->wParam, pItem->lParam);
902  else
903  PostMessageW(hwnd, pItem->message, pItem->wParam, pItem->lParam);
904  }
905 
906 #ifdef IMM_WIN3_SUPPORT
907  if (pNewTransMsg != lpTransMsg)
908  ImmLocalFree(pNewTransMsg);
909 #endif
910 }
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
WORD LANGID
Definition: typedefs.h:81
#define GetWin32ClientInfo()
Definition: ntuser.h:335
#define CLIENTIMC_WIDE
Definition: ntuser.h:1325
#define LANG_JAPANESE
Definition: nls.h:76
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _WIN32_WINNT_NT4
Definition: sdkddkver.h:20
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:909
DWORD NTAPI NtUserGetAppImeLevel(HWND hWnd)
Definition: ime.c:927
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _tagTRANSMSG TRANSMSG
#define ImmLocalFree(lpData)
Definition: precomp.h:89
#define LANGIDFROMLCID(l)
Definition: nls.h:18
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1305
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define LANG_KOREAN
Definition: nls.h:84
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1075
#define PRIMARYLANGID(l)
Definition: nls.h:16
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:954

Referenced by ImmTranslateMessage().

◆ Imm32ProcessHotKey()

BOOL APIENTRY Imm32ProcessHotKey ( HWND  hWnd,
HIMC  hIMC,
HKL  hKL,
DWORD  dwHotKeyID 
)

Definition at line 183 of file keymsg.c.

184 {
185  PIMEDPI pImeDpi;
186  BOOL ret;
187 
188  if (hIMC && Imm32IsCrossThreadAccess(hIMC))
189  return FALSE;
190 
191  switch (dwHotKeyID)
192  {
195 
197  return Imm32CShapeToggle(hIMC, hKL, hWnd);
198 
200  return Imm32CSymbolToggle(hIMC, hKL, hWnd);
201 
203  return Imm32JCloseOpen(hIMC, hKL, hWnd);
204 
206  return Imm32KShapeToggle(hIMC);
207 
209  return Imm32KHanjaConvert(hIMC);
210 
211  case IME_KHOTKEY_ENGLISH:
212  return Imm32KEnglish(hIMC);
213 
216 
218  return Imm32CShapeToggle(hIMC, hKL, hWnd);
219 
221  return Imm32CSymbolToggle(hIMC, hKL, hWnd);
222 
223  default:
224  break;
225  }
226 
227  if (dwHotKeyID < IME_HOTKEY_PRIVATE_FIRST || IME_HOTKEY_PRIVATE_LAST < dwHotKeyID)
228  return FALSE;
229 
230  pImeDpi = ImmLockImeDpi(hKL);
231  if (pImeDpi == NULL)
232  return FALSE;
233 
234  ret = (BOOL)pImeDpi->ImeEscape(hIMC, IME_ESC_PRIVATE_HOTKEY, &dwHotKeyID);
235  ImmUnlockImeDpi(pImeDpi);
236  return ret;
237 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
#define IME_CHOTKEY_IME_NONIME_TOGGLE
Definition: imm.h:331
#define LANGID_CHINESE_SIMPLIFIED
Definition: precomp.h:56
#define IME_THOTKEY_SHAPE_TOGGLE
Definition: imm.h:344
#define IME_JHOTKEY_CLOSE_OPEN
Definition: imm.h:336
#define IME_KHOTKEY_SHAPE_TOGGLE
Definition: imm.h:339
BOOL APIENTRY Imm32KEnglish(HIMC hIMC)
Definition: keymsg.c:161
#define LANGID_CHINESE_TRADITIONAL
Definition: precomp.h:57
HWND hWnd
Definition: settings.c:17
BOOL APIENTRY Imm32CShapeToggle(HIMC hIMC, HKL hKL, HWND hWnd)
Definition: keymsg.c:47
BOOL APIENTRY Imm32ImeNonImeToggle(HIMC hIMC, HKL hKL, HWND hWnd, LANGID LangID)
Definition: keymsg.c:16
BOOL APIENTRY Imm32JCloseOpen(HIMC hIMC, HKL hKL, HWND hWnd)
Definition: keymsg.c:107
BOOL APIENTRY Imm32KShapeToggle(HIMC hIMC)
Definition: keymsg.c:122
#define BOOL
Definition: nt_native.h:43
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL APIENTRY Imm32CSymbolToggle(HIMC hIMC, HKL hKL, HWND hWnd)
Definition: keymsg.c:77
#define IME_ESC_PRIVATE_HOTKEY
Definition: imm.h:571
#define IME_KHOTKEY_HANJACONVERT
Definition: imm.h:340
#define IME_THOTKEY_IME_NONIME_TOGGLE
Definition: imm.h:343
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:729
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
#define IME_HOTKEY_PRIVATE_FIRST
Definition: imm.h:352
#define IME_CHOTKEY_SHAPE_TOGGLE
Definition: imm.h:332
int ret
#define IME_HOTKEY_PRIVATE_LAST
Definition: imm.h:357
#define IME_CHOTKEY_SYMBOL_TOGGLE
Definition: imm.h:333
#define IME_THOTKEY_SYMBOL_TOGGLE
Definition: imm.h:345
#define NULL
Definition: types.h:112
#define IME_KHOTKEY_ENGLISH
Definition: imm.h:341
BOOL APIENTRY Imm32KHanjaConvert(HIMC hIMC)
Definition: keymsg.c:144

Referenced by ImmProcessKey(), and ImmSimulateHotKey().

◆ Imm32ProcessRequest()

LRESULT APIENTRY Imm32ProcessRequest ( HIMC  hIMC,
PWND  pWnd,
DWORD  dwCommand,
LPVOID  pData,
BOOL  bAnsiAPI 
)

Definition at line 360 of file keymsg.c.

361 {
362  HWND hWnd;
363  DWORD ret = 0, dwCharPos, cchCompStr;
364  LPVOID pCS, pTempData = pData;
365  LPRECONVERTSTRING pRS;
366  LPIMECHARPOSITION pICP;
367  PCLIENTIMC pClientImc;
368  UINT uCodePage = CP_ACP;
369  BOOL bAnsiWnd = !!(pWnd->state & WNDS_ANSIWINDOWPROC);
370  static const size_t acbData[7 * 2] =
371  {
372  /* UNICODE */
373  sizeof(COMPOSITIONFORM), sizeof(CANDIDATEFORM), sizeof(LOGFONTW),
374  sizeof(RECONVERTSTRING), sizeof(RECONVERTSTRING),
375  sizeof(IMECHARPOSITION), sizeof(RECONVERTSTRING),
376  /* ANSI */
377  sizeof(COMPOSITIONFORM), sizeof(CANDIDATEFORM), sizeof(LOGFONTA),
378  sizeof(RECONVERTSTRING), sizeof(RECONVERTSTRING),
379  sizeof(IMECHARPOSITION), sizeof(RECONVERTSTRING),
380  };
381 
382  if (dwCommand == 0 || dwCommand > IMR_DOCUMENTFEED)
383  return 0; /* Out of range */
384 
385  if (pData && IsBadWritePtr(pData, acbData[bAnsiAPI * 7 + dwCommand - 1]))
386  return 0; /* Invalid pointer */
387 
388  /* Sanity check */
389  switch (dwCommand)
390  {
392  pRS = pData;
393  if (pRS && (pRS->dwVersion != 0 || pRS->dwSize < sizeof(RECONVERTSTRING)))
394  {
396  return 0;
397  }
398  break;
399 
401  pRS = pData;
402  if (!pRS || pRS->dwVersion != 0)
403  {
405  return 0;
406  }
407  break;
408 
409  default:
410  if (!pData)
411  {
413  return 0;
414  }
415  break;
416  }
417 
418  pClientImc = ImmLockClientImc(hIMC);
419  if (pClientImc)
420  {
421  uCodePage = pClientImc->uCodePage;
422  ImmUnlockClientImc(pClientImc);
423  }
424 
425  /* Prepare */
426  switch (dwCommand)
427  {
428  case IMR_COMPOSITIONFONT:
429  if (bAnsiAPI == bAnsiWnd)
430  goto DoIt;
431  if (bAnsiWnd)
432  pTempData = ImmLocalAlloc(0, sizeof(LOGFONTA));
433  else
434  pTempData = ImmLocalAlloc(0, sizeof(LOGFONTW));
435  if (!pTempData)
436  return 0;
437  break;
438 
440  if (bAnsiAPI == bAnsiWnd || !pData)
441  goto DoIt;
442 
443  if (bAnsiWnd)
444  ret = Imm32ReconvertAnsiFromWide(NULL, pData, uCodePage);
445  else
446  ret = Imm32ReconvertWideFromAnsi(NULL, pData, uCodePage);
447 
448  pTempData = ImmLocalAlloc(0, ret + sizeof(WCHAR));
449  if (!pTempData)
450  return 0;
451 
452  pRS = pTempData;
453  pRS->dwSize = ret;
454  pRS->dwVersion = 0;
455 
456  if (dwCommand == IMR_CONFIRMRECONVERTSTRING)
457  {
458  if (bAnsiWnd)
459  ret = Imm32ReconvertAnsiFromWide(pTempData, pData, uCodePage);
460  else
461  ret = Imm32ReconvertWideFromAnsi(pTempData, pData, uCodePage);
462  }
463  break;
464 
466  if (bAnsiAPI == bAnsiWnd)
467  goto DoIt;
468 
469  pICP = pData;
470  dwCharPos = pICP->dwCharPos;
471 
472  if (bAnsiAPI)
473  {
474  cchCompStr = ImmGetCompositionStringA(hIMC, GCS_COMPSTR, NULL, 0);
475  if (!cchCompStr)
476  return 0;
477 
478  pCS = ImmLocalAlloc(0, (cchCompStr + 1) * sizeof(CHAR));
479  if (!pCS)
480  return 0;
481 
482  ImmGetCompositionStringA(hIMC, GCS_COMPSTR, pCS, cchCompStr);
483  pICP->dwCharPos = IchWideFromAnsi(pICP->dwCharPos, pCS, uCodePage);
484  }
485  else
486  {
487  cchCompStr = ImmGetCompositionStringW(hIMC, GCS_COMPSTR, NULL, 0);
488  if (!cchCompStr)
489  return 0;
490 
491  pCS = ImmLocalAlloc(0, (cchCompStr + 1) * sizeof(WCHAR));
492  if (!pCS)
493  return 0;
494 
495  ImmGetCompositionStringW(hIMC, GCS_COMPSTR, pCS, cchCompStr);
496  pICP->dwCharPos = IchAnsiFromWide(pICP->dwCharPos, pCS, uCodePage);
497  }
498 
499  ImmLocalFree(pCS);
500  break;
501 
502  default:
503  break;
504  }
505 
506 DoIt:
507  /* The main task */
508  hWnd = pWnd->head.h;
509  if (bAnsiWnd)
510  ret = SendMessageA(hWnd, WM_IME_REQUEST, dwCommand, (LPARAM)pTempData);
511  else
512  ret = SendMessageW(hWnd, WM_IME_REQUEST, dwCommand, (LPARAM)pTempData);
513 
514  if (bAnsiAPI == bAnsiWnd)
515  goto Quit;
516 
517  /* Get back to caller */
518  switch (dwCommand)
519  {
520  case IMR_COMPOSITIONFONT:
521  if (bAnsiAPI)
522  LogFontWideToAnsi(pTempData, pData);
523  else
524  LogFontAnsiToWide(pTempData, pData);
525  break;
526 
528  if (!ret)
529  break;
530 
531  if (ret < sizeof(RECONVERTSTRING))
532  {
533  ret = 0;
534  break;
535  }
536 
537  if (pTempData)
538  {
539  if (bAnsiWnd)
540  ret = Imm32ReconvertWideFromAnsi(pData, pTempData, uCodePage);
541  else
542  ret = Imm32ReconvertAnsiFromWide(pData, pTempData, uCodePage);
543  }
544  break;
545 
547  pICP->dwCharPos = dwCharPos;
548  break;
549 
550  default:
551  break;
552  }
553 
554 Quit:
555  if (pTempData != pData)
556  ImmLocalFree(pTempData);
557  return ret;
558 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:850
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
Definition: except.c:881
DWORD APIENTRY Imm32ReconvertAnsiFromWide(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, UINT uCodePage)
Definition: utils.c:504
DWORD dwSize
Definition: imm.h:97
struct tagRECONVERTSTRING RECONVERTSTRING
VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
Definition: utils.c:132
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CP_ACP
Definition: compat.h:109
char CHAR
Definition: xmlstorage.h:175
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
HWND hWnd
Definition: settings.c:17
DWORD dwVersion
Definition: imm.h:98
DWORD APIENTRY Imm32ReconvertWideFromAnsi(LPRECONVERTSTRING pDest, const RECONVERTSTRING *pSrc, UINT uCodePage)
Definition: utils.c:448
#define IMR_COMPOSITIONFONT
Definition: imm.h:540
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IMR_QUERYCHARPOSITION
Definition: imm.h:543
THRDESKHEAD head
Definition: ntuser.h:674
LONG_PTR LPARAM
Definition: windef.h:208
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:909
#define IMR_RECONVERTSTRING
Definition: imm.h:541
#define WM_IME_REQUEST
Definition: winuser.h:1823
UINT uCodePage
Definition: ntuser.h:1308
#define IMR_CONFIRMRECONVERTSTRING
Definition: imm.h:542
struct _tagCOMPOSITIONFORM COMPOSITIONFORM
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:892
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct tagLOGFONTW LOGFONTW
VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: utils.c:145
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwCharPos
Definition: imm.h:141
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
LONG APIENTRY IchWideFromAnsi(LONG cchAnsi, LPCSTR pchAnsi, UINT uCodePage)
Definition: utils.c:89
struct tagCANDIDATEFORM CANDIDATEFORM
LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage)
Definition: utils.c:109
#define IMR_DOCUMENTFEED
Definition: imm.h:544
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WNDS_ANSIWINDOWPROC
Definition: ntuser.h:607
DWORD state
Definition: ntuser.h:680
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
VOID APIENTRY Imm32RequestError(DWORD dwError)
Definition: keymsg.c:353
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
struct tagIMECHARPOSITION IMECHARPOSITION
#define GCS_COMPSTR
Definition: imm.h:367
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:954

Referenced by ImmRequestMessageAW().

◆ Imm32RequestError()

VOID APIENTRY Imm32RequestError ( DWORD  dwError)

Definition at line 353 of file keymsg.c.

354 {
355  FIXME("()\n");
356  SetLastError(dwError);
357 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define SetLastError(x)
Definition: compat.h:611

Referenced by Imm32ProcessRequest().

◆ Imm32SendChange()

BOOL APIENTRY Imm32SendChange ( BOOL  bProcess)

Definition at line 348 of file keymsg.c.

349 {
350  return ImmEnumInputContext((bProcess ? -1 : 0), Imm32SendChangeProc, 0);
351 }
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1101
static BOOL CALLBACK Imm32SendChangeProc(HIMC hIMC, LPARAM lParam)
Definition: keymsg.c:321

Referenced by ImmSystemHandler().

◆ Imm32SendChangeProc()

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

Definition at line 321 of file keymsg.c.

322 {
323  HWND hWnd;
324  LPINPUTCONTEXTDX pIC;
325 
326  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
327  if (!pIC)
328  return TRUE;
329 
330  hWnd = pIC->hWnd;
331  if (!IsWindow(hWnd))
332  goto Quit;
333 
339  NtUserNotifyIMEStatus(hWnd, pIC->fOpen, pIC->fdwConversion);
342 Quit:
343  pIC->dwChange = 0;
344  ImmUnlockIMC(hIMC); // ??? Windows doesn't unlock here
345  return TRUE;
346 }
#define WM_IME_NOTIFY
Definition: winuser.h:1817
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:809
#define INPUTCONTEXTDX_CHANGE_OPEN
Definition: immdev.h:134
DWORD dwChange
Definition: immdev.h:112
#define IMN_SETOPENSTATUS
Definition: imm.h:528
#define IMN_SETSENTENCEMODE
Definition: imm.h:527
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define INPUTCONTEXTDX_CHANGE_SENTENCE
Definition: immdev.h:136
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMN_SETCONVERSIONMODE
Definition: imm.h:526
#define INPUTCONTEXTDX_CHANGE_CONVERSION
Definition: immdev.h:135
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by Imm32SendChange().

◆ Imm32UnknownProcess1()

LRESULT APIENTRY Imm32UnknownProcess1 ( HWND  hWnd,
BOOL  fFlag 
)

Definition at line 289 of file keymsg.c.

290 {
291  HANDLE hThread;
292  PWND pWnd = NULL;
293  PIMM_UNKNOWN_PROCESS1 pUnknown1;
294  DWORD_PTR lResult = 0;
295 
296  if (hWnd && gpsi)
297  pWnd = ValidateHwndNoErr(hWnd);
298 
299  if (!pWnd)
300  return 0;
301 
303  {
304  SendMessageTimeoutW(hWnd, 0x505, 0, fFlag, 3, 5000, &lResult);
305  return lResult;
306  }
307 
308  pUnknown1 = ImmLocalAlloc(0, sizeof(IMM_UNKNOWN_PROCESS1));
309  if (!pUnknown1)
310  return 0;
311 
312  pUnknown1->hWnd = hWnd;
313  pUnknown1->fFlag = fFlag;
314 
315  hThread = CreateThread(NULL, 0, Imm32UnknownProcess1Proc, pUnknown1, 0, NULL);
316  if (hThread)
318  return 0;
319 }
#define CloseHandle
Definition: compat.h:598
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
PSERVERINFO gpsi
Definition: imm.c:17
HWND hWnd
Definition: settings.c:17
static DWORD WINAPI Imm32UnknownProcess1Proc(LPVOID arg)
Definition: keymsg.c:270
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:84
#define WNDS2_WMCREATEMSGPROCESSED
Definition: ntuser.h:653
uint32_t DWORD_PTR
Definition: typedefs.h:65
Definition: ntuser.h:672
#define NULL
Definition: types.h:112
HANDLE hThread
Definition: wizard.c:28
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
DWORD state2
Definition: ntuser.h:681

Referenced by ImmSystemHandler().

◆ Imm32UnknownProcess1Proc()

static DWORD WINAPI Imm32UnknownProcess1Proc ( LPVOID  arg)
static

Definition at line 270 of file keymsg.c.

271 {
272  HWND hwndDefIME;
273  UINT uValue;
274  DWORD_PTR lResult;
276 
277  Sleep(3000);
278  hwndDefIME = ImmGetDefaultIMEWnd(pUnknown->hWnd);
279  if (hwndDefIME)
280  {
281  uValue = (pUnknown->fFlag ? 0x23 : 0x24);
282  SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, uValue, (LPARAM)pUnknown->hWnd,
283  SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &lResult);
284  }
286  return FALSE;
287 }
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
void * arg
Definition: msvc.h:10
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1213
#define FALSE
Definition: types.h:117
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_IME_SYSTEM
Definition: undocuser.h:59
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
#define ImmLocalFree(lpData)
Definition: precomp.h:89
uint32_t DWORD_PTR
Definition: typedefs.h:65
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:638
unsigned int UINT
Definition: ndis.h:50
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
#define SMTO_BLOCK
Definition: winuser.h:1214

Referenced by Imm32UnknownProcess1().

◆ ImmGenerateMessage()

BOOL WINAPI ImmGenerateMessage ( HIMC  hIMC)

Definition at line 779 of file keymsg.c.

780 {
781  PCLIENTIMC pClientImc;
782  LPINPUTCONTEXT pIC;
783  LPTRANSMSG pMsgs, pTrans = NULL, pItem;
784  HWND hWnd;
785  DWORD dwIndex, dwCount, cbTrans;
786  HIMCC hMsgBuf = NULL;
787  BOOL bAnsi;
788 
789  TRACE("(%p)\n", hIMC);
790 
791  if (Imm32IsCrossThreadAccess(hIMC))
792  return FALSE;
793 
794  pClientImc = ImmLockClientImc(hIMC);
795  if (pClientImc == NULL)
796  return FALSE;
797 
798  bAnsi = !(pClientImc->dwFlags & CLIENTIMC_WIDE);
799  ImmUnlockClientImc(pClientImc);
800 
801  pIC = ImmLockIMC(hIMC);
802  if (pIC == NULL)
803  return FALSE;
804 
805  dwCount = pIC->dwNumMsgBuf;
806  if (dwCount == 0)
807  goto Quit;
808 
809  hMsgBuf = pIC->hMsgBuf;
810  pMsgs = ImmLockIMCC(hMsgBuf);
811  if (pMsgs == NULL)
812  goto Quit;
813 
814  cbTrans = dwCount * sizeof(TRANSMSG);
815  pTrans = ImmLocalAlloc(0, cbTrans);
816  if (pTrans == NULL)
817  goto Quit;
818 
819  RtlCopyMemory(pTrans, pMsgs, cbTrans);
820 
821 #ifdef IMM_WIN3_SUPPORT
822  if (GetWin32ClientInfo()->dwExpWinVer < _WIN32_WINNT_NT4) /* old version (3.x)? */
823  {
825  WORD wLang = PRIMARYLANGID(LangID);
826 
827  /* translate the messages if Japanese or Korean */
828  if (wLang == LANG_JAPANESE ||
829  (wLang == LANG_KOREAN && NtUserGetAppImeLevel(pIC->hWnd) == 3))
830  {
831  dwCount = ImmNt3Trans(dwCount, pTrans, hIMC, bAnsi, wLang);
832  }
833  }
834 #endif
835 
836  /* send them */
837  hWnd = pIC->hWnd;
838  pItem = pTrans;
839  for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem)
840  {
841  if (bAnsi)
842  SendMessageA(hWnd, pItem->message, pItem->wParam, pItem->lParam);
843  else
844  SendMessageW(hWnd, pItem->message, pItem->wParam, pItem->lParam);
845  }
846 
847 Quit:
848  ImmLocalFree(pTrans);
849  if (hMsgBuf)
850  ImmUnlockIMCC(hMsgBuf);
851  pIC->dwNumMsgBuf = 0; /* done */
852  ImmUnlockIMC(hIMC);
853  return TRUE;
854 }
DWORD HIMCC
Definition: dimm.idl:76
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
HWND hWnd
Definition: settings.c:17
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: utils.c:986
WORD LANGID
Definition: typedefs.h:81
#define GetWin32ClientInfo()
Definition: ntuser.h:335
#define CLIENTIMC_WIDE
Definition: ntuser.h:1325
#define LANG_JAPANESE
Definition: nls.h:76
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _WIN32_WINNT_NT4
Definition: sdkddkver.h:20
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:791
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:909
DWORD NTAPI NtUserGetAppImeLevel(HWND hWnd)
Definition: ime.c:927
#define TRACE(s)
Definition: solgame.cpp:4
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _tagTRANSMSG TRANSMSG
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
#define ImmLocalFree(lpData)
Definition: precomp.h:89
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: utils.c:996
HIMCC hMsgBuf
Definition: immdev.h:56
#define LANGIDFROMLCID(l)
Definition: nls.h:18
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD dwNumMsgBuf
Definition: immdev.h:55
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: ntuser.h:1305
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define LANG_KOREAN
Definition: nls.h:84
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1075
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032
#define PRIMARYLANGID(l)
Definition: nls.h:16
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:954

Referenced by test_ImmMessages(), and test_InvalidIMC().

◆ ImmGetHotKey()

BOOL WINAPI ImmGetHotKey ( IN DWORD  dwHotKey,
OUT LPUINT  lpuModifiers,
OUT LPUINT  lpuVKey,
OUT LPHKL  lphKL 
)

Definition at line 608 of file keymsg.c.

610 {
611  TRACE("(0x%lX, %p, %p, %p)\n", dwHotKey, lpuModifiers, lpuVKey, lphKL);
612  if (lpuModifiers && lpuVKey)
613  return NtUserGetImeHotKey(dwHotKey, lpuModifiers, lpuVKey, lphKL);
614  return FALSE;
615 }
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
BOOL NTAPI NtUserGetImeHotKey(DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, LPHKL lphKL)
Definition: ime.c:416

◆ ImmGetVirtualKey()

UINT WINAPI ImmGetVirtualKey ( HWND  hWnd)

Definition at line 650 of file keymsg.c.

651 {
652  HIMC hIMC;
653  LPINPUTCONTEXTDX pIC;
655 
656  TRACE("(%p)\n", hWnd);
657 
658  hIMC = ImmGetContext(hWnd);
659  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
660  if (!pIC)
661  return ret;
662 
663  if (pIC->bNeedsTrans)
664  ret = pIC->nVKey;
665 
666  ImmUnlockIMC(hIMC);
667  return ret;
668 }
#define VK_PROCESSKEY
Definition: winuser.h:2307
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
BOOL bNeedsTrans
Definition: immdev.h:107
UINT nVKey
Definition: immdev.h:106
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
int ret
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by ActiveIMMApp_GetVirtualKey().

◆ ImmIsUIMessageA()

BOOL WINAPI ImmIsUIMessageA ( HWND  hWndIME,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 589 of file keymsg.c.

590 {
591  TRACE("(%p, 0x%X, %p, %p)\n", hWndIME, msg, wParam, lParam);
592  return ImmIsUIMessageAW(hWndIME, msg, wParam, lParam, TRUE);
593 }
#define TRUE
Definition: types.h:120
static BOOL APIENTRY ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
Definition: keymsg.c:241
WPARAM wParam
Definition: combotst.c:138
#define TRACE(s)
Definition: solgame.cpp:4
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by ActiveIMMApp_IsUIMessageA(), and START_TEST().

◆ ImmIsUIMessageAW()

static BOOL APIENTRY ImmIsUIMessageAW ( HWND  hWndIME,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  bAnsi 
)
static

Definition at line 241 of file keymsg.c.

242 {
243  switch (msg)
244  {
245  case WM_IME_STARTCOMPOSITION: case WM_IME_ENDCOMPOSITION:
246  case WM_IME_COMPOSITION: case WM_IME_SETCONTEXT: case WM_IME_NOTIFY:
248  break;
249  default:
250  return FALSE;
251  }
252 
253  if (!hWndIME)
254  return TRUE;
255 
256  if (bAnsi)
257  SendMessageA(hWndIME, msg, wParam, lParam);
258  else
259  SendMessageW(hWndIME, msg, wParam, lParam);
260 
261  return TRUE;
262 }
#define WM_IME_NOTIFY
Definition: winuser.h:1817
#define TRUE
Definition: types.h:120
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_IME_SELECT
Definition: winuser.h:1820
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1819
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define WM_IME_SYSTEM
Definition: undocuser.h:59
#define WM_IME_SETCONTEXT
Definition: winuser.h:1816
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by ImmIsUIMessageA(), and ImmIsUIMessageW().

◆ ImmIsUIMessageW()

BOOL WINAPI ImmIsUIMessageW ( HWND  hWndIME,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 598 of file keymsg.c.

599 {
600  TRACE("(%p, 0x%X, %p, %p)\n", hWndIME, msg, wParam, lParam);
601  return ImmIsUIMessageAW(hWndIME, msg, wParam, lParam, FALSE);
602 }
static BOOL APIENTRY ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
Definition: keymsg.c:241
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139

Referenced by ActiveIMMApp_IsUIMessageW().

◆ ImmProcessKey()

DWORD WINAPI ImmProcessKey ( HWND  hWnd,
HKL  hKL,
UINT  vKey,
LPARAM  lParam,
DWORD  dwHotKeyID 
)

Definition at line 675 of file keymsg.c.

676 {
677  DWORD ret = 0;
678  HIMC hIMC;
679  PIMEDPI pImeDpi;
680  LPINPUTCONTEXTDX pIC;
681  BYTE KeyState[256];
682  UINT vk;
683  BOOL bUseIme = TRUE, bSkipThisKey = FALSE, bLowWordOnly = FALSE;
684 
685  TRACE("(%p, %p, 0x%X, %p, 0x%lX)\n", hWnd, hKL, vKey, lParam, dwHotKeyID);
686 
687  hIMC = ImmGetContext(hWnd);
688  pImeDpi = ImmLockImeDpi(hKL);
689  if (pImeDpi)
690  {
691  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
692  if (pIC)
693  {
694  if (LOBYTE(vKey) == VK_PACKET &&
696  {
697  if (ImeDpi_IsUnicode(pImeDpi))
698  {
699  bLowWordOnly = TRUE;
700  }
701  else
702  {
703  bUseIme = FALSE;
704  if (pIC->fOpen)
705  bSkipThisKey = TRUE;
706  }
707  }
708 
709  if (bUseIme)
710  {
711  if (GetKeyboardState(KeyState))
712  {
713  vk = (bLowWordOnly ? LOWORD(vKey) : vKey);
714  if (pImeDpi->ImeProcessKey(hIMC, vk, lParam, KeyState))
715  {
716  pIC->bNeedsTrans = TRUE;
717  pIC->nVKey = vKey;
719  }
720  }
721  }
722  else if (bSkipThisKey)
723  {
725  }
726 
727  ImmUnlockIMC(hIMC);
728  }
729 
730  ImmUnlockImeDpi(pImeDpi);
731  }
732 
733  if (dwHotKeyID != INVALID_HOTKEY_ID)
734  {
735  if (Imm32ProcessHotKey(hWnd, hIMC, hKL, dwHotKeyID))
736  {
737  if (vKey != VK_KANJI || dwHotKeyID != IME_JHOTKEY_CLOSE_OPEN)
738  ret |= IPHK_HOTKEY;
739  }
740  }
741 
742  if (ret & IPHK_PROCESSBYIME)
743  {
744  FIXME("TODO: We have to do something here.\n");
745  }
746 
747  ImmReleaseContext(hWnd, hIMC);
748  return ret;
749 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
#define IME_PROP_ACCEPT_WIDE_VKEY
Definition: imm.h:218
IMEINFO ImeInfo
Definition: ntuser.h:1253
#define IME_JHOTKEY_CLOSE_OPEN
Definition: imm.h:336
#define VK_KANJI
Definition: winuser.h:2193
#define LOBYTE(W)
Definition: jmemdos.c:487
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
WORD vk
Definition: input.c:77
HWND hWnd
Definition: settings.c:17
BOOL APIENTRY Imm32ProcessHotKey(HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID)
Definition: keymsg.c:183
#define IPHK_PROCESSBYIME
Definition: undocuser.h:139
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL bNeedsTrans
Definition: immdev.h:107
UINT nVKey
Definition: immdev.h:106
#define FIXME(fmt,...)
Definition: debug.h:111
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
DWORD fdwProperty
Definition: imm.h:158
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:729
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
int ret
unsigned char BYTE
Definition: xxhash.c:193
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1051
#define IPHK_SKIPTHISKEY
Definition: undocuser.h:141
unsigned int UINT
Definition: ndis.h:50
#define IPHK_HOTKEY
Definition: undocuser.h:138
#define INVALID_HOTKEY_ID
Definition: precomp.h:52
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by User32CallImmProcessKeyFromKernel().

◆ ImmRequestMessageA()

LRESULT WINAPI ImmRequestMessageA ( HIMC  hIMC,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1039 of file keymsg.c.

1040 {
1041  TRACE("(%p, %p, %p)\n", hIMC, wParam, lParam);
1042  return ImmRequestMessageAW(hIMC, wParam, lParam, TRUE);
1043 }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
#define TRACE(s)
Definition: solgame.cpp:4
LRESULT APIENTRY ImmRequestMessageAW(HIMC hIMC, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
Definition: keymsg.c:561
LPARAM lParam
Definition: combotst.c:139

Referenced by test_InvalidIMC().

◆ ImmRequestMessageAW()

LRESULT APIENTRY ImmRequestMessageAW ( HIMC  hIMC,
WPARAM  wParam,
LPARAM  lParam,
BOOL  bAnsi 
)

Definition at line 561 of file keymsg.c.

562 {
563  LRESULT ret = 0;
564  LPINPUTCONTEXT pIC;
565  HWND hWnd;
566  PWND pWnd = NULL;
567 
568  if (!hIMC || Imm32IsCrossThreadAccess(hIMC))
569  return FALSE;
570 
571  pIC = ImmLockIMC(hIMC);
572  if (!pIC)
573  return FALSE;
574 
575  hWnd = pIC->hWnd;
576  if (hWnd)
577  pWnd = ValidateHwnd(hWnd);
578 
579  if (pWnd && pWnd->head.pti == Imm32CurrentPti())
580  ret = Imm32ProcessRequest(hIMC, pWnd, (DWORD)wParam, (LPVOID)lParam, bAnsi);
581 
582  ImmUnlockIMC(hIMC);
583  return ret;
584 }
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
HWND hWnd
Definition: settings.c:17
static PTHREADINFO FASTCALL Imm32CurrentPti(VOID)
Definition: precomp.h:162
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
THRDESKHEAD head
Definition: ntuser.h:674
LRESULT APIENTRY Imm32ProcessRequest(HIMC hIMC, PWND pWnd, DWORD dwCommand, LPVOID pData, BOOL bAnsiAPI)
Definition: keymsg.c:360
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
Definition: precomp.h:100
int ret
Definition: ntuser.h:672
#define NULL
Definition: types.h:112
LONG_PTR LRESULT
Definition: windef.h:209
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032
LPARAM lParam
Definition: combotst.c:139
#define ValidateHwnd(hwnd)
Definition: precomp.h:85

Referenced by ImmRequestMessageA(), and ImmRequestMessageW().

◆ ImmRequestMessageW()

LRESULT WINAPI ImmRequestMessageW ( HIMC  hIMC,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1048 of file keymsg.c.

1049 {
1050  TRACE("(%p, %p, %p)\n", hIMC, wParam, lParam);
1051  return ImmRequestMessageAW(hIMC, wParam, lParam, FALSE);
1052 }
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
LRESULT APIENTRY ImmRequestMessageAW(HIMC hIMC, WPARAM wParam, LPARAM lParam, BOOL bAnsi)
Definition: keymsg.c:561
LPARAM lParam
Definition: combotst.c:139

◆ ImmSendMessageToActiveDefImeWndW()

LRESULT WINAPI ImmSendMessageToActiveDefImeWndW ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1058 of file keymsg.c.

1059 {
1060  HWND hwndIME;
1061 
1062  if (uMsg != WM_COPYDATA)
1063  return 0;
1064 
1066  if (!hwndIME)
1067  return 0;
1068 
1069  return SendMessageW(hwndIME, uMsg, wParam, lParam);
1070 }
HANDLE HWND
Definition: compat.h:19
WPARAM wParam
Definition: combotst.c:138
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4172
#define QUERY_WINDOW_DEFAULT_IME
Definition: ntuser.h:2926
#define WM_COPYDATA
Definition: winuser.h:1651
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ ImmSimulateHotKey()

BOOL WINAPI ImmSimulateHotKey ( HWND  hWnd,
DWORD  dwHotKeyID 
)

Definition at line 630 of file keymsg.c.

631 {
632  HIMC hIMC;
634  HKL hKL;
635  BOOL ret;
636 
637  TRACE("(%p, 0x%lX)\n", hWnd, dwHotKeyID);
638 
639  hIMC = ImmGetContext(hWnd);
642  ret = Imm32ProcessHotKey(hWnd, hIMC, hKL, dwHotKeyID);
643  ImmReleaseContext(hWnd, hIMC);
644  return ret;
645 }
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
HWND hWnd
Definition: settings.c:17
BOOL APIENTRY Imm32ProcessHotKey(HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID)
Definition: keymsg.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD dwThreadId
Definition: fdebug.c:31
UINT_PTR HKL
Definition: msctf.idl:101
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1051
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define NULL
Definition: types.h:112

Referenced by ActiveIMMApp_SimulateHotKey().

◆ ImmSystemHandler()

LRESULT WINAPI ImmSystemHandler ( HIMC  hIMC,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 754 of file keymsg.c.

755 {
756  TRACE("(%p, %p, %p)\n", hIMC, wParam, lParam);
757 
758  switch (wParam)
759  {
760  case 0x1f:
762  return 0;
763 
764  case 0x20:
766  return 0;
767 
768  case 0x23: case 0x24:
769  return Imm32UnknownProcess1((HWND)lParam, (wParam == 0x23));
770 
771  default:
772  return 0;
773  }
774 }
BOOL APIENTRY Imm32SendChange(BOOL bProcess)
Definition: keymsg.c:348
WPARAM wParam
Definition: combotst.c:138
LRESULT APIENTRY Imm32UnknownProcess1(HWND hWnd, BOOL fFlag)
Definition: keymsg.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CPS_COMPLETE
Definition: imm.h:312
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
Definition: ime.c:652
#define TRACE(s)
Definition: solgame.cpp:4
#define NI_COMPOSITIONSTR
Definition: imm.h:298
LPARAM lParam
Definition: combotst.c:139

Referenced by ImeWnd_OnImeSystem().

◆ ImmTranslateMessage()

BOOL WINAPI ImmTranslateMessage ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lKeyData 
)

Definition at line 916 of file keymsg.c.

917 {
918 #define MSG_COUNT 0x100
919  BOOL ret = FALSE;
920  INT kret;
921  LPINPUTCONTEXTDX pIC;
922  PIMEDPI pImeDpi = NULL;
924  LPTRANSMSG pTransMsg;
925  BYTE abKeyState[256];
926  HIMC hIMC;
927  HKL hKL;
928  UINT vk;
929  DWORD dwThreadId, dwCount, cbList;
930  WCHAR wch;
931  WORD wChar;
932 
933  TRACE("(%p, 0x%X, %p, %p)\n", hwnd, msg, wParam, lKeyData);
934 
935  /* filter the message */
936  switch (msg)
937  {
938  case WM_KEYDOWN: case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP:
939  break;
940  default:
941  return FALSE;
942  }
943 
944  hIMC = ImmGetContext(hwnd);
945  pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
946  if (pIC == NULL)
947  {
948  ImmReleaseContext(hwnd, hIMC);
949  return FALSE;
950  }
951 
952  if (!pIC->bNeedsTrans) /* is translation needed? */
953  {
954  /* directly post them */
955  dwCount = pIC->dwNumMsgBuf;
956  if (dwCount == 0)
957  goto Quit;
958 
959  pTransMsg = ImmLockIMCC(pIC->hMsgBuf);
960  if (pTransMsg)
961  {
962  Imm32PostMessages(hwnd, hIMC, dwCount, pTransMsg);
963  ImmUnlockIMCC(pIC->hMsgBuf);
964  ret = TRUE;
965  }
966  pIC->dwNumMsgBuf = 0; /* done */
967  goto Quit;
968  }
969  pIC->bNeedsTrans = FALSE; /* clear the flag */
970 
973  pImeDpi = ImmLockImeDpi(hKL);
974  if (pImeDpi == NULL)
975  goto Quit;
976 
977  if (!GetKeyboardState(abKeyState)) /* get keyboard ON/OFF status */
978  goto Quit;
979 
980  /* convert a virtual key if IME_PROP_KBD_CHAR_FIRST */
981  vk = pIC->nVKey;
983  {
984  if (ImeDpi_IsUnicode(pImeDpi))
985  {
986  wch = 0;
987  kret = ToUnicode(vk, HIWORD(lKeyData), abKeyState, &wch, 1, 0);
988  if (kret == 1)
989  vk = MAKELONG(LOBYTE(vk), wch);
990  }
991  else
992  {
993  wChar = 0;
994  kret = ToAsciiEx(vk, HIWORD(lKeyData), abKeyState, &wChar, 0, hKL);
995  if (kret > 0)
996  vk = MAKEWORD(vk, wChar);
997  }
998  }
999 
1000  /* allocate a list */
1001  cbList = offsetof(TRANSMSGLIST, TransMsg) + MSG_COUNT * sizeof(TRANSMSG);
1002  pList = ImmLocalAlloc(0, cbList);
1003  if (!pList)
1004  goto Quit;
1005 
1006  /* use IME conversion engine and convert the list */
1007  pList->uMsgCount = MSG_COUNT;
1008  kret = pImeDpi->ImeToAsciiEx(vk, HIWORD(lKeyData), abKeyState, pList, 0, hIMC);
1009  if (kret <= 0)
1010  goto Quit;
1011 
1012  /* post them */
1013  if (kret <= MSG_COUNT)
1014  {
1015  Imm32PostMessages(hwnd, hIMC, kret, pList->TransMsg);
1016  ret = TRUE;
1017  }
1018  else
1019  {
1020  pTransMsg = ImmLockIMCC(pIC->hMsgBuf);
1021  if (pTransMsg == NULL)
1022  goto Quit;
1023  Imm32PostMessages(hwnd, hIMC, kret, pTransMsg);
1024  ImmUnlockIMCC(pIC->hMsgBuf);
1025  }
1026 
1027 Quit:
1029  ImmUnlockImeDpi(pImeDpi);
1030  ImmUnlockIMC(hIMC);
1031  ImmReleaseContext(hwnd, hIMC);
1032  return ret;
1033 #undef MSG_COUNT
1034 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
IMEINFO ImeInfo
Definition: ntuser.h:1253
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define LOBYTE(W)
Definition: jmemdos.c:487
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
#define IME_PROP_KBD_CHAR_FIRST
Definition: imm.h:214
WORD vk
Definition: input.c:77
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: utils.c:986
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
FxChildList * pList
BOOL bNeedsTrans
Definition: immdev.h:107
UINT nVKey
Definition: immdev.h:106
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define offsetof(TYPE, MEMBER)
#define WM_KEYDOWN
Definition: winuser.h:1702
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD fdwProperty
Definition: imm.h:158
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:729
#define WM_KEYUP
Definition: winuser.h:1703
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _tagTRANSMSG TRANSMSG
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
#define MSG_COUNT
#define ImmLocalFree(lpData)
Definition: precomp.h:89
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: utils.c:996
int ret
DWORD dwThreadId
Definition: fdebug.c:31
UINT_PTR HKL
Definition: msctf.idl:101
unsigned char BYTE
Definition: xxhash.c:193
int WINAPI ToAsciiEx(_In_ UINT, _In_ UINT, _In_reads_opt_(256) CONST BYTE *, _Out_ LPWORD, _In_ UINT, _In_opt_ HKL)
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1051
#define WM_SYSKEYUP
Definition: winuser.h:1707
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
VOID APIENTRY Imm32PostMessages(HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg)
Definition: keymsg.c:857
int WINAPI ToUnicode(_In_ UINT wVirtKey, _In_ UINT wScanCode, _In_reads_bytes_opt_(256) CONST BYTE *lpKeyState, _Out_writes_(cchBuff) LPWSTR pwszBuff, _In_ int cchBuff, _In_ UINT wFlags)
#define msg(x)
Definition: auth_time.c:54
#define WM_SYSKEYDOWN
Definition: winuser.h:1706
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032

Referenced by TranslateMessage().

◆ ImmWINNLSGetIMEHotkey()

UINT WINAPI ImmWINNLSGetIMEHotkey ( HWND  hwndIme)

Definition at line 620 of file keymsg.c.

621 {
622  TRACE("(%p)\n", hwndIme);
623  UNREFERENCED_PARAMETER(hwndIme);
624  return 0; /* This is correct. This function of Windows just returns zero. */
625 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TRACE(s)
Definition: solgame.cpp:4

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( imm  )