ReactOS  0.4.14-dev-114-gc8cbd56
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 "wine/unicode.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 is_himc_ime_unicode(p)   (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE)
 
#define is_kbd_ime_unicode(p)   (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
 
#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 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 (InputContextData *data, LPBYTE source, INT slen, LPBYTE target, INT tlen, BOOL unicode)
 
static INT CopyCompAttrIMEtoClient (InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, INT sslen, LPBYTE target, INT tlen, 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 40 of file imm.c.

◆ is_himc_ime_unicode

#define is_himc_ime_unicode (   p)    (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE)

Definition at line 122 of file imm.c.

◆ is_kbd_ime_unicode

#define is_kbd_ime_unicode (   p)    (p->imeInfo.fdwProperty & IME_PROP_UNICODE)

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

◆ WINE_IMC_VALID_MAGIC

#define WINE_IMC_VALID_MAGIC   0x56434D49

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

395 {
396  ImmHkl *immHkl = IMM_GetImmHkl(hkl);
397  return immHkl->UIWnd;
398 }
HWND UIWnd
Definition: imm.c:50
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
HKL hkl
Definition: msctf.idl:611

◆ __wine_register_window()

BOOL WINAPI __wine_register_window ( HWND  hwnd)

Definition at line 1636 of file imm.c.

1637 {
1638  HWND new = NULL;
1640  TRACE("(%p)\n", hwnd);
1641 
1642  if (!needs_ime_window(hwnd))
1643  return FALSE;
1644 
1646  if (!thread_data)
1647  return FALSE;
1648 
1649  if (thread_data->disableIME || disable_ime)
1650  {
1651  TRACE("IME for this thread is disabled\n");
1653  return FALSE;
1654  }
1655  thread_data->windowRefs++;
1656  TRACE("windowRefs=%u, hwndDefault=%p\n",
1657  thread_data->windowRefs, thread_data->hwndDefault);
1658 
1659  /* Create default IME window */
1660  if (thread_data->windowRefs == 1)
1661  {
1662  /* Do not create the window inside of a critical section */
1666  0, 0, 1, 1, 0, 0, 0, 0);
1667  /* thread_data is in the current thread so we can assume it's still valid */
1669  /* See if anyone beat us */
1670  if (thread_data->hwndDefault == NULL)
1671  {
1672  thread_data->hwndDefault = new;
1673  new = NULL;
1674  TRACE("Default is %p\n", thread_data->hwndDefault);
1675  }
1676  }
1677 
1679 
1680  /* Clean up an unused new window outside of the critical section */
1681  if (new != NULL)
1682  DestroyWindow(new);
1683  return TRUE;
1684 }
#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:230
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI DestroyWindow(_In_ HWND)
static BOOL disable_ime
Definition: imm.c:120
static BOOL needs_ime_window(HWND hwnd)
Definition: imm.c:1622
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:109
#define WS_POPUP
Definition: pedump.c:616
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static const WCHAR szwDefaultIME[]
Definition: imm.c:110
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:112

◆ __wine_unregister_window()

void WINAPI __wine_unregister_window ( HWND  hwnd)

Definition at line 1689 of file imm.c.

1690 {
1691  HWND to_destroy = 0;
1693  TRACE("(%p)\n", hwnd);
1694 
1696  if (!thread_data) return;
1697 
1698  thread_data->windowRefs--;
1699  TRACE("windowRefs=%u, hwndDefault=%p\n",
1700  thread_data->windowRefs, thread_data->hwndDefault);
1701 
1702  /* Destroy default IME window */
1703  if (thread_data->windowRefs == 0 && thread_data->hwndDefault)
1704  {
1705  to_destroy = thread_data->hwndDefault;
1706  thread_data->hwndDefault = NULL;
1707  }
1709 
1710  if (to_destroy) DestroyWindow( to_destroy );
1711 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:230
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:112

◆ _ImmAssociateContextExEnumProc()

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

Definition at line 625 of file imm.c.

626 {
627  HIMC hImc = (HIMC)lParam;
629  return TRUE;
630 }
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:563
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 191 of file imm.c.

193 {
194  DWORD ret, i, len;
195 
197  if ( lpDst && dwBufLen > 0 )
198  {
199  *lpDst = *lpSrc;
200  lpDst->dwOffset[0] = ret;
201  }
202 
203  for ( i = 0; i < lpSrc->dwCount; i++)
204  {
205  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
206 
207  if ( lpDst && dwBufLen > 0 )
208  {
209  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
210 
212  (LPWSTR)dest, dwBufLen);
213 
214  if ( i + 1 < lpSrc->dwCount )
215  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(WCHAR);
216  dwBufLen -= len * sizeof(WCHAR);
217  }
218  else
219  len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)src, -1, NULL, 0);
220 
221  ret += len * sizeof(WCHAR);
222  }
223 
224  if ( lpDst )
225  lpDst->dwSize = ret;
226 
227  return ret;
228 }
#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 152 of file imm.c.

154 {
155  DWORD ret, i, len;
156 
158  if ( lpDst && dwBufLen > 0 )
159  {
160  *lpDst = *lpSrc;
161  lpDst->dwOffset[0] = ret;
162  }
163 
164  for ( i = 0; i < lpSrc->dwCount; i++)
165  {
166  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
167 
168  if ( lpDst && dwBufLen > 0 )
169  {
170  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
171 
173  (LPSTR)dest, dwBufLen, NULL, NULL);
174 
175  if ( i + 1 < lpSrc->dwCount )
176  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(char);
177  dwBufLen -= len * sizeof(char);
178  }
179  else
181 
182  ret += len * sizeof(char);
183  }
184 
185  if ( lpDst )
186  lpDst->dwSize = ret;
187 
188  return ret;
189 }
#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 ( InputContextData data,
LPBYTE  source,
INT  slen,
LPBYTE  ssource,
INT  sslen,
LPBYTE  target,
INT  tlen,
BOOL  unicode 
)
static

Definition at line 1224 of file imm.c.

1226 {
1227  INT rc;
1228 
1229  if (is_himc_ime_unicode(data) && !unicode)
1230  {
1231  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, sslen, NULL, 0, NULL, NULL);
1232  if (tlen)
1233  {
1234  const BYTE *src = source;
1235  LPBYTE dst = target;
1236  int i, j = 0, k = 0;
1237 
1238  if (rc < tlen)
1239  tlen = rc;
1240  for (i = 0; i < sslen; ++i)
1241  {
1242  int len;
1243 
1244  len = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)ssource + i, 1,
1245  NULL, 0, NULL, NULL);
1246  for (; len > 0; --len)
1247  {
1248  dst[j++] = src[k];
1249 
1250  if (j >= tlen)
1251  goto end;
1252  }
1253  ++k;
1254  }
1255  end:
1256  rc = j;
1257  }
1258  }
1259  else if (!is_himc_ime_unicode(data) && unicode)
1260  {
1261  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, sslen, NULL, 0);
1262  if (tlen)
1263  {
1264  const BYTE *src = source;
1265  LPBYTE dst = target;
1266  int i, j = 0;
1267 
1268  if (rc < tlen)
1269  tlen = rc;
1270  for (i = 0; i < sslen; ++i)
1271  {
1272  if (IsDBCSLeadByte(((LPSTR)ssource)[i]))
1273  continue;
1274 
1275  dst[j++] = src[i];
1276 
1277  if (j >= tlen)
1278  break;
1279  }
1280  rc = j;
1281  }
1282  }
1283  else
1284  {
1285  memcpy( target, source, min(slen,tlen));
1286  rc = slen;
1287  }
1288 
1289  return rc;
1290 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#define WideCharToMultiByte
Definition: compat.h:101
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CP_ACP
Definition: compat.h:99
GLuint GLuint end
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
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
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2221
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
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
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
GLenum GLenum dst
Definition: glext.h:6340
#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
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 1292 of file imm.c.

1294 {
1295  INT rc;
1296 
1297  if (is_himc_ime_unicode(data) && !unicode)
1298  {
1299  if (tlen)
1300  {
1301  int i;
1302 
1303  if (slen < tlen)
1304  tlen = slen;
1305  tlen /= sizeof (DWORD);
1306  for (i = 0; i < tlen; ++i)
1307  {
1308  ((DWORD *)target)[i] = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource,
1309  ((DWORD *)source)[i],
1310  NULL, 0,
1311  NULL, NULL);
1312  }
1313  rc = sizeof (DWORD) * i;
1314  }
1315  else
1316  rc = slen;
1317  }
1318  else if (!is_himc_ime_unicode(data) && unicode)
1319  {
1320  if (tlen)
1321  {
1322  int i;
1323 
1324  if (slen < tlen)
1325  tlen = slen;
1326  tlen /= sizeof (DWORD);
1327  for (i = 0; i < tlen; ++i)
1328  {
1329  ((DWORD *)target)[i] = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource,
1330  ((DWORD *)source)[i],
1331  NULL, 0);
1332  }
1333  rc = sizeof (DWORD) * i;
1334  }
1335  else
1336  rc = slen;
1337  }
1338  else
1339  {
1340  memcpy( target, source, min(slen,tlen));
1341  rc = slen;
1342  }
1343 
1344  return rc;
1345 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#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
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 1347 of file imm.c.

1348 {
1349  int rc;
1350 
1351  if (is_himc_ime_unicode(data) && !unicode)
1352  {
1353  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, offset, NULL, 0, NULL, NULL);
1354  }
1355  else if (!is_himc_ime_unicode(data) && unicode)
1356  {
1357  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, offset, NULL, 0);
1358  }
1359  else
1360  rc = offset;
1361 
1362  return rc;
1363 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#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
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 ( InputContextData data,
LPBYTE  source,
INT  slen,
LPBYTE  target,
INT  tlen,
BOOL  unicode 
)
static

Definition at line 1205 of file imm.c.

1207 {
1208  INT rc;
1209 
1210  if (is_himc_ime_unicode(data) && !unicode)
1211  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)source, slen, (LPSTR)target, tlen, NULL, NULL);
1212  else if (!is_himc_ime_unicode(data) && unicode)
1213  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)source, slen, (LPWSTR)target, tlen) * sizeof(WCHAR);
1214  else
1215  {
1216  int dlen = (unicode)?sizeof(WCHAR):sizeof(CHAR);
1217  memcpy( target, source, min(slen,tlen)*dlen);
1218  rc = slen*dlen;
1219  }
1220 
1221  return rc;
1222 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
__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
#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
#define CHAR(Char)

Referenced by ImmGetCompositionStringT().

◆ DllMain()

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

Definition at line 418 of file imm.c.

419 {
420  TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
421  switch (fdwReason)
422  {
423  case DLL_PROCESS_ATTACH:
425  {
426  return FALSE;
427  }
428  break;
429  case DLL_THREAD_ATTACH:
430  break;
431  case DLL_THREAD_DETACH:
433  break;
434  case DLL_PROCESS_DETACH:
435  if (lpReserved) break;
438  break;
439  }
440  return TRUE;
441 }
#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:40
static void IMM_FreeThreadData(void)
Definition: imm.c:272
static void IMM_FreeAllImmHkl(void)
Definition: imm.c:400

◆ EscapeRequiresWA()

static BOOL EscapeRequiresWA ( UINT  uEscape)
inlinestatic

Definition at line 919 of file imm.c.

920 {
921  if (uEscape == IME_ESC_GET_EUDC_DICTIONARY ||
922  uEscape == IME_ESC_SET_EUDC_DICTIONARY ||
923  uEscape == IME_ESC_IME_NAME ||
924  uEscape == IME_ESC_GETHELPFILENAME)
925  return TRUE;
926  return FALSE;
927 }
#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 503 of file imm.c.

504 {
505  HIMC ret;
507 
508  if (!thread_data) return 0;
509 
510  if (thread_data->defaultContext)
511  {
512  ret = thread_data->defaultContext;
514  return ret;
515  }
516 
517  /* can't create a default context in another thread */
518  if (thread_data->threadID != GetCurrentThreadId())
519  {
521  return 0;
522  }
523 
525 
526  ret = ImmCreateContext();
527  if (!ret) return 0;
528  ((InputContextData*)ret)->threadDefault = TRUE;
529 
530  /* thread_data is in the current thread so we can assume it's still valid */
532 
533  if (thread_data->defaultContext) /* someone beat us */
534  {
536  ret = thread_data->defaultContext;
537  }
538  else thread_data->defaultContext = ret;
539 
541  return ret;
542 }
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:230
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:740
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
int ret
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:798
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:112

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

◆ get_imc_data()

static InputContextData * get_imc_data ( HIMC  hIMC)
static

Definition at line 488 of file imm.c.

489 {
490  InputContextData *data = hIMC;
491 
492  if (hIMC == NULL)
493  return NULL;
494 
495  if(IsBadReadPtr(data, sizeof(InputContextData)) || data->magic != WINE_IMC_VALID_MAGIC)
496  {
498  return NULL;
499  }
500  return data;
501 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:83
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:409
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 798 of file imm.c.

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

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

◆ IMM_FreeAllImmHkl()

static void IMM_FreeAllImmHkl ( void  )
static

Definition at line 400 of file imm.c.

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

Referenced by DllMain().

◆ IMM_FreeThreadData()

static void IMM_FreeThreadData ( void  )
static

Definition at line 272 of file imm.c.

273 {
275 
278  {
279  if (data->threadID == GetCurrentThreadId())
280  {
281  list_remove(&data->entry);
283  IMM_DestroyContext(data->defaultContext);
285  TRACE("Thread Data Destroyed\n");
286  return;
287  }
288  }
290 }
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:395
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:798
uint32_t entry
Definition: isohybrid.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:112
#define HeapFree(x, y, z)
Definition: compat.h:394
static struct list ImmThreadDataList
Definition: imm.c:101

Referenced by DllMain().

◆ IMM_GetImmHkl()

static ImmHkl* IMM_GetImmHkl ( HKL  hkl)
static

Definition at line 326 of file imm.c.

327 {
328  ImmHkl *ptr;
330 
331  TRACE("Seeking ime for keyboard %p\n",hkl);
332 
334  {
335  if (ptr->hkl == hkl)
336  return ptr;
337  }
338  /* not found... create it */
339 
341 
342  ptr->hkl = hkl;
344  if (!ptr->hIME) ptr->hIME = load_graphics_driver();
345  if (ptr->hIME)
346  {
348  if (!ptr->pImeInquire || !ptr->pImeInquire(&ptr->imeInfo, ptr->imeClassName, NULL))
349  {
350  FreeLibrary(ptr->hIME);
351  ptr->hIME = NULL;
352  }
353  else
354  {
357  if (!ptr->pImeSelect || !ptr->pImeDestroy)
358  {
359  FreeLibrary(ptr->hIME);
360  ptr->hIME = NULL;
361  }
362  else
363  {
377  /* make sure our classname is WCHAR */
378  if (!is_kbd_ime_unicode(ptr))
379  {
380  WCHAR bufW[17];
381  MultiByteToWideChar(CP_ACP, 0, (LPSTR)ptr->imeClassName,
382  -1, bufW, 17);
383  lstrcpyW(ptr->imeClassName, bufW);
384  }
385  }
386  }
387  }
388  list_add_head(&ImmHklList,&ptr->entry);
389 
390  return ptr;
391 }
#define LOAD_FUNCPTR(f)
Definition: imm.c:325
BOOL WINAPI ImeConfigure(HKL, HWND, DWORD, LPVOID)
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
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
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:404
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI ImeSetActiveContext(HIMC, BOOL)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
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:100
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:43
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:406
#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:1840
static HMODULE load_graphics_driver(void)
Definition: imm.c:292

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

231 {
233  DWORD process;
234 
235  if (hwnd)
236  {
237  if (!(thread = GetWindowThreadProcessId(hwnd, &process))) return NULL;
238  if (process != GetCurrentProcessId()) return NULL;
239  }
240  else if (thread)
241  {
243  if (!h) return NULL;
245  CloseHandle(h);
246  if (process != GetCurrentProcessId()) return NULL;
247  }
248  else
250 
253  if (data->threadID == thread) return data;
254 
256  data->threadID = thread;
258  TRACE("Thread Data Created (%x)\n",thread);
259  return data;
260 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:398
__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:395
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:112
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
static struct list ImmThreadDataList
Definition: imm.c:101

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

545 {
547 
548  if (hWnd)
549  {
551  if (thread != GetCurrentThreadId()) return TRUE;
552  }
553  data = get_imc_data(hIMC);
554  if (data && data->threadID != GetCurrentThreadId())
555  return TRUE;
556 
557  return FALSE;
558 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
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 262 of file imm.c.

263 {
265 
266  if (!data)
267  return FALSE;
268 
269  return data->threadDefault;
270 }
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
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 563 of file imm.c.

564 {
565  HIMC old = NULL;
567 
568  TRACE("(%p, %p):\n", hWnd, hIMC);
569 
570  if(hIMC && !data)
571  return NULL;
572 
573  /*
574  * If already associated just return
575  */
576  if (hIMC && data->IMC.hWnd == hWnd)
577  return hIMC;
578 
579  if (hIMC && IMM_IsCrossThreadAccess(hWnd, hIMC))
580  return NULL;
581 
582  if (hWnd)
583  {
584  HIMC defaultContext = get_default_context( hWnd );
586 
587  if (old == NULL)
588  old = defaultContext;
589  else if (old == (HIMC)-1)
590  old = NULL;
591 
592  if (hIMC != defaultContext)
593  {
594  if (hIMC == NULL) /* Meaning disable imm for that window*/
596  else
598  }
599 
600  if (old)
601  {
602  InputContextData *old_data = old;
603  if (old_data->IMC.hWnd == hWnd)
604  old_data->IMC.hWnd = NULL;
605  }
606  }
607 
608  if (!hIMC)
609  return old;
610 
611  if(GetActiveWindow() == data->IMC.hWnd)
612  {
614  data->IMC.hWnd = hWnd;
616  }
617 
618  return old;
619 }
#define TRUE
Definition: types.h:120
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:503
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:74
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
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:544
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:103
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 635 of file imm.c.

636 {
637  TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
638 
639  if (!hWnd)
640  return FALSE;
641 
642  switch (dwFlags)
643  {
644  case 0:
646  return TRUE;
647  case IACE_DEFAULT:
648  {
649  HIMC defaultContext = get_default_context( hWnd );
650  if (!defaultContext) return FALSE;
651  ImmAssociateContext(hWnd,defaultContext);
652  return TRUE;
653  }
657  return TRUE;
658  case IACE_CHILDREN:
660  return TRUE;
661  default:
662  FIXME("Unknown dwFlags 0x%x\n",dwFlags);
663  return FALSE;
664  }
665 }
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:503
HWND hWnd
Definition: settings.c:17
static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
Definition: imm.c:625
#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:103
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:563
#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 670 of file imm.c.

672 {
673  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
674 
675  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
676 
677  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
678  return FALSE;
679 
680  if (immHkl->hIME && immHkl->pImeConfigure)
681  {
682  if (dwMode != IME_CONFIG_REGISTERWORD || !is_kbd_ime_unicode(immHkl))
683  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
684  else
685  {
686  REGISTERWORDW rww;
687  REGISTERWORDA *rwa = lpData;
688  BOOL rc;
689 
690  rww.lpReading = strdupAtoW(rwa->lpReading);
691  rww.lpWord = strdupAtoW(rwa->lpWord);
692  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rww);
694  HeapFree(GetProcessHeap(),0,rww.lpWord);
695  return rc;
696  }
697  }
698  else
699  return FALSE;
700 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:128
HMODULE hIME
Definition: imm.c:46
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
HWND hWnd
Definition: settings.c:17
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:395
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:547
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_ConfigureIMEA(), and test_ImmIME().

◆ ImmConfigureIMEW()

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

Definition at line 705 of file imm.c.

707 {
708  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
709 
710  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
711 
712  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
713  return FALSE;
714 
715  if (immHkl->hIME && immHkl->pImeConfigure)
716  {
717  if (dwMode != IME_CONFIG_REGISTERWORD || is_kbd_ime_unicode(immHkl))
718  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
719  else
720  {
721  REGISTERWORDW *rww = lpData;
722  REGISTERWORDA rwa;
723  BOOL rc;
724 
725  rwa.lpReading = strdupWtoA(rww->lpReading);
726  rwa.lpWord = strdupWtoA(rww->lpWord);
727  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rwa);
729  HeapFree(GetProcessHeap(),0,rwa.lpWord);
730  return rc;
731  }
732  }
733  else
734  return FALSE;
735 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:140
HMODULE hIME
Definition: imm.c:46
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
HWND hWnd
Definition: settings.c:17
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:395
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:547
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_ConfigureIMEW(), and test_ImmIME().

◆ ImmCreateBlankCompStr()

static HIMCC ImmCreateBlankCompStr ( void  )
static

Definition at line 476 of file imm.c.

477 {
478  HIMCC rc;
480  rc = ImmCreateIMCC(sizeof(COMPOSITIONSTRING));
481  ptr = ImmLockIMCC(rc);
482  memset(ptr,0,sizeof(COMPOSITIONSTRING));
483  ptr->dwSize = sizeof(COMPOSITIONSTRING);
484  ImmUnlockIMCC(rc);
485  return rc;
486 }
DWORD HIMCC
Definition: dimm.idl:76
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2931
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2939
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2915
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ImmCreateContext().

◆ ImmCreateContext()

HIMC WINAPI ImmCreateContext ( void  )

Definition at line 740 of file imm.c.

741 {
742  InputContextData *new_context;
743  LPGUIDELINE gl;
744  LPCANDIDATEINFO ci;
745  int i;
746 
748 
749  /* Load the IME */
750  new_context->immKbd = IMM_GetImmHkl(GetKeyboardLayout(0));
751 
752  if (!new_context->immKbd->hIME)
753  {
754  TRACE("IME dll could not be loaded\n");
755  HeapFree(GetProcessHeap(),0,new_context);
756  return 0;
757  }
758 
759  /* the HIMCCs are never NULL */
760  new_context->IMC.hCompStr = ImmCreateBlankCompStr();
761  new_context->IMC.hMsgBuf = ImmCreateIMCC(0);
762  new_context->IMC.hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
763  ci = ImmLockIMCC(new_context->IMC.hCandInfo);
764  memset(ci,0,sizeof(CANDIDATEINFO));
765  ci->dwSize = sizeof(CANDIDATEINFO);
766  ImmUnlockIMCC(new_context->IMC.hCandInfo);
767  new_context->IMC.hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
768  gl = ImmLockIMCC(new_context->IMC.hGuideLine);
769  memset(gl,0,sizeof(GUIDELINE));
770  gl->dwSize = sizeof(GUIDELINE);
771  ImmUnlockIMCC(new_context->IMC.hGuideLine);
772 
773  for (i = 0; i < ARRAY_SIZE(new_context->IMC.cfCandForm); i++)
774  new_context->IMC.cfCandForm[i].dwIndex = ~0u;
775 
776  /* Initialize the IME Private */
777  new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize);
778 
779  new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps;
780  new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps;
781 
782  if (!new_context->immKbd->pImeSelect(new_context, TRUE))
783  {
784  TRACE("Selection of IME failed\n");
785  IMM_DestroyContext(new_context);
786  return 0;
787  }
788  new_context->threadID = GetCurrentThreadId();
789  SendMessageW(GetFocus(), WM_IME_SELECT, TRUE, (LPARAM)new_context->immKbd);
790 
791  new_context->immKbd->uSelected++;
792  TRACE("Created context %p\n",new_context);
793 
794  new_context->magic = WINE_IMC_VALID_MAGIC;
795  return new_context;
796 }
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:46
DWORD threadID
Definition: imm.c:75
CANDIDATEFORM cfCandForm[4]
Definition: imm.h:39
#define WM_IME_SELECT
Definition: winuser.h:1815
INPUTCONTEXT IMC
Definition: imm.c:74
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:83
DWORD magic
Definition: imm.c:80
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:476
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2931
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:49
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
IMEINFO imeInfo
Definition: imm.c:47
DWORD fdwConversionCaps
Definition: imm.h:153
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2939
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:798
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
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:77
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2915
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:394

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

2916 {
2918 }
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 2637 of file imm.c.

2638 {
2639  FIXME("(%d, %d, %d, %d): stub\n", uType, hOwner, x, y);
2641  return 0;
2642 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
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 826 of file imm.c.

827 {
828  if (!IMM_IsDefaultContext(hIMC) && !IMM_IsCrossThreadAccess(NULL, hIMC))
829  return IMM_DestroyContext(hIMC);
830  else
831  return FALSE;
832 }
smooth NULL
Definition: ftsmooth.c:416
static BOOL IMM_IsDefaultContext(HIMC imc)
Definition: imm.c:262
static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
Definition: imm.c:544
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:798

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

2924 {
2925  return GlobalFree(block);
2926 }
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 2647 of file imm.c.

2648 {
2649  FIXME("(%p): stub\n", hSoftWnd);
2651  return FALSE;
2652 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define SetLastError(x)
Definition: compat.h:409
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ ImmDisableIME()

BOOL WINAPI ImmDisableIME ( DWORD  idThread)

Definition at line 837 of file imm.c.

838 {
839  if (idThread == (DWORD)-1)
840  disable_ime = TRUE;
841  else {
843  if (!thread_data) return FALSE;
844  thread_data->disableIME = TRUE;
846  }
847  return TRUE;
848 }
#define TRUE
Definition: types.h:120
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:230
static BOOL disable_ime
Definition: imm.c:120
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:112

Referenced by ActiveIMMApp_DisableIME(), and test_default_ime_disabled_cb().

◆ ImmDisableLegacyIME()

BOOL WINAPI ImmDisableLegacyIME ( void  )

Definition at line 3150 of file imm.c.

3151 {
3152  FIXME("stub\n");
3153  return TRUE;
3154 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( DWORD  idThread)

Definition at line 3121 of file imm.c.

3122 {
3123  FIXME("Stub\n");
3124  return FALSE;
3125 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ImmEnumInputContext()

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

Definition at line 3131 of file imm.c.

3132 {
3133  FIXME("Stub\n");
3134  return FALSE;
3135 }
#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 853 of file imm.c.

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

◆ ImmEnumRegisterWordW()

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

Definition at line 888 of file imm.c.

892 {
893  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
894  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
895  debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister), lpData);
896  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
897  {
898  if (is_kbd_ime_unicode(immHkl))
899  return immHkl->pImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
900  lpszRegister, lpData);
901  else
902  {
903  LPSTR lpszaReading = strdupWtoA(lpszReading);
904  LPSTR lpszaRegister = strdupWtoA(lpszRegister);
905  BOOL rc;
906 
907  rc = immHkl->pImeEnumRegisterWord(lpfnEnumProc, (LPCWSTR)lpszaReading,
908  dwStyle, (LPCWSTR)lpszaRegister, lpData);
909 
910  HeapFree(GetProcessHeap(),0,lpszaReading);
911  HeapFree(GetProcessHeap(),0,lpszaRegister);
912  return rc;
913  }
914  }
915  else
916  return 0;
917 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:140
HMODULE hIME
Definition: imm.c:46
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
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:395
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ ImmEscapeA()

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

Definition at line 932 of file imm.c.

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

970 {
971  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
972  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
973 
974  if (immHkl->hIME && immHkl->pImeEscape)
975  {
976  if (!EscapeRequiresWA(uEscape) || is_kbd_ime_unicode(immHkl))
977  return immHkl->pImeEscape(hIMC,uEscape,lpData);
978  else
979  {
980  CHAR buffer[81]; /* largest required buffer should be 80 */
981  LRESULT rc;
982  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
983  {
984  WideCharToMultiByte(CP_ACP,0,lpData,-1,buffer,81, NULL, NULL);
985  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
986  }
987  else
988  {
989  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
990  MultiByteToWideChar(CP_ACP,0,buffer,-1,lpData,80);
991  }
992  return rc;
993  }
994  }
995  else
996  return 0;
997 }
HMODULE hIME
Definition: imm.c:46
#define WideCharToMultiByte
Definition: compat.h:101
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
smooth NULL
Definition: ftsmooth.c:416
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:919
#define TRACE(s)
Definition: solgame.cpp:4
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
#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 2971 of file imm.c.

2972 {
2974 
2975  if (!data)
2976  {
2978  return FALSE;
2979  }
2980 
2981  TRACE("%i messages queued\n",data->IMC.dwNumMsgBuf);
2982  if (data->IMC.dwNumMsgBuf > 0)
2983  {
2984  LPTRANSMSG lpTransMsg;
2985  HIMCC hMsgBuf;
2986  DWORD i, dwNumMsgBuf;
2987 
2988  /* We are going to detach our hMsgBuff so that if processing messages
2989  generates new messages they go into a new buffer */
2990  hMsgBuf = data->IMC.hMsgBuf;
2991  dwNumMsgBuf = data->IMC.dwNumMsgBuf;
2992 
2993  data->IMC.hMsgBuf = ImmCreateIMCC(0);
2994  data->IMC.dwNumMsgBuf = 0;
2995 
2996  lpTransMsg = ImmLockIMCC(hMsgBuf);
2997  for (i = 0; i < dwNumMsgBuf; i++)
2998  ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam);
2999 
3000  ImmUnlockIMCC(hMsgBuf);
3001  ImmDestroyIMCC(hMsgBuf);
3002  }
3003 
3004  return TRUE;
3005 }
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:2923
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:2931
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:454
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2939
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:2915
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 1002 of file imm.c.

1005 {
1007  LPCANDIDATEINFO candinfo;
1008  LPCANDIDATELIST candlist;
1009  DWORD ret = 0;
1010 
1011  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1012 
1013  if (!data || !data->IMC.hCandInfo)
1014  return 0;
1015 
1016  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1017  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1018  goto done;
1019 
1020  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1021  if ( !candlist->dwSize || !candlist->dwCount )
1022  goto done;
1023 
1024  if ( !is_himc_ime_unicode(data) )
1025  {
1026  ret = candlist->dwSize;
1027  if ( lpCandList && dwBufLen >= ret )
1028  memcpy(lpCandList, candlist, ret);
1029  }
1030  else
1031  ret = convert_candidatelist_WtoA( candlist, lpCandList, dwBufLen);
1032 
1033 done:
1034  ImmUnlockIMCC(data->IMC.hCandInfo);
1035  return ret;
1036 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
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:2931
DWORD dwSize
Definition: imm.h:65
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
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:2939
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:152

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

◆ ImmGetCandidateListCountA()

DWORD WINAPI ImmGetCandidateListCountA ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1041 of file imm.c.

1043 {
1045  LPCANDIDATEINFO candinfo;
1046  DWORD ret, count;
1047 
1048  TRACE("%p, %p\n", hIMC, lpdwListCount);
1049 
1050  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1051  return 0;
1052 
1053  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1054 
1055  *lpdwListCount = count = candinfo->dwCount;
1056 
1057  if ( !is_himc_ime_unicode(data) )
1058  ret = candinfo->dwSize;
1059  else
1060  {
1061  ret = sizeof(CANDIDATEINFO);
1062  while ( count-- )
1063  ret += ImmGetCandidateListA(hIMC, count, NULL, 0);
1064  }
1065 
1066  ImmUnlockIMCC(data->IMC.hCandInfo);
1067  return ret;
1068 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
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:2931
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2939
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:1002

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

◆ ImmGetCandidateListCountW()

DWORD WINAPI ImmGetCandidateListCountW ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1073 of file imm.c.

1075 {
1077  LPCANDIDATEINFO candinfo;
1078  DWORD ret, count;
1079 
1080  TRACE("%p, %p\n", hIMC, lpdwListCount);
1081 
1082  if (!data || !lpdwListCount || !data->IMC.hCandInfo)
1083  return 0;
1084 
1085  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1086 
1087  *lpdwListCount = count = candinfo->dwCount;
1088 
1089  if ( is_himc_ime_unicode(data) )
1090  ret = candinfo->dwSize;
1091  else
1092  {
1093  ret = sizeof(CANDIDATEINFO);
1094  while ( count-- )
1095  ret += ImmGetCandidateListW(hIMC, count, NULL, 0);
1096  }
1097 
1098  ImmUnlockIMCC(data->IMC.hCandInfo);
1099  return ret;
1100 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
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:1105
DWORD dwSize
Definition: imm.h:199
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2931
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:2939
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 1105 of file imm.c.

1108 {
1110  LPCANDIDATEINFO candinfo;
1111  LPCANDIDATELIST candlist;
1112  DWORD ret = 0;
1113 
1114  TRACE("%p, %d, %p, %d\n", hIMC, dwIndex, lpCandList, dwBufLen);
1115 
1116  if (!data || !data->IMC.hCandInfo)
1117  return 0;
1118 
1119  candinfo = ImmLockIMCC(data->IMC.hCandInfo);
1120  if (dwIndex >= candinfo->dwCount || dwIndex >= ARRAY_SIZE(candinfo->dwOffset))
1121  goto done;
1122 
1123  candlist = (LPCANDIDATELIST)((LPBYTE)candinfo + candinfo->dwOffset[dwIndex]);
1124  if ( !candlist->dwSize || !candlist->dwCount )
1125  goto done;
1126 
1127  if ( is_himc_ime_unicode(data) )
1128  {
1129  ret = candlist->dwSize;
1130  if ( lpCandList && dwBufLen >= ret )
1131  memcpy(lpCandList, candlist, ret);
1132  }
1133  else
1134  ret = convert_candidatelist_AtoW( candlist, lpCandList, dwBufLen);
1135 
1136 done:
1137  ImmUnlockIMCC(data->IMC.hCandInfo);
1138  return ret;
1139 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
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:2931
DWORD dwSize
Definition: imm.h:65
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
static DWORD convert_candidatelist_AtoW(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:191
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:2939
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 1144 of file imm.c.

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

1169 {
1170  LOGFONTW lfW;
1171  BOOL rc;
1172 
1173  TRACE("(%p, %p):\n", hIMC, lplf);
1174 
1175  rc = ImmGetCompositionFontW(hIMC,&lfW);
1176  if (!rc || !lplf)
1177  return FALSE;
1178 
1179  memcpy(lplf,&lfW,sizeof(LOGFONTA));
1180  WideCharToMultiByte(CP_ACP, 0, lfW.lfFaceName, -1, lplf->lfFaceName,
1181  LF_FACESIZE, NULL, NULL);
1182  return TRUE;
1183 }
#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:1889
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:1188
#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 1188 of file imm.c.

1189 {
1191 
1192  TRACE("(%p, %p):\n", hIMC, lplf);
1193 
1194  if (!data || !lplf)
1195  return FALSE;
1196 
1197  *lplf = data->IMC.lfFont.W;
1198 
1199  return TRUE;
1200 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
#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 1459 of file imm.c.

1461 {
1462  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, FALSE);
1463 }
_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:1365

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

1367 {
1368  LONG rc = 0;
1370  LPCOMPOSITIONSTRING compstr;
1371  LPBYTE compdata;
1372 
1373  TRACE("(%p, 0x%x, %p, %d)\n", hIMC, dwIndex, lpBuf, dwBufLen);
1374 
1375  if (!data)
1376  return FALSE;
1377 
1378  if (!data->IMC.hCompStr)
1379  return FALSE;
1380 
1381  compdata = ImmLockIMCC(data->IMC.hCompStr);
1382  compstr = (LPCOMPOSITIONSTRING)compdata;
1383 
1384  switch (dwIndex)
1385  {
1386  case GCS_RESULTSTR:
1387  TRACE("GCS_RESULTSTR\n");
1388  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultStrOffset, compstr->dwResultStrLen, lpBuf, dwBufLen, unicode);
1389  break;
1390  case GCS_COMPSTR:
1391  TRACE("GCS_COMPSTR\n");
1392  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen, lpBuf, dwBufLen, unicode);
1393  break;
1394  case GCS_COMPATTR:
1395  TRACE("GCS_COMPATTR\n");
1396  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompAttrOffset, compstr->dwCompAttrLen,
1397  compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen,
1398  lpBuf, dwBufLen, unicode);
1399  break;
1400  case GCS_COMPCLAUSE:
1401  TRACE("GCS_COMPCLAUSE\n");
1402  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompClauseOffset,compstr->dwCompClauseLen,
1403  compdata + compstr->dwCompStrOffset,
1404  lpBuf, dwBufLen, unicode);
1405  break;
1406  case GCS_RESULTCLAUSE:
1407  TRACE("GCS_RESULTCLAUSE\n");
1408  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwResultClauseOffset,compstr->dwResultClauseLen,
1409  compdata + compstr->dwResultStrOffset,
1410  lpBuf, dwBufLen, unicode);
1411  break;
1412  case GCS_RESULTREADSTR:
1413  TRACE("GCS_RESULTREADSTR\n");
1414  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultReadStrOffset, compstr->dwResultReadStrLen, lpBuf, dwBufLen, unicode);
1415  break;
1416  case GCS_RESULTREADCLAUSE:
1417  TRACE("GCS_RESULTREADCLAUSE\n");
1419  compdata + compstr->dwResultStrOffset,
1420  lpBuf, dwBufLen, unicode);
1421  break;
1422  case GCS_COMPREADSTR:
1423  TRACE("GCS_COMPREADSTR\n");
1424  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen, lpBuf, dwBufLen, unicode);
1425  break;
1426  case GCS_COMPREADATTR:
1427  TRACE("GCS_COMPREADATTR\n");
1428  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompReadAttrOffset, compstr->dwCompReadAttrLen,
1429  compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen,
1430  lpBuf, dwBufLen, unicode);
1431  break;
1432  case GCS_COMPREADCLAUSE:
1433  TRACE("GCS_COMPREADCLAUSE\n");
1434  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompReadClauseOffset,compstr->dwCompReadClauseLen,
1435  compdata + compstr->dwCompStrOffset,
1436  lpBuf, dwBufLen, unicode);
1437  break;
1438  case GCS_CURSORPOS:
1439  TRACE("GCS_CURSORPOS\n");
1440  rc = CopyCompOffsetIMEtoClient(data, compstr->dwCursorPos, compdata + compstr->dwCompStrOffset, unicode);
1441  break;
1442  case GCS_DELTASTART:
1443  TRACE("GCS_DELTASTART\n");
1444  rc = CopyCompOffsetIMEtoClient(data, compstr->dwDeltaStart, compdata + compstr->dwCompStrOffset, unicode);
1445  break;
1446  default:
1447  FIXME("Unhandled index 0x%x\n",dwIndex);
1448  break;
1449  }
1450 
1451  ImmUnlockIMCC(data->IMC.hCompStr);
1452 
1453  return rc;
1454 }
static INT CopyCompClauseIMEtoClient(InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, LPBYTE target, INT tlen, BOOL unicode)
Definition: imm.c:1292
#define GCS_RESULTREADSTR
Definition: imm.h:364
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:1347
unsigned char * LPBYTE
Definition: typedefs.h:52
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:2931
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
#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:2939
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
static INT CopyCompStringIMEtoClient(InputContextData *data, LPBYTE source, INT slen, LPBYTE target, INT tlen, BOOL unicode)
Definition: imm.c:1205
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
static INT CopyCompAttrIMEtoClient(InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, INT sslen, LPBYTE target, INT tlen, BOOL unicode)
Definition: imm.c:1224
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 1469 of file imm.c.

1472 {
1473  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, TRUE);
1474 }
#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:1365

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

1480 {
1482 
1483  TRACE("(%p, %p)\n", hIMC, lpCompForm);
1484 
1485  if (!data)
1486  return FALSE;
1487 
1488  *lpCompForm = data->IMC.cfCompForm;
1489  return TRUE;
1490 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
#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 1496 of file imm.c.

1497 {
1498  HIMC rc;
1499 
1500  TRACE("%p\n", hWnd);
1501 
1502  if (!IsWindow(hWnd))
1503  {
1505  return NULL;
1506  }
1507 
1509  if (rc == (HIMC)-1)
1510  rc = NULL;
1511  else if (rc == NULL)
1512  rc = get_default_context( hWnd );
1513 
1514  if (rc)
1515  {
1516  InputContextData *data = rc;
1517  data->IMC.hWnd = hWnd;
1518  }
1519 
1520  TRACE("returning %p\n", rc);
1521 
1522  return rc;
1523 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:503
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:74
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:409
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:103
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 1528 of file imm.c.

1532 {
1533  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1534  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_a(pSrc), lpDst,
1535  dwBufLen, uFlag);
1536  if (immHkl->hIME && immHkl->pImeConversionList)
1537  {
1538  if (!is_kbd_ime_unicode(immHkl))
1539  return immHkl->pImeConversionList(hIMC,(LPCWSTR)pSrc,lpDst,dwBufLen,uFlag);
1540  else
1541  {
1542  LPCANDIDATELIST lpwDst;
1543  DWORD ret = 0, len;
1544  LPWSTR pwSrc = strdupAtoW(pSrc);
1545 
1546  len = immHkl->pImeConversionList(hIMC, pwSrc, NULL, 0, uFlag);
1547  lpwDst = HeapAlloc(GetProcessHeap(), 0, len);
1548  if ( lpwDst )
1549  {
1550  immHkl->pImeConversionList(hIMC, pwSrc, lpwDst, len, uFlag);
1551  ret = convert_candidatelist_WtoA( lpwDst, lpDst, dwBufLen);
1552  HeapFree(GetProcessHeap(), 0, lpwDst);
1553  }
1554  HeapFree(GetProcessHeap(), 0, pwSrc);
1555 
1556  return ret;
1557  }
1558  }
1559  else
1560  return 0;
1561 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:128
HMODULE hIME
Definition: imm.c:46
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
_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:395
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:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static DWORD convert_candidatelist_WtoA(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:152
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_GetConversionListA().

◆ ImmGetConversionListW()

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

Definition at line 1566 of file imm.c.

1570 {
1571  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1572  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_w(pSrc), lpDst,
1573  dwBufLen, uFlag);
1574  if (immHkl->hIME && immHkl->pImeConversionList)
1575  {
1576  if (is_kbd_ime_unicode(immHkl))
1577  return immHkl->pImeConversionList(hIMC,pSrc,lpDst,dwBufLen,uFlag);
1578  else
1579  {
1580  LPCANDIDATELIST lpaDst;
1581  DWORD ret = 0, len;
1582  LPSTR paSrc = strdupWtoA(pSrc);
1583 
1584  len = immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, NULL, 0, uFlag);
1585  lpaDst = HeapAlloc(GetProcessHeap(), 0, len);
1586  if ( lpaDst )
1587  {
1588  immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, lpaDst, len, uFlag);
1589  ret = convert_candidatelist_AtoW( lpaDst, lpDst, dwBufLen);
1590  HeapFree(GetProcessHeap(), 0, lpaDst);
1591  }
1592  HeapFree(GetProcessHeap(), 0, paSrc);
1593 
1594  return ret;
1595  }
1596  }
1597  else
1598  return 0;
1599 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:140
HMODULE hIME
Definition: imm.c:46
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
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:191
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
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:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_GetConversionListW().

◆ ImmGetConversionStatus()

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

Definition at line 1604 of file imm.c.

1606 {
1608 
1609  TRACE("%p %p %p\n", hIMC, lpfdwConversion, lpfdwSentence);
1610 
1611  if (!data)
1612  return FALSE;
1613 
1614  if (lpfdwConversion)
1615  *lpfdwConversion = data->IMC.fdwConversion;
1616  if (lpfdwSentence)
1617  *lpfdwSentence = data->IMC.fdwSentence;
1618 
1619  return TRUE;
1620 }
#define TRUE
Definition: types.h:120
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
#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 1716 of file imm.c.

1717 {
1718  HWND ret;
1720  if (!thread_data)
1721  return NULL;
1722  ret = thread_data->hwndDefault;
1724  TRACE("Default is %p\n",ret);
1725  return ret;
1726 }
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:230
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:112

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

1733 {
1734  WCHAR *buf;
1735  DWORD len;
1736 
1737  TRACE("%p %p %d\n", hKL, lpszDescription, uBufLen);
1738 
1739  /* find out how many characters in the unicode buffer */
1740  len = ImmGetDescriptionW( hKL, NULL, 0 );
1741  if (!len)
1742  return 0;
1743 
1744  /* allocate a buffer of that size */
1745  buf = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR) );
1746  if( !buf )
1747  return 0;
1748 
1749  /* fetch the unicode buffer */
1750  len = ImmGetDescriptionW( hKL, buf, len + 1 );
1751 
1752  /* convert it back to ASCII */
1753  len = WideCharToMultiByte( CP_ACP, 0, buf, len + 1,
1754  lpszDescription, uBufLen, NULL, NULL );
1755 
1756  HeapFree( GetProcessHeap(), 0, buf );
1757 
1758  if (len == 0)
1759  return 0;
1760 
1761  return len - 1;
1762 }
#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:395
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:1767
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_GetDescriptionA(), and test_ImmGetDescription().

◆ ImmGetDescriptionW()

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

Definition at line 1767 of file imm.c.

1768 {
1769  static const WCHAR name[] = { 'W','i','n','e',' ','X','I','M',0 };
1770 
1771  FIXME("(%p, %p, %d): semi stub\n", hKL, lpszDescription, uBufLen);
1772 
1773  if (!hKL) return 0;
1774  if (!uBufLen) return lstrlenW( name );
1775  lstrcpynW( lpszDescription, name, uBufLen );
1776  return lstrlenW( lpszDescription );
1777 }
#define lstrlenW
Definition: compat.h:407
#define lstrcpynW
Definition: compat.h:397
#define FIXME(fmt,...)
Definition: debug.h:110
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: name.c:36

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

◆ ImmGetGuideLineA()

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

Definition at line 1782 of file imm.c.

1784 {
1785  FIXME("(%p, %d, %s, %d): stub\n",
1786  hIMC, dwIndex, debugstr_a(lpBuf), dwBufLen
1787  );
1789  return 0;
1790 }
_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:409
#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 1795 of file imm.c.

1796 {
1797  FIXME("(%p, %d, %s, %d): stub\n",
1798  hIMC, dwIndex, debugstr_w(lpBuf), dwBufLen
1799  );
1801  return 0;
1802 }
_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:409
#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 3141 of file imm.c.

3142 {
3143  FIXME("%x, %p, %p, %p: stub\n", hotkey, modifiers, key, hkl);
3144  return FALSE;
3145 }
#define FIXME(fmt,...)
Definition: debug.h:110
HKL hkl
Definition: msctf.idl:611
Definition: path.c:42

◆ ImmGetIMCCLockCount()

DWORD WINAPI ImmGetIMCCLockCount ( HIMCC  imcc)

Definition at line 2947 of file imm.c.

2948 {
2949  return GlobalFlags(imcc) & GMEM_LOCKCOUNT;
2950 }
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 2963 of file imm.c.

2964 {
2965  return GlobalSize(imcc);
2966 }
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090

Referenced by test_ImmDestroyIMCC().

◆ ImmGetIMCLockCount()

DWORD WINAPI ImmGetIMCLockCount ( HIMC  hIMC)

Definition at line 2904 of file imm.c.

2905 {
2907  if (!data)
2908  return 0;
2909  return data->dwLock;
2910 }
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:488
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 1807 of file imm.c.

1808 {
1809  LPWSTR bufW = NULL;
1810  UINT wBufLen = uBufLen;
1811  UINT rc;
1812 
1813  if (uBufLen && lpszFileName)
1814  bufW = HeapAlloc(GetProcessHeap(),0,uBufLen * sizeof(WCHAR));
1815  else /* We need this to get the number of byte required */
1816  {
1817  bufW = HeapAlloc(GetProcessHeap(),0,MAX_PATH * sizeof(WCHAR));
1818  wBufLen = MAX_PATH;
1819  }
1820 
1821  rc = ImmGetIMEFileNameW(hKL,bufW,wBufLen);
1822 
1823  if (rc > 0)
1824  {
1825  if (uBufLen && lpszFileName)
1826  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, lpszFileName,
1827  uBufLen, NULL, NULL);
1828  else /* get the length */
1829  rc = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL,
1830  NULL);
1831  }
1832 
1833  HeapFree(GetProcessHeap(),0,bufW);
1834  return rc;
1835 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
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:1840
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ActiveIMMApp_GetIMEFileNameA().

◆ ImmGetIMEFileNameW()

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

Definition at line 1840 of file imm.c.

1841 {
1842  HKEY hkey;
1843  DWORD length;
1844  DWORD rc;
1845  WCHAR regKey[ARRAY_SIZE(szImeRegFmt)+8];
1846 
1847  wsprintfW( regKey, szImeRegFmt, (ULONG_PTR)hKL );
1848  rc = RegOpenKeyW( HKEY_LOCAL_MACHINE, regKey, &hkey);
1849  if (rc != ERROR_SUCCESS)
1850  {
1851  SetLastError(rc);
1852  return 0;
1853  }
1854 
1855  length = 0;
1857 
1858  if (rc != ERROR_SUCCESS)
1859  {
1860  RegCloseKey(hkey);
1861  SetLastError(rc);
1862  return 0;
1863  }
1864  if (length > uBufLen * sizeof(WCHAR) || !lpszFileName)
1865  {
1866  RegCloseKey(hkey);
1867  if (lpszFileName)
1868  {
1870  return 0;
1871  }
1872  else
1873  return length / sizeof(WCHAR);
1874  }
1875 
1876  RegGetValueW(hkey, NULL, szImeFileW, RRF_RT_REG_SZ, NULL, lpszFileName, &length);
1877 
1878  RegCloseKey(hkey);
1879 
1880  return length / sizeof(WCHAR);
1881 }
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:409
static const WCHAR szImeFileW[]
Definition: imm.c:105
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR szImeRegFmt[]
Definition: imm.c:107
#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 2737 of file imm.c.

2740 {
2742  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2743  lpImeParentMenu, lpImeMenu, dwSize);
2744 
2745  if (!data)
2746  {
2748  return 0;
2749  }
2750 
2751  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2752  {
2753  if (!is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2754  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2755  (IMEMENUITEMINFOW*)lpImeParentMenu,
2756  (IMEMENUITEMINFOW*)lpImeMenu, dwSize);
2757  else
2758  {
2759  IMEMENUITEMINFOW lpImeParentMenuW;
2760  IMEMENUITEMINFOW *lpImeMenuW, *parent = NULL;
2761  DWORD rc;
2762 
2763  if (lpImeParentMenu)
2764  parent = &lpImeParentMenuW;
2765  if (lpImeMenu)
2766  {
2767  int count = dwSize / sizeof(LPIMEMENUITEMINFOA);
2768  dwSize = count * sizeof(IMEMENUITEMINFOW);
2769  lpImeMenuW = HeapAlloc(GetProcessHeap(), 0, dwSize);
2770  }
2771  else
2772  lpImeMenuW = NULL;
2773 
2774  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2775  parent, lpImeMenuW, dwSize);
2776 
2777  if (lpImeParentMenu)
2778  {
2779  memcpy(lpImeParentMenu,&lpImeParentMenuW,sizeof(IMEMENUITEMINFOA));
2780  lpImeParentMenu->hbmpItem = lpImeParentMenuW.hbmpItem;
2781  WideCharToMultiByte(CP_ACP, 0, lpImeParentMenuW.szString,
2782  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE,
2783  NULL, NULL);
2784  }
2785  if (lpImeMenu && rc)
2786  {
2787  unsigned int i;
2788  for (i = 0; i < rc; i++)
2789  {
2790  memcpy(&lpImeMenu[i],&lpImeMenuW[1],sizeof(IMEMENUITEMINFOA));
2791  lpImeMenu[i].hbmpItem = lpImeMenuW[i].hbmpItem;
2792  WideCharToMultiByte(CP_ACP, 0, lpImeMenuW[i].szString,
2793  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE,
2794  NULL, NULL);
2795  }
2796  }
2797  HeapFree(GetProcessHeap(),0,lpImeMenuW);
2798  return rc;
2799  }
2800  }
2801  else
2802  return 0;
2803 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#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:488
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2897
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
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:394
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 2808 of file imm.c.

2811 {
2813  TRACE("(%p, %i, %i, %p, %p, %i):\n", hIMC, dwFlags, dwType,
2814  lpImeParentMenu, lpImeMenu, dwSize);
2815 
2816  if (!data)
2817  {
2819  return 0;
2820  }
2821 
2822  if (data->immKbd->hIME && data->immKbd->pImeGetImeMenuItems)
2823  {
2824  if (is_himc_ime_unicode(data) || (!lpImeParentMenu && !lpImeMenu))
2825  return data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2826  lpImeParentMenu, lpImeMenu, dwSize);
2827  else
2828  {
2829  IMEMENUITEMINFOA lpImeParentMenuA;
2830  IMEMENUITEMINFOA *lpImeMenuA, *parent = NULL;
2831  DWORD rc;
2832 
2833  if (lpImeParentMenu)
2834  parent = &lpImeParentMenuA;
2835  if (lpImeMenu)
2836  {
2837  int count = dwSize / sizeof(LPIMEMENUITEMINFOW);
2838  dwSize = count * sizeof(IMEMENUITEMINFOA);
2839  lpImeMenuA = HeapAlloc(GetProcessHeap(), 0, dwSize);
2840  }
2841  else
2842  lpImeMenuA = NULL;
2843 
2844  rc = data->immKbd->pImeGetImeMenuItems(hIMC, dwFlags, dwType,
2846  (IMEMENUITEMINFOW*)lpImeMenuA, dwSize);
2847 
2848  if (lpImeParentMenu)
2849  {
2850  memcpy(lpImeParentMenu,&lpImeParentMenuA,sizeof(IMEMENUITEMINFOA));
2851  lpImeParentMenu->hbmpItem = lpImeParentMenuA.hbmpItem;
2852  MultiByteToWideChar(CP_ACP, 0, lpImeParentMenuA.szString,
2853  -1, lpImeParentMenu->szString, IMEMENUITEM_STRING_SIZE);
2854  }
2855  if (lpImeMenu && rc)
2856  {
2857  unsigned int i;
2858  for (i = 0; i < rc; i++)
2859  {
2860  memcpy(&lpImeMenu[i],&lpImeMenuA[1],sizeof(IMEMENUITEMINFOA));
2861  lpImeMenu[i].hbmpItem = lpImeMenuA[i].hbmpItem;
2862  MultiByteToWideChar(CP_ACP, 0, lpImeMenuA[i].szString,
2863  -1, lpImeMenu[i].szString, IMEMENUITEM_STRING_SIZE);
2864  }
2865  }
2866  HeapFree(GetProcessHeap(),0,lpImeMenuA);
2867  return rc;
2868  }
2869  }
2870  else
2871  return 0;
2872 }
#define is_himc_ime_unicode(p)
Definition: imm.c:122
#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:488
smooth NULL
Definition: ftsmooth.c:416
struct tagIMEMENUITEMINFOA IMEMENUITEMINFOA
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmpItem
Definition: dimm.idl:138
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2897
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
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:394
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 1886 of file imm.c.

1887 {
1889  static int i;
1890 
1891  if (!data)
1892  return FALSE;
1893 
1894  TRACE("(%p): semi-stub\n", hIMC);
1895 
1896  if (!i++)
1897  FIXME("(%p): semi-stub\n", hIMC);
1898 
1899  return data->IMC.fOpen;
1900 }
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:488
#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 1905 of file imm.c.

1906 {
1907  DWORD rc = 0;
1908  ImmHkl *kbd;
1909 
1910  TRACE("(%p, %d)\n", hKL, fdwIndex);
1911  kbd = IMM_GetImmHkl(hKL);
1912 
1913  if (kbd && kbd->hIME)
1914  {
1915  switch (fdwIndex)
1916  {
1917  case IGP_PROPERTY: rc = kbd->imeInfo.fdwProperty; break;
1918  case IGP_CONVERSION: rc = kbd->imeInfo.fdwConversionCaps; break;
1919  case IGP_SENTENCE: rc = kbd->imeInfo.fdwSentenceCaps; break;
1920  case IGP_SETCOMPSTR: rc = kbd->imeInfo.fdwSCSCaps; break;
1921  case IGP_SELECT: rc = kbd->imeInfo.fdwSelectCaps; break;
1922  case IGP_GETIMEVERSION: rc = IMEVER_0400; break;
1923  case IGP_UI: rc = 0; break;
1924  default: rc = 0;
1925  }
1926  }
1927  return rc;
1928 }
HMODULE hIME
Definition: imm.c:46
#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:47
DWORD fdwConversionCaps
Definition: imm.h:153
Definition: imm.c:43
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:326
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 1933 of file imm.c.

1935 {
1936  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1937  TRACE("(%p, %d, %p):\n", hKL, nItem, lpStyleBuf);
1938  if (immHkl->hIME && immHkl->pImeGetRegisterWordStyle)
1939  {
1940  if (!is_kbd_ime_unicode(immHkl))
1941  return immHkl->pImeGetRegisterWordStyle(nItem,(LPSTYLEBUFW)lpStyleBuf);
1942  else
1943  {
1944  STYLEBUFW sbw;
1945  UINT rc;
1946 
1947  rc = immHkl->pImeGetRegisterWordStyle(nItem,&sbw);
1949  lpStyleBuf->szDescription, 32, NULL, NULL);
1950  lpStyleBuf->dwStyle = sbw.dwStyle;
1951  return rc;
1952  }
1953  }
1954  else
1955  return 0;
1956 }
DWORD dwStyle
Definition: imm.h:82
DWORD dwStyle
Definition: dimm.idl:109
HMODULE hIME
Definition: imm.c:46
#define WideCharToMultiByte
Definition: compat.h:101
#define is_kbd_ime_unicode(p)
Definition: imm.c:123
#define CP_ACP
Definition: compat.h:99