ReactOS  0.4.14-dev-838-g99f979d
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 39 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 331 of file imm.c.

◆ WINE_IMC_VALID_MAGIC

#define WINE_IMC_VALID_MAGIC   0x56434D49

Definition at line 82 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 400 of file imm.c.

401 {
402  ImmHkl *immHkl = IMM_GetImmHkl(hkl);
403  return immHkl->UIWnd;
404 }
HWND UIWnd
Definition: imm.c:49
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
HKL hkl
Definition: msctf.idl:611

◆ __wine_register_window()

BOOL WINAPI __wine_register_window ( HWND  hwnd)

Definition at line 1658 of file imm.c.

1659 {
1660  HWND new = NULL;
1662  TRACE("(%p)\n", hwnd);
1663 
1664  if (!needs_ime_window(hwnd))
1665  return FALSE;
1666 
1668  if (!thread_data)
1669  return FALSE;
1670 
1671  if (thread_data->disableIME || disable_ime)
1672  {
1673  TRACE("IME for this thread is disabled\n");
1675  return FALSE;
1676  }
1677  thread_data->windowRefs++;
1678  TRACE("windowRefs=%u, hwndDefault=%p\n",
1679  thread_data->windowRefs, thread_data->hwndDefault);
1680 
1681  /* Create default IME window */
1682  if (thread_data->windowRefs == 1)
1683  {
1684  /* Do not create the window inside of a critical section */
1688  0, 0, 1, 1, 0, 0, 0, 0);
1689  /* thread_data is in the current thread so we can assume it's still valid */
1691  /* See if anyone beat us */
1692  if (thread_data->hwndDefault == NULL)
1693  {
1694  thread_data->hwndDefault = new;
1695  new = NULL;
1696  TRACE("Default is %p\n", thread_data->hwndDefault);
1697  }
1698  }
1699 
1701 
1702  /* Clean up an unused new window outside of the critical section */
1703  if (new != NULL)
1704  DestroyWindow(new);
1705  return TRUE;
1706 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:236
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI DestroyWindow(_In_ HWND)
static BOOL disable_ime
Definition: imm.c:119
static BOOL needs_ime_window(HWND hwnd)
Definition: imm.c:1644
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:108
#define WS_POPUP
Definition: pedump.c:616
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static const WCHAR szwDefaultIME[]
Definition: imm.c:109
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:111

◆ __wine_unregister_window()

void WINAPI __wine_unregister_window ( HWND  hwnd)

Definition at line 1711 of file imm.c.

1712 {
1713  HWND to_destroy = 0;
1715  TRACE("(%p)\n", hwnd);
1716 
1718  if (!thread_data) return;
1719 
1720  thread_data->windowRefs--;
1721  TRACE("windowRefs=%u, hwndDefault=%p\n",
1722  thread_data->windowRefs, thread_data->hwndDefault);
1723 
1724  /* Destroy default IME window */
1725  if (thread_data->windowRefs == 0 && thread_data->hwndDefault)
1726  {
1727  to_destroy = thread_data->hwndDefault;
1728  thread_data->hwndDefault = NULL;
1729  }
1731 
1732  if (to_destroy) DestroyWindow( to_destroy );
1733 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:236
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:111

◆ _ImmAssociateContextExEnumProc()

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

Definition at line 631 of file imm.c.

632 {
633  HIMC hImc = (HIMC)lParam;
635  return TRUE;
636 }
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:569
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 197 of file imm.c.

199 {
200  DWORD ret, i, len;
201 
203  if ( lpDst && dwBufLen > 0 )
204  {
205  *lpDst = *lpSrc;
206  lpDst->dwOffset[0] = ret;
207  }
208 
209  for ( i = 0; i < lpSrc->dwCount; i++)
210  {
211  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
212 
213  if ( lpDst && dwBufLen > 0 )
214  {
215  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
216 
218  (LPWSTR)dest, dwBufLen);
219 
220  if ( i + 1 < lpSrc->dwCount )
221  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(WCHAR);
222  dwBufLen -= len * sizeof(WCHAR);
223  }
224  else
225  len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)src, -1, NULL, 0);
226 
227  ret += len * sizeof(WCHAR);
228  }
229 
230  if ( lpDst )
231  lpDst->dwSize = ret;
232 
233  return ret;
234 }
#define CP_ACP
Definition: compat.h:99
_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:52
DWORD dwSize
Definition: imm.h:65
DWORD dwOffset[1]
Definition: imm.h:71
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD dwCount
Definition: imm.h:67
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:254
#define MultiByteToWideChar
Definition: compat.h:100
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 158 of file imm.c.

160 {
161  DWORD ret, i, len;
162 
164  if ( lpDst && dwBufLen > 0 )
165  {
166  *lpDst = *lpSrc;
167  lpDst->dwOffset[0] = ret;
168  }
169 
170  for ( i = 0; i < lpSrc->dwCount; i++)
171  {
172  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
173 
174  if ( lpDst && dwBufLen > 0 )
175  {
176  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
177 
179  (LPSTR)dest, dwBufLen, NULL, NULL);
180 
181  if ( i + 1 < lpSrc->dwCount )
182  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(char);
183  dwBufLen -= len * sizeof(char);
184  }
185  else
187 
188  ret += len * sizeof(char);
189  }
190 
191  if ( lpDst )
192  lpDst->dwSize = ret;
193 
194  return ret;
195 }
#define WideCharToMultiByte
Definition: compat.h:101
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CP_ACP
Definition: compat.h:99
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:52
DWORD dwSize
Definition: imm.h:65
DWORD dwOffset[1]
Definition: imm.h:71
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
DWORD dwCount
Definition: imm.h:67
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:254
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 1243 of file imm.c.

1245 {
1246  union
1247  {
1248  const void *str;
1249  const WCHAR *strW;
1250  const char *strA;
1251  } string;
1252  INT rc;
1253 
1254  string.str = comp_string;
1255 
1256  if (is_himc_ime_unicode(data) && !unicode)
1257  {
1258  rc = WideCharToMultiByte(CP_ACP, 0, string.strW, str_len, NULL, 0, NULL, NULL);
1259  if (dst_len)
1260  {
1261  int i, j = 0, k = 0;
1262 
1263  if (rc < dst_len)
1264  dst_len = rc;
1265  for (i = 0; i < str_len; ++i)
1266  {
1267  int len;
1268 
1269  len = WideCharToMultiByte(CP_ACP, 0, string.strW + i, 1, NULL, 0, NULL, NULL);
1270  for (; len > 0; --len)
1271  {
1272  dst[j++] = src[k];
1273 
1274  if (j >= dst_len)
1275  goto end;
1276  }
1277  ++k;
1278  }
1279  end:
1280  rc = j;
1281  }
1282  }
1283  else if (!is_himc_ime_unicode(data) && unicode)
1284  {
1285  rc = MultiByteToWideChar(CP_ACP, 0, string.strA, str_len, NULL, 0);
1286  if (dst_len)
1287  {
1288  int i, j = 0;
1289 
1290  if (rc < dst_len)
1291  dst_len = rc;
1292  for (i = 0; i < str_len; ++i)
1293  {
1294  if (IsDBCSLeadByte(string.strA[i]))
1295  continue;
1296 
1297  dst[j++] = src[i];
1298 
1299  if (j >= dst_len)
1300  break;
1301  }
1302  rc = j;
1303  }
1304  }
1305  else
1306  {
1307  memcpy(dst, src, min(src_len, dst_len));
1308  rc = src_len;
1309  }
1310 
1311  return rc;
1312 }
char strA[12]
Definition: clipboard.c:2028
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define str_len
Definition: treelist.c:89
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
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:121
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:100
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 1314 of file imm.c.

1316 {
1317  INT rc;
1318 
1319  if (is_himc_ime_unicode(data) && !unicode)
1320  {
1321  if (tlen)
1322  {
1323  int i;
1324 
1325  if (slen < tlen)
1326  tlen = slen;
1327  tlen /= sizeof (DWORD);
1328  for (i = 0; i < tlen; ++i)
1329  {
1330  ((DWORD *)target)[i] = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource,
1331  ((DWORD *)source)[i],
1332  NULL, 0,
1333  NULL, NULL);
1334  }
1335  rc = sizeof (DWORD) * i;
1336  }
1337  else
1338  rc = slen;
1339  }
1340  else if (!is_himc_ime_unicode(data) && unicode)
1341  {
1342  if (tlen)
1343  {
1344  int i;
1345 
1346  if (slen < tlen)
1347  tlen = slen;
1348  tlen /= sizeof (DWORD);
1349  for (i = 0; i < tlen; ++i)
1350  {
1351  ((DWORD *)target)[i] = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource,
1352  ((DWORD *)source)[i],
1353  NULL, 0);
1354  }
1355  rc = sizeof (DWORD) * i;
1356  }
1357  else
1358  rc = slen;
1359  }
1360  else
1361  {
1362  memcpy( target, source, min(slen,tlen));
1363  rc = slen;
1364  }
1365 
1366  return rc;
1367 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char * LPSTR
Definition: xmlstorage.h:182
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
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:121
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:100
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 1369 of file imm.c.

1370 {
1371  int rc;
1372 
1373  if (is_himc_ime_unicode(data) && !unicode)
1374  {
1375  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, offset, NULL, 0, NULL, NULL);
1376  }
1377  else if (!is_himc_ime_unicode(data) && unicode)
1378  {
1379  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, offset, NULL, 0);
1380  }
1381  else
1382  rc = offset;
1383 
1384  return rc;
1385 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
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:121
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define MultiByteToWideChar
Definition: compat.h:100
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 1213 of file imm.c.

1215 {
1216  int char_size = unicode ? sizeof(WCHAR) : sizeof(char);
1217  INT ret;
1218 
1219  if (is_himc_ime_unicode(data) ^ unicode)
1220  {
1221  if (unicode)
1222  ret = MultiByteToWideChar(CP_ACP, 0, src, src_len, dst, dst_len / sizeof(WCHAR));
1223  else
1224  ret = WideCharToMultiByte(CP_ACP, 0, src, src_len, dst, dst_len, NULL, NULL);
1225  ret *= char_size;
1226  }
1227  else
1228  {
1229  if (dst_len)
1230  {
1231  ret = min(src_len * char_size, dst_len);
1232  memcpy(dst, src, ret);
1233  }
1234  else
1235  ret = src_len * char_size;
1236  }
1237 
1238  return ret;
1239 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
__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:100

Referenced by ImmGetCompositionStringT().

◆ DllMain()

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

Definition at line 424 of file imm.c.

425 {
426  TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
427  switch (fdwReason)
428  {
429  case DLL_PROCESS_ATTACH:
431  {
432  return FALSE;
433  }
434  break;
435  case DLL_THREAD_ATTACH:
436  break;
437  case DLL_THREAD_DETACH:
439  break;
440  case DLL_PROCESS_DETACH:
441  if (lpReserved) break;
444  break;
445  }
446  return TRUE;
447 }
#define TRUE
Definition: types.h:120
#define DLL_THREAD_ATTACH
Definition: compat.h:121
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define DLL_THREAD_DETACH
Definition: compat.h:122
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:189
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define IMM_INIT_MAGIC
Definition: imm.c:39
static void IMM_FreeThreadData(void)
Definition: imm.c:278
static void IMM_FreeAllImmHkl(void)
Definition: imm.c:406

◆ EscapeRequiresWA()

static BOOL EscapeRequiresWA ( UINT  uEscape)
inlinestatic

Definition at line 925 of file imm.c.

926 {
927  if (uEscape == IME_ESC_GET_EUDC_DICTIONARY ||
928  uEscape == IME_ESC_SET_EUDC_DICTIONARY ||
929  uEscape == IME_ESC_IME_NAME ||
930  uEscape == IME_ESC_GETHELPFILENAME)
931  return TRUE;
932  return FALSE;
933 }
#define TRUE
Definition: types.h:120
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:565
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:557
#define IME_ESC_IME_NAME
Definition: imm.h:560
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:558

Referenced by ImmEscapeA(), and ImmEscapeW().

◆ get_default_context()

static HIMC get_default_context ( HWND  hwnd)
static

Definition at line 509 of file imm.c.

510 {
511  HIMC ret;
513 
514  if (!thread_data) return 0;
515 
516  if (thread_data->defaultContext)
517  {
518  ret = thread_data->defaultContext;
520  return ret;
521  }
522 
523  /* can't create a default context in another thread */
524  if (thread_data->threadID != GetCurrentThreadId())
525  {
527  return 0;
528  }
529 
531 
532  ret = ImmCreateContext();
533  if (!ret) return 0;
534  ((InputContextData*)ret)->threadDefault = TRUE;
535 
536  /* thread_data is in the current thread so we can assume it's still valid */
538 
539  if (thread_data->defaultContext) /* someone beat us */
540  {
542  ret = thread_data->defaultContext;
543  }
544  else thread_data->defaultContext = ret;
545 
547  return ret;
548 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:236
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:746
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
int ret
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:804
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:111

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

◆ get_imc_data()

static InputContextData * get_imc_data ( HIMC  hIMC)
static

Definition at line 494 of file imm.c.

495 {
496  InputContextData *data = hIMC;
497 
498  if (hIMC == NULL)
499  return NULL;
500 
501  if(IsBadReadPtr(data, sizeof(InputContextData)) || data->magic != WINE_IMC_VALID_MAGIC)
502  {
504  return NULL;
505  }
506  return data;
507 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:82
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:417
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 804 of file imm.c.

805 {
807 
808  TRACE("Destroying %p\n",hIMC);
809 
810  if (!data)
811  return FALSE;
812 
813  data->immKbd->uSelected --;
814  data->immKbd->pImeSelect(hIMC, FALSE);
815  SendMessageW(data->IMC.hWnd, WM_IME_SELECT, FALSE, (LPARAM)data->immKbd);
816 
817  ImmDestroyIMCC(data->IMC.hCompStr);
818  ImmDestroyIMCC(data->IMC.hCandInfo);
819  ImmDestroyIMCC(data->IMC.hGuideLine);
820  ImmDestroyIMCC(data->IMC.hPrivate);
821  ImmDestroyIMCC(data->IMC.hMsgBuf);
822 
823  data->magic = 0;
825 
826  return TRUE;
827 }
#define TRUE
Definition: types.h:120
#define WM_IME_SELECT
Definition: winuser.h:1815
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2945
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
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:402

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

◆ IMM_FreeAllImmHkl()

static void IMM_FreeAllImmHkl ( void  )
static

Definition at line 406 of file imm.c.

407 {
408  ImmHkl *ptr,*cursor2;
409 
411  {
412  list_remove(&ptr->entry);
413  if (ptr->hIME)
414  {
415  ptr->pImeDestroy(1);
416  FreeLibrary(ptr->hIME);
417  }
418  if (ptr->UIWnd)
419  DestroyWindow(ptr->UIWnd);
421  }
422 }
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:413
#define GetProcessHeap()
Definition: compat.h:403
static struct list ImmHklList
Definition: imm.c:99
uint32_t entry
Definition: isohybrid.c:63
Definition: imm.c:42
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by DllMain().

◆ IMM_FreeThreadData()

static void IMM_FreeThreadData ( void  )
static

Definition at line 278 of file imm.c.

279 {
281 
284  {
285  if (data->threadID == GetCurrentThreadId())
286  {
287  list_remove(&data->entry);
289  IMM_DestroyContext(data->defaultContext);
291  TRACE("Thread Data Destroyed\n");
292  return;
293  }
294  }
296 }
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:403
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:804
uint32_t entry
Definition: isohybrid.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:111
#define HeapFree(x, y, z)
Definition: compat.h:402
static struct list ImmThreadDataList
Definition: imm.c:100

Referenced by DllMain().

◆ IMM_GetImmHkl()

static ImmHkl* IMM_GetImmHkl ( HKL  hkl)
static

Definition at line 332 of file imm.c.

333 {
334  ImmHkl *ptr;
336 
337  TRACE("Seeking ime for keyboard %p\n",hkl);
338 
340  {
341  if (ptr->hkl == hkl)
342  return ptr;
343  }
344  /* not found... create it */
345 
347 
348  ptr->hkl = hkl;
350  if (!ptr->hIME) ptr->hIME = load_graphics_driver();
351  if (ptr->hIME)
352  {
354  if (!ptr->pImeInquire || !ptr->pImeInquire(&ptr->imeInfo, ptr->imeClassName, NULL))
355  {
356  FreeLibrary(ptr->hIME);
357  ptr->hIME = NULL;
358  }
359  else
360  {
363  if (!ptr->pImeSelect || !ptr->pImeDestroy)
364  {
365  FreeLibrary(ptr->hIME);
366  ptr->hIME = NULL;
367  }
368  else
369  {
383  /* make sure our classname is WCHAR */
384  if (!is_kbd_ime_unicode(ptr))
385  {
386  WCHAR bufW[17];
387  MultiByteToWideChar(CP_ACP, 0, (LPSTR)ptr->imeClassName,
388  -1, bufW, 17);
389  lstrcpyW(ptr->imeClassName, bufW);
390  }
391  }
392  }
393  }
394  list_add_head(&ImmHklList,&ptr->entry);
395 
396  return ptr;
397 }
#define LOAD_FUNCPTR(f)
Definition: imm.c:331
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:99
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:126
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:412
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI ImeSetActiveContext(HIMC, BOOL)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:413
#define GetProcessHeap()
Definition: compat.h:403
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:26
BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions)
static struct list ImmHklList
Definition: imm.c:99
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:42
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:414
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MultiByteToWideChar
Definition: compat.h:100
BOOL WINAPI ImeSelect(HIMC, BOOL)
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: imm.c:1862
static HMODULE load_graphics_driver(void)
Definition: imm.c:298

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 236 of file imm.c.

237 {
239  DWORD process;
240 
241  if (hwnd)
242  {
243  if (!(thread = GetWindowThreadProcessId(hwnd, &process))) return NULL;
244  if (process != GetCurrentProcessId()) return NULL;
245  }
246  else if (thread)
247  {
249  if (!h) return NULL;
251  CloseHandle(h);
252  if (process != GetCurrentProcessId()) return NULL;
253  }
254  else
256 
259  if (data->threadID == thread) return data;
260 
262  data->threadID = thread;
264  TRACE("Thread Data Created (%x)\n",thread);
265  return data;
266 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:406
__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
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:403
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:123
#define THREAD_QUERY_INFORMATION
Definition: pstypes.h:141
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:111
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
static struct list ImmThreadDataList
Definition: imm.c:100

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 550 of file imm.c.

551 {
553 
554  if (hWnd)
555  {
557  if (thread != GetCurrentThreadId()) return TRUE;
558  }
559  data = get_imc_data(hIMC);
560  if (data && data->threadID != GetCurrentThreadId())
561  return TRUE;
562 
563  return FALSE;
564 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
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 268 of file imm.c.

269 {
271 
272  if (!data)
273  return FALSE;
274 
275  return data->threadDefault;
276 }
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
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 569 of file imm.c.

570 {
571  HIMC old = NULL;
573 
574  TRACE("(%p, %p):\n", hWnd, hIMC);
575 
576  if(hIMC && !data)
577  return NULL;
578 
579  /*
580  * If already associated just return
581  */
582  if (hIMC && data->IMC.hWnd == hWnd)
583  return hIMC;
584 
585  if (hIMC && IMM_IsCrossThreadAccess(hWnd, hIMC))
586  return NULL;
587 
588  if (hWnd)
589  {
590  HIMC defaultContext = get_default_context( hWnd );
592 
593  if (old == NULL)
594  old = defaultContext;
595  else if (old == (HIMC)-1)
596  old = NULL;
597 
598  if (hIMC != defaultContext)
599  {
600  if (hIMC == NULL) /* Meaning disable imm for that window*/
602  else
604  }
605 
606  if (old)
607  {
608  InputContextData *old_data = old;
609  if (old_data->IMC.hWnd == hWnd)
610  old_data->IMC.hWnd = NULL;
611  }
612  }
613 
614  if (!hIMC)
615  return old;
616 
617  if(GetActiveWindow() == data->IMC.hWnd)
618  {
620  data->IMC.hWnd = hWnd;
622  }
623 
624  return old;
625 }
#define TRUE
Definition: types.h:120
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:509
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:73
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
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:550
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:102
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ISC_SHOWUIALL
Definition: imm.h:300
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 641 of file imm.c.

642 {
643  TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
644 
645  if (!hWnd)
646  return FALSE;
647 
648  switch (dwFlags)
649  {
650  case 0:
652  return TRUE;
653  case IACE_DEFAULT:
654  {
655  HIMC defaultContext = get_default_context( hWnd );
656  if (!defaultContext) return FALSE;
657  ImmAssociateContext(hWnd,defaultContext);
658  return TRUE;
659  }
663  return TRUE;
664  case IACE_CHILDREN:
666  return TRUE;
667  default:
668  FIXME("Unknown dwFlags 0x%x\n",dwFlags);
669  return FALSE;
670  }
671 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define IACE_DEFAULT
Definition: imm.h:576
#define IACE_IGNORENOCONTEXT
Definition: imm.h:577
#define TRUE
Definition: types.h:120
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:509
HWND hWnd
Definition: settings.c:17
static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
Definition: imm.c:631
#define FIXME(fmt,...)
Definition: debug.h:110
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:102
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:569
#define IACE_CHILDREN
Definition: imm.h:575
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 676 of file imm.c.

678 {
679  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
680 
681  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
682 
683  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
684  return FALSE;
685 
686  if (immHkl->hIME && immHkl->pImeConfigure)
687  {
688  if (dwMode != IME_CONFIG_REGISTERWORD || !is_kbd_ime_unicode(immHkl))
689  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
690  else
691  {
692  REGISTERWORDW rww;
693  REGISTERWORDA *rwa = lpData;
694  BOOL rc;
695 
696  rww.lpReading = strdupAtoW(rwa->lpReading);
697  rww.lpWord = strdupAtoW(rwa->lpWord);
698  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rww);
700  HeapFree(GetProcessHeap(),0,rww.lpWord);
701  return rc;
702  }
703  }
704  else
705  return FALSE;
706 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:134
HMODULE hIME
Definition: imm.c:45
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
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:403
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:547
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_ConfigureIMEA(), and test_ImmIME().

◆ ImmConfigureIMEW()

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

Definition at line 711 of file imm.c.

713 {
714  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
715 
716  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
717 
718  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
719  return FALSE;
720 
721  if (immHkl->hIME && immHkl->pImeConfigure)
722  {
723  if (dwMode != IME_CONFIG_REGISTERWORD || is_kbd_ime_unicode(immHkl))
724  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
725  else
726  {
727  REGISTERWORDW *rww = lpData;
728  REGISTERWORDA rwa;
729  BOOL rc;
730 
731  rwa.lpReading = strdupWtoA(rww->lpReading);
732  rwa.lpWord = strdupWtoA(rww->lpWord);
733  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rwa);
735  HeapFree(GetProcessHeap(),0,rwa.lpWord);
736  return rc;
737  }
738  }
739  else
740  return FALSE;
741 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:146
HMODULE hIME
Definition: imm.c:45
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
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:403
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:547
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_ConfigureIMEW(), and test_ImmIME().

◆ ImmCreateBlankCompStr()

static HIMCC ImmCreateBlankCompStr ( void  )
static

Definition at line 482 of file imm.c.

483 {
484  HIMCC rc;
486  rc = ImmCreateIMCC(sizeof(COMPOSITIONSTRING));
487  ptr = ImmLockIMCC(rc);
488  memset(ptr,0,sizeof(COMPOSITIONSTRING));
489  ptr->dwSize = sizeof(COMPOSITIONSTRING);
490  ImmUnlockIMCC(rc);
491  return rc;
492 }
DWORD HIMCC
Definition: dimm.idl:76
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2937
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ImmCreateContext().

◆ ImmCreateContext()

HIMC WINAPI ImmCreateContext ( void  )

Definition at line 746 of file imm.c.

747 {
748  InputContextData *new_context;
749  LPGUIDELINE gl;
750  LPCANDIDATEINFO ci;
751  int i;
752 
754 
755  /* Load the IME */
756  new_context->immKbd = IMM_GetImmHkl(GetKeyboardLayout(0));
757 
758  if (!new_context->immKbd->hIME)
759  {
760  TRACE("IME dll could not be loaded\n");
761  HeapFree(GetProcessHeap(),0,new_context);
762  return 0;
763  }
764 
765  /* the HIMCCs are never NULL */
766  new_context->IMC.hCompStr = ImmCreateBlankCompStr();
767  new_context->IMC.hMsgBuf = ImmCreateIMCC(0);
768  new_context->IMC.hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
769  ci = ImmLockIMCC(new_context->IMC.hCandInfo);
770  memset(ci,0,sizeof(CANDIDATEINFO));
771  ci->dwSize = sizeof(CANDIDATEINFO);
772  ImmUnlockIMCC(new_context->IMC.hCandInfo);
773  new_context->IMC.hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
774  gl = ImmLockIMCC(new_context->IMC.hGuideLine);
775  memset(gl,0,sizeof(GUIDELINE));
776  gl->dwSize = sizeof(GUIDELINE);
777  ImmUnlockIMCC(new_context->IMC.hGuideLine);
778 
779  for (i = 0; i < ARRAY_SIZE(new_context->IMC.cfCandForm); i++)
780  new_context->IMC.cfCandForm[i].dwIndex = ~0u;
781 
782  /* Initialize the IME Private */
783  new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize);
784 
785  new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps;
786  new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps;
787 
788  if (!new_context->immKbd->pImeSelect(new_context, TRUE))
789  {
790  TRACE("Selection of IME failed\n");
791  IMM_DestroyContext(new_context);
792  return 0;
793  }
794  new_context->threadID = GetCurrentThreadId();
795  SendMessageW(GetFocus(), WM_IME_SELECT, TRUE, (LPARAM)new_context->immKbd);
796 
797  new_context->immKbd->uSelected++;
798  TRACE("Created context %p\n",new_context);
799 
800  new_context->magic = WINE_IMC_VALID_MAGIC;
801  return new_context;
802 }
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
#define TRUE
Definition: types.h:120
HMODULE hIME
Definition: imm.c:45
DWORD threadID
Definition: imm.c:74
CANDIDATEFORM cfCandForm[4]
Definition: imm.h:39
#define WM_IME_SELECT
Definition: winuser.h:1815
INPUTCONTEXT IMC
Definition: imm.c:73
DWORD fdwConversion
Definition: imm.h:32
HIMCC hPrivate
Definition: imm.h:43
DWORD dwSize
Definition: imm.h:199
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:82
DWORD magic
Definition: imm.c:79
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:482
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
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:48
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
IMEINFO imeInfo
Definition: imm.c:46
DWORD fdwConversionCaps
Definition: imm.h:153
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
struct tagCANDIDATEINFO CANDIDATEINFO
HIMCC hMsgBuf
Definition: imm.h:45
DWORD dwPrivateDataSize
Definition: imm.h:151
struct tagGUIDELINE GUIDELINE
static const struct getline_s gl[]
HIMCC hCompStr
Definition: imm.h:40
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:804
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
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:76
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2937
DWORD fdwSentence
Definition: imm.h:33
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HWND WINAPI GetFocus(void)
Definition: window.c:1905
DWORD fdwSentenceCaps
Definition: imm.h:154
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:402

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 2937 of file imm.c.

2938 {
2940 }
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 2659 of file imm.c.

2660 {
2661  FIXME("(%d, %d, %d, %d): stub\n", uType, hOwner, x, y);
2663  return 0;
2664 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ ImmDestroyContext()

BOOL WINAPI ImmDestroyContext ( HIMC  hIMC)

Definition at line 832 of file imm.c.

833 {
834  if (!IMM_IsDefaultContext(hIMC) && !IMM_IsCrossThreadAccess(NULL, hIMC))
835  return IMM_DestroyContext(hIMC);
836  else
837  return FALSE;
838 }
smooth NULL
Definition: ftsmooth.c:416
static BOOL IMM_IsDefaultContext(HIMC imc)
Definition: imm.c:268
static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
Definition: imm.c:550
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:804

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 2945 of file imm.c.

2946 {
2947  return GlobalFree(block);
2948 }
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 2669 of file imm.c.

2670 {
2671  FIXME("(%p): stub\n", hSoftWnd);
2673  return FALSE;
2674 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ ImmDisableIME()

BOOL WINAPI ImmDisableIME ( DWORD  idThread)

Definition at line 843 of file imm.c.

844 {
845  if (idThread == (DWORD)-1)
846  disable_ime = TRUE;
847  else {
849  if (!thread_data) return FALSE;
850  thread_data->disableIME = TRUE;
852  }
853  return TRUE;
854 }
#define TRUE
Definition: types.h:120
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:236
static BOOL disable_ime
Definition: imm.c:119
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:111

Referenced by ActiveIMMApp_DisableIME(), and test_default_ime_disabled_cb().

◆ ImmDisableLegacyIME()

BOOL WINAPI ImmDisableLegacyIME ( void  )

Definition at line 3172 of file imm.c.

3173 {
3174  FIXME("stub\n");
3175  return TRUE;
3176 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( DWORD  idThread)

Definition at line 3143 of file imm.c.

3144 {
3145  FIXME("Stub\n");
3146  return FALSE;
3147 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ImmEnumInputContext()

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

Definition at line 3153 of file imm.c.

3154 {
3155  FIXME("Stub\n");
3156  return FALSE;
3157 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ImmEnumRegisterWordA()

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

Definition at line 859 of file imm.c.

863 {
864  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
865  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
866  debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister), lpData);
867  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
868  {
869  if (!is_kbd_ime_unicode(immHkl))
870  return immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
871  (LPCWSTR)lpszReading, dwStyle, (LPCWSTR)lpszRegister, lpData);
872  else
873  {
874  LPWSTR lpszwReading = strdupAtoW(lpszReading);
875  LPWSTR lpszwRegister = strdupAtoW(lpszRegister);
876  BOOL rc;
877 
878  rc = immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
879  lpszwReading, dwStyle, lpszwRegister,
880  lpData);
881 
882  HeapFree(GetProcessHeap(),0,lpszwReading);
883  HeapFree(GetProcessHeap(),0,lpszwRegister);
884  return rc;
885  }
886  }
887  else
888  return 0;
889 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:134
HMODULE hIME
Definition: imm.c:45
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int(CALLBACK * REGISTERWORDENUMPROCW)(_In_ LPCWSTR, _In_ DWORD, _In_ LPCWSTR, _In_ LPVOID)
Definition: imm.h:49
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
#define debugstr_a
Definition: kernel32.h:31
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ ImmEnumRegisterWordW()

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

Definition at line 894 of file imm.c.

898 {
899  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
900  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
901  debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister), lpData);
902  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
903  {
904  if (is_kbd_ime_unicode(immHkl))
905  return immHkl->pImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
906  lpszRegister, lpData);
907  else
908  {
909  LPSTR lpszaReading = strdupWtoA(lpszReading);
910  LPSTR lpszaRegister = strdupWtoA(lpszRegister);
911  BOOL rc;
912 
913  rc = immHkl->pImeEnumRegisterWord(lpfnEnumProc, (LPCWSTR)lpszaReading,
914  dwStyle, (LPCWSTR)lpszaRegister, lpData);
915 
916  HeapFree(GetProcessHeap(),0,lpszaReading);
917  HeapFree(GetProcessHeap(),0,lpszaRegister);
918  return rc;
919  }
920  }
921  else
922  return 0;
923 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:146
HMODULE hIME
Definition: imm.c:45
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
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:403
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ ImmEscapeA()

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

Definition at line 938 of file imm.c.

941 {
942  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
943  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
944 
945  if (immHkl->hIME && immHkl->pImeEscape)
946  {
947  if (!EscapeRequiresWA(uEscape) || !is_kbd_ime_unicode(immHkl))
948  return immHkl->pImeEscape(hIMC,uEscape,lpData);
949  else
950  {
951  WCHAR buffer[81]; /* largest required buffer should be 80 */
952  LRESULT rc;
953  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
954  {
955  MultiByteToWideChar(CP_ACP,0,lpData,-1,buffer,81);
956  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
957  }
958  else
959  {
960  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
961  WideCharToMultiByte(CP_ACP,0,buffer,-1,lpData,80, NULL, NULL);
962  }
963  return rc;
964  }
965  }
966  else
967  return 0;
968 }
HMODULE hIME
Definition: imm.c:45
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
smooth NULL
Definition: ftsmooth.c:416
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:925
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define MultiByteToWideChar
Definition: compat.h:100
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:558
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 973 of file imm.c.

976 {
977  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
978  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
979 
980  if (immHkl->hIME && immHkl->pImeEscape)
981  {
982  if (!EscapeRequiresWA(uEscape) || is_kbd_ime_unicode(immHkl))
983  return immHkl->pImeEscape(hIMC,uEscape,lpData);
984  else
985  {
986  CHAR buffer[81]; /* largest required buffer should be 80 */
987  LRESULT rc;
988  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
989  {
990  WideCharToMultiByte(CP_ACP,0,lpData,-1,buffer,81, NULL, NULL);
991  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
992  }
993  else
994  {
995  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
996  MultiByteToWideChar(CP_ACP,0,buffer,-1,lpData,80);
997  }
998  return rc;
999  }
1000  }
1001  else
1002  return 0;
1003 }
HMODULE hIME
Definition: imm.c:45
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
smooth NULL
Definition: ftsmooth.c:416
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:925
#define TRACE(s)
Definition: solgame.cpp:4
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define MultiByteToWideChar
Definition: compat.h:100
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:558
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by ActiveIMMApp_EscapeW().

◆ ImmGenerateMessage()

BOOL WINAPI ImmGenerateMessage ( HIMC  hIMC)

Definition at line 2993 of file imm.c.

2994 {
2996 
2997  if (!data)
2998  {
3000  return FALSE;
3001  }
3002 
3003  TRACE("%i messages queued\n",data->IMC.dwNumMsgBuf);
3004  if (data->IMC.dwNumMsgBuf > 0)
3005  {
3006  LPTRANSMSG lpTransMsg;
3007  HIMCC hMsgBuf;
3008  DWORD i, dwNumMsgBuf;
3009 
3010  /* We are going to detach our hMsgBuff so that if processing messages
3011  generates new messages they go into a new buffer */
3012  hMsgBuf = data->IMC.hMsgBuf;
3013  dwNumMsgBuf = data->IMC.dwNumMsgBuf;
3014 
3015  data->IMC.hMsgBuf = ImmCreateIMCC(0);
3016  data->IMC.dwNumMsgBuf = 0;
3017 
3018  lpTransMsg = ImmLockIMCC(hMsgBuf);
3019  for (i = 0; i < dwNumMsgBuf; i++)
3020  ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam);
3021 
3022  ImmUnlockIMCC(hMsgBuf);
3023  ImmDestroyIMCC(hMsgBuf);
3024  }
3025 
3026  return TRUE;
3027 }
DWORD HIMCC
Definition: dimm.idl:76
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:2945
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:2953
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:460
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2937
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 1008 of file imm.c.

1011 {
1013  LPCANDIDATEINFO candinfo;
1014  LPCANDIDATELIST candlist;
1015  DWORD ret = 0;
1016 
1017  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1018 
1019  if (!data || !data->IMC.hCandInfo)
1020  return 0;
1021 
1022  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1023  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1024  goto done;
1025 
1026  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1027  if ( !candlist->dwSize || !candlist->dwCount )
1028  goto done;
1029 
1030  if ( !is_himc_ime_unicode(data) )
1031  {
1032  ret = candlist->dwSize;
1033  if ( lpCandList && dwBufLen >= ret )
1034  memcpy(lpCandList, candlist, ret);
1035  }
1036  else
1037  ret = convert_candidatelist_WtoA( candlist, lpCandList, dwBufLen);
1038 
1039 done:
1040  ImmUnlockIMCC(data->IMC.hCandInfo);
1041  return ret;
1042 }
DWORD dwCount
Definition: imm.h:200
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
unsigned char * LPBYTE
Definition: typedefs.h:52
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
DWORD dwSize
Definition: imm.h:65
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
DWORD dwCount
Definition: imm.h:67
#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:2961
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
DWORD dwOffset[32]
Definition: imm.h:201
#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:158

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

◆ ImmGetCandidateListCountA()

DWORD WINAPI ImmGetCandidateListCountA ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1047 of file imm.c.

1049 {
1051  LPCANDIDATEINFO candinfo;
1052  DWORD ret, count;
1053 
1054  TRACE("%p, %p\n", hIMC, lpdwListCount);
1055 
1056  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1057  return 0;
1058 
1059  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1060 
1061  *lpdwListCount = count = candinfo->dwCount;
1062 
1063  if ( !is_himc_ime_unicode(data) )
1064  ret = candinfo->dwSize;
1065  else
1066  {
1067  ret = sizeof(CANDIDATEINFO);
1068  while ( count-- )
1069  ret += ImmGetCandidateListA(hIMC, count, NULL, 0);
1070  }
1071 
1072  ImmUnlockIMCC(data->IMC.hCandInfo);
1073  return ret;
1074 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD dwCount
Definition: imm.h:200
DWORD dwSize
Definition: imm.h:199
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
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:1008

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

◆ ImmGetCandidateListCountW()

DWORD WINAPI ImmGetCandidateListCountW ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1079 of file imm.c.

1081 {
1083  LPCANDIDATEINFO candinfo;
1084  DWORD ret, count;
1085 
1086  TRACE("%p, %p\n", hIMC, lpdwListCount);
1087 
1088  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1089  return 0;
1090 
1091  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1092 
1093  *lpdwListCount = count = candinfo->dwCount;
1094 
1095  if ( is_himc_ime_unicode(data) )
1096  ret = candinfo->dwSize;
1097  else
1098  {
1099  ret = sizeof(CANDIDATEINFO);
1100  while ( count-- )
1101  ret += ImmGetCandidateListW(hIMC, count, NULL, 0);
1102  }
1103 
1104  ImmUnlockIMCC(data->IMC.hCandInfo);
1105  return ret;
1106 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD dwCount
Definition: imm.h:200
DWORD WINAPI ImmGetCandidateListW(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen)
Definition: imm.c:1111
DWORD dwSize
Definition: imm.h:199
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2961
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 1111 of file imm.c.

1114 {
1116  LPCANDIDATEINFO candinfo;
1117  LPCANDIDATELIST candlist;
1118  DWORD ret = 0;
1119 
1120  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1121 
1122  if (!data || !data->IMC.hCandInfo)
1123  return 0;
1124 
1125  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1126  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1127  goto done;
1128 
1129  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1130  if ( !candlist->dwSize || !candlist->dwCount )
1131  goto done;
1132 
1133  if ( is_himc_ime_unicode(data) )
1134  {
1135  ret = candlist->dwSize;
1136  if ( lpCandList && dwBufLen >= ret )
1137  memcpy(lpCandList, candlist, ret);
1138  }
1139  else
1140  ret = convert_candidatelist_AtoW( candlist, lpCandList, dwBufLen);
1141 
1142 done:
1143  ImmUnlockIMCC(data->IMC.hCandInfo);
1144  return ret;
1145 }
DWORD dwCount
Definition: imm.h:200
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
unsigned char * LPBYTE
Definition: typedefs.h:52
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2953
DWORD dwSize
Definition: imm.h:65
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
static DWORD convert_candidatelist_AtoW(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:197
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
DWORD dwCount
Definition: imm.h:67
#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:2961
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
DWORD dwOffset[32]
Definition: imm.h:201
#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 1150 of file imm.c.

1152 {
1154 
1155  TRACE("%p, %d, %p\n", hIMC, dwIndex, lpCandidate);
1156 
1157  if (!data || !lpCandidate)
1158  return FALSE;
1159 
1160  if (dwIndex >= ARRAY_SIZE(data->IMC.cfCandForm))
1161  return FALSE;
1162 
1163  if (data->IMC.cfCandForm[dwIndex].dwIndex != dwIndex)
1164  return FALSE;
1165 
1166  *lpCandidate = data->IMC.cfCandForm[dwIndex];
1167 
1168  return TRUE;
1169 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
#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 1174 of file imm.c.

1175 {
1176  LOGFONTW lfW;
1177  BOOL rc;
1178 
1179  TRACE("(%p, %p):\n", hIMC, lplf);
1180 
1181  rc = ImmGetCompositionFontW(hIMC,&lfW);
1182  if (!rc || !lplf)
1183  return FALSE;
1184 
1185  memcpy(lplf,&lfW,sizeof(LOGFONTA));
1186  WideCharToMultiByte(CP_ACP, 0, lfW.lfFaceName, -1, lplf->lfFaceName,
1187  LF_FACESIZE, NULL, NULL);
1188  return TRUE;
1189 }
#define TRUE
Definition: types.h:120
#define LF_FACESIZE
Definition: dimm.idl:39
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
CHAR lfFaceName[LF_FACESIZE]
Definition: wingdi.h:1893
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:1194
#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 1194 of file imm.c.

1195 {
1197 
1198  TRACE("(%p, %p):\n", hIMC, lplf);
1199 
1200  if (!data || !lplf)
1201  return FALSE;
1202 
1203  *lplf = data->IMC.lfFont.W;
1204 
1205  return TRUE;
1206 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
#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 1481 of file imm.c.

1483 {
1484  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, FALSE);
1485 }
_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:1387

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 1387 of file imm.c.

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

Referenced by ImmGetCompositionStringA(), and ImmGetCompositionStringW().

◆ ImmGetCompositionStringW()

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

Definition at line 1491 of file imm.c.

1494 {
1495  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, TRUE);
1496 }
#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:1387

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 1501 of file imm.c.

1502 {
1504 
1505  TRACE("(%p, %p)\n", hIMC, lpCompForm);
1506 
1507  if (!data)
1508  return FALSE;
1509 
1510  *lpCompForm = data->IMC.cfCompForm;
1511  return TRUE;
1512 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
#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 1518 of file imm.c.

1519 {
1520  HIMC rc;
1521 
1522  TRACE("%p\n", hWnd);
1523 
1524  if (!IsWindow(hWnd))
1525  {
1527  return NULL;
1528  }
1529 
1531  if (rc == (HIMC)-1)
1532  rc = NULL;
1533  else if (rc == NULL)
1534  rc = get_default_context( hWnd );
1535 
1536  if (rc)
1537  {
1538  InputContextData *data = rc;
1539  data->IMC.hWnd = hWnd;
1540  }
1541 
1542  TRACE("returning %p\n", rc);
1543 
1544  return rc;
1545 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:509
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:73
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:417
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:102
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 1550 of file imm.c.

1554 {
1555  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1556  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_a(pSrc), lpDst,
1557  dwBufLen, uFlag);
1558  if (immHkl->hIME && immHkl->pImeConversionList)
1559  {
1560  if (!is_kbd_ime_unicode(immHkl))
1561  return immHkl->pImeConversionList(hIMC,(LPCWSTR)pSrc,lpDst,dwBufLen,uFlag);
1562  else
1563  {
1564  LPCANDIDATELIST lpwDst;
1565  DWORD ret = 0, len;
1566  LPWSTR pwSrc = strdupAtoW(pSrc);
1567 
1568  len = immHkl->pImeConversionList(hIMC, pwSrc, NULL, 0, uFlag);
1569  lpwDst = HeapAlloc(GetProcessHeap(), 0, len);
1570  if ( lpwDst )
1571  {
1572  immHkl->pImeConversionList(hIMC, pwSrc, lpwDst, len, uFlag);
1573  ret = convert_candidatelist_WtoA( lpwDst, lpDst, dwBufLen);
1574  HeapFree(GetProcessHeap(), 0, lpwDst);
1575  }
1576  HeapFree(GetProcessHeap(), 0, pwSrc);
1577 
1578  return ret;
1579  }
1580  }
1581  else
1582  return 0;
1583 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:134
HMODULE hIME
Definition: imm.c:45
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
_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:403
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:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static DWORD convert_candidatelist_WtoA(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:158
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_GetConversionListA().

◆ ImmGetConversionListW()

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

Definition at line 1588 of file imm.c.

1592 {
1593  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1594  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_w(pSrc), lpDst,
1595  dwBufLen, uFlag);
1596  if (immHkl->hIME && immHkl->pImeConversionList)
1597  {
1598  if (is_kbd_ime_unicode(immHkl))
1599  return immHkl->pImeConversionList(hIMC,pSrc,lpDst,dwBufLen,uFlag);
1600  else
1601  {
1602  LPCANDIDATELIST lpaDst;
1603  DWORD ret = 0, len;
1604  LPSTR paSrc = strdupWtoA(pSrc);
1605 
1606  len = immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, NULL, 0, uFlag);
1607  lpaDst = HeapAlloc(GetProcessHeap(), 0, len);
1608  if ( lpaDst )
1609  {
1610  immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, lpaDst, len, uFlag);
1611  ret = convert_candidatelist_AtoW( lpaDst, lpDst, dwBufLen);
1612  HeapFree(GetProcessHeap(), 0, lpaDst);
1613  }
1614  HeapFree(GetProcessHeap(), 0, paSrc);
1615 
1616  return ret;
1617  }
1618  }
1619  else
1620  return 0;
1621 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:146
HMODULE hIME
Definition: imm.c:45
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126
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:197
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
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:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_GetConversionListW().

◆ ImmGetConversionStatus()

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

Definition at line 1626 of file imm.c.

1628 {
1630 
1631  TRACE("%p %p %p\n", hIMC, lpfdwConversion, lpfdwSentence);
1632 
1633  if (!data)
1634  return FALSE;
1635 
1636  if (lpfdwConversion)
1637  *lpfdwConversion = data->IMC.fdwConversion;
1638  if (lpfdwSentence)
1639  *lpfdwSentence = data->IMC.fdwSentence;
1640 
1641  return TRUE;
1642 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
#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 1738 of file imm.c.

1739 {
1740  HWND ret;
1742  if (!thread_data)
1743  return NULL;
1744  ret = thread_data->hwndDefault;
1746  TRACE("Default is %p\n",ret);
1747  return ret;
1748 }
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:236
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:111

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 1753 of file imm.c.

1755 {
1756  WCHAR *buf;
1757  DWORD len;
1758 
1759  TRACE("%p %p %d\n", hKL, lpszDescription, uBufLen);
1760 
1761  /* find out how many characters in the unicode buffer */
1762  len = ImmGetDescriptionW( hKL, NULL, 0 );
1763  if (!len)
1764  return 0;
1765 
1766  /* allocate a buffer of that size */
1767  buf = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR) );
1768  if( !buf )
1769  return 0;
1770 
1771  /* fetch the unicode buffer */
1772  len = ImmGetDescriptionW( hKL, buf, len + 1 );
1773 
1774  /* convert it back to ASCII */
1775  len = WideCharToMultiByte( CP_ACP, 0, buf, len + 1,
1776  lpszDescription, uBufLen, NULL, NULL );
1777 
1778  HeapFree( GetProcessHeap(), 0, buf );
1779 
1780  if (len == 0)
1781  return 0;
1782 
1783  return len - 1;
1784 }
#define WideCharToMultiByte
Definition: compat.h:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
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:1789
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_GetDescriptionA(), and test_ImmGetDescription().

◆ ImmGetDescriptionW()

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

Definition at line 1789 of file imm.c.

1790 {
1791  static const WCHAR name[] = { 'W','i','n','e',' ','X','I','M',0 };
1792 
1793  FIXME("(%p, %p, %d): semi stub\n", hKL, lpszDescription, uBufLen);
1794 
1795  if (!hKL) return 0;
1796  if (!uBufLen) return lstrlenW( name );
1797  lstrcpynW( lpszDescription, name, uBufLen );
1798  return lstrlenW( lpszDescription );
1799 }
#define lstrlenW
Definition: compat.h:415
#define lstrcpynW
Definition: compat.h:405
#define FIXME(fmt,...)
Definition: debug.h:110
__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 1804 of file imm.c.

1806 {
1807  FIXME("(%p, %d, %s, %d): stub\n",
1808  hIMC, dwIndex, debugstr_a(lpBuf), dwBufLen
1809  );
1811  return 0;
1812 }
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

Referenced by ActiveIMMApp_GetGuideLineA().

◆ ImmGetGuideLineW()

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

Definition at line 1817 of file imm.c.

1818 {
1819  FIXME("(%p, %d, %s, %d): stub\n",
1820  hIMC, dwIndex, debugstr_w(lpBuf), dwBufLen
1821  );
1823  return 0;
1824 }
_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:110
#define SetLastError(x)
Definition: compat.h:417
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

Referenced by ActiveIMMApp_GetGuideLineW().

◆ ImmGetHotKey()

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

Definition at line 3163 of file imm.c.

3164 {
3165  FIXME("%x, %p, %p, %p: stub\n", hotkey, modifiers, key, hkl);
3166  return FALSE;
3167 }
#define FIXME(fmt,...)
Definition: debug.h:110
HKL hkl
Definition: msctf.idl:611
Definition: path.c:41

◆ ImmGetIMCCLockCount()

DWORD WINAPI ImmGetIMCCLockCount ( HIMCC  imcc)

Definition at line 2969 of file imm.c.

2970 {
2971  return GlobalFlags(imcc) & GMEM_LOCKCOUNT;
2972 }
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 2985 of file imm.c.

2986 {
2987  return GlobalSize(imcc);
2988 }
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090

Referenced by test_ImmDestroyIMCC().

◆ ImmGetIMCLockCount()

DWORD WINAPI ImmGetIMCLockCount ( HIMC  hIMC)

Definition at line 2926 of file imm.c.

2927 {
2929  if (!data)
2930  return 0;
2931  return data->dwLock;
2932 }
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
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 1829 of file imm.c.

1830 {
1831  LPWSTR bufW = NULL;
1832  UINT wBufLen = uBufLen;
1833  UINT rc;
1834 
1835  if (uBufLen && lpszFileName)
1836  bufW = HeapAlloc(GetProcessHeap(),0,uBufLen * sizeof(WCHAR));
1837  else /* We need this to get the number of byte required */
1838  {
1839  bufW = HeapAlloc(GetProcessHeap(),0,MAX_PATH * sizeof(WCHAR));
1840  wBufLen = MAX_PATH;
1841  }
1842 
1843  rc = ImmGetIMEFileNameW(hKL,bufW,wBufLen);
1844 
1845  if (rc > 0)
1846  {
1847  if (uBufLen && lpszFileName)
1848  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, lpszFileName,
1849  uBufLen, NULL, NULL);
1850  else /* get the length */
1851  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL,
1852  NULL);
1853  }
1854 
1855  HeapFree(GetProcessHeap(),0,bufW);
1856  return rc;
1857 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: imm.c:1862
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ActiveIMMApp_GetIMEFileNameA().

◆ ImmGetIMEFileNameW()

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

Definition at line 1862 of file imm.c.

1863 {
1864  HKEY hkey;
1865  DWORD length;
1866  DWORD rc;
1867  WCHAR regKey[ARRAY_SIZE(szImeRegFmt)+8];
1868 
1869  wsprintfW( regKey, szImeRegFmt, (ULONG_PTR)hKL );
1870  rc = RegOpenKeyW( HKEY_LOCAL_MACHINE, regKey, &hkey);
1871  if (rc != ERROR_SUCCESS)
1872  {
1873  SetLastError(rc);
1874  return 0;
1875  }
1876 
1877  length = 0;
1879 
1880  if (rc != ERROR_SUCCESS)
1881  {
1882  RegCloseKey(hkey);
1883  SetLastError(rc);
1884  return 0;
1885  }
1886  if (length > uBufLen * sizeof(WCHAR) || !lpszFileName)
1887  {
1888  RegCloseKey(hkey);
1889  if (lpszFileName)
1890  {
1892  return 0;
1893  }
1894  else
1895  return length / sizeof(WCHAR);
1896  }
1897 
1898  RegGetValueW(hkey, NULL, szImeFileW, RRF_RT_REG_SZ, NULL, lpszFileName, &length);
1899 
1900  RegCloseKey(hkey);
1901 
1902  return length / sizeof(WCHAR);
1903 }
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:63
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:417
static const WCHAR szImeFileW[]
Definition: imm.c:104
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR szImeRegFmt[]
Definition: imm.c:106
#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 2759 of file imm.c.

2762 {
2764  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2765  lpImeParentMenu, lpImeMenu, dwSize);
2766 
2767  if (!data)
2768  {
2770  return 0;
2771  }
2772 
2773  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2774  {
2775  if (!is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2776  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2777  (IMEMENUITEMINFOW*)lpImeParentMenu,
2778  (IMEMENUITEMINFOW*)lpImeMenu, dwSize);
2779  else
2780  {
2781  IMEMENUITEMINFOW lpImeParentMenuW;
2782  IMEMENUITEMINFOW *lpImeMenuW, *parent = NULL;
2783  DWORD rc;
2784 
2785  if (lpImeParentMenu)
2786  parent = &lpImeParentMenuW;
2787  if (lpImeMenu)
2788  {
2789  int count = dwSize / sizeof(LPIMEMENUITEMINFOA);
2790  dwSize = count * sizeof(IMEMENUITEMINFOW);
2791  lpImeMenuW = HeapAlloc(GetProcessHeap(), 0, dwSize);
2792  }
2793  else
2794  lpImeMenuW = NULL;
2795 
2796  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2797  parent, lpImeMenuW, dwSize);
2798 
2799  if (lpImeParentMenu)
2800  {
2801  memcpy(lpImeParentMenu,&lpImeParentMenuW,sizeof(IMEMENUITEMINFOA));
2802  lpImeParentMenu->hbmpItem = lpImeParentMenuW.hbmpItem;
2803  WideCharToMultiByte(CP_ACP, 0, lpImeParentMenuW.szString,
2804  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE,
2805  NULL, NULL);
2806  }
2807  if (lpImeMenu && rc)
2808  {
2809  unsigned int i;
2810  for (i = 0; i < rc; i++)
2811  {
2812  memcpy(&lpImeMenu[i],&lpImeMenuW[1],sizeof(IMEMENUITEMINFOA));
2813  lpImeMenu[i].hbmpItem = lpImeMenuW[i].hbmpItem;
2814  WideCharToMultiByte(CP_ACP, 0, lpImeMenuW[i].szString,
2815  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE,
2816  NULL, NULL);
2817  }
2818  }
2819  HeapFree(GetProcessHeap(),0,lpImeMenuW);
2820  return rc;
2821  }
2822  }
2823  else
2824  return 0;
2825 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
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:494
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2869
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
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:402
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 2830 of file imm.c.

2833 {
2835  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2836  lpImeParentMenu, lpImeMenu, dwSize);
2837 
2838  if (!data)
2839  {
2841  return 0;
2842  }
2843 
2844  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2845  {
2846  if (is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2847  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2848  lpImeParentMenu, lpImeMenu, dwSize);
2849  else
2850  {
2851  IMEMENUITEMINFOA lpImeParentMenuA;
2852  IMEMENUITEMINFOA *lpImeMenuA, *parent = NULL;
2853  DWORD rc;
2854 
2855  if (lpImeParentMenu)
2856  parent = &lpImeParentMenuA;
2857  if (lpImeMenu)
2858  {
2859  int count = dwSize / sizeof(LPIMEMENUITEMINFOW);
2860  dwSize = count * sizeof(IMEMENUITEMINFOA);
2861  lpImeMenuA = HeapAlloc(GetProcessHeap(), 0, dwSize);
2862  }
2863  else
2864  lpImeMenuA = NULL;
2865 
2866  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2868  (IMEMENUITEMINFOW*)lpImeMenuA, dwSize);
2869 
2870  if (lpImeParentMenu)
2871  {
2872  memcpy(lpImeParentMenu,&lpImeParentMenuA,sizeof(IMEMENUITEMINFOA));
2873  lpImeParentMenu->hbmpItem = lpImeParentMenuA.hbmpItem;
2874  MultiByteToWideChar(CP_ACP, 0, lpImeParentMenuA.szString,
2875  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE);
2876  }
2877  if (lpImeMenu && rc)
2878  {
2879  unsigned int i;
2880  for (i = 0; i < rc; i++)
2881  {
2882  memcpy(&lpImeMenu[i],&lpImeMenuA[1],sizeof(IMEMENUITEMINFOA));
2883  lpImeMenu[i].hbmpItem = lpImeMenuA[i].hbmpItem;
2884  MultiByteToWideChar(CP_ACP, 0, lpImeMenuA[i].szString,
2885  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE);
2886  }
2887  }
2888  HeapFree(GetProcessHeap(),0,lpImeMenuA);
2889  return rc;
2890  }
2891  }
2892  else
2893  return 0;
2894 }
#define CP_ACP
Definition: compat.h:99
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
WCHAR szString[IMEMENUITEM_STRING_SIZE]
Definition: imm.h:126
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:494
smooth NULL
Definition: ftsmooth.c:416
struct tagIMEMENUITEMINFOA IMEMENUITEMINFOA
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:121
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2869
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
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:100
HBITMAP hbmpItem
Definition: imm.h:127
#define HeapFree(x, y, z)
Definition: compat.h:402
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 1908 of file imm.c.

1909 {
1911  static int i;
1912 
1913  if (!data)
1914  return FALSE;
1915 
1916  TRACE("(%p): semi-stub\n", hIMC);
1917 
1918  if (!i++)
1919  FIXME("(%p): semi-stub\n", hIMC);
1920 
1921  return data->IMC.fOpen;
1922 }
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 FIXME(fmt,...)
Definition: debug.h:110
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:494
#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 1927 of file imm.c.

1928 {
1929  DWORD rc = 0;
1930  ImmHkl *kbd;
1931 
1932  TRACE("(%p, %d)\n", hKL, fdwIndex);
1933  kbd = IMM_GetImmHkl(hKL);
1934 
1935  if (kbd && kbd->hIME)
1936  {
1937  switch (fdwIndex)
1938  {
1939  case IGP_PROPERTY: rc = kbd->imeInfo.fdwProperty; break;
1940  case IGP_CONVERSION: rc = kbd->imeInfo.fdwConversionCaps; break;
1941  case IGP_SENTENCE: rc = kbd->imeInfo.fdwSentenceCaps; break;
1942  case IGP_SETCOMPSTR: rc = kbd->imeInfo.fdwSCSCaps; break;
1943  case IGP_SELECT: rc = kbd->imeInfo.fdwSelectCaps; break;
1944  case IGP_GETIMEVERSION: rc = IMEVER_0400; break;
1945  case IGP_UI: rc = 0; break;
1946  default: rc = 0;
1947  }
1948  }
1949  return rc;
1950 }
HMODULE hIME
Definition: imm.c:45
#define IGP_PROPERTY
Definition: imm.h:438
#define IGP_SELECT
Definition: imm.h:443
DWORD fdwSelectCaps
Definition: imm.h:157
#define TRACE(s)
Definition: solgame.cpp:4
#define IGP_SETCOMPSTR
Definition: imm.h:442
DWORD fdwProperty
Definition: imm.h:152
unsigned long DWORD
Definition: ntddk_ex.h:95
IMEINFO imeInfo
Definition: imm.c:46
DWORD fdwConversionCaps
Definition: imm.h:153
Definition: imm.c:42
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:332
DWORD fdwSCSCaps
Definition: imm.h:156
#define IGP_GETIMEVERSION
Definition: imm.h:437
DWORD fdwSentenceCaps
Definition: imm.h:154
#define IMEVER_0400
Definition: imm.h:379
#define IGP_SENTENCE
Definition: imm.h:440
#define IGP_CONVERSION
Definition: imm.h:439
#define IGP_UI
Definition: imm.h:441

Referenced by ActiveIMMApp_GetProperty(), and test_ImmGetCompositionString().

◆ ImmGetRegisterWordStyleA()

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

Definition at line 1955 of file imm.c.

1957 {
1958  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1959  TRACE("(%p, %d, %p):\n", hKL, nItem, lpStyleBuf);
1960  if (immHkl->hIME && immHkl->pImeGetRegisterWordStyle)
1961  {
1962  if (!is_kbd_ime_unicode(immHkl))
1963  return immHkl->pImeGetRegisterWordStyle(nItem,(LPSTYLEBUFW)lpStyleBuf);
1964  else
1965  {
1966  STYLEBUFW sbw;
1967  UINT rc;
1968 
1969  rc = immHkl->pImeGetRegisterWordStyle(nItem,&sbw);
1971  lpStyleBuf->szDescription, 32, NULL, NULL);
1972  lpStyleBuf->dwStyle = sbw.dwStyle;
1973  return rc;
1974  }
1975  }
1976  else
1977  return 0;
1978 }
DWORD dwStyle
Definition: imm.h:82
DWORD dwStyle
Definition: dimm.idl:109
HMODULE hIME
Definition: imm.c:45
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:126