ReactOS  0.4.15-dev-1207-g698a8e6
imm.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/debug.h"
#include "imm.h"
#include "ddk/imm.h"
#include "winnls.h"
#include "winreg.h"
#include "wine/list.h"
Include dependency graph for imm.c:

Go to the source code of this file.

Classes

struct  _tagImmHkl
 
struct  tagInputContextData
 
struct  _tagTRANSMSG
 
struct  _tagIMMThreadData
 

Macros

#define IMM_INIT_MAGIC   0x19650412
 
#define WINE_IMC_VALID_MAGIC   0x56434D49
 
#define LOAD_FUNCPTR(f)   if((ptr->p##f = (LPVOID)GetProcAddress(ptr->hIME, #f)) == NULL){WARN("Can't find function %s in ime\n", #f);}
 

Typedefs

typedef struct _tagImmHkl ImmHkl
 
typedef struct tagInputContextData InputContextData
 
typedef struct _tagTRANSMSG TRANSMSG
 
typedef struct _tagTRANSMSGLPTRANSMSG
 
typedef struct _tagIMMThreadData IMMThreadData
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
BOOL WINAPI User32InitializeImmEntryTable (DWORD)
 
static BOOL is_himc_ime_unicode (const InputContextData *data)
 
static BOOL is_kbd_ime_unicode (const ImmHkl *hkl)
 
static BOOL IMM_DestroyContext (HIMC hIMC)
 
static InputContextDataget_imc_data (HIMC hIMC)
 
static WCHARstrdupAtoW (const char *str)
 
static CHARstrdupWtoA (const WCHAR *str)
 
static DWORD convert_candidatelist_WtoA (LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
 
static DWORD convert_candidatelist_AtoW (LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
 
static IMMThreadDataIMM_GetThreadData (HWND hwnd, DWORD thread)
 
static BOOL IMM_IsDefaultContext (HIMC imc)
 
static void IMM_FreeThreadData (void)
 
static HMODULE load_graphics_driver (void)
 
static ImmHklIMM_GetImmHkl (HKL hkl)
 
HWND WINAPI __wine_get_ui_window (HKL hkl)
 
static void IMM_FreeAllImmHkl (void)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
 
static void ImmInternalPostIMEMessage (InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void ImmInternalSendIMEMessage (InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT ImmInternalSendIMENotify (InputContextData *data, WPARAM notify, LPARAM lParam)
 
static HIMCC ImmCreateBlankCompStr (void)
 
static HIMC get_default_context (HWND hwnd)
 
static BOOL IMM_IsCrossThreadAccess (HWND hWnd, HIMC hIMC)
 
HIMC WINAPI ImmAssociateContext (HWND hWnd, HIMC hIMC)
 
static BOOL CALLBACK _ImmAssociateContextExEnumProc (HWND hwnd, LPARAM lParam)
 
BOOL WINAPI ImmAssociateContextEx (HWND hWnd, HIMC hIMC, DWORD dwFlags)
 
BOOL WINAPI ImmConfigureIMEA (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
BOOL WINAPI ImmConfigureIMEW (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
HIMC WINAPI ImmCreateContext (void)
 
BOOL WINAPI ImmDestroyContext (HIMC hIMC)
 
BOOL WINAPI ImmDisableIME (DWORD idThread)
 
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)
 
static BOOL EscapeRequiresWA (UINT uEscape)
 
LRESULT WINAPI ImmEscapeA (HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData)
 
LRESULT WINAPI ImmEscapeW (HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData)
 
DWORD WINAPI ImmGetCandidateListA (HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
 
DWORD WINAPI ImmGetCandidateListCountA (HIMC hIMC, LPDWORD lpdwListCount)
 
DWORD WINAPI ImmGetCandidateListCountW (HIMC hIMC, LPDWORD lpdwListCount)
 
DWORD WINAPI ImmGetCandidateListW (HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
 
BOOL WINAPI ImmGetCandidateWindow (HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate)
 
BOOL WINAPI ImmGetCompositionFontA (HIMC hIMC, LPLOGFONTA lplf)
 
BOOL WINAPI ImmGetCompositionFontW (HIMC hIMC, LPLOGFONTW lplf)
 
static INT CopyCompStringIMEtoClient (const InputContextData *data, const void *src, INT src_len, void *dst, INT dst_len, BOOL unicode)
 
static INT CopyCompAttrIMEtoClient (const InputContextData *data, const BYTE *src, INT src_len, const void *comp_string, INT str_len, BYTE *dst, INT dst_len, BOOL unicode)
 
static INT CopyCompClauseIMEtoClient (InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, LPBYTE target, INT tlen, BOOL unicode)
 
static INT CopyCompOffsetIMEtoClient (InputContextData *data, DWORD offset, LPBYTE ssource, BOOL unicode)
 
static LONG ImmGetCompositionStringT (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen, BOOL unicode)
 
LONG WINAPI ImmGetCompositionStringA (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
 
LONG WINAPI ImmGetCompositionStringW (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
 
BOOL WINAPI ImmGetCompositionWindow (HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
 
HIMC WINAPI ImmGetContext (HWND hWnd)
 
DWORD WINAPI ImmGetConversionListA (HKL hKL, HIMC hIMC, LPCSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
DWORD WINAPI ImmGetConversionListW (HKL hKL, HIMC hIMC, LPCWSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
BOOL WINAPI ImmGetConversionStatus (HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
 
static BOOL needs_ime_window (HWND hwnd)
 
BOOL WINAPI __wine_register_window (HWND hwnd)
 
void WINAPI __wine_unregister_window (HWND hwnd)
 
HWND WINAPI ImmGetDefaultIMEWnd (HWND hWnd)
 
UINT WINAPI ImmGetDescriptionA (HKL hKL, LPSTR lpszDescription, UINT uBufLen)
 
UINT WINAPI ImmGetDescriptionW (HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
 
DWORD WINAPI ImmGetGuideLineA (HIMC hIMC, DWORD dwIndex, LPSTR lpBuf, DWORD dwBufLen)
 
DWORD WINAPI ImmGetGuideLineW (HIMC hIMC, DWORD dwIndex, LPWSTR lpBuf, DWORD dwBufLen)
 
UINT WINAPI ImmGetIMEFileNameA (HKL hKL, LPSTR lpszFileName, UINT uBufLen)
 
UINT WINAPI ImmGetIMEFileNameW (HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
 
BOOL WINAPI ImmGetOpenStatus (HIMC hIMC)
 
DWORD WINAPI ImmGetProperty (HKL hKL, DWORD fdwIndex)
 
UINT WINAPI ImmGetRegisterWordStyleA (HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
 
UINT WINAPI ImmGetRegisterWordStyleW (HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
 
BOOL WINAPI ImmGetStatusWindowPos (HIMC hIMC, LPPOINT lpptPos)
 
UINT WINAPI ImmGetVirtualKey (HWND hWnd)
 
HKL WINAPI ImmInstallIMEA (LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
 
HKL WINAPI ImmInstallIMEW (LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
 
BOOL WINAPI ImmIsIME (HKL hKL)
 
BOOL WINAPI ImmIsUIMessageA (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmIsUIMessageW (HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmNotifyIME (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
 
BOOL WINAPI ImmRegisterWordA (HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister)
 
BOOL WINAPI ImmRegisterWordW (HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister)
 
BOOL WINAPI ImmReleaseContext (HWND hWnd, HIMC hIMC)
 
LRESULT WINAPI ImmRequestMessageA (HIMC hIMC, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI ImmRequestMessageW (HIMC hIMC, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI ImmSetCandidateWindow (HIMC hIMC, LPCANDIDATEFORM lpCandidate)
 
BOOL WINAPI ImmSetCompositionFontA (HIMC hIMC, LPLOGFONTA lplf)
 
BOOL WINAPI ImmSetCompositionFontW (HIMC hIMC, LPLOGFONTW lplf)
 
BOOL WINAPI ImmSetCompositionStringA (HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
 
BOOL WINAPI ImmSetCompositionStringW (HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
 
BOOL WINAPI ImmSetCompositionWindow (HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
 
BOOL WINAPI ImmSetConversionStatus (HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
 
BOOL WINAPI ImmSetOpenStatus (HIMC hIMC, BOOL fOpen)
 
BOOL WINAPI ImmSetStatusWindowPos (HIMC hIMC, LPPOINT lpptPos)
 
HWND WINAPI ImmCreateSoftKeyboard (UINT uType, UINT hOwner, int x, int y)
 
BOOL WINAPI ImmDestroySoftKeyboard (HWND hSoftWnd)
 
BOOL WINAPI ImmShowSoftKeyboard (HWND hSoftWnd, int nCmdShow)
 
BOOL WINAPI ImmSimulateHotKey (HWND hWnd, DWORD dwHotKeyID)
 
BOOL WINAPI ImmUnregisterWordA (HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
 
BOOL WINAPI ImmUnregisterWordW (HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
 
DWORD WINAPI ImmGetImeMenuItemsA (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOA lpImeParentMenu, LPIMEMENUITEMINFOA lpImeMenu, DWORD dwSize)
 
DWORD WINAPI ImmGetImeMenuItemsW (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize)
 
LPINPUTCONTEXT WINAPI ImmLockIMC (HIMC hIMC)
 
BOOL WINAPI ImmUnlockIMC (HIMC hIMC)
 
DWORD WINAPI ImmGetIMCLockCount (HIMC hIMC)
 
HIMCC WINAPI ImmCreateIMCC (DWORD size)
 
HIMCC WINAPI ImmDestroyIMCC (HIMCC block)
 
LPVOID WINAPI ImmLockIMCC (HIMCC imcc)
 
BOOL WINAPI ImmUnlockIMCC (HIMCC imcc)
 
DWORD WINAPI ImmGetIMCCLockCount (HIMCC imcc)
 
HIMCC WINAPI ImmReSizeIMCC (HIMCC imcc, DWORD size)
 
DWORD WINAPI ImmGetIMCCSize (HIMCC imcc)
 
BOOL WINAPI ImmGenerateMessage (HIMC hIMC)
 
BOOL WINAPI ImmTranslateMessage (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyData)
 
BOOL WINAPI ImmProcessKey (HWND hwnd, HKL hKL, UINT vKey, LPARAM lKeyData, DWORD unknown)
 
BOOL WINAPI ImmDisableTextFrameService (DWORD idThread)
 
BOOL WINAPI ImmEnumInputContext (DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam)
 
BOOL WINAPI ImmGetHotKey (DWORD hotkey, UINT *modifiers, UINT *key, HKL hkl)
 
BOOL WINAPI ImmDisableLegacyIME (void)
 

Variables

static struct list ImmHklList = LIST_INIT(ImmHklList)
 
static struct list ImmThreadDataList = LIST_INIT(ImmThreadDataList)
 
static const WCHAR szwWineIMCProperty [] = {'W','i','n','e','I','m','m','H','I','M','C','P','r','o','p','e','r','t','y',0}
 
static const WCHAR szImeFileW [] = {'I','m','e',' ','F','i','l','e',0}
 
static const WCHAR szLayoutTextW [] = {'L','a','y','o','u','t',' ','T','e','x','t',0}
 
static const WCHAR szImeRegFmt [] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','l','x',0}
 
static const WCHAR szwIME [] = {'I','M','E',0}
 
static const WCHAR szwDefaultIME [] = {'D','e','f','a','u','l','t',' ','I','M','E',0}
 
static CRITICAL_SECTION threaddata_cs = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 
static BOOL disable_ime
 

Macro Definition Documentation

◆ IMM_INIT_MAGIC

#define IMM_INIT_MAGIC   0x19650412

Definition at line 47 of file imm.c.

◆ LOAD_FUNCPTR

#define LOAD_FUNCPTR (   f)    if((ptr->p##f = (LPVOID)GetProcAddress(ptr->hIME, #f)) == NULL){WARN("Can't find function %s in ime\n", #f);}

Definition at line 339 of file imm.c.

◆ WINE_IMC_VALID_MAGIC

#define WINE_IMC_VALID_MAGIC   0x56434D49

Definition at line 90 of file imm.c.

Typedef Documentation

◆ ImmHkl

◆ IMMThreadData

◆ InputContextData

◆ LPTRANSMSG

◆ TRANSMSG

Function Documentation

◆ __wine_get_ui_window()

HWND WINAPI __wine_get_ui_window ( HKL  hkl)

Definition at line 408 of file imm.c.

409 {
410  ImmHkl *immHkl = IMM_GetImmHkl(hkl);
411  return immHkl->UIWnd;
412 }
HWND UIWnd
Definition: imm.c:57
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
HKL hkl
Definition: msctf.idl:611

◆ __wine_register_window()

BOOL WINAPI __wine_register_window ( HWND  hwnd)

Definition at line 1666 of file imm.c.

1667 {
1668  HWND new = NULL;
1670  TRACE("(%p)\n", hwnd);
1671 
1672  if (!needs_ime_window(hwnd))
1673  return FALSE;
1674 
1676  if (!thread_data)
1677  return FALSE;
1678 
1679  if (thread_data->disableIME || disable_ime)
1680  {
1681  TRACE("IME for this thread is disabled\n");
1683  return FALSE;
1684  }
1685  thread_data->windowRefs++;
1686  TRACE("windowRefs=%u, hwndDefault=%p\n",
1687  thread_data->windowRefs, thread_data->hwndDefault);
1688 
1689  /* Create default IME window */
1690  if (thread_data->windowRefs == 1)
1691  {
1692  /* Do not create the window inside of a critical section */
1696  0, 0, 1, 1, 0, 0, 0, 0);
1697  /* thread_data is in the current thread so we can assume it's still valid */
1699  /* See if anyone beat us */
1700  if (thread_data->hwndDefault == NULL)
1701  {
1702  thread_data->hwndDefault = new;
1703  new = NULL;
1704  TRACE("Default is %p\n", thread_data->hwndDefault);
1705  }
1706  }
1707 
1709 
1710  /* Clean up an unused new window outside of the critical section */
1711  if (new != NULL)
1712  DestroyWindow(new);
1713  return TRUE;
1714 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:244
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI DestroyWindow(_In_ HWND)
static BOOL disable_ime
Definition: imm.c:127
#define FALSE
Definition: types.h:117
static BOOL needs_ime_window(HWND hwnd)
Definition: imm.c:1652
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
static const WCHAR szwIME[]
Definition: imm.c:116
#define WS_POPUP
Definition: pedump.c:616
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static const WCHAR szwDefaultIME[]
Definition: imm.c:117
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119

◆ __wine_unregister_window()

void WINAPI __wine_unregister_window ( HWND  hwnd)

Definition at line 1719 of file imm.c.

1720 {
1721  HWND to_destroy = 0;
1723  TRACE("(%p)\n", hwnd);
1724 
1726  if (!thread_data) return;
1727 
1728  thread_data->windowRefs--;
1729  TRACE("windowRefs=%u, hwndDefault=%p\n",
1730  thread_data->windowRefs, thread_data->hwndDefault);
1731 
1732  /* Destroy default IME window */
1733  if (thread_data->windowRefs == 0 && thread_data->hwndDefault)
1734  {
1735  to_destroy = thread_data->hwndDefault;
1736  thread_data->hwndDefault = NULL;
1737  }
1739 
1740  if (to_destroy) DestroyWindow( to_destroy );
1741 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:244
BOOL WINAPI DestroyWindow(_In_ HWND)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119

◆ _ImmAssociateContextExEnumProc()

static BOOL CALLBACK _ImmAssociateContextExEnumProc ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 639 of file imm.c.

640 {
641  HIMC hImc = (HIMC)lParam;
643  return TRUE;
644 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:577
LPARAM lParam
Definition: combotst.c:139

Referenced by ImmAssociateContextEx().

◆ convert_candidatelist_AtoW()

static DWORD convert_candidatelist_AtoW ( LPCANDIDATELIST  lpSrc,
LPCANDIDATELIST  lpDst,
DWORD  dwBufLen 
)
static

Definition at line 205 of file imm.c.

207 {
208  DWORD ret, i, len;
209 
211  if ( lpDst && dwBufLen > 0 )
212  {
213  *lpDst = *lpSrc;
214  lpDst->dwOffset[0] = ret;
215  }
216 
217  for ( i = 0; i < lpSrc->dwCount; i++)
218  {
219  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
220 
221  if ( lpDst && dwBufLen > 0 )
222  {
223  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
224 
226  (LPWSTR)dest, dwBufLen);
227 
228  if ( i + 1 < lpSrc->dwCount )
229  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(WCHAR);
230  dwBufLen -= len * sizeof(WCHAR);
231  }
232  else
233  len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)src, -1, NULL, 0);
234 
235  ret += len * sizeof(WCHAR);
236  }
237 
238  if ( lpDst )
239  lpDst->dwSize = ret;
240 
241  return ret;
242 }
#define CP_ACP
Definition: compat.h:109
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
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
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: imm.h:74
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD dwCount
Definition: imm.h:70
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define MultiByteToWideChar
Definition: compat.h:110
static char * dest
Definition: rtl.c:135
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetCandidateListW(), and ImmGetConversionListW().

◆ convert_candidatelist_WtoA()

static DWORD convert_candidatelist_WtoA ( LPCANDIDATELIST  lpSrc,
LPCANDIDATELIST  lpDst,
DWORD  dwBufLen 
)
static

Definition at line 166 of file imm.c.

168 {
169  DWORD ret, i, len;
170 
172  if ( lpDst && dwBufLen > 0 )
173  {
174  *lpDst = *lpSrc;
175  lpDst->dwOffset[0] = ret;
176  }
177 
178  for ( i = 0; i < lpSrc->dwCount; i++)
179  {
180  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
181 
182  if ( lpDst && dwBufLen > 0 )
183  {
184  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
185 
187  (LPSTR)dest, dwBufLen, NULL, NULL);
188 
189  if ( i + 1 < lpSrc->dwCount )
190  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(char);
191  dwBufLen -= len * sizeof(char);
192  }
193  else
195 
196  ret += len * sizeof(char);
197  }
198 
199  if ( lpDst )
200  lpDst->dwSize = ret;
201 
202  return ret;
203 }
#define WideCharToMultiByte
Definition: compat.h:111
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CP_ACP
Definition: compat.h:109
char * LPSTR
Definition: xmlstorage.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
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
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: imm.h:74
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
DWORD dwCount
Definition: imm.h:70
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
static char * dest
Definition: rtl.c:135

Referenced by ImmGetCandidateListA(), and ImmGetConversionListA().

◆ CopyCompAttrIMEtoClient()

static INT CopyCompAttrIMEtoClient ( const InputContextData data,
const BYTE src,
INT  src_len,
const void comp_string,
INT  str_len,
BYTE dst,
INT  dst_len,
BOOL  unicode 
)
static

Definition at line 1251 of file imm.c.

1253 {
1254  union
1255  {
1256  const void *str;
1257  const WCHAR *strW;
1258  const char *strA;
1259  } string;
1260  INT rc;
1261 
1262  string.str = comp_string;
1263 
1264  if (is_himc_ime_unicode(data) && !unicode)
1265  {
1266  rc = WideCharToMultiByte(CP_ACP, 0, string.strW, str_len, NULL, 0, NULL, NULL);
1267  if (dst_len)
1268  {
1269  int i, j = 0, k = 0;
1270 
1271  if (rc < dst_len)
1272  dst_len = rc;
1273  for (i = 0; i < str_len; ++i)
1274  {
1275  int len;
1276 
1277  len = WideCharToMultiByte(CP_ACP, 0, string.strW + i, 1, NULL, 0, NULL, NULL);
1278  for (; len > 0; --len)
1279  {
1280  dst[j++] = src[k];
1281 
1282  if (j >= dst_len)
1283  goto end;
1284  }
1285  ++k;
1286  }
1287  end:
1288  rc = j;
1289  }
1290  }
1291  else if (!is_himc_ime_unicode(data) && unicode)
1292  {
1293  rc = MultiByteToWideChar(CP_ACP, 0, string.strA, str_len, NULL, 0);
1294  if (dst_len)
1295  {
1296  int i, j = 0;
1297 
1298  if (rc < dst_len)
1299  dst_len = rc;
1300  for (i = 0; i < str_len; ++i)
1301  {
1302  if (IsDBCSLeadByte(string.strA[i]))
1303  continue;
1304 
1305  dst[j++] = src[i];
1306 
1307  if (j >= dst_len)
1308  break;
1309  }
1310  rc = j;
1311  }
1312  }
1313  else
1314  {
1315  memcpy(dst, src, min(src_len, dst_len));
1316  rc = src_len;
1317  }
1318 
1319  return rc;
1320 }
char strA[12]
Definition: clipboard.c:2028
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
#define str_len
Definition: treelist.c:89
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58
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
WCHAR strW[12]
Definition: clipboard.c:2029
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2232
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
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 GLint GLint j
Definition: glfuncs.h:250
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
char string[160]
Definition: util.h:11
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
#define MultiByteToWideChar
Definition: compat.h:110
int k
Definition: mpi.c:3369

Referenced by ImmGetCompositionStringT().

◆ CopyCompClauseIMEtoClient()

static INT CopyCompClauseIMEtoClient ( InputContextData data,
LPBYTE  source,
INT  slen,
LPBYTE  ssource,
LPBYTE  target,
INT  tlen,
BOOL  unicode 
)
static

Definition at line 1322 of file imm.c.

1324 {
1325  INT rc;
1326 
1327  if (is_himc_ime_unicode(data) && !unicode)
1328  {
1329  if (tlen)
1330  {
1331  int i;
1332 
1333  if (slen < tlen)
1334  tlen = slen;
1335  tlen /= sizeof (DWORD);
1336  for (i = 0; i < tlen; ++i)
1337  {
1338  ((DWORD *)target)[i] = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource,
1339  ((DWORD *)source)[i],
1340  NULL, 0,
1341  NULL, NULL);
1342  }
1343  rc = sizeof (DWORD) * i;
1344  }
1345  else
1346  rc = slen;
1347  }
1348  else if (!is_himc_ime_unicode(data) && unicode)
1349  {
1350  if (tlen)
1351  {
1352  int i;
1353 
1354  if (slen < tlen)
1355  tlen = slen;
1356  tlen /= sizeof (DWORD);
1357  for (i = 0; i < tlen; ++i)
1358  {
1359  ((DWORD *)target)[i] = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource,
1360  ((DWORD *)source)[i],
1361  NULL, 0);
1362  }
1363  rc = sizeof (DWORD) * i;
1364  }
1365  else
1366  rc = slen;
1367  }
1368  else
1369  {
1370  memcpy( target, source, min(slen,tlen));
1371  rc = slen;
1372  }
1373 
1374  return rc;
1375 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
char * LPSTR
Definition: xmlstorage.h:182
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
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
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
#define MultiByteToWideChar
Definition: compat.h:110
GLenum target
Definition: glext.h:7315
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetCompositionStringT().

◆ CopyCompOffsetIMEtoClient()

static INT CopyCompOffsetIMEtoClient ( InputContextData data,
DWORD  offset,
LPBYTE  ssource,
BOOL  unicode 
)
static

Definition at line 1377 of file imm.c.

1378 {
1379  int rc;
1380 
1381  if (is_himc_ime_unicode(data) && !unicode)
1382  {
1383  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, offset, NULL, 0, NULL, NULL);
1384  }
1385  else if (!is_himc_ime_unicode(data) && unicode)
1386  {
1387  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, offset, NULL, 0);
1388  }
1389  else
1390  rc = offset;
1391 
1392  return rc;
1393 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
GLintptr offset
Definition: glext.h:5920
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define MultiByteToWideChar
Definition: compat.h:110
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetCompositionStringT().

◆ CopyCompStringIMEtoClient()

static INT CopyCompStringIMEtoClient ( const InputContextData data,
const void src,
INT  src_len,
void dst,
INT  dst_len,
BOOL  unicode 
)
static

Definition at line 1221 of file imm.c.

1223 {
1224  int char_size = unicode ? sizeof(WCHAR) : sizeof(char);
1225  INT ret;
1226 
1227  if (is_himc_ime_unicode(data) ^ unicode)
1228  {
1229  if (unicode)
1230  ret = MultiByteToWideChar(CP_ACP, 0, src, src_len, dst, dst_len / sizeof(WCHAR));
1231  else
1232  ret = WideCharToMultiByte(CP_ACP, 0, src, src_len, dst, dst_len, NULL, NULL);
1233  ret *= char_size;
1234  }
1235  else
1236  {
1237  if (dst_len)
1238  {
1239  ret = min(src_len * char_size, dst_len);
1240  memcpy(dst, src, ret);
1241  }
1242  else
1243  ret = src_len * char_size;
1244  }
1245 
1246  return ret;
1247 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
int32_t INT
Definition: typedefs.h:58
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by ImmGetCompositionStringT().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpReserved 
)

Definition at line 432 of file imm.c.

433 {
434  TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
435  switch (fdwReason)
436  {
437  case DLL_PROCESS_ATTACH:
439  {
440  return FALSE;
441  }
442  break;
443  case DLL_THREAD_ATTACH:
444  break;
445  case DLL_THREAD_DETACH:
447  break;
448  case DLL_PROCESS_DETACH:
449  if (lpReserved) break;
452  break;
453  }
454  return TRUE;
455 }
#define TRUE
Definition: types.h:120
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define FALSE
Definition: types.h:117
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:97
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define TRACE(s)
Definition: solgame.cpp:4
#define IMM_INIT_MAGIC
Definition: imm.c:47
static void IMM_FreeThreadData(void)
Definition: imm.c:286
static void IMM_FreeAllImmHkl(void)
Definition: imm.c:414

◆ EscapeRequiresWA()

static BOOL EscapeRequiresWA ( UINT  uEscape)
inlinestatic

Definition at line 933 of file imm.c.

934 {
935  if (uEscape == IME_ESC_GET_EUDC_DICTIONARY ||
936  uEscape == IME_ESC_SET_EUDC_DICTIONARY ||
937  uEscape == IME_ESC_IME_NAME ||
938  uEscape == IME_ESC_GETHELPFILENAME)
939  return TRUE;
940  return FALSE;
941 }
#define TRUE
Definition: types.h:120
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:568
#define FALSE
Definition: types.h:117
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:560
#define IME_ESC_IME_NAME
Definition: imm.h:563
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561

Referenced by ImmEscapeA(), and ImmEscapeW().

◆ get_default_context()

static HIMC get_default_context ( HWND  hwnd)
static

Definition at line 517 of file imm.c.

518 {
519  HIMC ret;
521 
522  if (!thread_data) return 0;
523 
524  if (thread_data->defaultContext)
525  {
526  ret = thread_data->defaultContext;
528  return ret;
529  }
530 
531  /* can't create a default context in another thread */
532  if (thread_data->threadID != GetCurrentThreadId())
533  {
535  return 0;
536  }
537 
539 
540  ret = ImmCreateContext();
541  if (!ret) return 0;
542  ((InputContextData*)ret)->threadDefault = TRUE;
543 
544  /* thread_data is in the current thread so we can assume it's still valid */
546 
547  if (thread_data->defaultContext) /* someone beat us */
548  {
550  ret = thread_data->defaultContext;
551  }
552  else thread_data->defaultContext = ret;
553 
555  return ret;
556 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:244
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:754
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
int ret
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:812
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119

Referenced by ImmAssociateContext(), ImmAssociateContextEx(), and ImmGetContext().

◆ get_imc_data()

static InputContextData * get_imc_data ( HIMC  hIMC)
static

Definition at line 502 of file imm.c.

503 {
504  InputContextData *data = hIMC;
505 
506  if (hIMC == NULL)
507  return NULL;
508 
509  if(IsBadReadPtr(data, sizeof(InputContextData)) || data->magic != WINE_IMC_VALID_MAGIC)
510  {
512  return NULL;
513  }
514  return data;
515 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:90
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:611
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:807

Referenced by IMM_DestroyContext(), IMM_IsCrossThreadAccess(), IMM_IsDefaultContext(), ImmAssociateContext(), ImmGenerateMessage(), ImmGetCandidateListA(), ImmGetCandidateListCountA(), ImmGetCandidateListCountW(), ImmGetCandidateListW(), ImmGetCandidateWindow(), ImmGetCompositionFontW(), ImmGetCompositionStringT(), ImmGetCompositionWindow(), ImmGetConversionStatus(), ImmGetIMCLockCount(), ImmGetImeMenuItemsA(), ImmGetImeMenuItemsW(), ImmGetOpenStatus(), ImmGetStatusWindowPos(), ImmLockIMC(), ImmNotifyIME(), ImmRequestMessageA(), ImmRequestMessageW(), ImmSetCandidateWindow(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmSetCompositionStringA(), ImmSetCompositionStringW(), ImmSetCompositionWindow(), ImmSetConversionStatus(), ImmSetOpenStatus(), ImmSetStatusWindowPos(), and ImmUnlockIMC().

◆ IMM_DestroyContext()

static BOOL IMM_DestroyContext ( HIMC  hIMC)
static

Definition at line 812 of file imm.c.

813 {
815 
816  TRACE("Destroying %p\n",hIMC);
817 
818  if (!data)
819  return FALSE;
820 
821  data->immKbd->uSelected --;
822  data->immKbd->pImeSelect(hIMC, FALSE);
823  SendMessageW(data->IMC.hWnd, WM_IME_SELECT, FALSE, (LPARAM)data->immKbd);
824 
825  ImmDestroyIMCC(data->IMC.hCompStr);
826  ImmDestroyIMCC(data->IMC.hCandInfo);
827  ImmDestroyIMCC(data->IMC.hGuideLine);
828  ImmDestroyIMCC(data->IMC.hPrivate);
829  ImmDestroyIMCC(data->IMC.hMsgBuf);
830 
831  data->magic = 0;
833 
834  return TRUE;
835 }
#define TRUE
Definition: types.h:120
#define WM_IME_SELECT
Definition: winuser.h:1815
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2964
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by get_default_context(), IMM_FreeThreadData(), ImmCreateContext(), and ImmDestroyContext().

◆ IMM_FreeAllImmHkl()

static void IMM_FreeAllImmHkl ( void  )
static

Definition at line 414 of file imm.c.

415 {
416  ImmHkl *ptr,*cursor2;
417 
419  {
420  list_remove(&ptr->entry);
421  if (ptr->hIME)
422  {
423  ptr->pImeDestroy(1);
424  FreeLibrary(ptr->hIME);
425  }
426  if (ptr->UIWnd)
427  DestroyWindow(ptr->UIWnd);
429  }
430 }
BOOL WINAPI DestroyWindow(_In_ HWND)
static PVOID ptr
Definition: dispmode.c:27
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
static struct list ImmHklList
Definition: imm.c:107
uint32_t entry
Definition: isohybrid.c:63
Definition: imm.c:50
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by DllMain().

◆ IMM_FreeThreadData()

static void IMM_FreeThreadData ( void  )
static

Definition at line 286 of file imm.c.

287 {
289 
292  {
293  if (data->threadID == GetCurrentThreadId())
294  {
295  list_remove(&data->entry);
297  IMM_DestroyContext(data->defaultContext);
299  TRACE("Thread Data Destroyed\n");
300  return;
301  }
302  }
304 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:812
uint32_t entry
Definition: isohybrid.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119
#define HeapFree(x, y, z)
Definition: compat.h:594
static struct list ImmThreadDataList
Definition: imm.c:108

Referenced by DllMain().

◆ IMM_GetImmHkl()

static ImmHkl* IMM_GetImmHkl ( HKL  hkl)
static

Definition at line 340 of file imm.c.

341 {
342  ImmHkl *ptr;
344 
345  TRACE("Seeking ime for keyboard %p\n",hkl);
346 
348  {
349  if (ptr->hkl == hkl)
350  return ptr;
351  }
352  /* not found... create it */
353 
355 
356  ptr->hkl = hkl;
358  if (!ptr->hIME) ptr->hIME = load_graphics_driver();
359  if (ptr->hIME)
360  {
362  if (!ptr->pImeInquire || !ptr->pImeInquire(&ptr->imeInfo, ptr->imeClassName, NULL))
363  {
364  FreeLibrary(ptr->hIME);
365  ptr->hIME = NULL;
366  }
367  else
368  {
371  if (!ptr->pImeSelect || !ptr->pImeDestroy)
372  {
373  FreeLibrary(ptr->hIME);
374  ptr->hIME = NULL;
375  }
376  else
377  {
391  /* make sure our classname is WCHAR */
392  if (!is_kbd_ime_unicode(ptr))
393  {
394  WCHAR bufW[17];
395  MultiByteToWideChar(CP_ACP, 0, (LPSTR)ptr->imeClassName,
396  -1, bufW, 17);
397  lstrcpyW(ptr->imeClassName, bufW);
398  }
399  }
400  }
401  }
402  list_add_head(&ImmHklList,&ptr->entry);
403 
404  return ptr;
405 }
#define LOAD_FUNCPTR(f)
Definition: imm.c:339
BOOL WINAPI ImeConfigure(HKL, HWND, DWORD, LPVOID)
BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE)
UINT WINAPI ImeToAsciiEx(UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC)
#define CP_ACP
Definition: compat.h:109
DWORD WINAPI ImeGetImeMenuItems(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD)
LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR)
BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static PVOID ptr
Definition: dispmode.c:27
#define LoadLibraryW(x)
Definition: compat.h:606
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI ImeSetActiveContext(HIMC, BOOL)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions)
static struct list ImmHklList
Definition: imm.c:107
DWORD WINAPI ImeConversionList(HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT)
uint32_t entry
Definition: isohybrid.c:63
BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD)
Definition: imm.c:50
BOOL WINAPI ImeSetCompositionString(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD)
UINT WINAPI ImeGetRegisterWordStyle(UINT, LPSTYLEBUFW)
BOOL WINAPI ImeDestroy(UINT)
HKL hkl
Definition: msctf.idl:611
#define lstrcpyW
Definition: compat.h:608
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI ImeSelect(HIMC, BOOL)
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: imm.c:1870
static HMODULE load_graphics_driver(void)
Definition: imm.c:306

Referenced by __wine_get_ui_window(), ImmConfigureIMEA(), ImmConfigureIMEW(), ImmCreateContext(), ImmEnumRegisterWordA(), ImmEnumRegisterWordW(), ImmEscapeA(), ImmEscapeW(), ImmGetConversionListA(), ImmGetConversionListW(), ImmGetProperty(), ImmGetRegisterWordStyleA(), ImmGetRegisterWordStyleW(), ImmIsIME(), ImmProcessKey(), ImmRegisterWordA(), ImmRegisterWordW(), ImmUnregisterWordA(), and ImmUnregisterWordW().

◆ IMM_GetThreadData()

static IMMThreadData* IMM_GetThreadData ( HWND  hwnd,
DWORD  thread 
)
static

Definition at line 244 of file imm.c.

245 {
247  DWORD process;
248 
249  if (hwnd)
250  {
251  if (!(thread = GetWindowThreadProcessId(hwnd, &process))) return NULL;
252  if (process != GetCurrentProcessId()) return NULL;
253  }
254  else if (thread)
255  {
257  if (!h) return NULL;
259  CloseHandle(h);
260  if (process != GetCurrentProcessId()) return NULL;
261  }
262  else
264 
267  if (data->threadID == thread) return data;
268 
270  data->threadID = thread;
272  TRACE("Thread Data Created (%x)\n",thread);
273  return data;
274 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:598
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static HANDLE process
Definition: process.c:76
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define FALSE
Definition: types.h:117
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HANDLE thread
Definition: service.c:33
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
Definition: thread.c:402
uint32_t entry
Definition: isohybrid.c:63
DWORD WINAPI GetProcessIdOfThread(IN HANDLE Thread)
Definition: thread.c:888
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define THREAD_QUERY_INFORMATION
Definition: pstypes.h:141
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
static struct list ImmThreadDataList
Definition: imm.c:108

Referenced by __wine_register_window(), __wine_unregister_window(), get_default_context(), ImmDisableIME(), and ImmGetDefaultIMEWnd().

◆ IMM_IsCrossThreadAccess()

static BOOL IMM_IsCrossThreadAccess ( HWND  hWnd,
HIMC  hIMC 
)
static

Definition at line 558 of file imm.c.

559 {
561 
562  if (hWnd)
563  {
565  if (thread != GetCurrentThreadId()) return TRUE;
566  }
567  data = get_imc_data(hIMC);
568  if (data && data->threadID != GetCurrentThreadId())
569  return TRUE;
570 
571  return FALSE;
572 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HANDLE thread
Definition: service.c:33

Referenced by ImmAssociateContext(), ImmDestroyContext(), ImmSetCandidateWindow(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmSetCompositionWindow(), ImmSetConversionStatus(), ImmSetOpenStatus(), and ImmSetStatusWindowPos().

◆ IMM_IsDefaultContext()

static BOOL IMM_IsDefaultContext ( HIMC  imc)
static

Definition at line 276 of file imm.c.

277 {
279 
280  if (!data)
281  return FALSE;
282 
283  return data->threadDefault;
284 }
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by ImmDestroyContext().

◆ ImmAssociateContext()

HIMC WINAPI ImmAssociateContext ( HWND  hWnd,
HIMC  hIMC 
)

Definition at line 577 of file imm.c.

578 {
579  HIMC old = NULL;
581 
582  TRACE("(%p, %p):\n", hWnd, hIMC);
583 
584  if(hIMC && !data)
585  return NULL;
586 
587  /*
588  * If already associated just return
589  */
590  if (hIMC && data->IMC.hWnd == hWnd)
591  return hIMC;
592 
593  if (hIMC && IMM_IsCrossThreadAccess(hWnd, hIMC))
594  return NULL;
595 
596  if (hWnd)
597  {
598  HIMC defaultContext = get_default_context( hWnd );
600 
601  if (old == NULL)
602  old = defaultContext;
603  else if (old == (HIMC)-1)
604  old = NULL;
605 
606  if (hIMC != defaultContext)
607  {
608  if (hIMC == NULL) /* Meaning disable imm for that window*/
610  else
612  }
613 
614  if (old)
615  {
616  InputContextData *old_data = old;
617  if (old_data->IMC.hWnd == hWnd)
618  old_data->IMC.hWnd = NULL;
619  }
620  }
621 
622  if (!hIMC)
623  return old;
624 
625  if(GetActiveWindow() == data->IMC.hWnd)
626  {
628  data->IMC.hWnd = hWnd;
630  }
631 
632  return old;
633 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:517
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:81
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define WM_IME_SETCONTEXT
Definition: winuser.h:1811
HWND hWnd
Definition: imm.h:28
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
Definition: imm.c:558
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:110
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ISC_SHOWUIALL
Definition: imm.h:303
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138

Referenced by _ImmAssociateContextExEnumProc(), ActiveIMMApp_AssociateContext(), ImmAssociateContextEx(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmAssociateContextEx()

BOOL WINAPI ImmAssociateContextEx ( HWND  hWnd,
HIMC  hIMC,
DWORD  dwFlags 
)

Definition at line 649 of file imm.c.

650 {
651  TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
652 
653  if (!hWnd)
654  return FALSE;
655 
656  switch (dwFlags)
657  {
658  case 0:
660  return TRUE;
661  case IACE_DEFAULT:
662  {
663  HIMC defaultContext = get_default_context( hWnd );
664  if (!defaultContext) return FALSE;
665  ImmAssociateContext(hWnd,defaultContext);
666  return TRUE;
667  }
671  return TRUE;
672  case IACE_CHILDREN:
674  return TRUE;
675  default:
676  FIXME("Unknown dwFlags 0x%x\n",dwFlags);
677  return FALSE;
678  }
679 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define IACE_DEFAULT
Definition: imm.h:579
#define IACE_IGNORENOCONTEXT
Definition: imm.h:580
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:517
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
Definition: imm.c:639
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
LONG_PTR LPARAM
Definition: windef.h:208
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:110
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:577
#define IACE_CHILDREN
Definition: imm.h:578
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by ActiveIMMApp_AssociateContextEx().

◆ ImmConfigureIMEA()

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

Definition at line 684 of file imm.c.

686 {
687  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
688 
689  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
690 
691  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
692  return FALSE;
693 
694  if (immHkl->hIME && immHkl->pImeConfigure)
695  {
696  if (dwMode != IME_CONFIG_REGISTERWORD || !is_kbd_ime_unicode(immHkl))
697  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
698  else
699  {
700  REGISTERWORDW rww;
701  REGISTERWORDA *rwa = lpData;
702  BOOL rc;
703 
704  rww.lpReading = strdupAtoW(rwa->lpReading);
705  rww.lpWord = strdupAtoW(rwa->lpWord);
706  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rww);
708  HeapFree(GetProcessHeap(),0,rww.lpWord);
709  return rc;
710  }
711  }
712  else
713  return FALSE;
714 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:142
HMODULE hIME
Definition: imm.c:53
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpWord
Definition: dimm.idl:31
LPSTR lpReading
Definition: dimm.idl:30
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:550
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_ConfigureIMEA(), and test_ImmIME().

◆ ImmConfigureIMEW()

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

Definition at line 719 of file imm.c.

721 {
722  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
723 
724  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
725 
726  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
727  return FALSE;
728 
729  if (immHkl->hIME && immHkl->pImeConfigure)
730  {
731  if (dwMode != IME_CONFIG_REGISTERWORD || is_kbd_ime_unicode(immHkl))
732  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
733  else
734  {
735  REGISTERWORDW *rww = lpData;
736  REGISTERWORDA rwa;
737  BOOL rc;
738 
739  rwa.lpReading = strdupWtoA(rww->lpReading);
740  rwa.lpWord = strdupWtoA(rww->lpWord);
741  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rwa);
743  HeapFree(GetProcessHeap(),0,rwa.lpWord);
744  return rc;
745  }
746  }
747  else
748  return FALSE;
749 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:154
HMODULE hIME
Definition: imm.c:53
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpWord
Definition: dimm.idl:31
LPSTR lpReading
Definition: dimm.idl:30
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:550
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_ConfigureIMEW(), and test_ImmIME().

◆ ImmCreateBlankCompStr()

static HIMCC ImmCreateBlankCompStr ( void  )
static

Definition at line 490 of file imm.c.

491 {
492  HIMCC rc;
494  rc = ImmCreateIMCC(sizeof(COMPOSITIONSTRING));
495  ptr = ImmLockIMCC(rc);
496  memset(ptr,0,sizeof(COMPOSITIONSTRING));
497  ptr->dwSize = sizeof(COMPOSITIONSTRING);
498  ImmUnlockIMCC(rc);
499  return rc;
500 }
DWORD HIMCC
Definition: dimm.idl:76
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2956
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ImmCreateContext().

◆ ImmCreateContext()

HIMC WINAPI ImmCreateContext ( void  )

Definition at line 754 of file imm.c.

755 {
756  InputContextData *new_context;
757  LPGUIDELINE gl;
758  LPCANDIDATEINFO ci;
759  int i;
760 
762 
763  /* Load the IME */
764  new_context->immKbd = IMM_GetImmHkl(GetKeyboardLayout(0));
765 
766  if (!new_context->immKbd->hIME)
767  {
768  TRACE("IME dll could not be loaded\n");
769  HeapFree(GetProcessHeap(),0,new_context);
770  return 0;
771  }
772 
773  /* the HIMCCs are never NULL */
774  new_context->IMC.hCompStr = ImmCreateBlankCompStr();
775  new_context->IMC.hMsgBuf = ImmCreateIMCC(0);
776  new_context->IMC.hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
777  ci = ImmLockIMCC(new_context->IMC.hCandInfo);
778  memset(ci,0,sizeof(CANDIDATEINFO));
779  ci->dwSize = sizeof(CANDIDATEINFO);
780  ImmUnlockIMCC(new_context->IMC.hCandInfo);
781  new_context->IMC.hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
782  gl = ImmLockIMCC(new_context->IMC.hGuideLine);
783  memset(gl,0,sizeof(GUIDELINE));
784  gl->dwSize = sizeof(GUIDELINE);
785  ImmUnlockIMCC(new_context->IMC.hGuideLine);
786 
787  for (i = 0; i < ARRAY_SIZE(new_context->IMC.cfCandForm); i++)
788  new_context->IMC.cfCandForm[i].dwIndex = ~0u;
789 
790  /* Initialize the IME Private */
791  new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize);
792 
793  new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps;
794  new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps;
795 
796  if (!new_context->immKbd->pImeSelect(new_context, TRUE))
797  {
798  TRACE("Selection of IME failed\n");
799  IMM_DestroyContext(new_context);
800  return 0;
801  }
802  new_context->threadID = GetCurrentThreadId();
803  SendMessageW(GetFocus(), WM_IME_SELECT, TRUE, (LPARAM)new_context->immKbd);
804 
805  new_context->immKbd->uSelected++;
806  TRACE("Created context %p\n",new_context);
807 
808  new_context->magic = WINE_IMC_VALID_MAGIC;
809  return new_context;
810 }
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 * u
Definition: glfuncs.h:240
HMODULE hIME
Definition: imm.c:53
DWORD threadID
Definition: imm.c:82
#define TRUE
Definition: types.h:120
CANDIDATEFORM cfCandForm[4]
Definition: imm.h:39
#define WM_IME_SELECT
Definition: winuser.h:1815
INPUTCONTEXT IMC
Definition: imm.c:81
DWORD fdwConversion
Definition: imm.h:32
HIMCC hPrivate
Definition: imm.h:43
DWORD dwSize
Definition: imm.h:202
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:90
DWORD magic
Definition: imm.c:87
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
static HIMCC ImmCreateBlankCompStr(void)
Definition: imm.c:490
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
HIMCC hCandInfo
Definition: imm.h:41
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
ULONG uSelected
Definition: imm.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
IMEINFO imeInfo
Definition: imm.c:54
DWORD fdwConversionCaps
Definition: imm.h:156
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
struct tagCANDIDATEINFO CANDIDATEINFO
HIMCC hMsgBuf
Definition: imm.h:45
DWORD dwPrivateDataSize
Definition: imm.h:154
struct tagGUIDELINE GUIDELINE
static const struct getline_s gl[]
HIMCC hCompStr
Definition: imm.h:40
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:812
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
DWORD dwIndex
Definition: dimm.idl:79
#define ARRAY_SIZE(a)
Definition: main.h:24
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HIMCC hGuideLine
Definition: imm.h:42
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
ImmHkl * immKbd
Definition: imm.c:84
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2956
DWORD fdwSentence
Definition: imm.h:33
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HWND WINAPI GetFocus(void)
Definition: window.c:1909
DWORD fdwSentenceCaps
Definition: imm.h:157
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_CreateContext(), get_default_context(), ImmGetContextThreadFunc(), test_ImmAssociateContextEx(), test_ImmDefaultHwnd(), test_ImmDestroyContext(), test_ImmGetIMCLockCount(), test_ImmNotifyIME(), and test_InvalidIMC().

◆ ImmCreateIMCC()

HIMCC WINAPI ImmCreateIMCC ( DWORD  size)

Definition at line 2956 of file imm.c.

2957 {
2959 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
GLsizeiptr size
Definition: glext.h:5919
#define GMEM_MOVEABLE
Definition: winbase.h:291
#define GMEM_ZEROINIT
Definition: winbase.h:303

Referenced by ImmCreateBlankCompStr(), ImmCreateContext(), ImmGenerateMessage(), test_ImmDestroyIMCC(), and test_ImmGetIMCCLockCount().

◆ ImmCreateSoftKeyboard()

HWND WINAPI ImmCreateSoftKeyboard ( UINT  uType,
UINT  hOwner,
int  x,
int  y 
)

Definition at line 2667 of file imm.c.

2668 {
2669  FIXME("(%d, %d, %d, %d): stub\n", uType, hOwner, x, y);
2671  return 0;
2672 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:111
#define SetLastError(x)
Definition: compat.h:611
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ ImmDestroyContext()

BOOL WINAPI ImmDestroyContext ( HIMC  hIMC)

Definition at line 840 of file imm.c.

841 {
842  if (!IMM_IsDefaultContext(hIMC) && !IMM_IsCrossThreadAccess(NULL, hIMC))
843  return IMM_DestroyContext(hIMC);
844  else
845  return FALSE;
846 }
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
static BOOL IMM_IsDefaultContext(HIMC imc)
Definition: imm.c:276
static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
Definition: imm.c:558
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:812

Referenced by ActiveIMMApp_DestroyContext(), test_ImmDefaultHwnd(), test_ImmDestroyContext(), test_ImmGetIMCLockCount(), test_ImmNotifyIME(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmDestroyIMCC()

HIMCC WINAPI ImmDestroyIMCC ( HIMCC  block)

Definition at line 2964 of file imm.c.

2965 {
2966  return GlobalFree(block);
2967 }
static unsigned int block
Definition: xmlmemory.c:118
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611

Referenced by IMM_DestroyContext(), ImmGenerateMessage(), test_ImmDestroyIMCC(), and test_ImmGetIMCCLockCount().

◆ ImmDestroySoftKeyboard()

BOOL WINAPI ImmDestroySoftKeyboard ( HWND  hSoftWnd)

Definition at line 2677 of file imm.c.

2678 {
2679 #ifdef __REACTOS__
2680  TRACE("(%p)\n", hSoftWnd);
2681  return DestroyWindow(hSoftWnd);
2682 #else
2683  FIXME("(%p): stub\n", hSoftWnd);
2685  return FALSE;
2686 #endif
2687 }
BOOL WINAPI DestroyWindow(_In_ HWND)
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:611
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ ImmDisableIME()

BOOL WINAPI ImmDisableIME ( DWORD  idThread)

Definition at line 851 of file imm.c.

852 {
853  if (idThread == (DWORD)-1)
854  disable_ime = TRUE;
855  else {
857  if (!thread_data) return FALSE;
858  thread_data->disableIME = TRUE;
860  }
861  return TRUE;
862 }
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:244
#define TRUE
Definition: types.h:120
static BOOL disable_ime
Definition: imm.c:127
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119

Referenced by ActiveIMMApp_DisableIME(), and test_default_ime_disabled_cb().

◆ ImmDisableLegacyIME()

BOOL WINAPI ImmDisableLegacyIME ( void  )

Definition at line 3205 of file imm.c.

3206 {
3207  FIXME("stub\n");
3208  return TRUE;
3209 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( DWORD  idThread)

Definition at line 3162 of file imm.c.

3163 {
3164  FIXME("Stub\n");
3165  return FALSE;
3166 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmEnumInputContext()

BOOL WINAPI ImmEnumInputContext ( DWORD  idThread,
IMCENUMPROC  lpfn,
LPARAM  lParam 
)

Definition at line 3172 of file imm.c.

3173 {
3174  FIXME("Stub\n");
3175  return FALSE;
3176 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmEnumRegisterWordA()

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

Definition at line 867 of file imm.c.

871 {
872  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
873  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
874  debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister), lpData);
875  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
876  {
877  if (!is_kbd_ime_unicode(immHkl))
878  return immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
879  (LPCWSTR)lpszReading, dwStyle, (LPCWSTR)lpszRegister, lpData);
880  else
881  {
882  LPWSTR lpszwReading = strdupAtoW(lpszReading);
883  LPWSTR lpszwRegister = strdupAtoW(lpszRegister);
884  BOOL rc;
885 
886  rc = immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
887  lpszwReading, dwStyle, lpszwRegister,
888  lpData);
889 
890  HeapFree(GetProcessHeap(),0,lpszwReading);
891  HeapFree(GetProcessHeap(),0,lpszwRegister);
892  return rc;
893  }
894  }
895  else
896  return 0;
897 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:142
HMODULE hIME
Definition: imm.c:53
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int(CALLBACK * REGISTERWORDENUMPROCW)(_In_ LPCWSTR, _In_ DWORD, _In_ LPCWSTR, _In_ LPVOID)
Definition: imm.h:52
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define debugstr_a
Definition: kernel32.h:31
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ ImmEnumRegisterWordW()

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

Definition at line 902 of file imm.c.

906 {
907  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
908  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
909  debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister), lpData);
910  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
911  {
912  if (is_kbd_ime_unicode(immHkl))
913  return immHkl->pImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
914  lpszRegister, lpData);
915  else
916  {
917  LPSTR lpszaReading = strdupWtoA(lpszReading);
918  LPSTR lpszaRegister = strdupWtoA(lpszRegister);
919  BOOL rc;
920 
921  rc = immHkl->pImeEnumRegisterWord(lpfnEnumProc, (LPCWSTR)lpszaReading,
922  dwStyle, (LPCWSTR)lpszaRegister, lpData);
923 
924  HeapFree(GetProcessHeap(),0,lpszaReading);
925  HeapFree(GetProcessHeap(),0,lpszaRegister);
926  return rc;
927  }
928  }
929  else
930  return 0;
931 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:154
HMODULE hIME
Definition: imm.c:53
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
char * LPSTR
Definition: xmlstorage.h:182
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ ImmEscapeA()

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

Definition at line 946 of file imm.c.

949 {
950  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
951  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
952 
953  if (immHkl->hIME && immHkl->pImeEscape)
954  {
955  if (!EscapeRequiresWA(uEscape) || !is_kbd_ime_unicode(immHkl))
956  return immHkl->pImeEscape(hIMC,uEscape,lpData);
957  else
958  {
959  WCHAR buffer[81]; /* largest required buffer should be 80 */
960  LRESULT rc;
961  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
962  {
963  MultiByteToWideChar(CP_ACP,0,lpData,-1,buffer,81);
964  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
965  }
966  else
967  {
968  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
969  WideCharToMultiByte(CP_ACP,0,buffer,-1,lpData,80, NULL, NULL);
970  }
971  return rc;
972  }
973  }
974  else
975  return 0;
976 }
HMODULE hIME
Definition: imm.c:53
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
smooth NULL
Definition: ftsmooth.c:416
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:933
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define MultiByteToWideChar
Definition: compat.h:110
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by ActiveIMMApp_EscapeA().

◆ ImmEscapeW()

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

Definition at line 981 of file imm.c.

984 {
985  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
986  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
987 
988  if (immHkl->hIME && immHkl->pImeEscape)
989  {
990  if (!EscapeRequiresWA(uEscape) || is_kbd_ime_unicode(immHkl))
991  return immHkl->pImeEscape(hIMC,uEscape,lpData);
992  else
993  {
994  CHAR buffer[81]; /* largest required buffer should be 80 */
995  LRESULT rc;
996  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
997  {
998  WideCharToMultiByte(CP_ACP,0,lpData,-1,buffer,81, NULL, NULL);
999  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1000  }
1001  else
1002  {
1003  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1004  MultiByteToWideChar(CP_ACP,0,buffer,-1,lpData,80);
1005  }
1006  return rc;
1007  }
1008  }
1009  else
1010  return 0;
1011 }
HMODULE hIME
Definition: imm.c:53
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
smooth NULL
Definition: ftsmooth.c:416
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:933
#define TRACE(s)
Definition: solgame.cpp:4
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define MultiByteToWideChar
Definition: compat.h:110
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by ActiveIMMApp_EscapeW().

◆ ImmGenerateMessage()

BOOL WINAPI ImmGenerateMessage ( HIMC  hIMC)

Definition at line 3012 of file imm.c.

3013 {
3015 
3016  if (!data)
3017  {
3019  return FALSE;
3020  }
3021 
3022  TRACE("%i messages queued\n",data->IMC.dwNumMsgBuf);
3023  if (data->IMC.dwNumMsgBuf > 0)
3024  {
3025  LPTRANSMSG lpTransMsg;
3026  HIMCC hMsgBuf;
3027  DWORD i, dwNumMsgBuf;
3028 
3029  /* We are going to detach our hMsgBuff so that if processing messages
3030  generates new messages they go into a new buffer */
3031  hMsgBuf = data->IMC.hMsgBuf;
3032  dwNumMsgBuf = data->IMC.dwNumMsgBuf;
3033 
3034  data->IMC.hMsgBuf = ImmCreateIMCC(0);
3035  data->IMC.dwNumMsgBuf = 0;
3036 
3037  lpTransMsg = ImmLockIMCC(hMsgBuf);
3038  for (i = 0; i < dwNumMsgBuf; i++)
3039  ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam);
3040 
3041  ImmUnlockIMCC(hMsgBuf);
3042  ImmDestroyIMCC(hMsgBuf);
3043  }
3044 
3045  return TRUE;
3046 }
DWORD HIMCC
Definition: dimm.idl:76
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2964
WPARAM wParam
Definition: combotst.c:138
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
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:468
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:611
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2956
LPARAM lParam
Definition: combotst.c:139

Referenced by ImmTranslateMessage(), test_ImmMessages(), and test_InvalidIMC().

◆ ImmGetCandidateListA()

DWORD WINAPI ImmGetCandidateListA ( HIMC  hIMC,
DWORD  dwIndex,
LPCANDIDATELIST  lpCandList,
DWORD  dwBufLen 
)

Definition at line 1016 of file imm.c.

1019 {
1021  LPCANDIDATEINFO candinfo;
1022  LPCANDIDATELIST candlist;
1023  DWORD ret = 0;
1024 
1025  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1026 
1027  if (!data || !data->IMC.hCandInfo)
1028  return 0;
1029 
1030  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1031  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1032  goto done;
1033 
1034  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1035  if ( !candlist->dwSize || !candlist->dwCount )
1036  goto done;
1037 
1038  if ( !is_himc_ime_unicode(data) )
1039  {
1040  ret = candlist->dwSize;
1041  if ( lpCandList && dwBufLen >= ret )
1042  memcpy(lpCandList, candlist, ret);
1043  }
1044  else
1045  ret = convert_candidatelist_WtoA( candlist, lpCandList, dwBufLen);
1046 
1047 done:
1048  ImmUnlockIMCC(data->IMC.hCandInfo);
1049  return ret;
1050 }
DWORD dwCount
Definition: imm.h:203
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
unsigned char * LPBYTE
Definition: typedefs.h:53
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
DWORD dwSize
Definition: imm.h:68
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
DWORD dwCount
Definition: imm.h:70
#define TRACE(s)
Definition: solgame.cpp:4
struct tagCANDIDATELIST * LPCANDIDATELIST
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
DWORD dwOffset[32]
Definition: imm.h:204
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ARRAY_SIZE(a)
Definition: main.h:24
static DWORD convert_candidatelist_WtoA(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:166

Referenced by ActiveIMMApp_GetCandidateListA(), ImmGetCandidateListCountA(), and test_InvalidIMC().

◆ ImmGetCandidateListCountA()

DWORD WINAPI ImmGetCandidateListCountA ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1055 of file imm.c.

1057 {
1059  LPCANDIDATEINFO candinfo;
1060  DWORD ret, count;
1061 
1062  TRACE("%p, %p\n", hIMC, lpdwListCount);
1063 
1064  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1065  return 0;
1066 
1067  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1068 
1069  *lpdwListCount = count = candinfo->dwCount;
1070 
1071  if ( !is_himc_ime_unicode(data) )
1072  ret = candinfo->dwSize;
1073  else
1074  {
1075  ret = sizeof(CANDIDATEINFO);
1076  while ( count-- )
1077  ret += ImmGetCandidateListA(hIMC, count, NULL, 0);
1078  }
1079 
1080  ImmUnlockIMCC(data->IMC.hCandInfo);
1081  return ret;
1082 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD dwCount
Definition: imm.h:203
DWORD dwSize
Definition: imm.h:202
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
struct tagCANDIDATEINFO CANDIDATEINFO
DWORD WINAPI ImmGetCandidateListA(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
Definition: imm.c:1016

Referenced by ActiveIMMApp_GetCandidateListCountA(), ActiveIMMApp_GetCandidateListCountW(), and test_InvalidIMC().

◆ ImmGetCandidateListCountW()

DWORD WINAPI ImmGetCandidateListCountW ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1087 of file imm.c.

1089 {
1091  LPCANDIDATEINFO candinfo;
1092  DWORD ret, count;
1093 
1094  TRACE("%p, %p\n", hIMC, lpdwListCount);
1095 
1096  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1097  return 0;
1098 
1099  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1100 
1101  *lpdwListCount = count = candinfo->dwCount;
1102 
1103  if ( is_himc_ime_unicode(data) )
1104  ret = candinfo->dwSize;
1105  else
1106  {
1107  ret = sizeof(CANDIDATEINFO);
1108  while ( count-- )
1109  ret += ImmGetCandidateListW(hIMC, count, NULL, 0);
1110  }
1111 
1112  ImmUnlockIMCC(data->IMC.hCandInfo);
1113  return ret;
1114 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD dwCount
Definition: imm.h:203
DWORD WINAPI ImmGetCandidateListW(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
Definition: imm.c:1119
DWORD dwSize
Definition: imm.h:202
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
struct tagCANDIDATEINFO CANDIDATEINFO

◆ ImmGetCandidateListW()

DWORD WINAPI ImmGetCandidateListW ( HIMC  hIMC,
DWORD  dwIndex,
LPCANDIDATELIST  lpCandList,
DWORD  dwBufLen 
)

Definition at line 1119 of file imm.c.

1122 {
1124  LPCANDIDATEINFO candinfo;
1125  LPCANDIDATELIST candlist;
1126  DWORD ret = 0;
1127 
1128  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1129 
1130  if (!data || !data->IMC.hCandInfo)
1131  return 0;
1132 
1133  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1134  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1135  goto done;
1136 
1137  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1138  if ( !candlist->dwSize || !candlist->dwCount )
1139  goto done;
1140 
1141  if ( is_himc_ime_unicode(data) )
1142  {
1143  ret = candlist->dwSize;
1144  if ( lpCandList && dwBufLen >= ret )
1145  memcpy(lpCandList, candlist, ret);
1146  }
1147  else
1148  ret = convert_candidatelist_AtoW( candlist, lpCandList, dwBufLen);
1149 
1150 done:
1151  ImmUnlockIMCC(data->IMC.hCandInfo);
1152  return ret;
1153 }
DWORD dwCount
Definition: imm.h:203
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
unsigned char * LPBYTE
Definition: typedefs.h:53
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
DWORD dwSize
Definition: imm.h:68
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
static DWORD convert_candidatelist_AtoW(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:205
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
DWORD dwCount
Definition: imm.h:70
#define TRACE(s)
Definition: solgame.cpp:4
struct tagCANDIDATELIST * LPCANDIDATELIST
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
DWORD dwOffset[32]
Definition: imm.h:204
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by ActiveIMMApp_GetCandidateListW(), and ImmGetCandidateListCountW().

◆ ImmGetCandidateWindow()

BOOL WINAPI ImmGetCandidateWindow ( HIMC  hIMC,
DWORD  dwIndex,
LPCANDIDATEFORM  lpCandidate 
)

Definition at line 1158 of file imm.c.

1160 {
1162 
1163  TRACE("%p, %d, %p\n", hIMC, dwIndex, lpCandidate);
1164 
1165  if (!data || !lpCandidate)
1166  return FALSE;
1167 
1168  if (dwIndex >= ARRAY_SIZE(data->IMC.cfCandForm))
1169  return FALSE;
1170 
1171  if (data->IMC.cfCandForm[dwIndex].dwIndex != dwIndex)
1172  return FALSE;
1173 
1174  *lpCandidate = data->IMC.cfCandForm[dwIndex];
1175 
1176  return TRUE;
1177 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ARRAY_SIZE(a)
Definition: main.h:24

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

◆ ImmGetCompositionFontA()

BOOL WINAPI ImmGetCompositionFontA ( HIMC  hIMC,
LPLOGFONTA  lplf 
)

Definition at line 1182 of file imm.c.

1183 {
1184  LOGFONTW lfW;
1185  BOOL rc;
1186 
1187  TRACE("(%p, %p):\n", hIMC, lplf);
1188 
1189  rc = ImmGetCompositionFontW(hIMC,&lfW);
1190  if (!rc || !lplf)
1191  return FALSE;
1192 
1193  memcpy(lplf,&lfW,sizeof(LOGFONTA));
1194  WideCharToMultiByte(CP_ACP, 0, lfW.lfFaceName, -1, lplf->lfFaceName,
1195  LF_FACESIZE, NULL, NULL);
1196  return TRUE;
1197 }
#define LF_FACESIZE
Definition: dimm.idl:39
#define WideCharToMultiByte
Definition: compat.h:111
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:109
CHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1893
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: imm.c:1202
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72

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

◆ ImmGetCompositionFontW()

BOOL WINAPI ImmGetCompositionFontW ( HIMC  hIMC,
LPLOGFONTW  lplf 
)

Definition at line 1202 of file imm.c.

1203 {
1205 
1206  TRACE("(%p, %p):\n", hIMC, lplf);
1207 
1208  if (!data || !lplf)
1209  return FALSE;
1210 
1211  *lplf = data->IMC.lfFont.W;
1212 
1213  return TRUE;
1214 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by ActiveIMMApp_GetCompositionFontW(), and ImmGetCompositionFontA().

◆ ImmGetCompositionStringA()

LONG WINAPI ImmGetCompositionStringA ( HIMC  hIMC,
DWORD  dwIndex,
LPVOID  lpBuf,
DWORD  dwBufLen 
)

Definition at line 1489 of file imm.c.

1491 {
1492  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, FALSE);
1493 }
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define FALSE
Definition: types.h:117
static LONG ImmGetCompositionStringT(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen, BOOL unicode)
Definition: imm.c:1395

Referenced by ActiveIMMApp_GetCompositionStringA(), RealDefWindowProcA(), test_ImmGetCompositionString(), test_ImmNotifyIME(), and test_InvalidIMC().

◆ ImmGetCompositionStringT()

static LONG ImmGetCompositionStringT ( HIMC  hIMC,
DWORD  dwIndex,
LPVOID  lpBuf,
DWORD  dwBufLen,
BOOL  unicode 
)
static

Definition at line 1395 of file imm.c.

1397 {
1398  LONG rc = 0;
1400  LPCOMPOSITIONSTRING compstr;
1401  LPBYTE compdata;
1402 
1403  TRACE("(%p, 0x%x, %p, %d)\n", hIMC, dwIndex, lpBuf, dwBufLen);
1404 
1405  if (!data)
1406  return FALSE;
1407 
1408  if (!data->IMC.hCompStr)
1409  return FALSE;
1410 
1411  compdata = ImmLockIMCC(data->IMC.hCompStr);
1412  compstr = (LPCOMPOSITIONSTRING)compdata;
1413 
1414  switch (dwIndex)
1415  {
1416  case GCS_RESULTSTR:
1417  TRACE("GCS_RESULTSTR\n");
1418  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultStrOffset, compstr->dwResultStrLen, lpBuf, dwBufLen, unicode);
1419  break;
1420  case GCS_COMPSTR:
1421  TRACE("GCS_COMPSTR\n");
1422  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen, lpBuf, dwBufLen, unicode);
1423  break;
1424  case GCS_COMPATTR:
1425  TRACE("GCS_COMPATTR\n");
1426  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompAttrOffset, compstr->dwCompAttrLen,
1427  compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen,
1428  lpBuf, dwBufLen, unicode);
1429  break;
1430  case GCS_COMPCLAUSE:
1431  TRACE("GCS_COMPCLAUSE\n");
1432  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompClauseOffset,compstr->dwCompClauseLen,
1433  compdata + compstr->dwCompStrOffset,
1434  lpBuf, dwBufLen, unicode);
1435  break;
1436  case GCS_RESULTCLAUSE:
1437  TRACE("GCS_RESULTCLAUSE\n");
1438  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwResultClauseOffset,compstr->dwResultClauseLen,
1439  compdata + compstr->dwResultStrOffset,
1440  lpBuf, dwBufLen, unicode);
1441  break;
1442  case GCS_RESULTREADSTR:
1443  TRACE("GCS_RESULTREADSTR\n");
1444  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultReadStrOffset, compstr->dwResultReadStrLen, lpBuf, dwBufLen, unicode);
1445  break;
1446  case GCS_RESULTREADCLAUSE:
1447  TRACE("GCS_RESULTREADCLAUSE\n");
1449  compdata + compstr->dwResultStrOffset,
1450  lpBuf, dwBufLen, unicode);
1451  break;
1452  case GCS_COMPREADSTR:
1453  TRACE("GCS_COMPREADSTR\n");
1454  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen, lpBuf, dwBufLen, unicode);
1455  break;
1456  case GCS_COMPREADATTR:
1457  TRACE("GCS_COMPREADATTR\n");
1458  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompReadAttrOffset, compstr->dwCompReadAttrLen,
1459  compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen,
1460  lpBuf, dwBufLen, unicode);
1461  break;
1462  case GCS_COMPREADCLAUSE:
1463  TRACE("GCS_COMPREADCLAUSE\n");
1464  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompReadClauseOffset,compstr->dwCompReadClauseLen,
1465  compdata + compstr->dwCompStrOffset,
1466  lpBuf, dwBufLen, unicode);
1467  break;
1468  case GCS_CURSORPOS:
1469  TRACE("GCS_CURSORPOS\n");
1470  rc = CopyCompOffsetIMEtoClient(data, compstr->dwCursorPos, compdata + compstr->dwCompStrOffset, unicode);
1471  break;
1472  case GCS_DELTASTART:
1473  TRACE("GCS_DELTASTART\n");
1474  rc = CopyCompOffsetIMEtoClient(data, compstr->dwDeltaStart, compdata + compstr->dwCompStrOffset, unicode);
1475  break;
1476  default:
1477  FIXME("Unhandled index 0x%x\n",dwIndex);
1478  break;
1479  }
1480 
1481  ImmUnlockIMCC(data->IMC.hCompStr);
1482 
1483  return rc;
1484 }
static INT CopyCompClauseIMEtoClient(InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, LPBYTE target, INT tlen, BOOL unicode)
Definition: imm.c:1322
#define GCS_RESULTREADSTR
Definition: imm.h:367
static INT CopyCompAttrIMEtoClient(const InputContextData *data, const BYTE *src, INT src_len, const void *comp_string, INT str_len, BYTE *dst, INT dst_len, BOOL unicode)
Definition: imm.c:1251
struct tagCOMPOSITIONSTRING * LPCOMPOSITIONSTRING
DWORD dwCompAttrLen
Definition: imm.h:171
DWORD dwCompReadClauseOffset
Definition: imm.h:168
DWORD dwCompStrLen
Definition: imm.h:175
DWORD dwCompReadClauseLen
Definition: imm.h:167
DWORD dwCompAttrOffset
Definition: imm.h:172
#define GCS_RESULTREADCLAUSE
Definition: imm.h:368
DWORD dwResultReadStrOffset
Definition: imm.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define GCS_CURSORPOS
Definition: imm.h:365
DWORD dwCursorPos
Definition: imm.h:177
DWORD dwCompReadStrLen
Definition: imm.h:169
static INT CopyCompOffsetIMEtoClient(InputContextData *data, DWORD offset, LPBYTE ssource, BOOL unicode)
Definition: imm.c:1377
static INT CopyCompStringIMEtoClient(const InputContextData *data, const void *src, INT src_len, void *dst, INT dst_len, BOOL unicode)
Definition: imm.c:1221
unsigned char * LPBYTE
Definition: typedefs.h:53
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2972
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:111
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define GCS_RESULTSTR
Definition: imm.h:369
#define GCS_COMPREADSTR
Definition: imm.h:359
DWORD dwResultClauseLen
Definition: imm.h:183
DWORD dwResultStrLen
Definition: imm.h:185
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwDeltaStart
Definition: imm.h:178
DWORD dwResultReadClauseOffset
Definition: imm.h:180
#define GCS_DELTASTART
Definition: imm.h:366
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2980
DWORD dwCompClauseLen
Definition: imm.h:173
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define GCS_COMPCLAUSE
Definition: imm.h:364
DWORD dwResultClauseOffset
Definition: imm.h:184
DWORD dwCompReadAttrOffset
Definition: imm.h:166
DWORD dwCompReadAttrLen
Definition: imm.h:165
#define GCS_COMPATTR
Definition: imm.h:363
DWORD dwResultReadClauseLen
Definition: imm.h:179
#define GCS_RESULTCLAUSE
Definition: imm.h:370
#define GCS_COMPREADCLAUSE
Definition: imm.h:361
DWORD dwCompStrOffset
Definition: imm.h:176
DWORD dwCompReadStrOffset
Definition: imm.h:170
DWORD dwCompClauseOffset
Definition: imm.h:174
DWORD dwResultReadStrLen
Definition: imm.h:181
#define GCS_COMPSTR
Definition: imm.h:362
#define GCS_COMPREADATTR
Definition: imm.h:360
DWORD dwResultStrOffset
Definition: imm.h:186

Referenced by ImmGetCompositionStringA(), and ImmGetCompositionStringW().

◆ ImmGetCompositionStringW()

LONG WINAPI ImmGetCompositionStringW ( HIMC  hIMC,
DWORD  dwIndex,
LPVOID  lpBuf,
DWORD  dwBufLen 
)

Definition at line 1499 of file imm.c.

1502 {
1503  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, TRUE);
1504 }
#define TRUE
Definition: types.h:120
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
static LONG ImmGetCompositionStringT(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen, BOOL unicode)
Definition: imm.c:1395

Referenced by ActiveIMMApp_GetCompositionStringW(), EDIT_GetCompositionStr(), EDIT_GetResultStr(), EDIT_ImeComposition(), ME_HandleMessage(), RealDefWindowProcW(), test_ime_wnd_proc(), and test_ImmGetCompositionString().

◆ ImmGetCompositionWindow()

BOOL WINAPI ImmGetCompositionWindow ( HIMC  hIMC,
LPCOMPOSITIONFORM  lpCompForm 
)

Definition at line 1509 of file imm.c.

1510 {
1512 
1513  TRACE("(%p, %p)\n", hIMC, lpCompForm);
1514 
1515  if (!data)
1516  return FALSE;
1517 
1518  *lpCompForm = data->IMC.cfCompForm;
1519  return TRUE;
1520 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

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

◆ ImmGetContext()

HIMC WINAPI ImmGetContext ( HWND  hWnd)

Definition at line 1526 of file imm.c.

1527 {
1528  HIMC rc;
1529 
1530  TRACE("%p\n", hWnd);
1531 
1532  if (!IsWindow(hWnd))
1533  {
1535  return NULL;
1536  }
1537 
1539  if (rc == (HIMC)-1)
1540  rc = NULL;
1541  else if (rc == NULL)
1542  rc = get_default_context( hWnd );
1543 
1544  if (rc)
1545  {
1546  InputContextData *data = rc;
1547  data->IMC.hWnd = hWnd;
1548  }
1549 
1550  TRACE("returning %p\n", rc);
1551 
1552  return rc;
1553 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:517
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:81
smooth NULL
Definition: ftsmooth.c:416
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define SetLastError(x)
Definition: compat.h:611
HWND hWnd
Definition: imm.h:28
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:110
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by ActiveIMMApp_GetContext(), EDIT_ImeComposition(), ImmGetContextThreadFunc(), ImmGetVirtualKey(), ImmProcessKey(), ImmTranslateMessage(), init(), ITextHostImpl_TxImmGetContext(), RealDefWindowProcA(), RealDefWindowProcW(), test_ime_processkey(), test_ime_wnd_proc(), test_ImmAssociateContextEx(), test_ImmDefaultHwnd(), test_ImmGetCompositionString(), test_ImmGetContext(), test_ImmIME(), test_ImmMessages(), test_ImmNotifyIME(), test_ImmSetCompositionString(), test_ImmThreads(), and test_InvalidIMC().

◆ ImmGetConversionListA()

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

Definition at line 1558 of file imm.c.

1562 {
1563  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1564  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_a(pSrc), lpDst,
1565  dwBufLen, uFlag);
1566  if (immHkl->hIME && immHkl->pImeConversionList)
1567  {
1568  if (!is_kbd_ime_unicode(immHkl))
1569  return immHkl->pImeConversionList(hIMC,(LPCWSTR)pSrc,lpDst,dwBufLen,uFlag);
1570  else
1571  {
1572  LPCANDIDATELIST lpwDst;
1573  DWORD ret = 0, len;
1574  LPWSTR pwSrc = strdupAtoW(pSrc);
1575 
1576  len = immHkl->pImeConversionList(hIMC, pwSrc, NULL, 0, uFlag);
1577  lpwDst = HeapAlloc(GetProcessHeap(), 0, len);
1578  if ( lpwDst )
1579  {
1580  immHkl->pImeConversionList(hIMC, pwSrc, lpwDst, len, uFlag);
1581  ret = convert_candidatelist_WtoA( lpwDst, lpDst, dwBufLen);
1582  HeapFree(GetProcessHeap(), 0, lpwDst);
1583  }
1584  HeapFree(GetProcessHeap(), 0, pwSrc);
1585 
1586  return ret;
1587  }
1588  }
1589  else
1590  return 0;
1591 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:142
HMODULE hIME
Definition: imm.c:53
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static DWORD convert_candidatelist_WtoA(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:166
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetConversionListA().

◆ ImmGetConversionListW()

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

Definition at line 1596 of file imm.c.

1600 {
1601  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1602  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_w(pSrc), lpDst,
1603  dwBufLen, uFlag);
1604  if (immHkl->hIME && immHkl->pImeConversionList)
1605  {
1606  if (is_kbd_ime_unicode(immHkl))
1607  return immHkl->pImeConversionList(hIMC,pSrc,lpDst,dwBufLen,uFlag);
1608  else
1609  {
1610  LPCANDIDATELIST lpaDst;
1611  DWORD ret = 0, len;
1612  LPSTR paSrc = strdupWtoA(pSrc);
1613 
1614  len = immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, NULL, 0, uFlag);
1615  lpaDst = HeapAlloc(GetProcessHeap(), 0, len);
1616  if ( lpaDst )
1617  {
1618  immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, lpaDst, len, uFlag);
1619  ret = convert_candidatelist_AtoW( lpaDst, lpDst, dwBufLen);
1620  HeapFree(GetProcessHeap(), 0, lpaDst);
1621  }
1622  HeapFree(GetProcessHeap(), 0, paSrc);
1623 
1624  return ret;
1625  }
1626  }
1627  else
1628  return 0;
1629 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:154
HMODULE hIME
Definition: imm.c:53
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:134
char * LPSTR
Definition: xmlstorage.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static DWORD convert_candidatelist_AtoW(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:205
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetConversionListW().

◆ ImmGetConversionStatus()

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

Definition at line 1634 of file imm.c.

1636 {
1638 
1639  TRACE("%p %p %p\n", hIMC, lpfdwConversion, lpfdwSentence);
1640 
1641  if (!data)
1642  return FALSE;
1643 
1644  if (lpfdwConversion)
1645  *lpfdwConversion = data->IMC.fdwConversion;
1646  if (lpfdwSentence)
1647  *lpfdwSentence = data->IMC.fdwSentence;
1648 
1649  return TRUE;
1650 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by ActiveIMMApp_GetConversionStatus(), and test_ImmThreads().

◆ ImmGetDefaultIMEWnd()

HWND WINAPI ImmGetDefaultIMEWnd ( HWND  hWnd)

Definition at line 1746 of file imm.c.

1747 {
1748  HWND ret;
1750  if (!thread_data)
1751  return NULL;
1752  ret = thread_data->hwndDefault;
1754  TRACE("Default is %p\n",ret);
1755  return ret;
1756 }
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:244
HWND hWnd
Definition: settings.c:17
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
int ret
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:119

Referenced by ActiveIMMApp_GetDefaultIMEWnd(), RealDefWindowProcA(), RealDefWindowProcW(), test_default_ime_disabled_cb(), test_default_ime_window_cancel_cb(), test_default_ime_window_cb(), test_default_ime_with_message_only_window_cb(), test_ime_wnd_proc(), test_ImmDefaultHwnd(), test_ImmGetDefaultIMEWnd_thread(), and test_ImmMessages().

◆ ImmGetDescriptionA()

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

Definition at line 1761 of file imm.c.

1763 {
1764  WCHAR *buf;
1765  DWORD len;
1766 
1767  TRACE("%p %p %d\n", hKL, lpszDescription, uBufLen);
1768 
1769  /* find out how many characters in the unicode buffer */
1770  len = ImmGetDescriptionW( hKL, NULL, 0 );
1771  if (!len)
1772  return 0;
1773 
1774  /* allocate a buffer of that size */
1775  buf = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR) );
1776  if( !buf )
1777  return 0;
1778 
1779  /* fetch the unicode buffer */
1780  len = ImmGetDescriptionW( hKL, buf, len + 1 );
1781 
1782  /* convert it back to ASCII */
1783  len = WideCharToMultiByte( CP_ACP, 0, buf, len + 1,
1784  lpszDescription, uBufLen, NULL, NULL );
1785 
1786  HeapFree( GetProcessHeap(), 0, buf );
1787 
1788  if (len == 0)
1789  return 0;
1790 
1791  return len - 1;
1792 }
#define WideCharToMultiByte
Definition: compat.h:111
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:109
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
Definition: imm.c:1797
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetDescriptionA(), and test_ImmGetDescription().

◆ ImmGetDescriptionW()

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

Definition at line 1797 of file imm.c.

1798 {
1799  static const WCHAR name[] = { 'W','i','n','e',' ','X','I','M',0 };
1800 
1801  FIXME("(%p, %p, %d): semi stub\n", hKL, lpszDescription, uBufLen);
1802 
1803  if (!hKL) return 0;
1804  if (!uBufLen) return lstrlenW( name );
1805  lstrcpynW( lpszDescription, name, uBufLen );
1806  return lstrlenW( lpszDescription );
1807 }
#define lstrlenW
Definition: compat.h:609
#define lstrcpynW
Definition: compat.h:597
#define FIXME(fmt,...)
Definition: debug.h:111
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: name.c:38

Referenced by ActiveIMMApp_GetDescriptionW(), ImmGetDescriptionA(), and test_ImmGetDescription().

◆ ImmGetGuideLineA()

DWORD WINAPI ImmGetGuideLineA ( HIMC  hIMC,
DWORD  dwIndex,
LPSTR  lpBuf,
DWORD  dwBufLen 
)

Definition at line 1812 of file imm.c.

1814 {
1815  FIXME("(%p, %d, %s, %d): stub\n",
1816  hIMC, dwIndex, debugstr_a(lpBuf), dwBufLen
1817  );
1819  return 0;
1820 }
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:611
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by ActiveIMMApp_GetGuideLineA().

◆ ImmGetGuideLineW()

DWORD WINAPI ImmGetGuideLineW ( HIMC  hIMC,
DWORD  dwIndex,
LPWSTR  lpBuf,
DWORD  dwBufLen 
)

Definition at line 1825 of file imm.c.

1826 {
1827  FIXME("(%p, %d, %s, %d): stub\n",
1828  hIMC, dwIndex, debugstr_w(lpBuf), dwBufLen
1829  );
1831  return 0;
1832 }
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define SetLastError(x)
Definition: compat.h:611
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by ActiveIMMApp_GetGuideLineW().

◆ ImmGetHotKey()

BOOL WINAPI ImmGetHotKey ( DWORD  hotkey,
UINT modifiers,
UINT key,
HKL  hkl 
)

Definition at line 3195 of file imm.c.

3196 {
3197  FIXME("%x, %p, %p, %p: stub\n", hotkey, modifiers, key, hkl);
3198  return FALSE;
3199 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
HKL hkl
Definition: msctf.idl:611
Definition: path.c:41

◆ ImmGetIMCCLockCount()

DWORD WINAPI ImmGetIMCCLockCount ( HIMCC  imcc)

Definition at line 2988 of file imm.c.

2989 {
2990  return GlobalFlags(imcc) & GMEM_LOCKCOUNT;
2991 }
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
#define GMEM_LOCKCOUNT
Definition: winbase.h:306

Referenced by test_ImmDestroyIMCC(), and test_ImmGetIMCCLockCount().

◆ ImmGetIMCCSize()

DWORD WINAPI ImmGetIMCCSize ( HIMCC  imcc)

Definition at line 3004 of file imm.c.

3005 {
3006  return GlobalSize(imcc);
3007 }
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090

Referenced by test_ImmDestroyIMCC().

◆ ImmGetIMCLockCount()

DWORD WINAPI ImmGetIMCLockCount ( HIMC  hIMC)

Definition at line 2945 of file imm.c.

2946 {
2948  if (!data)
2949  return 0;
2950  return data->dwLock;
2951 }
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by test_ImmDestroyContext(), and test_ImmGetIMCLockCount().

◆ ImmGetIMEFileNameA()

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

Definition at line 1837 of file imm.c.

1838 {
1839  LPWSTR bufW = NULL;
1840  UINT wBufLen = uBufLen;
1841  UINT rc;
1842 
1843  if (uBufLen && lpszFileName)
1844  bufW = HeapAlloc(GetProcessHeap(),0,uBufLen * sizeof(WCHAR));
1845  else /* We need this to get the number of byte required */
1846  {
1847  bufW = HeapAlloc(GetProcessHeap(),0,MAX_PATH * sizeof(WCHAR));
1848  wBufLen = MAX_PATH;
1849  }
1850 
1851  rc = ImmGetIMEFileNameW(hKL,bufW,wBufLen);
1852 
1853  if (rc > 0)
1854  {
1855  if (uBufLen && lpszFileName)
1856  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, lpszFileName,
1857  uBufLen, NULL, NULL);
1858  else /* get the length */
1859  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL,
1860  NULL);
1861  }
1862 
1863  HeapFree(GetProcessHeap(),0,bufW);
1864  return rc;
1865 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: imm.c:1870
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetIMEFileNameA().

◆ ImmGetIMEFileNameW()

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

Definition at line 1870 of file imm.c.

1871 {
1872  HKEY hkey;
1873  DWORD length;
1874  DWORD rc;
1875  WCHAR regKey[ARRAY_SIZE(szImeRegFmt)+8];
1876 
1877  wsprintfW( regKey, szImeRegFmt, (ULONG_PTR)hKL );
1878  rc = RegOpenKeyW( HKEY_LOCAL_MACHINE, regKey, &hkey);
1879  if (rc != ERROR_SUCCESS)
1880  {
1881  SetLastError(rc);
1882  return 0;
1883  }
1884 
1885  length = 0;
1887 
1888  if (rc != ERROR_SUCCESS)
1889  {
1890  RegCloseKey(hkey);
1891  SetLastError(rc);
1892  return 0;
1893  }
1894  if (length > uBufLen * sizeof(WCHAR) || !lpszFileName)
1895  {
1896  RegCloseKey(hkey);
1897  if (lpszFileName)
1898  {
1900  return 0;
1901  }
1902  else
1903  return length / sizeof(WCHAR);
1904  }
1905 
1906  RegGetValueW(hkey, NULL, szImeFileW, RRF_RT_REG_SZ, NULL, lpszFileName, &length);
1907 
1908  RegCloseKey(hkey);
1909 
1910  return length / sizeof(WCHAR);
1911 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define RRF_RT_REG_SZ
Definition: driver.c:575
uint32_t ULONG_PTR
Definition: typedefs.h:65
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:611
static const WCHAR szImeFileW[]
Definition: imm.c:112
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR szImeRegFmt[]
Definition: imm.c:114
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by ActiveIMMApp_GetIMEFileNameW(), IMM_GetImmHkl(), and ImmGetIMEFileNameA().

◆ ImmGetImeMenuItemsA()

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

Definition at line 2778 of file imm.c.

2781 {
2783  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2784  lpImeParentMenu, lpImeMenu, dwSize);
2785 
2786  if (!data)
2787  {
2789  return 0;
2790  }
2791 
2792  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2793  {
2794  if (!is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2795  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2796  (IMEMENUITEMINFOW*)lpImeParentMenu,
2797  (IMEMENUITEMINFOW*)lpImeMenu, dwSize);
2798  else
2799  {
2800  IMEMENUITEMINFOW lpImeParentMenuW;
2801  IMEMENUITEMINFOW *lpImeMenuW, *parent = NULL;
2802  DWORD rc;
2803 
2804  if (lpImeParentMenu)
2805  parent = &lpImeParentMenuW;
2806  if (lpImeMenu)
2807  {
2808  int count = dwSize / sizeof(LPIMEMENUITEMINFOA);
2809  dwSize = count * sizeof(IMEMENUITEMINFOW);
2810  lpImeMenuW = HeapAlloc(GetProcessHeap(), 0, dwSize);
2811  }
2812  else
2813  lpImeMenuW = NULL;
2814 
2815  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2816  parent, lpImeMenuW, dwSize);
2817 
2818  if (lpImeParentMenu)
2819  {
2820  memcpy(lpImeParentMenu,&lpImeParentMenuW,sizeof(IMEMENUITEMINFOA));
2821  lpImeParentMenu->hbmpItem = lpImeParentMenuW.hbmpItem;
2822  WideCharToMultiByte(CP_ACP, 0, lpImeParentMenuW.szString,
2823  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE,
2824  NULL, NULL);
2825  }
2826  if (lpImeMenu && rc)
2827  {
2828  unsigned int i;
2829  for (i = 0; i < rc; i++)
2830  {
2831  memcpy(&lpImeMenu[i],&lpImeMenuW[1],sizeof(IMEMENUITEMINFOA));
2832  lpImeMenu[i].hbmpItem = lpImeMenuW[i].hbmpItem;
2833  WideCharToMultiByte(CP_ACP, 0, lpImeMenuW[i].szString,
2834  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE,
2835  NULL, NULL);
2836  }
2837  }
2838  HeapFree(GetProcessHeap(),0,lpImeMenuW);
2839  return rc;
2840  }
2841  }
2842  else
2843  return 0;
2844 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
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
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2944
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:611
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IMEMENUITEM_STRING_SIZE
Definition: dimm.idl:115
struct tagIMEMENUITEMINFOW IMEMENUITEMINFOW
WCHAR szString[IMEMENUITEM_STRING_SIZE]
Definition: dimm.idl:137
struct tagIMEMENUITEMINFOA * LPIMEMENUITEMINFOA
#define HeapFree(x, y, z)
Definition: compat.h:594
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by ActiveIMMApp_GetImeMenuItemsA(), and test_InvalidIMC().

◆ ImmGetImeMenuItemsW()

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

Definition at line 2849 of file imm.c.

2852 {
2854  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2855  lpImeParentMenu, lpImeMenu, dwSize);
2856 
2857  if (!data)
2858  {
2860  return 0;
2861  }
2862 
2863  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2864  {
2865  if (is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2866  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2867  lpImeParentMenu, lpImeMenu, dwSize);
2868  else
2869  {
2870  IMEMENUITEMINFOA lpImeParentMenuA;
2871  IMEMENUITEMINFOA *lpImeMenuA, *parent = NULL;
2872  DWORD rc;
2873 
2874  if (lpImeParentMenu)
2875  parent = &lpImeParentMenuA;
2876  if (lpImeMenu)
2877  {
2878  int count = dwSize / sizeof(LPIMEMENUITEMINFOW);
2879  dwSize = count * sizeof(IMEMENUITEMINFOA);
2880  lpImeMenuA = HeapAlloc(GetProcessHeap(), 0, dwSize);
2881  }
2882  else
2883  lpImeMenuA = NULL;
2884 
2885  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2887  (IMEMENUITEMINFOW*)lpImeMenuA, dwSize);
2888 
2889  if (lpImeParentMenu)
2890  {
2891  memcpy(lpImeParentMenu,&lpImeParentMenuA,sizeof(IMEMENUITEMINFOA));
2892  lpImeParentMenu->hbmpItem = lpImeParentMenuA.hbmpItem;
2893  MultiByteToWideChar(CP_ACP, 0, lpImeParentMenuA.szString,
2894  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE);
2895  }
2896  if (lpImeMenu && rc)
2897  {
2898  unsigned int i;
2899  for (i = 0; i < rc; i++)
2900  {
2901  memcpy(&lpImeMenu[i],&lpImeMenuA[1],sizeof(IMEMENUITEMINFOA));
2902  lpImeMenu[i].hbmpItem = lpImeMenuA[i].hbmpItem;
2903  MultiByteToWideChar(CP_ACP, 0, lpImeMenuA[i].szString,
2904  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE);
2905  }
2906  }
2907  HeapFree(GetProcessHeap(),0,lpImeMenuA);
2908  return rc;
2909  }
2910  }
2911  else
2912  return 0;
2913 }
#define CP_ACP
Definition: compat.h:109
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
WCHAR szString[IMEMENUITEM_STRING_SIZE]
Definition: imm.h:129
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
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
smooth NULL
Definition: ftsmooth.c:416
struct tagIMEMENUITEMINFOA IMEMENUITEMINFOA
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:129
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2944
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:611
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IMEMENUITEM_STRING_SIZE
Definition: dimm.idl:115
HBITMAP hbmpItem
Definition: dimm.idl:126
#define MultiByteToWideChar
Definition: compat.h:110
HBITMAP hbmpItem
Definition: imm.h:130
#define HeapFree(x, y, z)
Definition: compat.h:594
CHAR szString[IMEMENUITEM_STRING_SIZE]
Definition: dimm.idl:125
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
struct tagIMEMENUITEMINFOW * LPIMEMENUITEMINFOW

Referenced by ActiveIMMApp_GetImeMenuItemsW().

◆ ImmGetOpenStatus()

BOOL WINAPI ImmGetOpenStatus ( HIMC  hIMC)

Definition at line 1916 of file imm.c.

1917 {
1919  static int i;
1920 
1921  if (!data)
1922  return FALSE;
1923 
1924  TRACE("(%p): semi-stub\n", hIMC);
1925 
1926  if (!i++)
1927  FIXME("(%p): semi-stub\n", hIMC);
1928 
1929  return data->IMC.fOpen;
1930 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:502
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

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

◆ ImmGetProperty()

DWORD WINAPI ImmGetProperty ( HKL  hKL,
DWORD  fdwIndex 
)

Definition at line 1935 of file imm.c.

1936 {
1937  DWORD rc = 0;
1938  ImmHkl *kbd;
1939 
1940  TRACE("(%p, %d)\n", hKL, fdwIndex);
1941  kbd = IMM_GetImmHkl(hKL);
1942 
1943  if (kbd && kbd->hIME)
1944  {
1945  switch (fdwIndex)
1946  {
1947  case IGP_PROPERTY: rc = kbd->imeInfo.fdwProperty; break;
1948  case IGP_CONVERSION: rc = kbd->imeInfo.fdwConversionCaps; break;
1949  case IGP_SENTENCE: rc = kbd->imeInfo.fdwSentenceCaps; break;
1950  case IGP_SETCOMPSTR: rc = kbd->imeInfo.fdwSCSCaps; break;
1951  case IGP_SELECT: rc = kbd->imeInfo.fdwSelectCaps; break;
1952  case IGP_GETIMEVERSION: rc = IMEVER_0400; break;
1953  case IGP_UI: rc = 0; break;
1954  default: rc = 0;
1955  }
1956  }
1957  return rc;
1958 }
HMODULE hIME
Definition: imm.c:53
#define IGP_PROPERTY
Definition: imm.h:441
#define IGP_SELECT
Definition: imm.h:446
DWORD fdwSelectCaps
Definition: imm.h:160
#define TRACE(s)
Definition: solgame.cpp:4
#define IGP_SETCOMPSTR
Definition: imm.h:445
DWORD fdwProperty
Definition: imm.h:155
unsigned long DWORD
Definition: ntddk_ex.h:95
IMEINFO imeInfo
Definition: imm.c:54
DWORD fdwConversionCaps
Definition: imm.h:156
Definition: imm.c:50
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:340
DWORD fdwSCSCaps
Definition: imm.h:159
#define IGP_GETIMEVERSION
Definition: imm.h:440
DWORD fdwSentenceCaps
Definition: imm.h:157
#define IMEVER_0400
Definition: imm.h:382
#define IGP_SENTENCE
Definition: imm.h:443
#define IGP_CONVERSION
Definition: imm.h:442
#define IGP_UI
Definition: imm.h:444

Referenced by ActiveIMMApp_GetProperty(), and test_ImmGetCompositionString().

◆ ImmGetRegisterWordStyleA()

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

Definition at line 1963 of file imm.c.

1965 {
1966  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1967  TRACE("(%p, %d, %p):\n", hKL, nItem, lpStyleBuf);
1968  if (immHkl->hIME && immHkl->pImeGetRegisterWordStyle)
1969  {
1970  if (!is_kbd_ime_unicode(immHkl))
1971  return immHkl->pImeGetRegisterWordStyle(nItem,(LPSTYLEBUFW)lpStyleBuf);
1972  else
1973  {
1974  STYLEBUFW sbw;
1975  UINT rc;
1976 
1977  rc = immHkl->pImeGetRegisterWordStyle(nItem,&sbw);
1979  lpStyleBuf->szDescription, 32, NULL, NULL);
1980  lpStyleBuf->dwStyle = sbw.dwStyle