ReactOS  0.4.15-dev-4610-g11e0ed3
regword.c File Reference
#include "precomp.h"
Include dependency graph for regword.c:

Go to the source code of this file.

Classes

struct  ENUM_WORD_A2W
 
struct  ENUM_WORD_W2A
 

Typedefs

typedef struct ENUM_WORD_A2W ENUM_WORD_A2W
 
typedef struct ENUM_WORD_A2WLPENUM_WORD_A2W
 
typedef struct ENUM_WORD_W2A ENUM_WORD_W2A
 
typedef struct ENUM_WORD_W2ALPENUM_WORD_W2A
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
static INT CALLBACK Imm32EnumWordProcA2W (LPCSTR pszReadingA, DWORD dwStyle, LPCSTR pszRegisterA, LPVOID lpData)
 
static INT CALLBACK Imm32EnumWordProcW2A (LPCWSTR pszReadingW, DWORD dwStyle, LPCWSTR pszRegisterW, LPVOID lpData)
 
UINT WINAPI ImmEnumRegisterWordA (HKL hKL, REGISTERWORDENUMPROCA lpfnEnumProc, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister, LPVOID lpData)
 
UINT WINAPI ImmEnumRegisterWordW (HKL hKL, REGISTERWORDENUMPROCW lpfnEnumProc, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister, LPVOID lpData)
 
UINT WINAPI ImmGetRegisterWordStyleA (HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
 
UINT WINAPI ImmGetRegisterWordStyleW (HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
 
BOOL WINAPI ImmRegisterWordA (HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister)
 
BOOL WINAPI ImmRegisterWordW (HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister)
 
BOOL WINAPI ImmUnregisterWordA (HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
 
BOOL WINAPI ImmUnregisterWordW (HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
 

Typedef Documentation

◆ ENUM_WORD_A2W

◆ ENUM_WORD_W2A

◆ LPENUM_WORD_A2W

◆ LPENUM_WORD_W2A

Function Documentation

◆ Imm32EnumWordProcA2W()

static INT CALLBACK Imm32EnumWordProcA2W ( LPCSTR  pszReadingA,
DWORD  dwStyle,
LPCSTR  pszRegisterA,
LPVOID  lpData 
)
static

Definition at line 30 of file regword.c.

31 {
32  INT ret = 0;
33  LPENUM_WORD_A2W lpEnumData = lpData;
34  LPWSTR pszReadingW = NULL, pszRegisterW = NULL;
35 
36  if (pszReadingA)
37  {
38  pszReadingW = Imm32WideFromAnsi(pszReadingA);
39  if (pszReadingW == NULL)
40  goto Quit;
41  }
42 
43  if (pszRegisterA)
44  {
45  pszRegisterW = Imm32WideFromAnsi(pszRegisterA);
46  if (pszRegisterW == NULL)
47  goto Quit;
48  }
49 
50  ret = lpEnumData->lpfnEnumProc(pszReadingW, dwStyle, pszRegisterW, lpEnumData->lpData);
51  lpEnumData->ret = ret;
52 
53 Quit:
54  ImmLocalFree(pszReadingW);
55  ImmLocalFree(pszRegisterW);
56  return ret;
57 }
int32_t INT
Definition: typedefs.h:58
UINT ret
Definition: regword.c:16
REGISTERWORDENUMPROCW lpfnEnumProc
Definition: regword.c:14
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
LPVOID lpData
Definition: regword.c:15
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:65

Referenced by ImmEnumRegisterWordW().

◆ Imm32EnumWordProcW2A()

static INT CALLBACK Imm32EnumWordProcW2A ( LPCWSTR  pszReadingW,
DWORD  dwStyle,
LPCWSTR  pszRegisterW,
LPVOID  lpData 
)
static

Definition at line 60 of file regword.c.

61 {
62  INT ret = 0;
63  LPENUM_WORD_W2A lpEnumData = lpData;
64  LPSTR pszReadingA = NULL, pszRegisterA = NULL;
65 
66  if (pszReadingW)
67  {
68  pszReadingA = Imm32AnsiFromWide(pszReadingW);
69  if (pszReadingW == NULL)
70  goto Quit;
71  }
72 
73  if (pszRegisterW)
74  {
75  pszRegisterA = Imm32AnsiFromWide(pszRegisterW);
76  if (pszRegisterA == NULL)
77  goto Quit;
78  }
79 
80  ret = lpEnumData->lpfnEnumProc(pszReadingA, dwStyle, pszRegisterA, lpEnumData->lpData);
81  lpEnumData->ret = ret;
82 
83 Quit:
84  ImmLocalFree(pszReadingA);
85  ImmLocalFree(pszRegisterA);
86  return ret;
87 }
LPVOID lpData
Definition: regword.c:22
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:58
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:76
UINT ret
Definition: regword.c:23
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
REGISTERWORDENUMPROCA lpfnEnumProc
Definition: regword.c:21
#define NULL
Definition: types.h:112

Referenced by ImmEnumRegisterWordA().

◆ ImmEnumRegisterWordA()

UINT WINAPI ImmEnumRegisterWordA ( HKL  hKL,
REGISTERWORDENUMPROCA  lpfnEnumProc,
LPCSTR  lpszReading,
DWORD  dwStyle,
LPCSTR  lpszRegister,
LPVOID  lpData 
)

Definition at line 93 of file regword.c.

96 {
97  UINT ret = 0;
98  LPWSTR pszReadingW = NULL, pszRegisterW = NULL;
99  ENUM_WORD_W2A EnumDataW2A;
100  PIMEDPI pImeDpi;
101 
102  TRACE("(%p, %p, %s, 0x%lX, %s, %p)\n", hKL, lpfnEnumProc, debugstr_a(lpszReading),
103  dwStyle, debugstr_a(lpszRegister), lpData);
104 
105  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
106  if (!pImeDpi)
107  return 0;
108 
109  if (!ImeDpi_IsUnicode(pImeDpi))
110  {
111  ret = pImeDpi->ImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
112  lpszRegister, lpData);
113  ImmUnlockImeDpi(pImeDpi);
114  return ret;
115  }
116 
117  if (lpszReading)
118  {
119  pszReadingW = Imm32WideFromAnsi(lpszReading);
120  if (pszReadingW == NULL)
121  goto Quit;
122  }
123 
124  if (lpszRegister)
125  {
126  pszRegisterW = Imm32WideFromAnsi(lpszRegister);
127  if (pszRegisterW == NULL)
128  goto Quit;
129  }
130 
131  EnumDataW2A.lpfnEnumProc = lpfnEnumProc;
132  EnumDataW2A.lpData = lpData;
133  EnumDataW2A.ret = 0;
134  pImeDpi->ImeEnumRegisterWord(Imm32EnumWordProcW2A, pszReadingW, dwStyle,
135  pszRegisterW, &EnumDataW2A);
136  ret = EnumDataW2A.ret;
137 
138 Quit:
139  ImmLocalFree(pszReadingW);
140  ImmLocalFree(pszRegisterW);
141  ImmUnlockImeDpi(pImeDpi);
142  return ret;
143 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
LPVOID lpData
Definition: regword.c:22
UINT ret
Definition: regword.c:23
static INT CALLBACK Imm32EnumWordProcW2A(LPCWSTR pszReadingW, DWORD dwStyle, LPCWSTR pszRegisterW, LPVOID lpData)
Definition: regword.c:60
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
REGISTERWORDENUMPROCA lpfnEnumProc
Definition: regword.c:21
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:65

◆ ImmEnumRegisterWordW()

UINT WINAPI ImmEnumRegisterWordW ( HKL  hKL,
REGISTERWORDENUMPROCW  lpfnEnumProc,
LPCWSTR  lpszReading,
DWORD  dwStyle,
LPCWSTR  lpszRegister,
LPVOID  lpData 
)

Definition at line 149 of file regword.c.

152 {
153  UINT ret = 0;
154  LPSTR pszReadingA = NULL, pszRegisterA = NULL;
155  ENUM_WORD_A2W EnumDataA2W;
156  PIMEDPI pImeDpi;
157 
158  TRACE("(%p, %p, %s, 0x%lX, %s, %p)\n", hKL, lpfnEnumProc, debugstr_w(lpszReading),
159  dwStyle, debugstr_w(lpszRegister), lpData);
160 
161  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
162  if (!pImeDpi)
163  return 0;
164 
165  if (ImeDpi_IsUnicode(pImeDpi))
166  {
167  ret = pImeDpi->ImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
168  lpszRegister, lpData);
169  ImmUnlockImeDpi(pImeDpi);
170  return ret;
171  }
172 
173  if (lpszReading)
174  {
175  pszReadingA = Imm32AnsiFromWide(lpszReading);
176  if (pszReadingA == NULL)
177  goto Quit;
178  }
179 
180  if (lpszRegister)
181  {
182  pszRegisterA = Imm32AnsiFromWide(lpszRegister);
183  if (pszRegisterA == NULL)
184  goto Quit;
185  }
186 
187  EnumDataA2W.lpfnEnumProc = lpfnEnumProc;
188  EnumDataA2W.lpData = lpData;
189  EnumDataA2W.ret = 0;
190  pImeDpi->ImeEnumRegisterWord(Imm32EnumWordProcA2W, pszReadingA, dwStyle,
191  pszRegisterA, &EnumDataA2W);
192  ret = EnumDataA2W.ret;
193 
194 Quit:
195  ImmLocalFree(pszReadingA);
196  ImmLocalFree(pszRegisterA);
197  ImmUnlockImeDpi(pImeDpi);
198  return ret;
199 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
char * LPSTR
Definition: xmlstorage.h:182
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:76
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
UINT ret
Definition: regword.c:16
REGISTERWORDENUMPROCW lpfnEnumProc
Definition: regword.c:14
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
LPVOID lpData
Definition: regword.c:15
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285
static INT CALLBACK Imm32EnumWordProcA2W(LPCSTR pszReadingA, DWORD dwStyle, LPCSTR pszRegisterA, LPVOID lpData)
Definition: regword.c:30

◆ ImmGetRegisterWordStyleA()

UINT WINAPI ImmGetRegisterWordStyleA ( HKL  hKL,
UINT  nItem,
LPSTYLEBUFA  lpStyleBuf 
)

Definition at line 204 of file regword.c.

205 {
206  UINT iItem, ret = 0;
207  PIMEDPI pImeDpi;
208  LPSTYLEBUFA pDestA;
209  LPSTYLEBUFW pSrcW, pNewStylesW = NULL;
210  size_t cchW;
211  INT cchA;
212 
213  TRACE("(%p, %u, %p)\n", hKL, nItem, lpStyleBuf);
214 
215  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
216  if (!pImeDpi)
217  return 0;
218 
219  if (!ImeDpi_IsUnicode(pImeDpi))
220  {
221  ret = pImeDpi->ImeGetRegisterWordStyle(nItem, lpStyleBuf);
222  goto Quit;
223  }
224 
225  if (nItem > 0)
226  {
227  pNewStylesW = ImmLocalAlloc(0, nItem * sizeof(STYLEBUFW));
228  if (!pNewStylesW)
229  goto Quit;
230  }
231 
232  ret = pImeDpi->ImeGetRegisterWordStyle(nItem, pNewStylesW);
233 
234  if (nItem > 0)
235  {
236  /* lpStyleBuf <-- pNewStylesW */
237  for (iItem = 0; iItem < ret; ++iItem)
238  {
239  pSrcW = &pNewStylesW[iItem];
240  pDestA = &lpStyleBuf[iItem];
241  pDestA->dwStyle = pSrcW->dwStyle;
242  StringCchLengthW(pSrcW->szDescription, _countof(pSrcW->szDescription), &cchW);
244  pSrcW->szDescription, (INT)cchW,
245  pDestA->szDescription, _countof(pDestA->szDescription),
246  NULL, NULL);
247  if (cchA > _countof(pDestA->szDescription) - 1)
248  cchA = _countof(pDestA->szDescription) - 1;
249  pDestA->szDescription[cchA] = 0;
250  }
251  }
252 
253 Quit:
254  ImmLocalFree(pNewStylesW);
255  ImmUnlockImeDpi(pImeDpi);
256  return ret;
257 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
DWORD dwStyle
Definition: imm.h:88
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
#define MB_PRECOMPOSED
Definition: winnls.h:281
DWORD dwStyle
Definition: imm.h:82
int32_t INT
Definition: typedefs.h:58
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR szDescription[32]
Definition: imm.h:89
#define _countof(array)
Definition: sndvol32.h:68
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
CHAR szDescription[32]
Definition: imm.h:83
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285

Referenced by ActiveIMMApp_GetRegisterWordStyleA().

◆ ImmGetRegisterWordStyleW()

UINT WINAPI ImmGetRegisterWordStyleW ( HKL  hKL,
UINT  nItem,
LPSTYLEBUFW  lpStyleBuf 
)

Definition at line 262 of file regword.c.

263 {
264  UINT iItem, ret = 0;
265  PIMEDPI pImeDpi;
266  LPSTYLEBUFA pSrcA, pNewStylesA = NULL;
267  LPSTYLEBUFW pDestW;
268  size_t cchA;
269  INT cchW;
270 
271  TRACE("(%p, %u, %p)\n", hKL, nItem, lpStyleBuf);
272 
273  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
274  if (!pImeDpi)
275  return 0;
276 
277  if (ImeDpi_IsUnicode(pImeDpi))
278  {
279  ret = pImeDpi->ImeGetRegisterWordStyle(nItem, lpStyleBuf);
280  goto Quit;
281  }
282 
283  if (nItem > 0)
284  {
285  pNewStylesA = ImmLocalAlloc(0, nItem * sizeof(STYLEBUFA));
286  if (!pNewStylesA)
287  goto Quit;
288  }
289 
290  ret = pImeDpi->ImeGetRegisterWordStyle(nItem, pNewStylesA);
291 
292  if (nItem > 0)
293  {
294  /* lpStyleBuf <-- pNewStylesA */
295  for (iItem = 0; iItem < ret; ++iItem)
296  {
297  pSrcA = &pNewStylesA[iItem];
298  pDestW = &lpStyleBuf[iItem];
299  pDestW->dwStyle = pSrcA->dwStyle;
300  StringCchLengthA(pSrcA->szDescription, _countof(pSrcA->szDescription), &cchA);
302  pSrcA->szDescription, (INT)cchA,
303  pDestW->szDescription, _countof(pDestW->szDescription));
304  if (cchW > _countof(pDestW->szDescription) - 1)
305  cchW = _countof(pDestW->szDescription) - 1;
306  pDestW->szDescription[cchW] = 0;
307  }
308  }
309 
310 Quit:
311  ImmLocalFree(pNewStylesA);
312  ImmUnlockImeDpi(pImeDpi);
313  return ret;
314 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
DWORD dwStyle
Definition: imm.h:88
#define CP_ACP
Definition: compat.h:109
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:234
#define MB_PRECOMPOSED
Definition: winnls.h:281
DWORD dwStyle
Definition: imm.h:82
int32_t INT
Definition: typedefs.h:58
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR szDescription[32]
Definition: imm.h:89
#define _countof(array)
Definition: sndvol32.h:68
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
CHAR szDescription[32]
Definition: imm.h:83
STRSAFEAPI StringCchLengthA(STRSAFE_LPCSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:832
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285

Referenced by ActiveIMMApp_GetRegisterWordStyleW().

◆ ImmRegisterWordA()

BOOL WINAPI ImmRegisterWordA ( HKL  hKL,
LPCSTR  lpszReading,
DWORD  dwStyle,
LPCSTR  lpszRegister 
)

Definition at line 320 of file regword.c.

321 {
322  BOOL ret = FALSE;
323  PIMEDPI pImeDpi;
324  LPWSTR pszReadingW = NULL, pszRegisterW = NULL;
325 
326  TRACE("(%p, %s, 0x%lX, %s)\n", hKL, debugstr_a(lpszReading), dwStyle,
327  debugstr_a(lpszRegister));
328 
329  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
330  if (!pImeDpi)
331  return FALSE;
332 
333  if (!ImeDpi_IsUnicode(pImeDpi))
334  {
335  ret = pImeDpi->ImeRegisterWord(lpszReading, dwStyle, lpszRegister);
336  ImmUnlockImeDpi(pImeDpi);
337  return ret;
338  }
339 
340  if (lpszReading)
341  {
342  pszReadingW = Imm32WideFromAnsi(lpszReading);
343  if (pszReadingW == NULL)
344  goto Quit;
345  }
346 
347  if (lpszRegister)
348  {
349  pszRegisterW = Imm32WideFromAnsi(lpszRegister);
350  if (pszRegisterW == NULL)
351  goto Quit;
352  }
353 
354  ret = pImeDpi->ImeRegisterWord(pszReadingW, dwStyle, pszRegisterW);
355 
356 Quit:
357  ImmLocalFree(pszReadingW);
358  ImmLocalFree(pszRegisterW);
359  ImmUnlockImeDpi(pImeDpi);
360  return ret;
361 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:65

Referenced by ActiveIMMApp_RegisterWordA().

◆ ImmRegisterWordW()

BOOL WINAPI ImmRegisterWordW ( HKL  hKL,
LPCWSTR  lpszReading,
DWORD  dwStyle,
LPCWSTR  lpszRegister 
)

Definition at line 367 of file regword.c.

368 {
369  BOOL ret = FALSE;
370  PIMEDPI pImeDpi;
371  LPSTR pszReadingA = NULL, pszRegisterA = NULL;
372 
373  TRACE("(%p, %s, 0x%lX, %s)\n", hKL, debugstr_w(lpszReading), dwStyle,
374  debugstr_w(lpszRegister));
375 
376  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
377  if (!pImeDpi)
378  return FALSE;
379 
380  if (ImeDpi_IsUnicode(pImeDpi))
381  {
382  ret = pImeDpi->ImeRegisterWord(lpszReading, dwStyle, lpszRegister);
383  ImmUnlockImeDpi(pImeDpi);
384  return ret;
385  }
386 
387  if (lpszReading)
388  {
389  pszReadingA = Imm32AnsiFromWide(lpszReading);
390  if (!pszReadingA)
391  goto Quit;
392  }
393 
394  if (lpszRegister)
395  {
396  pszRegisterA = Imm32AnsiFromWide(lpszRegister);
397  if (!pszRegisterA)
398  goto Quit;
399  }
400 
401  ret = pImeDpi->ImeRegisterWord(pszReadingA, dwStyle, pszRegisterA);
402 
403 Quit:
404  ImmLocalFree(pszReadingA);
405  ImmLocalFree(pszRegisterA);
406  ImmUnlockImeDpi(pImeDpi);
407  return ret;
408 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
char * LPSTR
Definition: xmlstorage.h:182
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:76
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285

Referenced by ActiveIMMApp_RegisterWordW().

◆ ImmUnregisterWordA()

BOOL WINAPI ImmUnregisterWordA ( HKL  hKL,
LPCSTR  lpszReading,
DWORD  dwStyle,
LPCSTR  lpszUnregister 
)

Definition at line 414 of file regword.c.

415 {
416  BOOL ret = FALSE;
417  PIMEDPI pImeDpi;
418  LPWSTR pszReadingW = NULL, pszUnregisterW = NULL;
419 
420  TRACE("(%p, %s, 0x%lX, %s)\n", hKL, debugstr_a(lpszReading), dwStyle,
421  debugstr_a(lpszUnregister));
422 
423  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
424  if (pImeDpi == NULL)
425  return FALSE;
426 
427  if (!ImeDpi_IsUnicode(pImeDpi))
428  {
429  ret = pImeDpi->ImeUnregisterWord(lpszReading, dwStyle, lpszUnregister);
430  ImmUnlockImeDpi(pImeDpi);
431  return ret;
432  }
433 
434  if (lpszReading)
435  {
436  pszReadingW = Imm32WideFromAnsi(lpszReading);
437  if (pszReadingW == NULL)
438  goto Quit;
439  }
440 
441  if (lpszUnregister)
442  {
443  pszUnregisterW = Imm32WideFromAnsi(lpszUnregister);
444  if (pszUnregisterW == NULL)
445  goto Quit;
446  }
447 
448  ret = pImeDpi->ImeUnregisterWord(pszReadingW, dwStyle, pszUnregisterW);
449 
450 Quit:
451  ImmLocalFree(pszReadingW);
452  ImmLocalFree(pszUnregisterW);
453  ImmUnlockImeDpi(pImeDpi);
454  return ret;
455 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR APIENTRY Imm32WideFromAnsi(LPCSTR pszA)
Definition: utils.c:65

Referenced by ActiveIMMApp_UnregisterWordA().

◆ ImmUnregisterWordW()

BOOL WINAPI ImmUnregisterWordW ( HKL  hKL,
LPCWSTR  lpszReading,
DWORD  dwStyle,
LPCWSTR  lpszUnregister 
)

Definition at line 461 of file regword.c.

462 {
463  BOOL ret = FALSE;
464  PIMEDPI pImeDpi;
465  LPSTR pszReadingA = NULL, pszUnregisterA = NULL;
466 
467  TRACE("(%p, %s, 0x%lX, %s)\n", hKL, debugstr_w(lpszReading), dwStyle,
468  debugstr_w(lpszUnregister));
469 
470  pImeDpi = Imm32FindOrLoadImeDpi(hKL);
471  if (!pImeDpi)
472  return FALSE;
473 
474  if (ImeDpi_IsUnicode(pImeDpi))
475  {
476  ret = pImeDpi->ImeUnregisterWord(lpszReading, dwStyle, lpszUnregister);
477  ImmUnlockImeDpi(pImeDpi);
478  return ret;
479  }
480 
481  if (lpszReading)
482  {
483  pszReadingA = Imm32AnsiFromWide(lpszReading);
484  if (!pszReadingA)
485  goto Quit;
486  }
487 
488  if (lpszUnregister)
489  {
490  pszUnregisterA = Imm32AnsiFromWide(lpszUnregister);
491  if (!pszUnregisterA)
492  goto Quit;
493  }
494 
495  ret = pImeDpi->ImeUnregisterWord(pszReadingA, dwStyle, pszUnregisterA);
496 
497 Quit:
498  ImmLocalFree(pszReadingA);
499  ImmLocalFree(pszUnregisterA);
500  ImmUnlockImeDpi(pImeDpi);
501  return ret;
502 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
char * LPSTR
Definition: xmlstorage.h:182
LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW)
Definition: utils.c:76
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ImeDpi_IsUnicode(pImeDpi)
Definition: precomp.h:116
#define ImmLocalFree(lpData)
Definition: precomp.h:89
int ret
#define NULL
Definition: types.h:112
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:285

Referenced by ActiveIMMApp_UnregisterWordW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( imm  )