ReactOS  0.4.15-dev-2977-ge996662
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 <stdlib.h>
#include <ndk/umtypes.h>
#include <ndk/pstypes.h>
#include <ndk/rtlfuncs.h>
#include "../../../win32ss/include/ntuser.h"
#include "../../../win32ss/include/ntwin32.h"
#include <imm32_undoc.h>
#include <strsafe.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 WIN32_NO_STATUS
 
#define IMM_INIT_MAGIC   0x19650412
 
#define IMM_INVALID_CANDFORM   ULONG_MAX
 
#define REGKEY_KEYBOARD_LAYOUTS   L"System\\CurrentControlSet\\Control\\Keyboard Layouts"
 
#define REGKEY_IMM   L"Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM"
 
#define WINE_IMC_VALID_MAGIC   0x56434D49
 
#define LOAD_FUNCPTR(f)   if((ptr->p##f = (LPVOID)GetProcAddress(ptr->hIME, #f)) == NULL){WARN("Can't find function %s in ime\n", #f);}
 
#define ROUNDUP4(n)   (((n) + 3) & ~3) /* DWORD alignment */
 
#define IMM32_FLAG_UNKNOWN   0x4
 
#define IMM32_FLAG_CICERO_ENABLED   0x20
 

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 DWORD APIENTRY Imm32QueryInputContext (HIMC hIMC, DWORD dwUnknown2)
 
static DWORD APIENTRY Imm32NotifyIMEStatus (HWND hwnd, HIMC hIMC, DWORD dwConversion)
 
static VOID APIENTRY Imm32FreeImeDpi (PIMEDPI pImeDpi, BOOL bDestroy)
 
static BOOL APIENTRY Imm32NotifyAction (HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD_PTR dwValue, DWORD_PTR dwCommand, DWORD_PTR dwData)
 
HKL WINAPI ImmLoadLayout (HKL hKL, PIMEINFOEX pImeInfoEx)
 
static BOOL is_himc_ime_unicode (const InputContextData *data)
 
static BOOL is_kbd_ime_unicode (const ImmHkl *hkl)
 
static BOOL IMM_DestroyContext (HIMC hIMC)
 
static InputContextDataget_imc_data (HIMC hIMC)
 
static WCHARstrdupAtoW (const char *str)
 
static CHARstrdupWtoA (const WCHAR *str)
 
static DWORD convert_candidatelist_WtoA (LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
 
static DWORD convert_candidatelist_AtoW (LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
 
static IMMThreadDataIMM_GetThreadData (HWND hwnd, DWORD thread)
 
static BOOL IMM_IsDefaultContext (HIMC imc)
 
static void IMM_FreeThreadData (void)
 
static HMODULE load_graphics_driver (void)
 
static ImmHklIMM_GetImmHkl (HKL hkl)
 
HWND WINAPI __wine_get_ui_window (HKL hkl)
 
static void IMM_FreeAllImmHkl (void)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
 
static void ImmInternalPostIMEMessage (InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void ImmInternalSendIMEMessage (InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT ImmInternalSendIMENotify (InputContextData *data, WPARAM notify, LPARAM lParam)
 
static HIMCC ImmCreateBlankCompStr (void)
 
static HIMC get_default_context (HWND hwnd)
 
static BOOL IMM_IsCrossThreadAccess (HWND hWnd, HIMC hIMC)
 
HIMC WINAPI ImmAssociateContext (HWND hWnd, HIMC hIMC)
 
static BOOL CALLBACK _ImmAssociateContextExEnumProc (HWND hwnd, LPARAM lParam)
 
BOOL WINAPI ImmAssociateContextEx (HWND hWnd, HIMC hIMC, DWORD dwFlags)
 
BOOL WINAPI ImmConfigureIMEA (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
BOOL WINAPI ImmConfigureIMEW (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
 
HIMC WINAPI ImmCreateContext (void)
 
BOOL WINAPI ImmDestroyContext (HIMC hIMC)
 
BOOL WINAPI ImmDisableIME (DWORD dwThreadId)
 
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)
 
LPVOID APIENTRY Imm32HeapAlloc (DWORD dwFlags, DWORD dwBytes)
 
static DWORD_PTR APIENTRY Imm32GetThreadState (DWORD Routine)
 
static DWORD_PTR APIENTRY Imm32QueryWindow (HWND hWnd, DWORD Index)
 
static DWORD APIENTRY Imm32UpdateInputContext (HIMC hIMC, DWORD Unknown1, PCLIENTIMC pClientImc)
 
static PCLIENTIMC APIENTRY Imm32GetClientImcCache (void)
 
PCLIENTIMC WINAPI ImmLockClientImc (HIMC hImc)
 
VOID WINAPI ImmUnlockClientImc (PCLIENTIMC pClientImc)
 
static DWORD APIENTRY CandidateListWideToAnsi (const CANDIDATELIST *pWideCL, LPCANDIDATELIST pAnsiCL, DWORD dwBufLen, UINT uCodePage)
 
static DWORD APIENTRY CandidateListAnsiToWide (const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST pWideCL, DWORD dwBufLen, UINT uCodePage)
 
static DWORD APIENTRY ImmGetCandidateListAW (HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen, BOOL bAnsi)
 
DWORD APIENTRY ImmGetCandidateListCountAW (HIMC hIMC, LPDWORD lpdwListCount, BOOL bAnsi)
 
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)
 
static VOID APIENTRY LogFontAnsiToWide (const LOGFONTA *plfA, LPLOGFONTW plfW)
 
static VOID APIENTRY LogFontWideToAnsi (const LOGFONTW *plfW, LPLOGFONTA plfA)
 
BOOL WINAPI ImmGetCompositionFontA (HIMC hIMC, LPLOGFONTA lplf)
 
BOOL WINAPI ImmGetCompositionFontW (HIMC hIMC, LPLOGFONTW lplf)
 
static INT CopyCompStringIMEtoClient (const InputContextData *data, const void *src, INT src_len, void *dst, INT dst_len, BOOL unicode)
 
static INT CopyCompAttrIMEtoClient (const InputContextData *data, const BYTE *src, INT src_len, const void *comp_string, INT str_len, BYTE *dst, INT dst_len, BOOL unicode)
 
static INT CopyCompClauseIMEtoClient (InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, LPBYTE target, INT tlen, BOOL unicode)
 
static INT CopyCompOffsetIMEtoClient (InputContextData *data, DWORD offset, LPBYTE ssource, BOOL unicode)
 
static LONG ImmGetCompositionStringT (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen, BOOL unicode)
 
LONG WINAPI ImmGetCompositionStringA (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
 
LONG WINAPI ImmGetCompositionStringW (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
 
BOOL WINAPI ImmGetCompositionWindow (HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
 
HIMC WINAPI ImmGetContext (HWND hWnd)
 
DWORD WINAPI ImmGetConversionListA (HKL hKL, HIMC hIMC, LPCSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
DWORD WINAPI ImmGetConversionListW (HKL hKL, HIMC hIMC, LPCWSTR pSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen, UINT uFlag)
 
BOOL WINAPI ImmGetConversionStatus (HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
 
static BOOL needs_ime_window (HWND hwnd)
 
BOOL WINAPI __wine_register_window (HWND hwnd)
 
void WINAPI __wine_unregister_window (HWND hwnd)
 
HWND WINAPI ImmGetDefaultIMEWnd (HWND hWnd)
 
BOOL WINAPI CtfImmIsCiceroEnabled (VOID)
 
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)
 
PIMEDPI WINAPI ImmLockImeDpi (HKL hKL)
 
VOID WINAPI ImmUnlockImeDpi (PIMEDPI pImeDpi)
 
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 dwThreadId)
 
BOOL WINAPI ImmEnumInputContext (DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
 
BOOL WINAPI ImmGetHotKey (IN DWORD dwHotKey, OUT LPUINT lpuModifiers, OUT LPUINT lpuVKey, OUT LPHKL lphKL)
 
BOOL WINAPI ImmDisableLegacyIME (void)
 
BOOL WINAPI ImmSetActiveContext (HWND hwnd, HIMC hIMC, BOOL fFlag)
 
BOOL WINAPI ImmSetActiveContextConsoleIME (HWND hwnd, BOOL fFlag)
 
BOOL WINAPI ImmRegisterClient (PVOID ptr, HINSTANCE hMod)
 
BOOL WINAPI CtfImmIsTextFrameServiceDisabled (VOID)
 
static BOOL APIENTRY Imm32GetImeInfoEx (PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
 
BOOL WINAPI ImmGetImeInfoEx (PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
 

Variables

RTL_CRITICAL_SECTION g_csImeDpi
 
PIMEDPI g_pImeDpiList = NULL
 
PSERVERINFO g_psi = NULL
 
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
 
HANDLE g_hImm32Heap = NULL
 
DWORD g_dwImm32Flags = 0
 

Macro Definition Documentation

◆ IMM32_FLAG_CICERO_ENABLED

#define IMM32_FLAG_CICERO_ENABLED   0x20

Definition at line 1128 of file imm.c.

◆ IMM32_FLAG_UNKNOWN

#define IMM32_FLAG_UNKNOWN   0x4

Definition at line 1127 of file imm.c.

◆ IMM_INIT_MAGIC

#define IMM_INIT_MAGIC   0x19650412

Definition at line 48 of file imm.c.

◆ IMM_INVALID_CANDFORM

#define IMM_INVALID_CANDFORM   ULONG_MAX

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

◆ REGKEY_IMM

#define REGKEY_IMM   L"Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM"

Definition at line 53 of file imm.c.

◆ REGKEY_KEYBOARD_LAYOUTS

#define REGKEY_KEYBOARD_LAYOUTS   L"System\\CurrentControlSet\\Control\\Keyboard Layouts"

Definition at line 51 of file imm.c.

◆ ROUNDUP4

#define ROUNDUP4 (   n)    (((n) + 3) & ~3) /* DWORD alignment */

Definition at line 1121 of file imm.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file imm.c.

◆ WINE_IMC_VALID_MAGIC

#define WINE_IMC_VALID_MAGIC   0x56434D49

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

525 {
526  ImmHkl *immHkl = IMM_GetImmHkl(hkl);
527  return immHkl->UIWnd;
528 }
HWND UIWnd
Definition: imm.c:173
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
HKL hkl
Definition: msctf.idl:611

◆ __wine_register_window()

BOOL WINAPI __wine_register_window ( HWND  hwnd)

Definition at line 2146 of file imm.c.

2147 {
2148  HWND new = NULL;
2150  TRACE("(%p)\n", hwnd);
2151 
2152  if (!needs_ime_window(hwnd))
2153  return FALSE;
2154 
2156  if (!thread_data)
2157  return FALSE;
2158 
2159  if (thread_data->disableIME || disable_ime)
2160  {
2161  TRACE("IME for this thread is disabled\n");
2163  return FALSE;
2164  }
2165  thread_data->windowRefs++;
2166  TRACE("windowRefs=%u, hwndDefault=%p\n",
2167  thread_data->windowRefs, thread_data->hwndDefault);
2168 
2169  /* Create default IME window */
2170  if (thread_data->windowRefs == 1)
2171  {
2172  /* Do not create the window inside of a critical section */
2176  0, 0, 1, 1, 0, 0, 0, 0);
2177  /* thread_data is in the current thread so we can assume it's still valid */
2179  /* See if anyone beat us */
2180  if (thread_data->hwndDefault == NULL)
2181  {
2182  thread_data->hwndDefault = new;
2183  new = NULL;
2184  TRACE("Default is %p\n", thread_data->hwndDefault);
2185  }
2186  }
2187 
2189 
2190  /* Clean up an unused new window outside of the critical section */
2191  if (new != NULL)
2192  DestroyWindow(new);
2193  return TRUE;
2194 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:360
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI DestroyWindow(_In_ HWND)
static BOOL disable_ime
Definition: imm.c:243
#define FALSE
Definition: types.h:117
static BOOL needs_ime_window(HWND hwnd)
Definition: imm.c:2132
#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:232
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static const WCHAR szwDefaultIME[]
Definition: imm.c:233
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:235

◆ __wine_unregister_window()

void WINAPI __wine_unregister_window ( HWND  hwnd)

Definition at line 2199 of file imm.c.

2200 {
2201  HWND to_destroy = 0;
2203  TRACE("(%p)\n", hwnd);
2204 
2206  if (!thread_data) return;
2207 
2208  thread_data->windowRefs--;
2209  TRACE("windowRefs=%u, hwndDefault=%p\n",
2210  thread_data->windowRefs, thread_data->hwndDefault);
2211 
2212  /* Destroy default IME window */
2213  if (thread_data->windowRefs == 0 && thread_data->hwndDefault)
2214  {
2215  to_destroy = thread_data->hwndDefault;
2216  thread_data->hwndDefault = NULL;
2217  }
2219 
2220  if (to_destroy) DestroyWindow( to_destroy );
2221 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:360
BOOL WINAPI DestroyWindow(_In_ HWND)
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:235

◆ _ImmAssociateContextExEnumProc()

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

Definition at line 755 of file imm.c.

756 {
757  HIMC hImc = (HIMC)lParam;
759  return TRUE;
760 }
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:693
LPARAM lParam
Definition: combotst.c:139

Referenced by ImmAssociateContextEx().

◆ CandidateListAnsiToWide()

static DWORD APIENTRY CandidateListAnsiToWide ( const CANDIDATELIST pAnsiCL,
LPCANDIDATELIST  pWideCL,
DWORD  dwBufLen,
UINT  uCodePage 
)
static

Definition at line 1290 of file imm.c.

1292 {
1293  DWORD dwSize, dwIndex, cchGot, cbGot, cbLeft;
1294  const BYTE *pbAnsi;
1295  LPBYTE pbWide;
1296  LPDWORD pibOffsets;
1297 
1298  /* calculate total wide size */
1299  if (pAnsiCL->dwCount > 0)
1300  {
1301  dwSize = sizeof(CANDIDATELIST) + ((pAnsiCL->dwCount - 1) * sizeof(DWORD));
1302  for (dwIndex = 0; dwIndex < pAnsiCL->dwCount; ++dwIndex)
1303  {
1304  pbAnsi = (const BYTE *)pAnsiCL + pAnsiCL->dwOffset[dwIndex];
1305  cchGot = MultiByteToWideChar(uCodePage, MB_PRECOMPOSED, (LPCSTR)pbAnsi, -1, NULL, 0);
1306  dwSize += cchGot * sizeof(WCHAR);
1307  }
1308  }
1309  else
1310  {
1311  dwSize = sizeof(CANDIDATELIST);
1312  }
1313 
1314  dwSize = ROUNDUP4(dwSize);
1315  if (dwBufLen == 0)
1316  return dwSize;
1317  if (dwBufLen < dwSize)
1318  return 0;
1319 
1320  /* store to wide */
1321  pWideCL->dwSize = dwBufLen;
1322  pWideCL->dwStyle = pAnsiCL->dwStyle;
1323  pWideCL->dwCount = pAnsiCL->dwCount;
1324  pWideCL->dwSelection = pAnsiCL->dwSelection;
1325  pWideCL->dwPageStart = pAnsiCL->dwPageStart;
1326  pWideCL->dwPageSize = pAnsiCL->dwPageSize;
1327 
1328  pibOffsets = pWideCL->dwOffset;
1329  if (pAnsiCL->dwCount > 0)
1330  {
1331  pibOffsets[0] = sizeof(CANDIDATELIST) + ((pWideCL->dwCount - 1) * sizeof(DWORD));
1332  cbLeft = dwBufLen - pibOffsets[0];
1333 
1334  for (dwIndex = 0; dwIndex < pAnsiCL->dwCount; ++dwIndex)
1335  {
1336  pbAnsi = (const BYTE *)pAnsiCL + pAnsiCL->dwOffset[dwIndex];
1337  pbWide = (LPBYTE)pWideCL + pibOffsets[dwIndex];
1338 
1339  /* convert to wide */
1340  cchGot = MultiByteToWideChar(uCodePage, MB_PRECOMPOSED, (LPCSTR)pbAnsi, -1,
1341  (LPWSTR)pbWide, cbLeft / sizeof(WCHAR));
1342  cbGot = cchGot * sizeof(WCHAR);
1343  cbLeft -= cbGot;
1344 
1345  if (dwIndex + 1 < pAnsiCL->dwCount)
1346  pibOffsets[dwIndex + 1] = pibOffsets[dwIndex] + cbGot;
1347  }
1348  }
1349  else
1350  {
1351  pibOffsets[0] = sizeof(CANDIDATELIST);
1352  }
1353 
1354  return dwBufLen;
1355 }
DWORD dwCount
Definition: dimm.idl:94
DWORD dwPageSize
Definition: dimm.idl:97
#define ROUNDUP4(n)
Definition: imm.c:1121
#define MB_PRECOMPOSED
Definition: winnls.h:281
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define DWORD
Definition: nt_native.h:44
DWORD dwPageSize
Definition: imm.h:73
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwPageStart
Definition: imm.h:72
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: dimm.idl:98
DWORD dwOffset[1]
Definition: imm.h:74
DWORD dwStyle
Definition: imm.h:69
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD dwCount
Definition: imm.h:70
DWORD dwStyle
Definition: dimm.idl:93
struct tagCANDIDATELIST CANDIDATELIST
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: xxhash.c:193
DWORD dwPageStart
Definition: dimm.idl:96
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
DWORD dwSelection
Definition: imm.h:71
uint32_t * LPDWORD
Definition: typedefs.h:59
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD dwSelection
Definition: dimm.idl:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by ImmGetCandidateListAW(), and ImmGetCandidateListCountAW().

◆ CandidateListWideToAnsi()

static DWORD APIENTRY CandidateListWideToAnsi ( const CANDIDATELIST pWideCL,
LPCANDIDATELIST  pAnsiCL,
DWORD  dwBufLen,
UINT  uCodePage 
)
static

Definition at line 1221 of file imm.c.

1223 {
1224  BOOL bUsedDefault;
1225  DWORD dwSize, dwIndex, cbGot, cbLeft;
1226  const BYTE *pbWide;
1227  LPBYTE pbAnsi;
1228  LPDWORD pibOffsets;
1229 
1230  /* calculate total ansi size */
1231  if (pWideCL->dwCount > 0)
1232  {
1233  dwSize = sizeof(CANDIDATELIST) + ((pWideCL->dwCount - 1) * sizeof(DWORD));
1234  for (dwIndex = 0; dwIndex < pWideCL->dwCount; ++dwIndex)
1235  {
1236  pbWide = (const BYTE *)pWideCL + pWideCL->dwOffset[dwIndex];
1237  cbGot = WideCharToMultiByte(uCodePage, 0, (LPCWSTR)pbWide, -1, NULL, 0,
1238  NULL, &bUsedDefault);
1239  dwSize += cbGot;
1240  }
1241  }
1242  else
1243  {
1244  dwSize = sizeof(CANDIDATELIST);
1245  }
1246 
1247  dwSize = ROUNDUP4(dwSize);
1248  if (dwBufLen == 0)
1249  return dwSize;
1250  if (dwBufLen < dwSize)
1251  return 0;
1252 
1253  /* store to ansi */
1254  pAnsiCL->dwSize = dwBufLen;
1255  pAnsiCL->dwStyle = pWideCL->dwStyle;
1256  pAnsiCL->dwCount = pWideCL->dwCount;
1257  pAnsiCL->dwSelection = pWideCL->dwSelection;
1258  pAnsiCL->dwPageStart = pWideCL->dwPageStart;
1259  pAnsiCL->dwPageSize = pWideCL->dwPageSize;
1260 
1261  pibOffsets = pAnsiCL->dwOffset;
1262  if (pWideCL->dwCount > 0)
1263  {
1264  pibOffsets[0] = sizeof(CANDIDATELIST) + ((pWideCL->dwCount - 1) * sizeof(DWORD));
1265  cbLeft = dwBufLen - pibOffsets[0];
1266 
1267  for (dwIndex = 0; dwIndex < pWideCL->dwCount; ++dwIndex)
1268  {
1269  pbWide = (const BYTE *)pWideCL + pWideCL->dwOffset[dwIndex];
1270  pbAnsi = (LPBYTE)pAnsiCL + pibOffsets[dwIndex];
1271 
1272  /* convert to ansi */
1273  cbGot = WideCharToMultiByte(uCodePage, 0, (LPCWSTR)pbWide, -1,
1274  (LPSTR)pbAnsi, cbLeft, NULL, &bUsedDefault);
1275  cbLeft -= cbGot;
1276 
1277  if (dwIndex < pWideCL->dwCount - 1)
1278  pibOffsets[dwIndex + 1] = pibOffsets[dwIndex] + cbGot;
1279  }
1280  }
1281  else
1282  {
1283  pibOffsets[0] = sizeof(CANDIDATELIST);
1284  }
1285 
1286  return dwBufLen;
1287 }
DWORD dwCount
Definition: dimm.idl:94
DWORD dwPageSize
Definition: dimm.idl:97
#define ROUNDUP4(n)
Definition: imm.c:1121
#define WideCharToMultiByte
Definition: compat.h:111
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char * LPSTR
Definition: xmlstorage.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define DWORD
Definition: nt_native.h:44
DWORD dwPageSize
Definition: imm.h:73
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwPageStart
Definition: imm.h:72
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: dimm.idl:98
DWORD dwOffset[1]
Definition: imm.h:74
DWORD dwStyle
Definition: imm.h:69
DWORD dwCount
Definition: imm.h:70
DWORD dwStyle
Definition: dimm.idl:93
struct tagCANDIDATELIST CANDIDATELIST
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: xxhash.c:193
DWORD dwPageStart
Definition: dimm.idl:96
#define NULL
Definition: types.h:112
DWORD dwSelection
Definition: imm.h:71
uint32_t * LPDWORD
Definition: typedefs.h:59
DWORD dwSelection
Definition: dimm.idl:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by ImmGetCandidateListAW(), and ImmGetCandidateListCountAW().

◆ convert_candidatelist_AtoW()

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

Definition at line 321 of file imm.c.

323 {
324  DWORD ret, i, len;
325 
327  if ( lpDst && dwBufLen > 0 )
328  {
329  *lpDst = *lpSrc;
330  lpDst->dwOffset[0] = ret;
331  }
332 
333  for ( i = 0; i < lpSrc->dwCount; i++)
334  {
335  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
336 
337  if ( lpDst && dwBufLen > 0 )
338  {
339  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
340 
342  (LPWSTR)dest, dwBufLen);
343 
344  if ( i + 1 < lpSrc->dwCount )
345  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(WCHAR);
346  dwBufLen -= len * sizeof(WCHAR);
347  }
348  else
349  len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)src, -1, NULL, 0);
350 
351  ret += len * sizeof(WCHAR);
352  }
353 
354  if ( lpDst )
355  lpDst->dwSize = ret;
356 
357  return ret;
358 }
#define CP_ACP
Definition: compat.h:109
if(dx==0 &&dy==0)
Definition: linetemp.h:174
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: imm.h:74
const char * LPCSTR
Definition: xmlstorage.h:183
DWORD dwCount
Definition: imm.h:70
__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
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 FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static char * dest
Definition: rtl.c:135
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetConversionListW().

◆ convert_candidatelist_WtoA()

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

Definition at line 282 of file imm.c.

284 {
285  DWORD ret, i, len;
286 
288  if ( lpDst && dwBufLen > 0 )
289  {
290  *lpDst = *lpSrc;
291  lpDst->dwOffset[0] = ret;
292  }
293 
294  for ( i = 0; i < lpSrc->dwCount; i++)
295  {
296  LPBYTE src = (LPBYTE)lpSrc + lpSrc->dwOffset[i];
297 
298  if ( lpDst && dwBufLen > 0 )
299  {
300  LPBYTE dest = (LPBYTE)lpDst + lpDst->dwOffset[i];
301 
303  (LPSTR)dest, dwBufLen, NULL, NULL);
304 
305  if ( i + 1 < lpSrc->dwCount )
306  lpDst->dwOffset[i+1] = lpDst->dwOffset[i] + len * sizeof(char);
307  dwBufLen -= len * sizeof(char);
308  }
309  else
311 
312  ret += len * sizeof(char);
313  }
314 
315  if ( lpDst )
316  lpDst->dwSize = ret;
317 
318  return ret;
319 }
#define WideCharToMultiByte
Definition: compat.h:111
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CP_ACP
Definition: compat.h:109
if(dx==0 &&dy==0)
Definition: linetemp.h:174
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
unsigned char * LPBYTE
Definition: typedefs.h:53
DWORD dwSize
Definition: imm.h:68
DWORD dwOffset[1]
Definition: imm.h:74
unsigned char
Definition: typeof.h:29
DWORD dwCount
Definition: imm.h:70
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
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 FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NULL
Definition: types.h:112
static char * dest
Definition: rtl.c:135

Referenced by ImmGetConversionListA().

◆ CopyCompAttrIMEtoClient()

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

Definition at line 1721 of file imm.c.

1723 {
1724  union
1725  {
1726  const void *str;
1727  const WCHAR *strW;
1728  const char *strA;
1729  } string;
1730  INT rc;
1731 
1732  string.str = comp_string;
1733 
1734  if (is_himc_ime_unicode(data) && !unicode)
1735  {
1736  rc = WideCharToMultiByte(CP_ACP, 0, string.strW, str_len, NULL, 0, NULL, NULL);
1737  if (dst_len)
1738  {
1739  int i, j = 0, k = 0;
1740 
1741  if (rc < dst_len)
1742  dst_len = rc;
1743  for (i = 0; i < str_len; ++i)
1744  {
1745  int len;
1746 
1747  len = WideCharToMultiByte(CP_ACP, 0, string.strW + i, 1, NULL, 0, NULL, NULL);
1748  for (; len > 0; --len)
1749  {
1750  dst[j++] = src[k];
1751 
1752  if (j >= dst_len)
1753  goto end;
1754  }
1755  ++k;
1756  }
1757  end:
1758  rc = j;
1759  }
1760  }
1761  else if (!is_himc_ime_unicode(data) && unicode)
1762  {
1763  rc = MultiByteToWideChar(CP_ACP, 0, string.strA, str_len, NULL, 0);
1764  if (dst_len)
1765  {
1766  int i, j = 0;
1767 
1768  if (rc < dst_len)
1769  dst_len = rc;
1770  for (i = 0; i < str_len; ++i)
1771  {
1772  if (IsDBCSLeadByte(string.strA[i]))
1773  continue;
1774 
1775  dst[j++] = src[i];
1776 
1777  if (j >= dst_len)
1778  break;
1779  }
1780  rc = j;
1781  }
1782  }
1783  else
1784  {
1785  memcpy(dst, src, min(src_len, dst_len));
1786  rc = src_len;
1787  }
1788 
1789  return rc;
1790 }
char strA[12]
Definition: clipboard.c:2028
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
#define str_len
Definition: treelist.c:89
int32_t INT
Definition: typedefs.h:58
WCHAR strW[12]
Definition: clipboard.c:2029
const WCHAR * str
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2232
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:245
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLuint end
Definition: gl.h:1545
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
char string[160]
Definition: util.h:11
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
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
int k
Definition: mpi.c:3369

Referenced by ImmGetCompositionStringT().

◆ CopyCompClauseIMEtoClient()

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

Definition at line 1792 of file imm.c.

1794 {
1795  INT rc;
1796 
1797  if (is_himc_ime_unicode(data) && !unicode)
1798  {
1799  if (tlen)
1800  {
1801  int i;
1802 
1803  if (slen < tlen)
1804  tlen = slen;
1805  tlen /= sizeof (DWORD);
1806  for (i = 0; i < tlen; ++i)
1807  {
1808  ((DWORD *)target)[i] = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource,
1809  ((DWORD *)source)[i],
1810  NULL, 0,
1811  NULL, NULL);
1812  }
1813  rc = sizeof (DWORD) * i;
1814  }
1815  else
1816  rc = slen;
1817  }
1818  else if (!is_himc_ime_unicode(data) && unicode)
1819  {
1820  if (tlen)
1821  {
1822  int i;
1823 
1824  if (slen < tlen)
1825  tlen = slen;
1826  tlen /= sizeof (DWORD);
1827  for (i = 0; i < tlen; ++i)
1828  {
1829  ((DWORD *)target)[i] = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource,
1830  ((DWORD *)source)[i],
1831  NULL, 0);
1832  }
1833  rc = sizeof (DWORD) * i;
1834  }
1835  else
1836  rc = slen;
1837  }
1838  else
1839  {
1840  memcpy( target, source, min(slen,tlen));
1841  rc = slen;
1842  }
1843 
1844  return rc;
1845 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
char * LPSTR
Definition: xmlstorage.h:182
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:245
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
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 min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
GLenum target
Definition: glext.h:7315
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetCompositionStringT().

◆ CopyCompOffsetIMEtoClient()

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

Definition at line 1847 of file imm.c.

1848 {
1849  int rc;
1850 
1851  if (is_himc_ime_unicode(data) && !unicode)
1852  {
1853  rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, offset, NULL, 0, NULL, NULL);
1854  }
1855  else if (!is_himc_ime_unicode(data) && unicode)
1856  {
1857  rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, offset, NULL, 0);
1858  }
1859  else
1860  rc = offset;
1861 
1862  return rc;
1863 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
char * LPSTR
Definition: xmlstorage.h:182
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:245
GLintptr offset
Definition: glext.h:5920
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ImmGetCompositionStringT().

◆ CopyCompStringIMEtoClient()

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

Definition at line 1691 of file imm.c.

1693 {
1694  int char_size = unicode ? sizeof(WCHAR) : sizeof(char);
1695  INT ret;
1696 
1697  if (is_himc_ime_unicode(data) ^ unicode)
1698  {
1699  if (unicode)
1700  ret = MultiByteToWideChar(CP_ACP, 0, src, src_len, dst, dst_len / sizeof(WCHAR));
1701  else
1702  ret = WideCharToMultiByte(CP_ACP, 0, src, src_len, dst, dst_len, NULL, NULL);
1703  ret *= char_size;
1704  }
1705  else
1706  {
1707  if (dst_len)
1708  {
1709  ret = min(src_len * char_size, dst_len);
1710  memcpy(dst, src, ret);
1711  }
1712  else
1713  ret = src_len * char_size;
1714  }
1715 
1716  return ret;
1717 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
int32_t INT
Definition: typedefs.h:58
static BOOL is_himc_ime_unicode(const InputContextData *data)
Definition: imm.c:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by ImmGetCompositionStringT().

◆ CtfImmIsCiceroEnabled()

BOOL WINAPI CtfImmIsCiceroEnabled ( VOID  )

Definition at line 2240 of file imm.c.

2241 {
2243 }
#define IMM32_FLAG_CICERO_ENABLED
Definition: imm.c:1128
DWORD g_dwImm32Flags
Definition: imm.c:1124

◆ CtfImmIsTextFrameServiceDisabled()

BOOL WINAPI CtfImmIsTextFrameServiceDisabled ( VOID  )

Definition at line 3807 of file imm.c.

3808 {
3809  PTEB pTeb = NtCurrentTeb();
3810  if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->CI_flags & CI_TFSDISABLED)
3811  return TRUE;
3812  return FALSE;
3813 }
ULONG Win32ClientInfo[31]
Definition: compat.h:706
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CI_TFSDISABLED
Definition: ntuser.h:284
Definition: compat.h:694
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

Referenced by ImmGetImeInfoEx().

◆ DllMain()

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

Definition at line 548 of file imm.c.

549 {
550  TRACE("%p, %x, %p\n",hInstDLL,fdwReason,lpReserved);
551  switch (fdwReason)
552  {
553  case DLL_PROCESS_ATTACH:
555  {
556  return FALSE;
557  }
558  break;
559  case DLL_THREAD_ATTACH:
560  break;
561  case DLL_THREAD_DETACH:
563  break;
564  case DLL_PROCESS_DETACH:
565  if (lpReserved) break;
568  break;
569  }
570  return TRUE;
571 }
#define TRUE
Definition: types.h:120
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define FALSE
Definition: types.h:117
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:97
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define TRACE(s)
Definition: solgame.cpp:4
#define IMM_INIT_MAGIC
Definition: imm.c:48
static void IMM_FreeThreadData(void)
Definition: imm.c:402
static void IMM_FreeAllImmHkl(void)
Definition: imm.c:530

◆ EscapeRequiresWA()

static BOOL EscapeRequiresWA ( UINT  uEscape)
inlinestatic

Definition at line 1041 of file imm.c.

1042 {
1043  if (uEscape == IME_ESC_GET_EUDC_DICTIONARY ||
1044  uEscape == IME_ESC_SET_EUDC_DICTIONARY ||
1045  uEscape == IME_ESC_IME_NAME ||
1046  uEscape == IME_ESC_GETHELPFILENAME)
1047  return TRUE;
1048  return FALSE;
1049 }
#define TRUE
Definition: types.h:120
#define IME_ESC_GETHELPFILENAME
Definition: imm.h:568
#define FALSE
Definition: types.h:117
#define IME_ESC_GET_EUDC_DICTIONARY
Definition: imm.h:560
#define IME_ESC_IME_NAME
Definition: imm.h:563
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561

Referenced by ImmEscapeA(), and ImmEscapeW().

◆ get_default_context()

static HIMC get_default_context ( HWND  hwnd)
static

Definition at line 633 of file imm.c.

634 {
635  HIMC ret;
637 
638  if (!thread_data) return 0;
639 
640  if (thread_data->defaultContext)
641  {
642  ret = thread_data->defaultContext;
644  return ret;
645  }
646 
647  /* can't create a default context in another thread */
648  if (thread_data->threadID != GetCurrentThreadId())
649  {
651  return 0;
652  }
653 
655 
656  ret = ImmCreateContext();
657  if (!ret) return 0;
658  ((InputContextData*)ret)->threadDefault = TRUE;
659 
660  /* thread_data is in the current thread so we can assume it's still valid */
662 
663  if (thread_data->defaultContext) /* someone beat us */
664  {
666  ret = thread_data->defaultContext;
667  }
668  else thread_data->defaultContext = ret;
669 
671  return ret;
672 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static IMMThreadData * IMM_GetThreadData(HWND hwnd, DWORD thread)
Definition: imm.c:360
#define TRUE
Definition: types.h:120
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD HIMC
Definition: dimm.idl:75
HIMC WINAPI ImmCreateContext(void)
Definition: imm.c:870
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
int ret
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:928
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:235

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

◆ get_imc_data()

static InputContextData * get_imc_data ( HIMC  hIMC)
static

Definition at line 618 of file imm.c.

619 {
620  InputContextData *data = hIMC;
621 
622  if (hIMC == NULL)
623  return NULL;
624 
625  if(IsBadReadPtr(data, sizeof(InputContextData)) || data->magic != WINE_IMC_VALID_MAGIC)
626  {
628  return NULL;
629  }
630  return data;
631 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:206
#define SetLastError(x)
Definition: compat.h:611
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
Definition: except.c:803
#define NULL
Definition: types.h:112

Referenced by IMM_DestroyContext(), IMM_IsCrossThreadAccess(), IMM_IsDefaultContext(), ImmAssociateContext(), ImmGenerateMessage(), ImmGetCompositionStringT(), ImmGetImeMenuItemsA(), ImmGetImeMenuItemsW(), ImmLockIMC(), ImmRequestMessageA(), ImmRequestMessageW(), ImmSetCandidateWindow(), ImmSetCompositionFontA(), ImmSetCompositionFontW(), ImmSetCompositionStringA(), ImmSetCompositionStringW(), and ImmSetConversionStatus().

◆ Imm32FreeImeDpi()

static VOID APIENTRY Imm32FreeImeDpi ( PIMEDPI  pImeDpi,
BOOL  bDestroy 
)
static

Definition at line 72 of file imm.c.

73 {
74  if (pImeDpi->hInst == NULL)
75  return;
76  if (bDestroy)
77  pImeDpi->ImeDestroy(0);
78  FreeLibrary(pImeDpi->hInst);
79  pImeDpi->hInst = NULL;
80 }
HINSTANCE hInst
Definition: ntuser.h:1221
FN_ImeDestroy ImeDestroy
Definition: ntuser.h:1229
#define FreeLibrary(x)
Definition: compat.h:607
#define NULL
Definition: types.h:112

Referenced by ImmUnlockImeDpi().

◆ Imm32GetClientImcCache()

static PCLIENTIMC APIENTRY Imm32GetClientImcCache ( void  )
static

Definition at line 1158 of file imm.c.

1159 {
1160  // FIXME: Do something properly here
1161  return NULL;
1162 }
#define NULL
Definition: types.h:112

Referenced by ImmLockClientImc().

◆ Imm32GetImeInfoEx()

static BOOL APIENTRY Imm32GetImeInfoEx ( PIMEINFOEX  pImeInfoEx,
IMEINFOEXCLASS  SearchType 
)
static

Definition at line 3819 of file imm.c.

3820 {
3821  return NtUserGetImeInfoEx(pImeInfoEx, SearchType);
3822 }
BOOL NTAPI NtUserGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
Definition: ime.c:107

Referenced by ImmGetImeInfoEx().

◆ Imm32GetThreadState()

static DWORD_PTR APIENTRY Imm32GetThreadState ( DWORD  Routine)
static

Definition at line 1142 of file imm.c.

1143 {
1144  return NtUserGetThreadState(Routine);
1145 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231

Referenced by ImmGetDefaultIMEWnd(), and ImmLockClientImc().

◆ Imm32HeapAlloc()

LPVOID APIENTRY Imm32HeapAlloc ( DWORD  dwFlags,
DWORD  dwBytes 
)

Definition at line 1130 of file imm.c.

1131 {
1132  if (!g_hImm32Heap)
1133  {
1134  g_hImm32Heap = RtlGetProcessHeap();
1135  if (g_hImm32Heap == NULL)
1136  return NULL;
1137  }
1138  return HeapAlloc(g_hImm32Heap, dwFlags, dwBytes);
1139 }
HANDLE g_hImm32Heap
Definition: imm.c:1123
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define NULL
Definition: types.h:112

Referenced by ImmLockClientImc().

◆ Imm32NotifyAction()

static BOOL APIENTRY Imm32NotifyAction ( HIMC  hIMC,
HWND  hwnd,
DWORD  dwAction,
DWORD_PTR  dwIndex,
DWORD_PTR  dwValue,
DWORD_PTR  dwCommand,
DWORD_PTR  dwData 
)
static

Definition at line 83 of file imm.c.

85 {
86  DWORD dwLayout;
87  HKL hKL;
88  PIMEDPI pImeDpi;
89 
90  if (dwAction)
91  {
92  dwLayout = Imm32QueryInputContext(hIMC, 1);
93  if (dwLayout)
94  {
95  /* find keyboard layout and lock it */
96  hKL = GetKeyboardLayout(dwLayout);
97  pImeDpi = ImmLockImeDpi(hKL);
98  if (pImeDpi)
99  {
100  /* do notify */
101  pImeDpi->NotifyIME(hIMC, dwAction, dwIndex, dwValue);
102 
103  ImmUnlockImeDpi(pImeDpi); /* unlock */
104  }
105  }
106  }
107 
108  if (hwnd && dwCommand)
109  SendMessageW(hwnd, WM_IME_NOTIFY, dwCommand, dwData);
110 
111  return TRUE;
112 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_IME_NOTIFY
Definition: winuser.h:1812
#define TRUE
Definition: types.h:120
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: imm.c:3066
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static DWORD APIENTRY Imm32QueryInputContext(HIMC hIMC, DWORD dwUnknown2)
Definition: imm.c:62
unsigned long DWORD
Definition: ntddk_ex.h:95
FN_NotifyIME NotifyIME
Definition: ntuser.h:1231
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: imm.c:3095
UINT_PTR HKL
Definition: msctf.idl:101
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194

Referenced by ImmSetCompositionWindow(), ImmSetOpenStatus(), and ImmSetStatusWindowPos().

◆ Imm32NotifyIMEStatus()

static DWORD APIENTRY Imm32NotifyIMEStatus ( HWND  hwnd,
HIMC  hIMC,
DWORD  dwConversion 
)
static

Definition at line 67 of file imm.c.

68 {
69  return NtUserNotifyIMEStatus(hwnd, hIMC, dwConversion);
70 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, HIMC hIMC, DWORD dwConversion)
Definition: ime.c:52

Referenced by ImmSetOpenStatus().

◆ Imm32QueryInputContext()

static DWORD APIENTRY Imm32QueryInputContext ( HIMC  hIMC,
DWORD  dwUnknown2 
)
static

Definition at line 62 of file imm.c.

63 {
64  return NtUserQueryInputContext(hIMC, dwUnknown2);
65 }
DWORD NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwUnknown2)
Definition: ntstubs.c:632

Referenced by Imm32NotifyAction(), ImmSetOpenStatus(), and ImmSetStatusWindowPos().

◆ Imm32QueryWindow()

static DWORD_PTR APIENTRY Imm32QueryWindow ( HWND  hWnd,
DWORD  Index 
)
static

Definition at line 1147 of file imm.c.

1148 {
1149  return NtUserQueryWindow(hWnd, Index);
1150 }
HWND hWnd
Definition: settings.c:17
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by ImmGetDefaultIMEWnd(), and ImmNotifyIME().

◆ Imm32UpdateInputContext()

static DWORD APIENTRY Imm32UpdateInputContext ( HIMC  hIMC,
DWORD  Unknown1,
PCLIENTIMC  pClientImc 
)
static

Definition at line 1153 of file imm.c.

1154 {
1155  return NtUserUpdateInputContext(hIMC, Unknown1, pClientImc);
1156 }
DWORD NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD Unknown1, LPVOID pClientImc)
Definition: ntstubs.c:358

Referenced by ImmLockClientImc().

◆ IMM_DestroyContext()

static BOOL IMM_DestroyContext ( HIMC  hIMC)
static

Definition at line 928 of file imm.c.

929 {
931 
932  TRACE("Destroying %p\n",hIMC);
933 
934  if (!data)
935  return FALSE;
936 
937  data->immKbd->uSelected --;
938  data->immKbd->pImeSelect(hIMC, FALSE);
939  SendMessageW(data->IMC.hWnd, WM_IME_SELECT, FALSE, (LPARAM)data->immKbd);
940 
941  ImmDestroyIMCC(data->IMC.hCompStr);
942  ImmDestroyIMCC(data->IMC.hCandInfo);
943  ImmDestroyIMCC(data->IMC.hGuideLine);
944  ImmDestroyIMCC(data->IMC.hPrivate);
945  ImmDestroyIMCC(data->IMC.hMsgBuf);
946 
947  data->magic = 0;
949 
950  return TRUE;
951 }
#define TRUE
Definition: types.h:120
#define WM_IME_SELECT
Definition: winuser.h:1815
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:3521
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HeapFree(x, y, z)
Definition: compat.h:594

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

◆ IMM_FreeAllImmHkl()

static void IMM_FreeAllImmHkl ( void  )
static

Definition at line 530 of file imm.c.

531 {
532  ImmHkl *ptr,*cursor2;
533 
535  {
536  list_remove(&ptr->entry);
537  if (ptr->hIME)
538  {
539  ptr->pImeDestroy(1);
540  FreeLibrary(ptr->hIME);
541  }
542  if (ptr->UIWnd)
543  DestroyWindow(ptr->UIWnd);
545  }
546 }
BOOL WINAPI DestroyWindow(_In_ HWND)
static PVOID ptr
Definition: dispmode.c:27
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
static struct list ImmHklList
Definition: imm.c:223
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by DllMain().

◆ IMM_FreeThreadData()

static void IMM_FreeThreadData ( void  )
static

Definition at line 402 of file imm.c.

403 {
405 
408  {
409  if (data->threadID == GetCurrentThreadId())
410  {
411  list_remove(&data->entry);
413  IMM_DestroyContext(data->defaultContext);
415  TRACE("Thread Data Destroyed\n");
416  return;
417  }
418  }
420 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:928
uint32_t entry
Definition: isohybrid.c:63
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:235
#define HeapFree(x, y, z)
Definition: compat.h:594
static struct list ImmThreadDataList
Definition: imm.c:224

Referenced by DllMain().

◆ IMM_GetImmHkl()

static ImmHkl* IMM_GetImmHkl ( HKL  hkl)
static

Definition at line 456 of file imm.c.

457 {
458  ImmHkl *ptr;
460 
461  TRACE("Seeking ime for keyboard %p\n",hkl);
462 
464  {
465  if (ptr->hkl == hkl)
466  return ptr;
467  }
468  /* not found... create it */
469 
471 
472  ptr->hkl = hkl;
474  if (!ptr->hIME) ptr->hIME = load_graphics_driver();
475  if (ptr->hIME)
476  {
478  if (!ptr->pImeInquire || !ptr->pImeInquire(&ptr->imeInfo, ptr->imeClassName, NULL))
479  {
480  FreeLibrary(ptr->hIME);
481  ptr->hIME = NULL;
482  }
483  else
484  {
487  if (!ptr->pImeSelect || !ptr->pImeDestroy)
488  {
489  FreeLibrary(ptr->hIME);
490  ptr->hIME = NULL;
491  }
492  else
493  {
507  /* make sure our classname is WCHAR */
508  if (!is_kbd_ime_unicode(ptr))
509  {
510  WCHAR bufW[17];
511  MultiByteToWideChar(CP_ACP, 0, (LPSTR)ptr->imeClassName,
512  -1, bufW, 17);
513  lstrcpyW(ptr->imeClassName, bufW);
514  }
515  }
516  }
517  }
518  list_add_head(&ImmHklList,&ptr->entry);
519 
520  return ptr;
521 }
#define LOAD_FUNCPTR(f)
Definition: imm.c:455
BOOL WINAPI ImeConfigure(HKL, HWND, DWORD, LPVOID)
BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE)
UINT WINAPI ImeToAsciiEx(UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC)
#define CP_ACP
Definition: compat.h:109
DWORD WINAPI ImeGetImeMenuItems(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD)
LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID)
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR)
BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static PVOID ptr
Definition: dispmode.c:27
#define LoadLibraryW(x)
Definition: compat.h:606
BOOL WINAPI ImeSetActiveContext(HIMC, BOOL)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions)
static struct list ImmHklList
Definition: imm.c:223
DWORD WINAPI ImeConversionList(HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT)
uint32_t entry
Definition: isohybrid.c:63
BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD)
BOOL WINAPI ImeSetCompositionString(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD)
UINT WINAPI ImeGetRegisterWordStyle(UINT, LPSTYLEBUFW)
BOOL WINAPI ImeDestroy(UINT)
HKL hkl
Definition: msctf.idl:611
#define lstrcpyW
Definition: compat.h:608
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI ImeSelect(HIMC, BOOL)
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: imm.c:2347
static HMODULE load_graphics_driver(void)
Definition: imm.c:422

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

◆ IMM_GetThreadData()

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

Definition at line 360 of file imm.c.

361 {
363  DWORD process;
364 
365  if (hwnd)
366  {
367  if (!(thread = GetWindowThreadProcessId(hwnd, &process))) return NULL;
368  if (process != GetCurrentProcessId()) return NULL;
369  }
370  else if (thread)
371  {
373  if (!h) return NULL;
375  CloseHandle(h);
376  if (process != GetCurrentProcessId()) return NULL;
377  }
378  else
380 
383  if (data->threadID == thread) return data;
384 
386  data->threadID = thread;
388  TRACE("Thread Data Created (%x)\n",thread);
389  return data;
390 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CloseHandle
Definition: compat.h:598
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static HANDLE process
Definition: process.c:76
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define FALSE
Definition: types.h:117
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HANDLE thread
Definition: service.c:33
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
Definition: thread.c:402
uint32_t entry
Definition: isohybrid.c:63
DWORD WINAPI GetProcessIdOfThread(IN HANDLE Thread)
Definition: thread.c:888
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define THREAD_QUERY_INFORMATION
Definition: pstypes.h:149
static CRITICAL_SECTION threaddata_cs
Definition: imm.c:235
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1158
static struct list ImmThreadDataList
Definition: imm.c:224

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

◆ IMM_IsCrossThreadAccess()

static BOOL IMM_IsCrossThreadAccess ( HWND  hWnd,
HIMC  hIMC 
)
static

Definition at line 674 of file imm.c.

675 {
677 
678  if (hWnd)
679  {
681  if (thread != GetCurrentThreadId()) return TRUE;
682  }
683  data = get_imc_data(hIMC);
684  if (data && data->threadID != GetCurrentThreadId())
685  return TRUE;
686 
687  return FALSE;
688 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
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
#define NULL
Definition: types.h:112

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

◆ IMM_IsDefaultContext()

static BOOL IMM_IsDefaultContext ( HIMC  imc)
static

Definition at line 392 of file imm.c.

393 {
395 
396  if (!data)
397  return FALSE;
398 
399  return data->threadDefault;
400 }
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
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 693 of file imm.c.

694 {
695  HIMC old = NULL;
697 
698  TRACE("(%p, %p):\n", hWnd, hIMC);
699 
700  if(hIMC && !data)
701  return NULL;
702 
703  /*
704  * If already associated just return
705  */
706  if (hIMC && data->IMC.hWnd == hWnd)
707  return hIMC;
708 
709  if (hIMC && IMM_IsCrossThreadAccess(hWnd, hIMC))
710  return NULL;
711 
712  if (hWnd)
713  {
714  HIMC defaultContext = get_default_context( hWnd );
716 
717  if (old == NULL)
718  old = defaultContext;
719  else if (old == (HIMC)-1)
720  old = NULL;
721 
722  if (hIMC != defaultContext)
723  {
724  if (hIMC == NULL) /* Meaning disable imm for that window*/
726  else
728  }
729 
730  if (old)
731  {
732  InputContextData *old_data = old;
733  if (old_data->IMC.hWnd == hWnd)
734  old_data->IMC.hWnd = NULL;
735  }
736  }
737 
738  if (!hIMC)
739  return old;
740 
741  if(GetActiveWindow() == data->IMC.hWnd)
742  {
744  data->IMC.hWnd = hWnd;
746  }
747 
748  return old;
749 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:633
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:197
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
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:674
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:226
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
#define ISC_SHOWUIALL
Definition: imm.h:303
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138

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

◆ ImmAssociateContextEx()

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

Definition at line 765 of file imm.c.

766 {
767  TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
768 
769  if (!hWnd)
770  return FALSE;
771 
772  switch (dwFlags)
773  {
774  case 0:
776  return TRUE;
777  case IACE_DEFAULT:
778  {
779  HIMC defaultContext = get_default_context( hWnd );
780  if (!defaultContext) return FALSE;
781  ImmAssociateContext(hWnd,defaultContext);
782  return TRUE;
783  }
787  return TRUE;
788  case IACE_CHILDREN:
790  return TRUE;
791  default:
792  FIXME("Unknown dwFlags 0x%x\n",dwFlags);
793  return FALSE;
794  }
795 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define IACE_DEFAULT
Definition: imm.h:579
#define IACE_IGNORENOCONTEXT
Definition: imm.h:580
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:633
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
Definition: imm.c:755
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
LONG_PTR LPARAM
Definition: windef.h:208
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:226
HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:693
#define IACE_CHILDREN
Definition: imm.h:578
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by ActiveIMMApp_AssociateContextEx().

◆ ImmConfigureIMEA()

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

Definition at line 800 of file imm.c.

802 {
803  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
804 
805  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
806 
807  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
808  return FALSE;
809 
810  if (immHkl->hIME && immHkl->pImeConfigure)
811  {
812  if (dwMode != IME_CONFIG_REGISTERWORD || !is_kbd_ime_unicode(immHkl))
813  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
814  else
815  {
816  REGISTERWORDW rww;
817  REGISTERWORDA *rwa = lpData;
818  BOOL rc;
819 
820  rww.lpReading = strdupAtoW(rwa->lpReading);
821  rww.lpWord = strdupAtoW(rwa->lpWord);
822  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rww);
824  HeapFree(GetProcessHeap(),0,rww.lpWord);
825  return rc;
826  }
827  }
828  else
829  return FALSE;
830 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:258
HMODULE hIME
Definition: imm.c:169
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpWord
Definition: dimm.idl:31
LPSTR lpReading
Definition: dimm.idl:30
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:550
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_ConfigureIMEA(), and test_ImmIME().

◆ ImmConfigureIMEW()

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

Definition at line 835 of file imm.c.

837 {
838  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
839 
840  TRACE("(%p, %p, %d, %p):\n", hKL, hWnd, dwMode, lpData);
841 
842  if (dwMode == IME_CONFIG_REGISTERWORD && !lpData)
843  return FALSE;
844 
845  if (immHkl->hIME && immHkl->pImeConfigure)
846  {
847  if (dwMode != IME_CONFIG_REGISTERWORD || is_kbd_ime_unicode(immHkl))
848  return immHkl->pImeConfigure(hKL,hWnd,dwMode,lpData);
849  else
850  {
851  REGISTERWORDW *rww = lpData;
852  REGISTERWORDA rwa;
853  BOOL rc;
854 
855  rwa.lpReading = strdupWtoA(rww->lpReading);
856  rwa.lpWord = strdupWtoA(rww->lpWord);
857  rc = immHkl->pImeConfigure(hKL,hWnd,dwMode,&rwa);
859  HeapFree(GetProcessHeap(),0,rwa.lpWord);
860  return rc;
861  }
862  }
863  else
864  return FALSE;
865 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:270
HMODULE hIME
Definition: imm.c:169
HWND hWnd
Definition: settings.c:17
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
#define FALSE
Definition: types.h:117
LPWSTR lpReading
Definition: dimm.idl:35
unsigned int BOOL
Definition: ntddk_ex.h:94
LPSTR lpWord
Definition: dimm.idl:31
LPSTR lpReading
Definition: dimm.idl:30
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define IME_CONFIG_REGISTERWORD
Definition: imm.h:550
LPWSTR lpWord
Definition: dimm.idl:36
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_ConfigureIMEW(), and test_ImmIME().

◆ ImmCreateBlankCompStr()

static HIMCC ImmCreateBlankCompStr ( void  )
static

Definition at line 606 of file imm.c.

607 {
608  HIMCC rc;
610  rc = ImmCreateIMCC(sizeof(COMPOSITIONSTRING));
611  ptr = ImmLockIMCC(rc);
612  memset(ptr,0,sizeof(COMPOSITIONSTRING));
613  ptr->dwSize = sizeof(COMPOSITIONSTRING);
614  ImmUnlockIMCC(rc);
615  return rc;
616 }
DWORD HIMCC
Definition: dimm.idl:76
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
struct tagCOMPOSITIONSTRING COMPOSITIONSTRING
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:3511
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ImmCreateContext().

◆ ImmCreateContext()

HIMC WINAPI ImmCreateContext ( void  )

Definition at line 870 of file imm.c.

871 {
872  InputContextData *new_context;
873  LPGUIDELINE gl;
874  LPCANDIDATEINFO ci;
875  int i;
876 
878 
879  /* Load the IME */
880  new_context->immKbd = IMM_GetImmHkl(GetKeyboardLayout(0));
881 
882  if (!new_context->immKbd->hIME)
883  {
884  TRACE("IME dll could not be loaded\n");
885  HeapFree(GetProcessHeap(),0,new_context);
886  return 0;
887  }
888 
889  /* the HIMCCs are never NULL */
890  new_context->IMC.hCompStr = ImmCreateBlankCompStr();
891  new_context->IMC.hMsgBuf = ImmCreateIMCC(0);
892  new_context->IMC.hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO));
893  ci = ImmLockIMCC(new_context->IMC.hCandInfo);
894  memset(ci,0,sizeof(CANDIDATEINFO));
895  ci->dwSize = sizeof(CANDIDATEINFO);
896  ImmUnlockIMCC(new_context->IMC.hCandInfo);
897  new_context->IMC.hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE));
898  gl = ImmLockIMCC(new_context->IMC.hGuideLine);
899  memset(gl,0,sizeof(GUIDELINE));
900  gl->dwSize = sizeof(GUIDELINE);
901  ImmUnlockIMCC(new_context->IMC.hGuideLine);
902 
903  for (i = 0; i < ARRAY_SIZE(new_context->IMC.cfCandForm); i++)
904  new_context->IMC.cfCandForm[i].dwIndex = ~0u;
905 
906  /* Initialize the IME Private */
907  new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize);
908 
909  new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps;
910  new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps;
911 
912  if (!new_context->immKbd->pImeSelect(new_context, TRUE))
913  {
914  TRACE("Selection of IME failed\n");
915  IMM_DestroyContext(new_context);
916  return 0;
917  }
918  new_context->threadID = GetCurrentThreadId();
919  SendMessageW(GetFocus(), WM_IME_SELECT, TRUE, (LPARAM)new_context->immKbd);
920 
921  new_context->immKbd->uSelected++;
922  TRACE("Created context %p\n",new_context);
923 
924  new_context->magic = WINE_IMC_VALID_MAGIC;
925  return new_context;
926 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
HMODULE hIME
Definition: imm.c:169
DWORD threadID
Definition: imm.c:198
#define TRUE
Definition: types.h:120
CANDIDATEFORM cfCandForm[4]
Definition: imm.h:39
#define WM_IME_SELECT
Definition: winuser.h:1815
INPUTCONTEXT IMC
Definition: imm.c:197
DWORD fdwConversion
Definition: imm.h:32
HIMCC hPrivate
Definition: imm.h:43
DWORD dwSize
Definition: imm.h:202
#define WINE_IMC_VALID_MAGIC
Definition: imm.c:206
static HIMCC ImmCreateBlankCompStr(void)
Definition: imm.c:606
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
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:172
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
IMEINFO imeInfo
Definition: imm.c:170
DWORD fdwConversionCaps
Definition: imm.h:156
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
struct tagCANDIDATEINFO CANDIDATEINFO
HIMCC hMsgBuf
Definition: imm.h:45
DWORD dwPrivateDataSize
Definition: imm.h:154
struct tagGUIDELINE GUIDELINE
static const struct getline_s gl[]
HIMCC hCompStr
Definition: imm.h:40
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:928
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
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
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:200
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:3511
DWORD fdwSentence
Definition: imm.h:33
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HWND WINAPI GetFocus(void)
Definition: window.c:1909
DWORD fdwSentenceCaps
Definition: imm.h:157
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:594

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

◆ ImmCreateIMCC()

HIMCC WINAPI ImmCreateIMCC ( DWORD  size)

Definition at line 3511 of file imm.c.

3512 {
3513  if (size < 4)
3514  size = 4;
3515  return LocalAlloc(LHND, size);
3516 }
GLsizeiptr size
Definition: glext.h:5919
#define LHND
Definition: winbase.h:379
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

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

◆ ImmCreateSoftKeyboard()

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

Definition at line 3215 of file imm.c.

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

◆ ImmDestroyContext()

BOOL WINAPI ImmDestroyContext ( HIMC  hIMC)

Definition at line 956 of file imm.c.

957 {
958  if (!IMM_IsDefaultContext(hIMC) && !IMM_IsCrossThreadAccess(NULL, hIMC))
959  return IMM_DestroyContext(hIMC);
960  else
961  return FALSE;
962 }
#define FALSE
Definition: types.h:117
static BOOL IMM_IsDefaultContext(HIMC imc)
Definition: imm.c:392
static BOOL IMM_IsCrossThreadAccess(HWND hWnd, HIMC hIMC)
Definition: imm.c:674
static BOOL IMM_DestroyContext(HIMC hIMC)
Definition: imm.c:928
#define NULL
Definition: types.h:112

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

3522 {
3523  if (block)
3524  return LocalFree(block);
3525  return NULL;
3526 }
static unsigned int block
Definition: xmlmemory.c:118
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define NULL
Definition: types.h:112

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

◆ ImmDestroySoftKeyboard()

BOOL WINAPI ImmDestroySoftKeyboard ( HWND  hSoftWnd)

Definition at line 3225 of file imm.c.

3226 {
3227  TRACE("(%p)\n", hSoftWnd);
3228  return DestroyWindow(hSoftWnd);
3229 }
BOOL WINAPI DestroyWindow(_In_ HWND)
#define TRACE(s)
Definition: solgame.cpp:4

◆ ImmDisableIME()

BOOL WINAPI ImmDisableIME ( DWORD  dwThreadId)

Definition at line 967 of file imm.c.

968 {
970 }
DWORD dwThreadId
Definition: fdebug.c:31
DWORD NTAPI NtUserDisableThreadIme(DWORD dwUnknown1)
Definition: ime.c:89

Referenced by ActiveIMMApp_DisableIME(), and test_default_ime_disabled_cb().

◆ ImmDisableLegacyIME()

BOOL WINAPI ImmDisableLegacyIME ( void  )

Definition at line 3764 of file imm.c.

3765 {
3766  FIXME("stub\n");
3767  return TRUE;
3768 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( DWORD  dwThreadId)

Definition at line 3729 of file imm.c.

3730 {
3731  FIXME("Stub\n");
3732  return FALSE;
3733 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmEnumInputContext()

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

Definition at line 3739 of file imm.c.

3740 {
3741  FIXME("Stub\n");
3742  return FALSE;
3743 }
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ImmEnumRegisterWordA()

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

Definition at line 975 of file imm.c.

979 {
980  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
981  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
982  debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister), lpData);
983  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
984  {
985  if (!is_kbd_ime_unicode(immHkl))
986  return immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
987  (LPCWSTR)lpszReading, dwStyle, (LPCWSTR)lpszRegister, lpData);
988  else
989  {
990  LPWSTR lpszwReading = strdupAtoW(lpszReading);
991  LPWSTR lpszwRegister = strdupAtoW(lpszRegister);
992  BOOL rc;
993 
994  rc = immHkl->pImeEnumRegisterWord((REGISTERWORDENUMPROCW)lpfnEnumProc,
995  lpszwReading, dwStyle, lpszwRegister,
996  lpData);
997 
998  HeapFree(GetProcessHeap(),0,lpszwReading);
999  HeapFree(GetProcessHeap(),0,lpszwRegister);
1000  return rc;
1001  }
1002  }
1003  else
1004  return 0;
1005 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:258
HMODULE hIME
Definition: imm.c:169
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int(CALLBACK * REGISTERWORDENUMPROCW)(_In_ LPCWSTR, _In_ DWORD, _In_ LPCWSTR, _In_ LPVOID)
Definition: imm.h:52
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define debugstr_a
Definition: kernel32.h:31
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ ImmEnumRegisterWordW()

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

Definition at line 1010 of file imm.c.

1014 {
1015  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1016  TRACE("(%p, %p, %s, %d, %s, %p):\n", hKL, lpfnEnumProc,
1017  debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister), lpData);
1018  if (immHkl->hIME && immHkl->pImeEnumRegisterWord)
1019  {
1020  if (is_kbd_ime_unicode(immHkl))
1021  return immHkl->pImeEnumRegisterWord(lpfnEnumProc, lpszReading, dwStyle,
1022  lpszRegister, lpData);
1023  else
1024  {
1025  LPSTR lpszaReading = strdupWtoA(lpszReading);
1026  LPSTR lpszaRegister = strdupWtoA(lpszRegister);
1027  BOOL rc;
1028 
1029  rc = immHkl->pImeEnumRegisterWord(lpfnEnumProc, (LPCWSTR)lpszaReading,
1030  dwStyle, (LPCWSTR)lpszaRegister, lpData);
1031 
1032  HeapFree(GetProcessHeap(),0,lpszaReading);
1033  HeapFree(GetProcessHeap(),0,lpszaRegister);
1034  return rc;
1035  }
1036  }
1037  else
1038  return 0;
1039 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:270
HMODULE hIME
Definition: imm.c:169
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
char * LPSTR
Definition: xmlstorage.h:182
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ ImmEscapeA()

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

Definition at line 1054 of file imm.c.

1057 {
1058  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1059  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
1060 
1061  if (immHkl->hIME && immHkl->pImeEscape)
1062  {
1063  if (!EscapeRequiresWA(uEscape) || !is_kbd_ime_unicode(immHkl))
1064  return immHkl->pImeEscape(hIMC,uEscape,lpData);
1065  else
1066  {
1067  WCHAR buffer[81]; /* largest required buffer should be 80 */
1068  LRESULT rc;
1069  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
1070  {
1071  MultiByteToWideChar(CP_ACP,0,lpData,-1,buffer,81);
1072  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1073  }
1074  else
1075  {
1076  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1077  WideCharToMultiByte(CP_ACP,0,buffer,-1,lpData,80, NULL, NULL);
1078  }
1079  return rc;
1080  }
1081  }
1082  else
1083  return 0;
1084 }
HMODULE hIME
Definition: imm.c:169
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:1041
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by ActiveIMMApp_EscapeA().

◆ ImmEscapeW()

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

Definition at line 1089 of file imm.c.

1092 {
1093  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
1094  TRACE("(%p, %p, %d, %p):\n", hKL, hIMC, uEscape, lpData);
1095 
1096  if (immHkl->hIME && immHkl->pImeEscape)
1097  {
1098  if (!EscapeRequiresWA(uEscape) || is_kbd_ime_unicode(immHkl))
1099  return immHkl->pImeEscape(hIMC,uEscape,lpData);
1100  else
1101  {
1102  CHAR buffer[81]; /* largest required buffer should be 80 */
1103  LRESULT rc;
1104  if (uEscape == IME_ESC_SET_EUDC_DICTIONARY)
1105  {
1106  WideCharToMultiByte(CP_ACP,0,lpData,-1,buffer,81, NULL, NULL);
1107  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1108  }
1109  else
1110  {
1111  rc = immHkl->pImeEscape(hIMC,uEscape,buffer);
1112  MultiByteToWideChar(CP_ACP,0,buffer,-1,lpData,80);
1113  }
1114  return rc;
1115  }
1116  }
1117  else
1118  return 0;
1119 }
HMODULE hIME
Definition: imm.c:169
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
char CHAR
Definition: xmlstorage.h:175
GLuint buffer
Definition: glext.h:5915
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
static BOOL EscapeRequiresWA(UINT uEscape)
Definition: imm.c:1041
#define TRACE(s)
Definition: solgame.cpp:4
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
#define IME_ESC_SET_EUDC_DICTIONARY
Definition: imm.h:561
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by ActiveIMMApp_EscapeW().

◆ ImmGenerateMessage()

BOOL WINAPI ImmGenerateMessage ( HIMC  hIMC)

Definition at line 3579 of file imm.c.

3580 {
3582 
3583  if (!data)
3584  {
3586  return FALSE;
3587  }
3588 
3589  TRACE("%i messages queued\n",data->IMC.dwNumMsgBuf);
3590  if (data->IMC.dwNumMsgBuf > 0)
3591  {
3592  LPTRANSMSG lpTransMsg;
3593  HIMCC hMsgBuf;
3594  DWORD i, dwNumMsgBuf;
3595 
3596  /* We are going to detach our hMsgBuff so that if processing messages
3597  generates new messages they go into a new buffer */
3598  hMsgBuf = data->IMC.hMsgBuf;
3599  dwNumMsgBuf = data->IMC.dwNumMsgBuf;
3600 
3601  data->IMC.hMsgBuf = ImmCreateIMCC(0);
3602  data->IMC.dwNumMsgBuf = 0;
3603 
3604  lpTransMsg = ImmLockIMCC(hMsgBuf);
3605  for (i = 0; i < dwNumMsgBuf; i++)
3606  ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam);
3607 
3608  ImmUnlockIMCC(hMsgBuf);
3609  ImmDestroyIMCC(hMsgBuf);
3610  }
3611 
3612  return TRUE;
3613 }
DWORD HIMCC
Definition: dimm.idl:76
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: imm.c:3521
WPARAM wParam
Definition: combotst.c:138
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
#define FALSE
Definition: types.h:117
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:584
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:611
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
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
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: imm.c:3511
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 1527 of file imm.c.

1530 {
1531  return ImmGetCandidateListAW(hIMC, dwIndex, lpCandList, dwBufLen, TRUE);
1532 }
#define TRUE
Definition: types.h:120
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
static DWORD APIENTRY ImmGetCandidateListAW(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen, BOOL bAnsi)
Definition: imm.c:1358

Referenced by ActiveIMMApp_GetCandidateListA(), and test_InvalidIMC().

◆ ImmGetCandidateListAW()

static DWORD APIENTRY ImmGetCandidateListAW ( HIMC  hIMC,
DWORD  dwIndex,
LPCANDIDATELIST  lpCandList,
DWORD  dwBufLen,
BOOL  bAnsi 
)
static

Definition at line 1358 of file imm.c.

1360 {
1361  DWORD ret = 0;
1362  LPINPUTCONTEXT pIC;
1363  PCLIENTIMC pClientImc;
1364  LPCANDIDATEINFO pCI;
1365  LPCANDIDATELIST pCL;
1366  DWORD dwSize;
1367 
1368  pClientImc = ImmLockClientImc(hIMC);
1369  if (!pClientImc)
1370  return 0;
1371 
1372  pIC = ImmLockIMC(hIMC);
1373  if (pIC == NULL)
1374  {
1375  ImmUnlockClientImc(pClientImc);
1376  return 0;
1377  }
1378 
1379  pCI = ImmLockIMCC(pIC->hCandInfo);
1380  if (pCI == NULL)
1381  {
1382  ImmUnlockIMC(hIMC);
1383  ImmUnlockClientImc(pClientImc);
1384  return 0;
1385  }
1386 
1387  if (pCI->dwSize < sizeof(CANDIDATEINFO) || pCI->dwCount <= dwIndex)
1388  goto Quit;
1389 
1390  /* get required size */
1391  pCL = (LPCANDIDATELIST)((LPBYTE)pCI + pCI->dwOffset[dwIndex]);
1392  if (bAnsi)
1393  {
1394  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1396  else
1397  dwSize = pCL->dwSize;
1398  }
1399  else
1400  {
1401  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1402  dwSize = pCL->dwSize;
1403  else
1405  }
1406 
1407  if (dwBufLen != 0 && dwSize != 0)
1408  {
1409  if (lpCandList == NULL || dwBufLen < dwSize)
1410  goto Quit;
1411 
1412  /* store */
1413  if (bAnsi)
1414  {
1415  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1416  CandidateListAnsiToWide(pCL, lpCandList, dwSize, CP_ACP);
1417  else
1418  RtlCopyMemory(lpCandList, pCL, dwSize);
1419  }
1420  else
1421  {
1422  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1423  RtlCopyMemory(lpCandList, pCL, dwSize);
1424  else
1425  CandidateListWideToAnsi(pCL, lpCandList, dwSize, CP_ACP);
1426  }
1427  }
1428 
1429  ret = dwSize;
1430 
1431 Quit:
1432  ImmUnlockIMCC(pIC->hCandInfo);
1433  ImmUnlockIMC(hIMC);
1434  ImmUnlockClientImc(pClientImc);
1435  return ret;
1436 }
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
#define CP_ACP
Definition: compat.h:109
DWORD dwCount
Definition: imm.h:203
DWORD dwSize
Definition: imm.h:202
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
unsigned char * LPBYTE
Definition: typedefs.h:53
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
HIMCC hCandInfo
Definition: imm.h:41
DWORD dwSize
Definition: imm.h:68
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:1164
struct tagCANDIDATELIST * LPCANDIDATELIST
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:24
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
int ret
DWORD dwOffset[32]
Definition: imm.h:204
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: imm32_undoc.h:15
static DWORD APIENTRY CandidateListAnsiToWide(const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST pWideCL, DWORD dwBufLen, UINT uCodePage)
Definition: imm.c:1290
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static DWORD APIENTRY CandidateListWideToAnsi(const CANDIDATELIST *pWideCL, LPCANDIDATELIST pAnsiCL, DWORD dwBufLen, UINT uCodePage)
Definition: imm.c:1221
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:1201

Referenced by ImmGetCandidateListA(), and ImmGetCandidateListW().

◆ ImmGetCandidateListCountA()

DWORD WINAPI ImmGetCandidateListCountA ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1537 of file imm.c.

1539 {
1540  return ImmGetCandidateListCountAW(hIMC, lpdwListCount, TRUE);
1541 }
#define TRUE
Definition: types.h:120
DWORD APIENTRY ImmGetCandidateListCountAW(HIMC hIMC, LPDWORD lpdwListCount, BOOL bAnsi)
Definition: imm.c:1438

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

◆ ImmGetCandidateListCountAW()

DWORD APIENTRY ImmGetCandidateListCountAW ( HIMC  hIMC,
LPDWORD  lpdwListCount,
BOOL  bAnsi 
)

Definition at line 1438 of file imm.c.

1439 {
1440  DWORD ret = 0, cbGot, dwIndex;
1441  PCLIENTIMC pClientImc;
1442  LPINPUTCONTEXT pIC;
1443  const CANDIDATEINFO *pCI;
1444  const BYTE *pb;
1445  const CANDIDATELIST *pCL;
1446  const DWORD *pdwOffsets;
1447 
1448  if (lpdwListCount == NULL)
1449  return 0;
1450 
1451  *lpdwListCount = 0;
1452 
1453  pClientImc = ImmLockClientImc(hIMC);
1454  if (pClientImc == NULL)
1455  return 0;
1456 
1457  pIC = ImmLockIMC(hIMC);
1458  if (pIC == NULL)
1459  {
1460  ImmUnlockClientImc(pClientImc);
1461  return 0;
1462  }
1463 
1464  pCI = ImmLockIMCC(pIC->hCandInfo);
1465  if (pCI == NULL)
1466  {
1467  ImmUnlockIMC(hIMC);
1468  ImmUnlockClientImc(pClientImc);
1469  return 0;
1470  }
1471 
1472  if (pCI->dwSize < sizeof(CANDIDATEINFO))
1473  goto Quit;
1474 
1475  *lpdwListCount = pCI->dwCount; /* the number of candidate lists */
1476 
1477  /* calculate total size of candidate lists */
1478  if (bAnsi)
1479  {
1480  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1481  {
1482  ret = ROUNDUP4(pCI->dwPrivateSize);
1483  pdwOffsets = pCI->dwOffset;
1484  for (dwIndex = 0; dwIndex < pCI->dwCount; ++dwIndex)
1485  {
1486  pb = (const BYTE *)pCI + pdwOffsets[dwIndex];
1487  pCL = (const CANDIDATELIST *)pb;
1488  cbGot = CandidateListWideToAnsi(pCL, NULL, 0, CP_ACP);
1489  ret += cbGot;
1490  }
1491  }
1492  else
1493  {
1494  ret = pCI->dwSize;
1495  }
1496  }
1497  else
1498  {
1499  if (pClientImc->dwFlags & CLIENTIMC_WIDE)
1500  {
1501  ret = pCI->dwSize;
1502  }
1503  else
1504  {
1505  ret = ROUNDUP4(pCI->dwPrivateSize);
1506  pdwOffsets = pCI->dwOffset;
1507  for (dwIndex = 0; dwIndex < pCI->dwCount; ++dwIndex)
1508  {
1509  pb = (const BYTE *)pCI + pdwOffsets[dwIndex];
1510  pCL = (const CANDIDATELIST *)pb;
1511  cbGot = CandidateListAnsiToWide(pCL, NULL, 0, CP_ACP);
1512  ret += cbGot;
1513  }
1514  }
1515  }
1516 
1517 Quit:
1518  ImmUnlockIMCC(pIC->hCandInfo);
1519  ImmUnlockIMC(hIMC);
1520  ImmUnlockClientImc(pClientImc);
1521  return ret;
1522 }
#define ROUNDUP4(n)
Definition: imm.c:1121
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
#define CP_ACP
Definition: compat.h:109
DWORD dwCount
Definition: imm.h:203
DWORD dwSize
Definition: imm.h:202
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
DWORD dwPrivateSize
Definition: imm.h:205
HIMCC hCandInfo
Definition: imm.h:41
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:1164
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:24
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
int ret
DWORD dwOffset[32]
Definition: imm.h:204
unsigned char BYTE
Definition: xxhash.c:193
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: imm32_undoc.h:15
static DWORD APIENTRY CandidateListAnsiToWide(const CANDIDATELIST *pAnsiCL, LPCANDIDATELIST pWideCL, DWORD dwBufLen, UINT uCodePage)
Definition: imm.c:1290
static DWORD APIENTRY CandidateListWideToAnsi(const CANDIDATELIST *pWideCL, LPCANDIDATELIST pAnsiCL, DWORD dwBufLen, UINT uCodePage)
Definition: imm.c:1221
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:1201

Referenced by ImmGetCandidateListCountA(), and ImmGetCandidateListCountW().

◆ ImmGetCandidateListCountW()

DWORD WINAPI ImmGetCandidateListCountW ( HIMC  hIMC,
LPDWORD  lpdwListCount 
)

Definition at line 1546 of file imm.c.

1548 {
1549  return ImmGetCandidateListCountAW(hIMC, lpdwListCount, FALSE);
1550 }
#define FALSE
Definition: types.h:117
DWORD APIENTRY ImmGetCandidateListCountAW(HIMC hIMC, LPDWORD lpdwListCount, BOOL bAnsi)
Definition: imm.c:1438

◆ ImmGetCandidateListW()

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

Definition at line 1555 of file imm.c.

1558 {
1559  return ImmGetCandidateListAW(hIMC, dwIndex, lpCandList, dwBufLen, FALSE);
1560 }
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define FALSE
Definition: types.h:117
static DWORD APIENTRY ImmGetCandidateListAW(HIMC hIMC, DWORD dwIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen, BOOL bAnsi)
Definition: imm.c:1358

Referenced by ActiveIMMApp_GetCandidateListW().

◆ ImmGetCandidateWindow()

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

Definition at line 1565 of file imm.c.

1567 {
1568  BOOL ret = FALSE;
1569  LPINPUTCONTEXT pIC;
1570  LPCANDIDATEFORM pCF;
1571 
1572  TRACE("ImmGetCandidateWindow(%p, %lu, %p)\n", hIMC, dwIndex, lpCandidate);
1573 
1574  pIC = ImmLockIMC(hIMC);
1575  if (pIC == NULL)
1576  return FALSE;
1577 
1578  pCF = &pIC->cfCandForm[dwIndex];
1579  if (pCF->dwIndex != IMM_INVALID_CANDFORM)
1580  {
1581  *lpCandidate = *pCF;
1582  ret = TRUE;
1583  }
1584 
1585  ImmUnlockIMC(hIMC);
1586  return ret;
1587 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
CANDIDATEFORM cfCandForm[4]
Definition: imm.h:39
#define IMM_INVALID_CANDFORM
Definition: imm.c:49
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define NULL
Definition: types.h:112
DWORD dwIndex
Definition: imm.h:60
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468

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

◆ ImmGetCompositionFontA()

BOOL WINAPI ImmGetCompositionFontA ( HIMC  hIMC,
LPLOGFONTA  lplf 
)

Definition at line 1616 of file imm.c.

1617 {
1618  PCLIENTIMC pClientImc;
1619  BOOL ret = FALSE, bWide;
1620  LPINPUTCONTEXT pIC;
1621 
1622  TRACE("ImmGetCompositionFontA(%p, %p)\n", hIMC, lplf);
1623 
1624  pClientImc = ImmLockClientImc(hIMC);
1625  if (pClientImc == NULL)
1626  return FALSE;
1627 
1628  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1629  ImmUnlockClientImc(pClientImc);
1630 
1631  pIC = ImmLockIMC(hIMC);
1632  if (pIC == NULL)
1633  return FALSE;
1634 
1635  if (pIC->fdwInit & INIT_LOGFONT)
1636  {
1637  if (bWide)
1638  LogFontWideToAnsi(&pIC->lfFont.W, lplf);
1639  else
1640  *lplf = pIC->lfFont.A;
1641 
1642  ret = TRUE;
1643  }
1644 
1645  ImmUnlockIMC(hIMC);
1646  return ret;
1647 }
static VOID APIENTRY LogFontWideToAnsi(const LOGFONTW *plfW, LPLOGFONTA plfA)
Definition: imm.c:1601
LOGFONTA A
Definition: imm.h:35
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
#define INIT_LOGFONT
Definition: imm.h:94
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:1164
#define TRACE(s)
Definition: solgame.cpp:4
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:24
int ret
DWORD fdwInit
Definition: imm.h:46
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: imm32_undoc.h:15
union _tagINPUTCONTEXT::@3512 lfFont
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468
LOGFONTW W
Definition: imm.h:36
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:1201

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

◆ ImmGetCompositionFontW()

BOOL WINAPI ImmGetCompositionFontW ( HIMC  hIMC,
LPLOGFONTW  lplf 
)

Definition at line 1652 of file imm.c.

1653 {
1654  PCLIENTIMC pClientImc;
1655  BOOL bWide;
1656  LPINPUTCONTEXT pIC;
1657  BOOL ret = FALSE;
1658 
1659  TRACE("ImmGetCompositionFontW(%p, %p)\n", hIMC, lplf);
1660 
1661  pClientImc = ImmLockClientImc(hIMC);
1662  if (pClientImc == NULL)
1663  return FALSE;
1664 
1665  bWide = (pClientImc->dwFlags & CLIENTIMC_WIDE);
1666  ImmUnlockClientImc(pClientImc);
1667 
1668  pIC = ImmLockIMC(hIMC);
1669  if (pIC == NULL)
1670  return FALSE;
1671 
1672  if (pIC->fdwInit & INIT_LOGFONT)
1673  {
1674  if (bWide)
1675  *lplf = pIC->lfFont.W;
1676  else
1677  LogFontAnsiToWide(&pIC->lfFont.A, lplf);
1678 
1679  ret = TRUE;
1680  }
1681 
1682  ImmUnlockIMC(hIMC);
1683  return ret;
1684 }
LOGFONTA A
Definition: imm.h:35
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
#define INIT_LOGFONT
Definition: imm.h:94
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:1164
#define TRACE(s)
Definition: solgame.cpp:4
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:24
int ret
static VOID APIENTRY LogFontAnsiToWide(const LOGFONTA *plfA, LPLOGFONTW plfW)
Definition: imm.c:1589
DWORD fdwInit
Definition: imm.h:46
#define NULL
Definition: types.h:112
DWORD dwFlags
Definition: imm32_undoc.h:15
union _tagINPUTCONTEXT::@3512 lfFont
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468
LOGFONTW W
Definition: imm.h:36
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:1201

Referenced by ActiveIMMApp_GetCompositionFontW().

◆ ImmGetCompositionStringA()

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

Definition at line 1959 of file imm.c.

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

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

1867 {
1868  LONG rc = 0;
1870  LPCOMPOSITIONSTRING compstr;
1871  LPBYTE compdata;
1872 
1873  TRACE("(%p, 0x%x, %p, %d)\n", hIMC, dwIndex, lpBuf, dwBufLen);
1874 
1875  if (!data)
1876  return FALSE;
1877 
1878  if (!data->IMC.hCompStr)
1879  return FALSE;
1880 
1881  compdata = ImmLockIMCC(data->IMC.hCompStr);
1882  compstr = (LPCOMPOSITIONSTRING)compdata;
1883 
1884  switch (dwIndex)
1885  {
1886  case GCS_RESULTSTR:
1887  TRACE("GCS_RESULTSTR\n");
1888  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultStrOffset, compstr->dwResultStrLen, lpBuf, dwBufLen, unicode);
1889  break;
1890  case GCS_COMPSTR:
1891  TRACE("GCS_COMPSTR\n");
1892  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen, lpBuf, dwBufLen, unicode);
1893  break;
1894  case GCS_COMPATTR:
1895  TRACE("GCS_COMPATTR\n");
1896  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompAttrOffset, compstr->dwCompAttrLen,
1897  compdata + compstr->dwCompStrOffset, compstr->dwCompStrLen,
1898  lpBuf, dwBufLen, unicode);
1899  break;
1900  case GCS_COMPCLAUSE:
1901  TRACE("GCS_COMPCLAUSE\n");
1902  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompClauseOffset,compstr->dwCompClauseLen,
1903  compdata + compstr->dwCompStrOffset,
1904  lpBuf, dwBufLen, unicode);
1905  break;
1906  case GCS_RESULTCLAUSE:
1907  TRACE("GCS_RESULTCLAUSE\n");
1908  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwResultClauseOffset,compstr->dwResultClauseLen,
1909  compdata + compstr->dwResultStrOffset,
1910  lpBuf, dwBufLen, unicode);
1911  break;
1912  case GCS_RESULTREADSTR:
1913  TRACE("GCS_RESULTREADSTR\n");
1914  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwResultReadStrOffset, compstr->dwResultReadStrLen, lpBuf, dwBufLen, unicode);
1915  break;
1916  case GCS_RESULTREADCLAUSE:
1917  TRACE("GCS_RESULTREADCLAUSE\n");
1919  compdata + compstr->dwResultStrOffset,
1920  lpBuf, dwBufLen, unicode);
1921  break;
1922  case GCS_COMPREADSTR:
1923  TRACE("GCS_COMPREADSTR\n");
1924  rc = CopyCompStringIMEtoClient(data, compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen, lpBuf, dwBufLen, unicode);
1925  break;
1926  case GCS_COMPREADATTR:
1927  TRACE("GCS_COMPREADATTR\n");
1928  rc = CopyCompAttrIMEtoClient(data, compdata + compstr->dwCompReadAttrOffset, compstr->dwCompReadAttrLen,
1929  compdata + compstr->dwCompReadStrOffset, compstr->dwCompReadStrLen,
1930  lpBuf, dwBufLen, unicode);
1931  break;
1932  case GCS_COMPREADCLAUSE:
1933  TRACE("GCS_COMPREADCLAUSE\n");
1934  rc = CopyCompClauseIMEtoClient(data, compdata + compstr->dwCompReadClauseOffset,compstr->dwCompReadClauseLen,
1935  compdata + compstr->dwCompStrOffset,
1936  lpBuf, dwBufLen, unicode);
1937  break;
1938  case GCS_CURSORPOS:
1939  TRACE("GCS_CURSORPOS\n");
1940  rc = CopyCompOffsetIMEtoClient(data, compstr->dwCursorPos, compdata + compstr->dwCompStrOffset, unicode);
1941  break;
1942  case GCS_DELTASTART:
1943  TRACE("GCS_DELTASTART\n");
1944  rc = CopyCompOffsetIMEtoClient(data, compstr->dwDeltaStart, compdata + compstr->dwCompStrOffset, unicode);
1945  break;
1946  default:
1947  FIXME("Unhandled index 0x%x\n",dwIndex);
1948  break;
1949  }
1950 
1951  ImmUnlockIMCC(data->IMC.hCompStr);
1952 
1953  return rc;
1954 }
static INT CopyCompClauseIMEtoClient(InputContextData *data, LPBYTE source, INT slen, LPBYTE ssource, LPBYTE target, INT tlen, BOOL unicode)
Definition: imm.c:1792
#define GCS_RESULTREADSTR
Definition: imm.h:367
static INT CopyCompAttrIMEtoClient(const InputContextData *data, const BYTE *src, INT src_len, const void *comp_string, INT str_len, BYTE *dst, INT dst_len, BOOL unicode)
Definition: imm.c:1721
struct tagCOMPOSITIONSTRING * LPCOMPOSITIONSTRING
DWORD dwCompAttrLen
Definition: imm.h:171
DWORD dwCompReadClauseOffset
Definition: imm.h:168
DWORD dwCompStrLen
Definition: imm.h:175
DWORD dwCompReadClauseLen
Definition: imm.h:167
DWORD dwCompAttrOffset
Definition: imm.h:172
#define GCS_RESULTREADCLAUSE
Definition: imm.h:368
DWORD dwResultReadStrOffset
Definition: imm.h:182
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define GCS_CURSORPOS
Definition: imm.h:365
DWORD dwCursorPos
Definition: imm.h:177
DWORD dwCompReadStrLen
Definition: imm.h:169
static INT CopyCompOffsetIMEtoClient(InputContextData *data, DWORD offset, LPBYTE ssource, BOOL unicode)
Definition: imm.c:1847
static INT CopyCompStringIMEtoClient(const InputContextData *data, const void *src, INT src_len, void *dst, INT dst_len, BOOL unicode)
Definition: imm.c:1691
unsigned char * LPBYTE
Definition: typedefs.h:53
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: imm.c:3531
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:111
static InputContextData * get_imc_data(HIMC hIMC)
Definition: imm.c:618
#define GCS_RESULTSTR
Definition: imm.h:369
#define GCS_COMPREADSTR
Definition: imm.h:359
DWORD dwResultClauseLen
Definition: imm.h:183
DWORD dwResultStrLen
Definition: imm.h:185
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwDeltaStart
Definition: imm.h:178
DWORD dwResultReadClauseOffset
Definition: imm.h:180
#define GCS_DELTASTART
Definition: imm.h:366
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: imm.c:3541
DWORD dwCompClauseLen
Definition: imm.h:173
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define GCS_COMPCLAUSE
Definition: imm.h:364
DWORD dwResultClauseOffset
Definition: imm.h:184
DWORD dwCompReadAttrOffset
Definition: imm.h:166
DWORD dwCompReadAttrLen
Definition: imm.h:165
#define GCS_COMPATTR
Definition: imm.h:363
DWORD dwResultReadClauseLen
Definition: imm.h:179
#define GCS_RESULTCLAUSE
Definition: imm.h:370
#define GCS_COMPREADCLAUSE
Definition: imm.h:361
DWORD dwCompStrOffset
Definition: imm.h:176
DWORD dwCompReadStrOffset
Definition: imm.h:170
DWORD dwCompClauseOffset
Definition: imm.h:174
DWORD dwResultReadStrLen
Definition: imm.h:181
#define GCS_COMPSTR
Definition: imm.h:362
#define GCS_COMPREADATTR
Definition: imm.h:360
DWORD dwResultStrOffset
Definition: imm.h:186

Referenced by ImmGetCompositionStringA(), and ImmGetCompositionStringW().

◆ ImmGetCompositionStringW()

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

Definition at line 1969 of file imm.c.

1972 {
1973  return ImmGetCompositionStringT(hIMC, dwIndex, lpBuf, dwBufLen, TRUE);
1974 }
#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:1865

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

1980 {
1981  LPINPUTCONTEXT pIC;
1982  BOOL ret = FALSE;
1983 
1984  TRACE("ImmGetCompositionWindow(%p, %p)\n", hIMC, lpCompForm);
1985 
1986  pIC = ImmLockIMC(hIMC);
1987  if (!pIC)
1988  return FALSE;
1989 
1990  if (pIC->fdwInit & INIT_COMPFORM)
1991  {
1992  *lpCompForm = pIC->cfCompForm;
1993  ret = TRUE;
1994  }
1995 
1996  ImmUnlockIMC(hIMC);
1997  return ret;
1998 }
#define TRUE
Definition: types.h:120
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:3455
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
COMPOSITIONFORM cfCompForm
Definition: imm.h:38
#define INIT_COMPFORM
Definition: imm.h:95
int ret
DWORD fdwInit
Definition: imm.h:46
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:3468

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

◆ ImmGetContext()

HIMC WINAPI ImmGetContext ( HWND  hWnd)

Definition at line 2004 of file imm.c.

2005 {
2006  HIMC rc;
2007 
2008  TRACE("%p\n", hWnd);
2009 
2010  if (!IsWindow(hWnd))
2011  {
2013  return NULL;
2014  }
2015 
2017  if (rc == (HIMC)-1)
2018  rc = NULL;
2019  else if (rc == NULL)
2020  rc = get_default_context( hWnd );
2021 
2022  if (rc)
2023  {
2024  InputContextData *data = rc;
2025  data->IMC.hWnd = hWnd;
2026  }
2027 
2028  TRACE("returning %p\n", rc);
2029 
2030  return rc;
2031 }
static HIMC get_default_context(HWND hwnd)
Definition: imm.c:633
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
INPUTCONTEXT IMC
Definition: imm.c:197
DWORD HIMC
Definition: dimm.idl:75
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define SetLastError(x)
Definition: compat.h:611
HWND hWnd
Definition: imm.h:28
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const WCHAR szwWineIMCProperty[]
Definition: imm.c:226
#define NULL
Definition: types.h:112
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)

Referenced by ActiveIMMApp_GetContext(), EDIT_ImeComposition(), ImmGetContextThreadFunc(), ImmGetVirtualKey(), ImmProcessKey(), ImmSetActiveContextConsoleIME(), 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 2036 of file imm.c.

2040 {
2041  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
2042  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_a(pSrc), lpDst,
2043  dwBufLen, uFlag);
2044  if (immHkl->hIME && immHkl->pImeConversionList)
2045  {
2046  if (!is_kbd_ime_unicode(immHkl))
2047  return immHkl->pImeConversionList(hIMC,(LPCWSTR)pSrc,lpDst,dwBufLen,uFlag);
2048  else
2049  {
2050  LPCANDIDATELIST lpwDst;
2051  DWORD ret = 0, len;
2052  LPWSTR pwSrc = strdupAtoW(pSrc);
2053 
2054  len = immHkl->pImeConversionList(hIMC, pwSrc, NULL, 0, uFlag);
2055  lpwDst = HeapAlloc(GetProcessHeap(), 0, len);
2056  if ( lpwDst )
2057  {
2058  immHkl->pImeConversionList(hIMC, pwSrc, lpwDst, len, uFlag);
2059  ret = convert_candidatelist_WtoA( lpwDst, lpDst, dwBufLen);
2060  HeapFree(GetProcessHeap(), 0, lpwDst);
2061  }
2062  HeapFree(GetProcessHeap(), 0, pwSrc);
2063 
2064  return ret;
2065  }
2066  }
2067  else
2068  return 0;
2069 }
static WCHAR * strdupAtoW(const char *str)
Definition: imm.c:258
HMODULE hIME
Definition: imm.c:169
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4245
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static DWORD convert_candidatelist_WtoA(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:282
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetConversionListA().

◆ ImmGetConversionListW()

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

Definition at line 2074 of file imm.c.

2078 {
2079  ImmHkl *immHkl = IMM_GetImmHkl(hKL);
2080  TRACE("(%p, %p, %s, %p, %d, %d):\n", hKL, hIMC, debugstr_w(pSrc), lpDst,
2081  dwBufLen, uFlag);
2082  if (immHkl->hIME && immHkl->pImeConversionList)
2083  {
2084  if (is_kbd_ime_unicode(immHkl))
2085  return immHkl->pImeConversionList(hIMC,pSrc,lpDst,dwBufLen,uFlag);
2086  else
2087  {
2088  LPCANDIDATELIST lpaDst;
2089  DWORD ret = 0, len;
2090  LPSTR paSrc = strdupWtoA(pSrc);
2091 
2092  len = immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, NULL, 0, uFlag);
2093  lpaDst = HeapAlloc(GetProcessHeap(), 0, len);
2094  if ( lpaDst )
2095  {
2096  immHkl->pImeConversionList(hIMC, (LPCWSTR)paSrc, lpaDst, len, uFlag);
2097  ret = convert_candidatelist_AtoW( lpaDst, lpDst, dwBufLen);
2098  HeapFree(GetProcessHeap(), 0, lpaDst);
2099  }
2100  HeapFree(GetProcessHeap(), 0, paSrc);
2101 
2102  return ret;
2103  }
2104  }
2105  else
2106  return 0;
2107 }
static CHAR * strdupWtoA(const WCHAR *str)
Definition: imm.c:270
HMODULE hIME
Definition: imm.c:169
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static BOOL is_kbd_ime_unicode(const ImmHkl *hkl)
Definition: imm.c:250
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
static DWORD convert_candidatelist_AtoW(LPCANDIDATELIST lpSrc, LPCANDIDATELIST lpDst, DWORD dwBufLen)
Definition: imm.c:321
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
static ImmHkl * IMM_GetImmHkl(HKL hkl)
Definition: imm.c:456
#define NULL
Definition: types.h:112
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ActiveIMMApp_GetConversionListW().

◆ ImmGetConversionStatus()

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

Definition at line 2112 of file imm.c.

2114 {
2115  LPINPUTCONTEXT pIC;
2116 
<