ReactOS 0.4.15-dev-8245-gd24675b
ctf.c File Reference
#include "precomp.h"
#include <ndk/ldrfuncs.h>
#include <msctf.h>
#include <objidl.h>
#include <compat_undoc.h>
#include <CtfImeTable.h>
Include dependency graph for ctf.c:

Go to the source code of this file.

Classes

struct  IMMTLSDATA
 
struct  ISPY
 
struct  IMM_DELAY_SET_LANG_BAND
 

Macros

#define IMM32_GET_FN(ppfn, phinstDLL, dll_name, func_name)    Imm32GetFn((FARPROC*)(ppfn), (phinstDLL), (dll_name), #func_name)
 
#define OLE32_FN(name)   g_pfnOLE32_##name
 
#define Imm32GetOle32Fn(func_name)    IMM32_GET_FN(&OLE32_FN(func_name), &g_hOle32, L"ole32.dll", #func_name)
 
#define MSCTF_FN(name)   g_pfnMSCTF_##name
 
#define Imm32GetMsctfFn(func_name)    IMM32_GET_FN(&MSCTF_FN(func_name), &g_hMsctf, L"msctf.dll", #func_name)
 
#define DEFINE_CTF_IME_FN(func_name, ret_type, params)    typedef ret_type (WINAPI *FN_##func_name)params;
 
#define DEFINE_CTF_IME_FN(func_name, ret_type, params)    FN_##func_name g_pfn##func_name = NULL;
 
#define CTF_IME_FN(func_name)   g_pfn##func_name
 
#define Imm32DeleteIMMISPY(pSpy)   ImmLocalFree(pSpy)
 
#define DEFINE_CTF_IME_FN(func_name, ret_type, params)
 
#define DEFINE_CTF_IME_FN(func_name, ret_type, params)   CTF_IME_FN(func_name) = NULL;
 

Typedefs

typedef HRESULT(WINAPIFN_CoInitializeEx) (LPVOID, DWORD)
 
typedef VOID(WINAPIFN_CoUninitialize) (VOID)
 
typedef HRESULT(WINAPIFN_CoRegisterInitializeSpy) (IInitializeSpy *, ULARGE_INTEGER *)
 
typedef HRESULT(WINAPIFN_CoRevokeInitializeSpy) (ULARGE_INTEGER)
 
typedef HRESULT(WINAPIFN_TF_CreateLangBarMgr) (ITfLangBarMgr **)
 
typedef VOID(WINAPIFN_TF_InvalidAssemblyListCacheIfExist) (VOID)
 
typedef BOOL(WINAPIFN_ApphelpCheckIME) (_In_z_ LPCWSTR AppName)
 
typedef struct IMMTLSDATA IMMTLSDATA
 
typedef struct IMMTLSDATAPIMMTLSDATA
 
typedef struct ISPY ISPY
 
typedef struct ISPYPISPY
 
typedef struct IMM_DELAY_SET_LANG_BAND IMM_DELAY_SET_LANG_BAND
 
typedef struct IMM_DELAY_SET_LANG_BANDPIMM_DELAY_SET_LANG_BAND
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (imm)
 
static BOOL Imm32InsideLoaderLock (VOID)
 
static BOOL Imm32IsInteractiveUserLogon (VOID)
 
static BOOL Imm32IsRunningInMsoobe (VOID)
 
static BOOL Imm32IsCUASEnabledInRegistry (VOID)
 
BOOL Imm32GetFn (_Inout_opt_ FARPROC *ppfn, _Inout_ HINSTANCE *phinstDLL, _In_ LPCWSTR pszDllName, _In_ LPCSTR pszFuncName)
 
FN_CoInitializeEx OLE32_FN (CoInitializeEx)
 
FN_CoUninitialize OLE32_FN (CoUninitialize)
 
FN_CoRegisterInitializeSpy OLE32_FN (CoRegisterInitializeSpy)
 
FN_CoRevokeInitializeSpy OLE32_FN (CoRevokeInitializeSpy)
 
HRESULT Imm32CoInitializeEx (VOID)
 
VOID Imm32CoUninitialize (VOID)
 
HRESULT Imm32CoRegisterInitializeSpy (IInitializeSpy *spy, ULARGE_INTEGER *cookie)
 
HRESULT Imm32CoRevokeInitializeSpy (ULARGE_INTEGER cookie)
 
FN_TF_CreateLangBarMgr MSCTF_FN (TF_CreateLangBarMgr)
 
FN_TF_InvalidAssemblyListCacheIfExist MSCTF_FN (TF_InvalidAssemblyListCacheIfExist)
 
HRESULT Imm32TF_CreateLangBarMgr (_Inout_ ITfLangBarMgr **ppBarMgr)
 
VOID Imm32TF_InvalidAssemblyListCacheIfExist (VOID)
 
BOOL Imm32CheckAndApplyAppCompat (_In_ ULONG dwReason, _In_z_ LPCWSTR pszAppName)
 
static VOID Imm32InitTLS (VOID)
 
static IMMTLSDATAImm32AllocateTLS (VOID)
 
static IMMTLSDATAImm32GetTLS (VOID)
 
static DWORD Imm32GetCoInitCountSkip (VOID)
 
static DWORD Imm32IncCoInitCountSkip (VOID)
 
static DWORD Imm32DecCoInitCountSkip (VOID)
 
VOID WINAPI CtfImmEnterCoInitCountSkipMode (VOID)
 
BOOL WINAPI CtfImmLeaveCoInitCountSkipMode (VOID)
 
static STDMETHODIMP ISPY_QueryInterface (_Inout_ IInitializeSpy *pThis, _In_ REFIID riid, _Inout_ LPVOID *ppvObj)
 
static STDMETHODIMP_ (ULONG)
 
static STDMETHODIMP ISPY_PreInitialize (_Inout_ IInitializeSpy *pThis, _In_ DWORD dwCoInit, _In_ DWORD dwCurThreadAptRefs)
 
static STDMETHODIMP ISPY_PostInitialize (_Inout_ IInitializeSpy *pThis, _In_ HRESULT hrCoInit, _In_ DWORD dwCoInit, _In_ DWORD dwNewThreadAptRefs)
 
static STDMETHODIMP ISPY_PreUninitialize (_Inout_ IInitializeSpy *pThis, _In_ DWORD dwCurThreadAptRefs)
 
static STDMETHODIMP ISPY_PostUninitialize (_In_ IInitializeSpy *pThis, _In_ DWORD dwNewThreadAptRefs)
 
static ISPYImm32AllocIMMISPY (VOID)
 
HRESULT CtfImmCoInitialize (VOID)
 
VOID WINAPI CtfImmCoUninitialize (VOID)
 
HINSTANCE Imm32LoadCtfIme (VOID)
 
HRESULT CtfImeCreateThreadMgr (VOID)
 
BOOL CtfImeProcessCicHotkey (_In_ HIMC hIMC, _In_ UINT vKey, _In_ LPARAM lParam)
 
HRESULT CtfImeDestroyThreadMgr (VOID)
 
BOOL WINAPI CtfAImmIsIME (_In_ HKL hKL)
 
BOOL WINAPI CtfImmIsCiceroStartedInThread (VOID)
 
VOID WINAPI CtfImmSetCiceroStartInThread (_In_ BOOL bStarted)
 
VOID WINAPI CtfImmSetAppCompatFlags (_In_ DWORD dwFlags)
 
HRESULT CtfImeCreateInputContext (_In_ HIMC hIMC)
 
HRESULT CtfImeDestroyInputContext (_In_ HIMC hIMC)
 
HRESULT CtfImeSetActiveContextAlways (_In_ HIMC hIMC, _In_ BOOL fActive, _In_ HWND hWnd, _In_ HKL hKL)
 
static BOOL CALLBACK Imm32EnumCreateCtfICProc (_In_ HIMC hIMC, _In_ LPARAM lParam)
 
static BOOL Imm32IsTIMDisabledInRegistry (VOID)
 
HRESULT Imm32ActivateOrDeactivateTIM (_In_ BOOL bCreate)
 
HRESULT CtfImmTIMDestroyInputContext (_In_ HIMC hIMC)
 
HRESULT CtfImmTIMCreateInputContext (_In_ HIMC hIMC)
 
HRESULT WINAPI CtfImmLastEnabledWndDestroy (_In_ BOOL bCreate)
 
HRESULT WINAPI CtfAImmActivate (_Out_opt_ HINSTANCE *phinstCtfIme)
 
HRESULT WINAPI CtfAImmDeactivate (_In_ BOOL bDestroy)
 
BOOL WINAPI CtfImmIsCiceroEnabled (VOID)
 
BOOL WINAPI CtfImmIsTextFrameServiceDisabled (VOID)
 
BOOL WINAPI ImmDisableTextFrameService (_In_ DWORD dwThreadId)
 
HRESULT WINAPI CtfImmTIMActivate (_In_ HKL hKL)
 
static DWORD APIENTRY Imm32DelaySetLangBandProc (LPVOID arg)
 
LRESULT CtfImmSetLangBand (_In_ HWND hWnd, _In_ BOOL fSet)
 
BOOL WINAPI CtfImmGenerateMessage (_In_ HIMC hIMC, _In_ BOOL bSend)
 
DWORD WINAPI CtfImmHideToolbarWnd (VOID)
 
VOID WINAPI CtfImmRestoreToolbarWnd (_In_ LPVOID pUnused, _In_ DWORD dwShowFlags)
 
LRESULT WINAPI CtfImmDispatchDefImeMessage (_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
 
BOOL WINAPI CtfImmIsGuidMapEnable (_In_ HIMC hIMC)
 
HRESULT WINAPI CtfImmGetGuidAtom (_In_ HIMC hIMC, _In_ DWORD dwUnknown, _Out_ LPDWORD pdwGuidAtom)
 

Variables

HINSTANCE g_hOle32 = NULL
 
HINSTANCE g_hMsctf = NULL
 
DWORD g_aimm_compat_flags = 0
 
BOOL g_disable_CUAS_flag = FALSE
 
HINSTANCE g_hCtfIme = NULL
 
DWORD g_dwTLSIndex = -1
 
static const IInitializeSpyVtbl g_vtblISPY
 

Macro Definition Documentation

◆ CTF_IME_FN

#define CTF_IME_FN (   func_name)    g_pfn##func_name

Definition at line 225 of file ctf.c.

◆ DEFINE_CTF_IME_FN [1/4]

#define DEFINE_CTF_IME_FN (   func_name,
  ret_type,
  params 
)     typedef ret_type (WINAPI *FN_##func_name)params;

Definition at line 220 of file ctf.c.

◆ DEFINE_CTF_IME_FN [2/4]

#define DEFINE_CTF_IME_FN (   func_name,
  ret_type,
  params 
)     FN_##func_name g_pfn##func_name = NULL;

Definition at line 220 of file ctf.c.

◆ DEFINE_CTF_IME_FN [3/4]

#define DEFINE_CTF_IME_FN (   func_name,
  ret_type,
  params 
)
Value:
{ \
bSuccess = FALSE; /* Failed */ \
break; \
}
#define CTF_IME_FN(func_name)
Definition: ctf.c:225
HINSTANCE g_hCtfIme
Definition: ctf.c:210
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
static BOOLEAN bSuccess
Definition: drive.cpp:433
void func_name(void)

Definition at line 220 of file ctf.c.

◆ DEFINE_CTF_IME_FN [4/4]

#define DEFINE_CTF_IME_FN (   func_name,
  ret_type,
  params 
)    CTF_IME_FN(func_name) = NULL;

Definition at line 220 of file ctf.c.

◆ IMM32_GET_FN

#define IMM32_GET_FN (   ppfn,
  phinstDLL,
  dll_name,
  func_name 
)     Imm32GetFn((FARPROC*)(ppfn), (phinstDLL), (dll_name), #func_name)

Definition at line 106 of file ctf.c.

◆ Imm32DeleteIMMISPY

#define Imm32DeleteIMMISPY (   pSpy)    ImmLocalFree(pSpy)

Definition at line 568 of file ctf.c.

◆ Imm32GetMsctfFn

#define Imm32GetMsctfFn (   func_name)     IMM32_GET_FN(&MSCTF_FN(func_name), &g_hMsctf, L"msctf.dll", #func_name)

Definition at line 176 of file ctf.c.

◆ Imm32GetOle32Fn

#define Imm32GetOle32Fn (   func_name)     IMM32_GET_FN(&OLE32_FN(func_name), &g_hOle32, L"ole32.dll", #func_name)

Definition at line 127 of file ctf.c.

◆ MSCTF_FN

#define MSCTF_FN (   name)    g_pfnMSCTF_##name

Definition at line 168 of file ctf.c.

◆ OLE32_FN

#define OLE32_FN (   name)    g_pfnOLE32_##name

Definition at line 115 of file ctf.c.

Typedef Documentation

◆ FN_ApphelpCheckIME

typedef BOOL(WINAPI * FN_ApphelpCheckIME) (_In_z_ LPCWSTR AppName)

Definition at line 228 of file ctf.c.

◆ FN_CoInitializeEx

typedef HRESULT(WINAPI * FN_CoInitializeEx) (LPVOID, DWORD)

Definition at line 117 of file ctf.c.

◆ FN_CoRegisterInitializeSpy

typedef HRESULT(WINAPI * FN_CoRegisterInitializeSpy) (IInitializeSpy *, ULARGE_INTEGER *)

Definition at line 119 of file ctf.c.

◆ FN_CoRevokeInitializeSpy

typedef HRESULT(WINAPI * FN_CoRevokeInitializeSpy) (ULARGE_INTEGER)

Definition at line 120 of file ctf.c.

◆ FN_CoUninitialize

typedef VOID(WINAPI * FN_CoUninitialize) (VOID)

Definition at line 118 of file ctf.c.

◆ FN_TF_CreateLangBarMgr

typedef HRESULT(WINAPI * FN_TF_CreateLangBarMgr) (ITfLangBarMgr **)

Definition at line 170 of file ctf.c.

◆ FN_TF_InvalidAssemblyListCacheIfExist

typedef VOID(WINAPI * FN_TF_InvalidAssemblyListCacheIfExist) (VOID)

Definition at line 171 of file ctf.c.

◆ IMM_DELAY_SET_LANG_BAND

◆ IMMTLSDATA

◆ ISPY

typedef struct ISPY ISPY

◆ PIMM_DELAY_SET_LANG_BAND

◆ PIMMTLSDATA

◆ PISPY

typedef struct ISPY * PISPY

Function Documentation

◆ CtfAImmActivate()

HRESULT WINAPI CtfAImmActivate ( _Out_opt_ HINSTANCE phinstCtfIme)

Definition at line 1009 of file ctf.c.

1011{
1012 HRESULT hr;
1013 HINSTANCE hinstCtfIme;
1014
1015 TRACE("(%p)\n", phinstCtfIme);
1016
1017 /* Load a CTF IME file if necessary */
1018 hinstCtfIme = Imm32LoadCtfIme();
1019
1020 /* Create a thread manager of the CTF IME */
1022 if (hr == S_OK)
1023 {
1024 /* Update CI_... flags of the thread client info */
1025 GetWin32ClientInfo()->CI_flags |= CI_AIMMACTIVATED; /* Activate AIMM */
1026 GetWin32ClientInfo()->CI_flags &= ~CI_TSFDISABLED; /* Enable TSF */
1027
1028 /* Create the CTF input contexts */
1030 }
1031
1032 if (phinstCtfIme)
1033 *phinstCtfIme = hinstCtfIme;
1034
1035 return hr;
1036}
HRESULT CtfImeCreateThreadMgr(VOID)
Definition: ctf.c:723
HINSTANCE Imm32LoadCtfIme(VOID)
Definition: ctf.c:647
static BOOL CALLBACK Imm32EnumCreateCtfICProc(_In_ HIMC hIMC, _In_ LPARAM lParam)
Definition: ctf.c:863
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1096
#define CI_AIMMACTIVATED
Definition: ntuser.h:311
#define GetWin32ClientInfo()
Definition: ntuser.h:352
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

◆ CtfAImmDeactivate()

HRESULT WINAPI CtfAImmDeactivate ( _In_ BOOL  bDestroy)

Definition at line 1044 of file ctf.c.

1046{
1047 HRESULT hr;
1048
1049 if (!bDestroy)
1050 return E_FAIL;
1051
1053 if (hr == S_OK)
1054 {
1055 GetWin32ClientInfo()->CI_flags &= ~CI_AIMMACTIVATED; /* Deactivate AIMM */
1056 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED; /* Disable TSF */
1057 }
1058
1059 return hr;
1060}
HRESULT CtfImeDestroyThreadMgr(VOID)
Definition: ctf.c:751
#define E_FAIL
Definition: ddrawi.h:102
#define CI_TSFDISABLED
Definition: ntuser.h:310

◆ CtfAImmIsIME()

BOOL WINAPI CtfAImmIsIME ( _In_ HKL  hKL)

Definition at line 767 of file ctf.c.

768{
769 TRACE("(%p)\n", hKL);
770 if (!Imm32LoadCtfIme())
771 return ImmIsIME(hKL);
772 return CTF_IME_FN(CtfImeIsIME)(hKL);
773}
BOOL WINAPI ImmIsIME(HKL hKL)
Definition: ime.c:880
EXTERN_C BOOL WINAPI CtfImeIsIME(_In_ HKL hKL)
Definition: msctfime.cpp:874

◆ CtfImeCreateInputContext()

HRESULT CtfImeCreateInputContext ( _In_ HIMC  hIMC)

Definition at line 816 of file ctf.c.

818{
819 TRACE("(%p)\n", hIMC);
820
821 if (!Imm32LoadCtfIme())
822 return E_FAIL;
823
825}
HRESULT CtfImeCreateInputContext(_In_ HIMC hIMC)
Definition: ctf.c:816

Referenced by CtfImeCreateInputContext(), CtfImmTIMCreateInputContext(), and Imm32EnumCreateCtfICProc().

◆ CtfImeCreateThreadMgr()

HRESULT CtfImeCreateThreadMgr ( VOID  )

Definition at line 723 of file ctf.c.

724{
725 TRACE("()\n");
726
727 if (!Imm32LoadCtfIme())
728 return E_FAIL;
729
731}

Referenced by CtfAImmActivate(), CtfImeCreateThreadMgr(), CtfImmTIMActivate(), and Imm32ActivateOrDeactivateTIM().

◆ CtfImeDestroyInputContext()

HRESULT CtfImeDestroyInputContext ( _In_ HIMC  hIMC)

Definition at line 831 of file ctf.c.

832{
833 TRACE("(%p)\n", hIMC);
834
835 if (!Imm32LoadCtfIme())
836 return E_FAIL;
837
839}
HRESULT CtfImeDestroyInputContext(_In_ HIMC hIMC)
Definition: ctf.c:831

Referenced by CtfImeDestroyInputContext(), and CtfImmTIMDestroyInputContext().

◆ CtfImeDestroyThreadMgr()

HRESULT CtfImeDestroyThreadMgr ( VOID  )

Definition at line 751 of file ctf.c.

752{
753 TRACE("()\n");
754
755 if (!Imm32LoadCtfIme())
756 return E_FAIL;
757
759}

Referenced by CtfAImmDeactivate(), CtfImeDestroyThreadMgr(), Imm32ActivateOrDeactivateTIM(), and ImmDisableTextFrameService().

◆ CtfImeProcessCicHotkey()

BOOL CtfImeProcessCicHotkey ( _In_ HIMC  hIMC,
_In_ UINT  vKey,
_In_ LPARAM  lParam 
)

Definition at line 737 of file ctf.c.

738{
739 TRACE("(%p, %u, %p)\n", hIMC, vKey, lParam);
740
741 if (!Imm32LoadCtfIme())
742 return FALSE;
743
744 return CTF_IME_FN(CtfImeProcessCicHotkey)(hIMC, vKey, lParam);
745}
LPARAM lParam
Definition: combotst.c:139
BOOL CtfImeProcessCicHotkey(_In_ HIMC hIMC, _In_ UINT vKey, _In_ LPARAM lParam)
Definition: ctf.c:737

Referenced by CtfImeProcessCicHotkey().

◆ CtfImeSetActiveContextAlways()

HRESULT CtfImeSetActiveContextAlways ( _In_ HIMC  hIMC,
_In_ BOOL  fActive,
_In_ HWND  hWnd,
_In_ HKL  hKL 
)

Definition at line 845 of file ctf.c.

850{
851 TRACE("(%p, %d, %p, %p)\n", hIMC, fActive, hWnd, hKL);
852
853 if (!Imm32LoadCtfIme())
854 return E_FAIL;
855
856 return CTF_IME_FN(CtfImeSetActiveContextAlways)(hIMC, fActive, hWnd, hKL);
857}
HWND hWnd
Definition: settings.c:17
HRESULT CtfImeSetActiveContextAlways(_In_ HIMC hIMC, _In_ BOOL fActive, _In_ HWND hWnd, _In_ HKL hKL)
Definition: ctf.c:845

Referenced by CtfImeSetActiveContextAlways().

◆ CtfImmCoInitialize()

HRESULT CtfImmCoInitialize ( VOID  )

Definition at line 574 of file ctf.c.

575{
576 HRESULT hr;
578 ISPY *pSpy;
579
580 if (GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT)
581 return S_OK; /* Already initialized */
582
585 return hr; /* CoInitializeEx failed */
586
587 GetWin32ClientInfo()->CI_flags |= CI_CTFCOINIT;
588 Imm32InitTLS();
589
591 if (!pData || pData->pSpy)
592 return S_OK; /* Cannot allocate or already it has a spy */
593
594 pSpy = Imm32AllocIMMISPY();
595 pData->pSpy = (IInitializeSpy*)pSpy;
596 if (IS_NULL_UNEXPECTEDLY(pSpy))
597 return S_OK; /* Cannot allocate a spy */
598
600 {
601 /* Failed to register the spy */
603 pData->pSpy = NULL;
604 pData->uliCookie.QuadPart = 0;
605 }
606
607 return S_OK;
608}
static IMMTLSDATA * Imm32AllocateTLS(VOID)
Definition: ctf.c:296
static ISPY * Imm32AllocIMMISPY(VOID)
Definition: ctf.c:557
#define Imm32DeleteIMMISPY(pSpy)
Definition: ctf.c:568
HRESULT Imm32CoInitializeEx(VOID)
Definition: ctf.c:130
HRESULT Imm32CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cookie)
Definition: ctf.c:146
static VOID Imm32InitTLS(VOID)
Definition: ctf.c:285
#define NULL
Definition: types.h:112
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define IS_NULL_UNEXPECTEDLY(p)
Definition: precomp.h:125
#define CI_CTFCOINIT
Definition: ntuser.h:307
Definition: ctf.c:416
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830

Referenced by CtfImmTIMActivate().

◆ CtfImmCoUninitialize()

VOID WINAPI CtfImmCoUninitialize ( VOID  )

Definition at line 614 of file ctf.c.

615{
617
618 if (!(GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT))
619 return; /* Not CoInitialize'd */
620
621 pData = Imm32GetTLS();
622 if (pData)
623 {
624 pData->bUninitializing = TRUE;
625 Imm32CoUninitialize(); /* Do CoUninitialize */
626 pData->bUninitializing = FALSE;
627
628 GetWin32ClientInfo()->CI_flags &= ~CI_CTFCOINIT;
629 }
630
632 if (!pData || !pData->pSpy)
633 return; /* There were no spy */
634
635 /* Our work is done. We don't need spies like you anymore. */
637 ISPY_Release(pData->pSpy);
638 pData->pSpy = NULL;
639 pData->uliCookie.QuadPart = 0;
640}
VOID Imm32CoUninitialize(VOID)
Definition: ctf.c:138
static IMMTLSDATA * Imm32GetTLS(VOID)
Definition: ctf.c:321
HRESULT Imm32CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
Definition: ctf.c:154
#define TRUE
Definition: types.h:120

Referenced by ImmDisableTextFrameService(), and ISPY_PreInitialize().

◆ CtfImmDispatchDefImeMessage()

LRESULT WINAPI CtfImmDispatchDefImeMessage ( _In_ HWND  hWnd,
_In_ UINT  uMsg,
_In_ WPARAM  wParam,
_In_ LPARAM  lParam 
)

Definition at line 1416 of file ctf.c.

1421{
1422 TRACE("(%p, %u, %p, %p)\n", hWnd, uMsg, wParam, lParam);
1423
1425 return 0;
1426
1428}
WPARAM wParam
Definition: combotst.c:138
static BOOL Imm32InsideLoaderLock(VOID)
Definition: ctf.c:16
NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void)
Definition: ldrapi.c:1557
EXTERN_C LRESULT WINAPI CtfImeDispatchDefImeMessage(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: msctfime.cpp:837

Referenced by ImeWndProc_common().

◆ CtfImmEnterCoInitCountSkipMode()

VOID WINAPI CtfImmEnterCoInitCountSkipMode ( VOID  )

Definition at line 381 of file ctf.c.

382{
384
385 TRACE("()\n");
386
387 pData = Imm32GetTLS();
388 if (pData)
389 ++(pData->bDoCount);
390}

◆ CtfImmGenerateMessage()

BOOL WINAPI CtfImmGenerateMessage ( _In_ HIMC  hIMC,
_In_ BOOL  bSend 
)

Definition at line 1272 of file ctf.c.

1275{
1276 DWORD_PTR dwImeThreadId, dwCurrentThreadId;
1277 PCLIENTIMC pClientImc;
1278 BOOL bUnicode;
1279 LPINPUTCONTEXT pIC;
1280 DWORD iMsg, dwNumMsgBuf;
1281 LPTRANSMSG pOldTransMsg, pNewTransMsg;
1282 SIZE_T cbTransMsg;
1283
1284 TRACE("(%p, %d)\n", hIMC, bSend);
1285
1286 dwImeThreadId = NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID);
1287 dwCurrentThreadId = GetCurrentThreadId();
1288 if (dwImeThreadId != dwCurrentThreadId)
1289 {
1290 ERR("%p vs %p\n", dwImeThreadId, dwCurrentThreadId);
1291 return FALSE;
1292 }
1293
1294 pClientImc = ImmLockClientImc(hIMC);
1295 if (IS_NULL_UNEXPECTEDLY(pClientImc))
1296 return FALSE;
1297
1298 bUnicode = !!(pClientImc->dwFlags & CLIENTIMC_WIDE);
1299 ImmUnlockClientImc(pClientImc);
1300
1301 pIC = (LPINPUTCONTEXT)ImmLockIMC(hIMC);
1302 if (IS_NULL_UNEXPECTEDLY(pIC))
1303 return FALSE;
1304
1305 dwNumMsgBuf = pIC->dwNumMsgBuf;
1306 pOldTransMsg = (LPTRANSMSG)ImmLockIMCC(pIC->hMsgBuf);
1307 if (IS_NULL_UNEXPECTEDLY(pOldTransMsg))
1308 {
1309 pIC->dwNumMsgBuf = 0;
1310 ImmUnlockIMC(hIMC);
1311 return TRUE;
1312 }
1313
1314 cbTransMsg = sizeof(TRANSMSG) * dwNumMsgBuf;
1315 pNewTransMsg = (PTRANSMSG)ImmLocalAlloc(0, cbTransMsg);
1316 if (IS_NULL_UNEXPECTEDLY(pNewTransMsg))
1317 {
1318 ImmUnlockIMCC(pIC->hMsgBuf);
1319 pIC->dwNumMsgBuf = 0;
1320 ImmUnlockIMC(hIMC);
1321 return TRUE;
1322 }
1323
1324 RtlCopyMemory(pNewTransMsg, pOldTransMsg, cbTransMsg);
1325
1326 for (iMsg = 0; iMsg < dwNumMsgBuf; ++iMsg)
1327 {
1328 HWND hWnd = pIC->hWnd;
1329 UINT uMsg = pNewTransMsg[iMsg].message;
1330 WPARAM wParam = pNewTransMsg[iMsg].wParam;
1331 LPARAM lParam = pNewTransMsg[iMsg].lParam;
1332 if (bSend)
1333 {
1334 if (bUnicode)
1335 SendMessageW(hWnd, uMsg, wParam, lParam);
1336 else
1337 SendMessageA(hWnd, uMsg, wParam, lParam);
1338 }
1339 else
1340 {
1341 if (bUnicode)
1342 PostMessageW(hWnd, uMsg, wParam, lParam);
1343 else
1344 PostMessageA(hWnd, uMsg, wParam, lParam);
1345 }
1346 }
1347
1348 ImmLocalFree(pNewTransMsg);
1349 ImmUnlockIMCC(pIC->hMsgBuf);
1350 pIC->dwNumMsgBuf = 0; /* Processed */
1351 ImmUnlockIMC(hIMC);
1352
1353 return TRUE;
1354}
#define ERR(fmt,...)
Definition: debug.h:113
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1066
VOID WINAPI ImmUnlockClientImc(PCLIENTIMC pClientImc)
Definition: imm.c:983
PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc)
Definition: imm.c:937
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1057
LPVOID APIENTRY ImmLocalAlloc(DWORD dwFlags, DWORD dwBytes)
Definition: utils.c:415
#define ImmLocalFree(lpData)
Definition: precomp.h:89
BOOL WINAPI ImmUnlockIMCC(HIMCC imcc)
Definition: utils.c:1208
LPVOID WINAPI ImmLockIMCC(HIMCC imcc)
Definition: utils.c:1198
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _tagTRANSMSG * LPTRANSMSG
struct _tagTRANSMSG TRANSMSG
#define CLIENTIMC_WIDE
Definition: imm32_undoc.h:138
struct _tagINPUTCONTEXT * LPINPUTCONTEXT
struct _tagTRANSMSG * PTRANSMSG
DWORD_PTR NTAPI NtUserQueryInputContext(HIMC hIMC, DWORD dwType)
Definition: ime.c:1791
unsigned int UINT
Definition: ndis.h:50
HIMCC hMsgBuf
Definition: immdev.h:146
DWORD dwNumMsgBuf
Definition: immdev.h:145
LPARAM lParam
Definition: imm32.c:68
WPARAM wParam
Definition: imm32.c:67
UINT message
Definition: imm32.c:66
uint32_t DWORD_PTR
Definition: typedefs.h:65
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
@ QIC_INPUTTHREADID
Definition: undocuser.h:393
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ CtfImmGetGuidAtom()

HRESULT WINAPI CtfImmGetGuidAtom ( _In_ HIMC  hIMC,
_In_ DWORD  dwUnknown,
_Out_ LPDWORD  pdwGuidAtom 
)

Definition at line 1467 of file ctf.c.

1471{
1472 HRESULT hr = E_FAIL;
1473 PIMEDPI pImeDpi;
1475 HKL hKL;
1476
1477 TRACE("(%p, 0xlX, %p)\n", hIMC, dwUnknown, pdwGuidAtom);
1478
1479 *pdwGuidAtom = 0;
1480
1481 if (!IS_CICERO_MODE() || IS_16BIT_MODE())
1482 return hr;
1483
1486 if (IS_IME_HKL(hKL))
1487 return S_OK;
1488
1489 pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1490 if (IS_NULL_UNEXPECTEDLY(pImeDpi))
1491 return hr;
1492
1493 hr = pImeDpi->CtfImeGetGuidAtom(hIMC, dwUnknown, pdwGuidAtom);
1494
1495 ImmUnlockImeDpi(pImeDpi);
1496 return hr;
1497}
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:1007
PIMEDPI APIENTRY Imm32FindOrLoadImeDpi(HKL hKL)
Definition: ime.c:343
DWORD dwThreadId
Definition: fdebug.c:31
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
#define IS_16BIT_MODE()
Definition: ntuser.h:1211
#define IS_CICERO_MODE()
Definition: ntuser.h:1210
UINT_PTR HKL
Definition: msctf.idl:143
#define DWORD
Definition: nt_native.h:44
HKL WINAPI GetKeyboardLayout(_In_ DWORD)

◆ CtfImmHideToolbarWnd()

DWORD WINAPI CtfImmHideToolbarWnd ( VOID  )

Definition at line 1362 of file ctf.c.

1363{
1364 ITfLangBarMgr *pBarMgr;
1365 DWORD dwShowFlags = 0;
1366 BOOL bShown;
1367
1368 TRACE("()\n");
1369
1370 if (FAILED(Imm32TF_CreateLangBarMgr(&pBarMgr)))
1371 return dwShowFlags;
1372
1373 if (SUCCEEDED(pBarMgr->lpVtbl->GetShowFloatingStatus(pBarMgr, &dwShowFlags)))
1374 {
1375 bShown = !(dwShowFlags & 0x800);
1376 dwShowFlags &= 0xF;
1377 if (bShown)
1378 pBarMgr->lpVtbl->ShowFloating(pBarMgr, 8);
1379 }
1380
1381 pBarMgr->lpVtbl->Release(pBarMgr);
1382 return dwShowFlags;
1383}
HRESULT Imm32TF_CreateLangBarMgr(_Inout_ ITfLangBarMgr **ppBarMgr)
Definition: ctf.c:179
HRESULT GetShowFloatingStatus([out] DWORD *pdwFlags)
HRESULT ShowFloating([in] DWORD dwFlags)
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51

Referenced by ImeWnd_OnImeControl().

◆ CtfImmIsCiceroEnabled()

BOOL WINAPI CtfImmIsCiceroEnabled ( VOID  )

Definition at line 1068 of file ctf.c.

1069{
1070 return IS_CICERO_MODE();
1071}

◆ CtfImmIsCiceroStartedInThread()

BOOL WINAPI CtfImmIsCiceroStartedInThread ( VOID  )

Definition at line 781 of file ctf.c.

782{
783 TRACE("()\n");
784 return !!(GetWin32ClientInfo()->CI_flags & CI_CICERO_STARTED);
785}
#define CI_CICERO_STARTED
Definition: ntuser.h:309

Referenced by CtfImeProcessCicHotkey(), and ImmProcessKey().

◆ CtfImmIsGuidMapEnable()

BOOL WINAPI CtfImmIsGuidMapEnable ( _In_ HIMC  hIMC)

Definition at line 1434 of file ctf.c.

1436{
1438 HKL hKL;
1439 PIMEDPI pImeDpi;
1440 BOOL ret = FALSE;
1441
1442 TRACE("(%p)\n", hIMC);
1443
1444 if (!IS_CICERO_MODE() || IS_16BIT_MODE())
1445 return ret;
1446
1449
1450 if (IS_IME_HKL(hKL))
1451 return ret;
1452
1453 pImeDpi = Imm32FindOrLoadImeDpi(hKL);
1454 if (IS_NULL_UNEXPECTEDLY(pImeDpi))
1455 return ret;
1456
1457 ret = pImeDpi->CtfImeIsGuidMapEnable(hIMC);
1458
1459 ImmUnlockImeDpi(pImeDpi);
1460 return ret;
1461}
int ret

◆ CtfImmIsTextFrameServiceDisabled()

BOOL WINAPI CtfImmIsTextFrameServiceDisabled ( VOID  )

Definition at line 1079 of file ctf.c.

1080{
1081 return !!(GetWin32ClientInfo()->CI_flags & CI_TSFDISABLED);
1082}

Referenced by Imm32SelectInputContext(), and ImmGetImeInfoEx().

◆ CtfImmLastEnabledWndDestroy()

HRESULT WINAPI CtfImmLastEnabledWndDestroy ( _In_ BOOL  bCreate)

Definition at line 996 of file ctf.c.

998{
999 TRACE("(%d)\n", bCreate);
1001}
HRESULT Imm32ActivateOrDeactivateTIM(_In_ BOOL bCreate)
Definition: ctf.c:895
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1519

◆ CtfImmLeaveCoInitCountSkipMode()

BOOL WINAPI CtfImmLeaveCoInitCountSkipMode ( VOID  )

Definition at line 395 of file ctf.c.

396{
398
399 TRACE("()\n");
400
401 pData = Imm32GetTLS();
402 if (!pData || !pData->bDoCount)
403 return FALSE;
404
405 --(pData->bDoCount);
406 return TRUE;
407}

◆ CtfImmRestoreToolbarWnd()

VOID WINAPI CtfImmRestoreToolbarWnd ( _In_ LPVOID  pUnused,
_In_ DWORD  dwShowFlags 
)

Definition at line 1391 of file ctf.c.

1394{
1395 HRESULT hr;
1396 ITfLangBarMgr *pBarMgr;
1397
1398 UNREFERENCED_PARAMETER(pUnused);
1399
1400 TRACE("(%p, 0x%X)\n", pUnused, dwShowFlags);
1401
1402 hr = Imm32TF_CreateLangBarMgr(&pBarMgr);
1404 return;
1405
1406 if (dwShowFlags)
1407 pBarMgr->lpVtbl->ShowFloating(pBarMgr, dwShowFlags);
1408
1409 pBarMgr->lpVtbl->Release(pBarMgr);
1410}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317

Referenced by ImeWnd_OnImeControl().

◆ CtfImmSetAppCompatFlags()

VOID WINAPI CtfImmSetAppCompatFlags ( _In_ DWORD  dwFlags)

Definition at line 805 of file ctf.c.

806{
807 TRACE("(0x%08X)\n", dwFlags);
808 if (!(dwFlags & 0xF0FFFFFF))
810}
DWORD g_aimm_compat_flags
Definition: ctf.c:204
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ CtfImmSetCiceroStartInThread()

VOID WINAPI CtfImmSetCiceroStartInThread ( _In_ BOOL  bStarted)

Definition at line 790 of file ctf.c.

791{
792 TRACE("(%d)\n", bStarted);
793 if (bStarted)
795 else
796 GetWin32ClientInfo()->CI_flags &= ~CI_CICERO_STARTED;
797}

◆ CtfImmSetLangBand()

LRESULT CtfImmSetLangBand ( _In_ HWND  hWnd,
_In_ BOOL  fSet 
)

Definition at line 1233 of file ctf.c.

1236{
1238 PWND pWnd = NULL;
1239 PIMM_DELAY_SET_LANG_BAND pSetBand;
1240 DWORD_PTR lResult = 0;
1241
1242 if (hWnd && gpsi)
1243 pWnd = ValidateHwndNoErr(hWnd);
1244
1245 if (IS_NULL_UNEXPECTEDLY(pWnd))
1246 return 0;
1247
1249 {
1251 5000, &lResult);
1252 return lResult;
1253 }
1254
1255 pSetBand = ImmLocalAlloc(0, sizeof(IMM_DELAY_SET_LANG_BAND));
1256 if (IS_NULL_UNEXPECTEDLY(pSetBand))
1257 return 0;
1258
1259 pSetBand->hWnd = hWnd;
1260 pSetBand->fSet = fSet;
1261
1263 if (hThread)
1265 return 0;
1266}
static DWORD APIENTRY Imm32DelaySetLangBandProc(LPVOID arg)
Definition: ctf.c:1211
#define CloseHandle
Definition: compat.h:739
PSERVERINFO gpsi
Definition: imm.c:18
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:84
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define WNDS2_WMCREATEMSGPROCESSED
Definition: ntuser.h:670
HANDLE hThread
Definition: wizard.c:28
Definition: ntuser.h:694
DWORD state2
Definition: ntuser.h:702
#define SMTO_BLOCK
Definition: winuser.h:1224
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1223
#define WM_USER
Definition: winuser.h:1895

Referenced by ImmSystemHandler().

◆ CtfImmTIMActivate()

HRESULT WINAPI CtfImmTIMActivate ( _In_ HKL  hKL)

Definition at line 1123 of file ctf.c.

1124{
1125 HRESULT hr = S_OK;
1126
1127 TRACE("(%p)\n", hKL);
1128
1130 {
1131 TRACE("g_disable_CUAS_flag\n");
1132 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED;
1133 return FALSE;
1134 }
1135
1136 if (GetWin32ClientInfo()->CI_flags & CI_TSFDISABLED)
1137 {
1138 TRACE("CI_TSFDISABLED\n");
1139 return FALSE;
1140 }
1141
1143 {
1144 TRACE("TIM is disabled in registry\n");
1145 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED;
1146 return FALSE;
1147 }
1148
1150 {
1151 TRACE("TIM is disabled due to LOGON or MSOBE\n");
1152 return FALSE;
1153 }
1154
1156 {
1157 TRACE("CUAS is disabled in registry\n");
1158 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED;
1159 return FALSE;
1160 }
1161
1162 if (NtCurrentTeb()->ProcessEnvironmentBlock->AppCompatFlags.LowPart & 0x100)
1163 {
1164 TRACE("CUAS is disabled by AppCompatFlags\n");
1165 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED;
1166 return FALSE;
1167 }
1168
1170 {
1171 TRACE("TIM is disabled by Loader\n");
1172 return FALSE;
1173 }
1174
1175 if (!IS_CICERO_MODE() || IS_16BIT_MODE())
1176 {
1177 TRACE("TIM is disabled because CICERO mode is unset\n");
1178 return FALSE;
1179 }
1180
1181 if (IS_IME_HKL(hKL))
1182 hKL = (HKL)UlongToHandle(MAKELONG(LOWORD(hKL), LOWORD(hKL)));
1183
1184 if (!ImmLoadIME(hKL))
1186
1188
1189 if ((GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT) &&
1190 !(GetWin32ClientInfo()->CI_flags & CI_CTFTIM))
1191 {
1193 if (SUCCEEDED(hr))
1194 GetWin32ClientInfo()->CI_flags |= CI_CTFTIM;
1195 }
1196
1197 return hr;
1198}
#define UlongToHandle(ul)
Definition: basetsd.h:97
static BOOL Imm32IsRunningInMsoobe(VOID)
Definition: ctf.c:45
HRESULT CtfImmCoInitialize(VOID)
Definition: ctf.c:574
VOID Imm32TF_InvalidAssemblyListCacheIfExist(VOID)
Definition: ctf.c:189
static BOOL Imm32IsTIMDisabledInRegistry(VOID)
Definition: ctf.c:877
static BOOL Imm32IsCUASEnabledInRegistry(VOID)
Definition: ctf.c:61
BOOL g_disable_CUAS_flag
Definition: ctf.c:207
static BOOL Imm32IsInteractiveUserLogon(VOID)
Definition: ctf.c:23
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:347
BOOL WINAPI ImmLoadIME(HKL hKL)
Definition: ime.c:1055
#define CI_CTFTIM
Definition: ntuser.h:308
#define NtCurrentTeb
#define LOWORD(l)
Definition: pedump.c:82
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by CtfLoadThreadLayout(), and Imm32InternalLockIMC().

◆ CtfImmTIMCreateInputContext()

HRESULT CtfImmTIMCreateInputContext ( _In_ HIMC  hIMC)

Definition at line 939 of file ctf.c.

941{
942 PCLIENTIMC pClientImc;
943 DWORD_PTR dwImeThreadId, dwCurrentThreadId;
945
946 TRACE("(%p)\n", hIMC);
947
948 pClientImc = ImmLockClientImc(hIMC);
949 if (!pClientImc)
950 return E_FAIL;
951
952 if (GetWin32ClientInfo()->CI_flags & CI_AIMMACTIVATED)
953 {
954 if (!pClientImc->bCtfIme)
955 {
956 dwImeThreadId = NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID);
957 dwCurrentThreadId = GetCurrentThreadId();
958 if (dwImeThreadId == dwCurrentThreadId)
959 {
960 pClientImc->bCtfIme = TRUE;
963 pClientImc->bCtfIme = FALSE;
964 }
965 }
966 }
967 else
968 {
969 if (!(GetWin32ClientInfo()->CI_flags & CI_CTFTIM))
970 return S_OK;
971
972 if (!pClientImc->bCtfIme)
973 {
974 dwImeThreadId = NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID);
975 dwCurrentThreadId = GetCurrentThreadId();
976 if ((dwImeThreadId == dwCurrentThreadId) && IS_CICERO_MODE() && !IS_16BIT_MODE())
977 {
978 pClientImc->bCtfIme = TRUE;
981 pClientImc->bCtfIme = FALSE;
982 }
983 }
984 }
985
986 ImmUnlockClientImc(pClientImc);
987 return hr;
988}
#define S_FALSE
Definition: winerror.h:2357

Referenced by Imm32CreateInputContext(), and Imm32InternalLockIMC().

◆ CtfImmTIMDestroyInputContext()

HRESULT CtfImmTIMDestroyInputContext ( _In_ HIMC  hIMC)

Definition at line 929 of file ctf.c.

931{
932 if (!IS_CICERO_MODE() || (GetWin32ClientInfo()->dwCompatFlags2 & 2))
933 return E_NOINTERFACE;
934
935 return CtfImeDestroyInputContext(hIMC);
936}
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by Imm32DestroyInputContext().

◆ Imm32ActivateOrDeactivateTIM()

HRESULT Imm32ActivateOrDeactivateTIM ( _In_ BOOL  bCreate)

Definition at line 895 of file ctf.c.

897{
898 HRESULT hr = S_OK;
899
900 if (!IS_CICERO_MODE() || IS_16BIT_MODE() ||
901 !(GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT))
902 {
903 return S_OK; /* No need to activate/de-activate TIM */
904 }
905
906 if (bCreate)
907 {
908 if (!(GetWin32ClientInfo()->CI_flags & CI_CTFTIM))
909 {
911 if (SUCCEEDED(hr))
912 GetWin32ClientInfo()->CI_flags |= CI_CTFTIM;
913 }
914 }
915 else /* Destroy */
916 {
917 if (GetWin32ClientInfo()->CI_flags & CI_CTFTIM)
918 {
920 if (SUCCEEDED(hr))
921 GetWin32ClientInfo()->CI_flags &= ~CI_CTFTIM;
922 }
923 }
924
925 return hr;
926}

Referenced by CtfImmLastEnabledWndDestroy(), and ISPY_PreInitialize().

◆ Imm32AllocateTLS()

static IMMTLSDATA * Imm32AllocateTLS ( VOID  )
static

Definition at line 296 of file ctf.c.

297{
299
300 if (g_dwTLSIndex == -1)
301 return NULL;
302
304 if (pData)
305 return pData;
306
309 return NULL;
310
312 {
314 return NULL;
315 }
316
317 return pData;
318}
DWORD g_dwTLSIndex
Definition: ctf.c:270
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IS_FALSE_UNEXPECTEDLY(x)
Definition: precomp.h:137
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276

Referenced by CtfImmCoInitialize(), and CtfImmCoUninitialize().

◆ Imm32AllocIMMISPY()

static ISPY * Imm32AllocIMMISPY ( VOID  )
static

Definition at line 557 of file ctf.c.

558{
559 ISPY *pSpy = (ISPY*)ImmLocalAlloc(0, sizeof(ISPY));
560 if (!pSpy)
561 return NULL;
562
563 pSpy->m_pSpyVtbl = &g_vtblISPY;
564 pSpy->m_cRefs = 1;
565 return pSpy;
566}
static const IInitializeSpyVtbl g_vtblISPY
Definition: ctf.c:545
LONG m_cRefs
Definition: ctf.c:418
const IInitializeSpyVtbl * m_pSpyVtbl
Definition: ctf.c:417

Referenced by CtfImmCoInitialize().

◆ Imm32CheckAndApplyAppCompat()

BOOL Imm32CheckAndApplyAppCompat ( _In_ ULONG  dwReason,
_In_z_ LPCWSTR  pszAppName 
)

Definition at line 235 of file ctf.c.

238{
239 HINSTANCE hinstApphelp;
240 FN_ApphelpCheckIME pApphelpCheckIME;
241
242 /* Query the application compatibility patcher */
244 return TRUE; /* The app's IME is not disabled */
245
246 /* Load apphelp.dll if necessary */
247 hinstApphelp = GetModuleHandleW(L"apphelp.dll");
248 if (!hinstApphelp)
249 {
250 hinstApphelp = LoadLibraryW(L"apphelp.dll");
251 if (!hinstApphelp)
252 return TRUE; /* There is no apphelp.dll. The app's IME is not disabled */
253 }
254
255 /* Is ApphelpCheckIME implemented? */
256 pApphelpCheckIME = (FN_ApphelpCheckIME)GetProcAddress(hinstApphelp, "ApphelpCheckIME");
257 if (!pApphelpCheckIME)
258 return TRUE; /* Not implemented. The app's IME is not disabled */
259
260 /* Is the app's IME disabled or not? */
261 return pApphelpCheckIME(pszAppName);
262}
BOOL WINAPI BaseCheckAppcompatCache(_In_ PCWSTR ApplicationName, _In_ HANDLE FileHandle, _In_opt_ PCWSTR Environment, _Out_opt_ PULONG pdwReason)
Definition: appcache.c:229
DWORD dwReason
Definition: misc.cpp:154
BOOL(WINAPI * FN_ApphelpCheckIME)(_In_z_ LPCWSTR AppName)
Definition: ctf.c:228
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define LoadLibraryW(x)
Definition: compat.h:747
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define L(x)
Definition: ntvdm.h:50

Referenced by Imm32LoadCtfIme().

◆ Imm32CoInitializeEx()

HRESULT Imm32CoInitializeEx ( VOID  )

Definition at line 130 of file ctf.c.

131{
133 return E_FAIL;
134
136}
#define OLE32_FN(name)
Definition: ctf.c:115
#define Imm32GetOle32Fn(func_name)
Definition: ctf.c:127
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278

Referenced by CtfImmCoInitialize(), and ISPY_PreUninitialize().

◆ Imm32CoRegisterInitializeSpy()

HRESULT Imm32CoRegisterInitializeSpy ( IInitializeSpy spy,
ULARGE_INTEGER cookie 
)

Definition at line 146 of file ctf.c.

147{
149 return E_FAIL;
150
152}
HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cookie)
Definition: compobj.c:1832
Definition: cookie.c:34

Referenced by CtfImmCoInitialize().

◆ Imm32CoRevokeInitializeSpy()

HRESULT Imm32CoRevokeInitializeSpy ( ULARGE_INTEGER  cookie)

Definition at line 154 of file ctf.c.

155{
157 return E_FAIL;
158
160}
HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
Definition: compobj.c:1891

Referenced by CtfImmCoUninitialize().

◆ Imm32CoUninitialize()

VOID Imm32CoUninitialize ( VOID  )

Definition at line 138 of file ctf.c.

139{
141 return;
142
144}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067

Referenced by CtfImmCoUninitialize().

◆ Imm32DecCoInitCountSkip()

static DWORD Imm32DecCoInitCountSkip ( VOID  )
static

Definition at line 359 of file ctf.c.

360{
361 DWORD dwSkipCount;
363
364 pData = Imm32GetTLS();;
365 if (!pData)
366 return 0;
367
368 dwSkipCount = pData->dwSkipCount;
369 if (pData->bDoCount)
370 {
371 if (dwSkipCount)
372 pData->dwSkipCount = dwSkipCount - 1;
373 }
374
375 return dwSkipCount;
376}

Referenced by ISPY_PostUninitialize().

◆ Imm32DelaySetLangBandProc()

static DWORD APIENTRY Imm32DelaySetLangBandProc ( LPVOID  arg)
static

Definition at line 1211 of file ctf.c.

1212{
1213 HWND hwndDefIME;
1214 WPARAM wParam;
1215 DWORD_PTR lResult;
1216 PIMM_DELAY_SET_LANG_BAND pSetBand = arg;
1217
1218 Sleep(3000); /* Delay 3 seconds! */
1219
1220 hwndDefIME = ImmGetDefaultIMEWnd(pSetBand->hWnd);
1221 if (hwndDefIME)
1222 {
1223 wParam = (pSetBand->fSet ? IMS_SETLANGBAND : IMS_UNSETLANGBAND);
1224 SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, wParam, (LPARAM)pSetBand->hWnd,
1225 SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &lResult);
1226 }
1227 ImmLocalFree(pSetBand);
1228 return FALSE;
1229}
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:890
#define IMS_SETLANGBAND
Definition: immdev.h:116
#define IMS_UNSETLANGBAND
Definition: immdev.h:117
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define WM_IME_SYSTEM
Definition: undocuser.h:60
void * arg
Definition: msvc.h:10

Referenced by CtfImmSetLangBand().

◆ Imm32EnumCreateCtfICProc()

static BOOL CALLBACK Imm32EnumCreateCtfICProc ( _In_ HIMC  hIMC,
_In_ LPARAM  lParam 
)
static

Definition at line 863 of file ctf.c.

866{
869 return TRUE; /* Continue */
870}

Referenced by CtfAImmActivate().

◆ Imm32GetCoInitCountSkip()

static DWORD Imm32GetCoInitCountSkip ( VOID  )
static

Definition at line 331 of file ctf.c.

332{
334 if (!pData)
335 return 0;
336 return pData->dwSkipCount;
337}

Referenced by ISPY_PostInitialize().

◆ Imm32GetFn()

BOOL Imm32GetFn ( _Inout_opt_ FARPROC ppfn,
_Inout_ HINSTANCE phinstDLL,
_In_ LPCWSTR  pszDllName,
_In_ LPCSTR  pszFuncName 
)

Definition at line 83 of file ctf.c.

88{
90
91 if (*ppfn)
92 return TRUE;
93
94 if (*phinstDLL == NULL)
95 {
97 *phinstDLL = LoadLibraryExW(szPath, NULL, 0);
98 if (*phinstDLL == NULL)
99 return FALSE;
100 }
101
102 *ppfn = (FARPROC)GetProcAddress(*phinstDLL, pszFuncName);
103 return *ppfn != NULL;
104}
int(* FARPROC)()
Definition: compat.h:36
#define MAX_PATH
Definition: compat.h:34
BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR pszFileName)
Definition: utils.c:286
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
LPCWSTR szPath
Definition: env.c:37
#define _countof(array)
Definition: sndvol32.h:70
char * pszDllName
Definition: spec2def.c:73
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ Imm32GetTLS()

◆ Imm32IncCoInitCountSkip()

static DWORD Imm32IncCoInitCountSkip ( VOID  )
static

Definition at line 341 of file ctf.c.

342{
344 DWORD dwOldSkipCount;
345
346 pData = Imm32GetTLS();
347 if (!pData)
348 return 0;
349
350 dwOldSkipCount = pData->dwSkipCount;
351 if (pData->bDoCount)
352 pData->dwSkipCount = dwOldSkipCount + 1;
353
354 return dwOldSkipCount;
355}

Referenced by ISPY_PreInitialize().

◆ Imm32InitTLS()

static VOID Imm32InitTLS ( VOID  )
static

Definition at line 285 of file ctf.c.

286{
288
289 if (g_dwTLSIndex == -1)
291
293}
RTL_CRITICAL_SECTION gcsImeDpi
Definition: ime.c:16
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1100
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

Referenced by CtfImmCoInitialize().

◆ Imm32InsideLoaderLock()

static BOOL Imm32InsideLoaderLock ( VOID  )
static

Definition at line 16 of file ctf.c.

17{
18 return NtCurrentTeb()->ProcessEnvironmentBlock->LoaderLock->OwningThread ==
19 NtCurrentTeb()->ClientId.UniqueThread;
20}

Referenced by CtfImmDispatchDefImeMessage(), CtfImmTIMActivate(), and ISPY_PreUninitialize().

◆ Imm32IsCUASEnabledInRegistry()

static BOOL Imm32IsCUASEnabledInRegistry ( VOID  )
static

Definition at line 61 of file ctf.c.

62{
63 HKEY hKey;
65 DWORD dwType, dwData, cbData;
66
67 error = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\CTF\\SystemShared", &hKey);
68 if (error != ERROR_SUCCESS)
69 return FALSE;
70
71 dwData = 0;
72 cbData = sizeof(dwData);
73 error = RegQueryValueExW(hKey, L"CUAS", NULL, &dwType, (LPBYTE)&dwData, &cbData);
75
76 if (error != ERROR_SUCCESS || dwType != REG_DWORD)
77 return FALSE;
78
79 return !!dwData;
80}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
FxAutoRegKey hKey
#define error(str)
Definition: mkdosfs.c:1605
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CtfImmTIMActivate().

◆ Imm32IsInteractiveUserLogon()

static BOOL Imm32IsInteractiveUserLogon ( VOID  )
static

Definition at line 23 of file ctf.c.

24{
25 BOOL bOK, IsMember = FALSE;
26 PSID pSid;
28
30 0, 0, 0, 0, 0, 0, 0, &pSid))
31 {
32 ERR("Error: %ld\n", GetLastError());
33 return FALSE;
34 }
35
36 bOK = CheckTokenMembership(NULL, pSid, &IsMember);
37
38 if (pSid)
40
41 return bOK && IsMember;
42}
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
Definition: token.c:21
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
Definition: security.c:674
PVOID WINAPI FreeSid(PSID pSid)
Definition: security.c:698
static PSID pSid
Definition: security.c:74
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SECURITY_INTERACTIVE_RID
Definition: setypes.h:559
#define SECURITY_NT_AUTHORITY
Definition: setypes.h:554

Referenced by CtfImmTIMActivate().

◆ Imm32IsRunningInMsoobe()

static BOOL Imm32IsRunningInMsoobe ( VOID  )
static

Definition at line 45 of file ctf.c.

46{
47 LPWSTR pchFilePart = NULL;
49
51 return FALSE;
52
54 if (!pchFilePart)
55 return FALSE;
56
57 return lstrcmpiW(pchFilePart, L"msoobe.exe") == 0;
58}
Definition: bufpool.h:45
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CtfImmTIMActivate().

◆ Imm32IsTIMDisabledInRegistry()

static BOOL Imm32IsTIMDisabledInRegistry ( VOID  )
static

Definition at line 877 of file ctf.c.

878{
879 DWORD dwData, cbData;
880 HKEY hKey;
882
883 error = RegOpenKeyW(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\CTF", &hKey);
884 if (error != ERROR_SUCCESS)
885 return FALSE;
886
887 dwData = 0;
888 cbData = sizeof(dwData);
889 RegQueryValueExW(hKey, L"Disable Thread Input Manager", NULL, NULL, (LPBYTE)&dwData, &cbData);
891 return !!dwData;
892}
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by CtfImmTIMActivate().

◆ Imm32LoadCtfIme()

HINSTANCE Imm32LoadCtfIme ( VOID  )

Definition at line 647 of file ctf.c.

648{
650 IMEINFOEX ImeInfoEx;
651 WCHAR szImeFile[MAX_PATH];
652
653 /* Lock the IME interface */
655
656 do
657 {
658 if (g_hCtfIme) /* Already loaded? */
659 {
660 bSuccess = TRUE;
661 break;
662 }
663
664 /*
665 * NOTE: (HKL)0x04090409 is English US keyboard (default).
666 * The Cicero keyboard logically uses English US keyboard.
667 */
668 if (!ImmLoadLayout((HKL)ULongToHandle(0x04090409), &ImeInfoEx))
669 break;
670
671 /* Build a path string in system32. The installed IME file must be in system32. */
672 Imm32GetSystemLibraryPath(szImeFile, _countof(szImeFile), ImeInfoEx.wszImeFile);
673
674 /* Is the CTF IME disabled by app compatibility patcher? */
675 if (!Imm32CheckAndApplyAppCompat(0, szImeFile))
676 break; /* This IME is disabled */
677
678 /* Load a CTF IME file */
679 g_hCtfIme = LoadLibraryW(szImeFile);
680 if (!g_hCtfIme)
681 break;
682
683 /* Assume success */
684 bSuccess = TRUE;
685
686 /* Retrieve the CTF IME functions */
687#undef DEFINE_CTF_IME_FN
688#define DEFINE_CTF_IME_FN(func_name, ret_type, params) \
689 CTF_IME_FN(func_name) = (FN_##func_name)GetProcAddress(g_hCtfIme, #func_name); \
690 if (!CTF_IME_FN(func_name)) \
691 { \
692 bSuccess = FALSE; /* Failed */ \
693 break; \
694 }
695#include <CtfImeTable.h>
696 } while (0);
697
698 /* Unload the CTF IME if failed */
699 if (!bSuccess)
700 {
701 /* Set NULL to the function pointers */
702#undef DEFINE_CTF_IME_FN
703#define DEFINE_CTF_IME_FN(func_name, ret_type, params) CTF_IME_FN(func_name) = NULL;
704#include <CtfImeTable.h>
705
706 if (g_hCtfIme)
707 {
709 g_hCtfIme = NULL;
710 }
711 }
712
713 /* Unlock the IME interface */
715
716 return g_hCtfIme;
717}
#define ULongToHandle(h)
Definition: basetsd.h:81
BOOL Imm32CheckAndApplyAppCompat(_In_ ULONG dwReason, _In_z_ LPCWSTR pszAppName)
Definition: ctf.c:235
#define FreeLibrary(x)
Definition: compat.h:748
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx)
Definition: imm.c:67
WCHAR wszImeFile[80]
Definition: imm32_undoc.h:38

Referenced by CtfAImmActivate(), CtfAImmIsIME(), CtfImeCreateInputContext(), CtfImeCreateThreadMgr(), CtfImeDestroyInputContext(), CtfImeDestroyThreadMgr(), CtfImeProcessCicHotkey(), CtfImeSetActiveContextAlways(), and CtfImmDispatchDefImeMessage().

◆ Imm32TF_CreateLangBarMgr()

HRESULT Imm32TF_CreateLangBarMgr ( _Inout_ ITfLangBarMgr **  ppBarMgr)

Definition at line 179 of file ctf.c.

180{
181 TRACE("TF_CreateLangBarMgr(%p)\n", ppBarMgr);
182
184 return E_FAIL;
185
186 return MSCTF_FN(TF_CreateLangBarMgr)(ppBarMgr);
187}
#define Imm32GetMsctfFn(func_name)
Definition: ctf.c:176
#define MSCTF_FN(name)
Definition: ctf.c:168
HRESULT WINAPI TF_CreateLangBarMgr(ITfLangBarMgr **pppbm)
Definition: msctf.c:686

Referenced by CtfImmHideToolbarWnd(), and CtfImmRestoreToolbarWnd().

◆ Imm32TF_InvalidAssemblyListCacheIfExist()

VOID Imm32TF_InvalidAssemblyListCacheIfExist ( VOID  )

Definition at line 189 of file ctf.c.

190{
191 TRACE("TF_InvalidAssemblyListCacheIfExist()\n");
192
194 return;
195
197}
HRESULT WINAPI TF_InvalidAssemblyListCacheIfExist(void)
Definition: msctf.c:677

Referenced by CtfImmTIMActivate().

◆ ImmDisableTextFrameService()

BOOL WINAPI ImmDisableTextFrameService ( _In_ DWORD  dwThreadId)

Definition at line 1088 of file ctf.c.

1089{
1090 HRESULT hr = S_OK;
1091
1092 TRACE("(0x%lX)\n", dwThreadId);
1093
1094 if (dwThreadId == -1)
1096
1098 return TRUE;
1099
1100 GetWin32ClientInfo()->CI_flags |= CI_TSFDISABLED;
1101
1102 if (IS_CICERO_MODE() && !IS_16BIT_MODE() &&
1103 (GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT) &&
1104 (GetWin32ClientInfo()->CI_flags & CI_CTFTIM))
1105 {
1107 if (SUCCEEDED(hr))
1108 {
1109 GetWin32ClientInfo()->CI_flags &= ~CI_CTFTIM;
1111 }
1112 }
1113
1114 return hr == S_OK;
1115}
VOID WINAPI CtfImmCoUninitialize(VOID)
Definition: ctf.c:614

◆ ISPY_PostInitialize()

static STDMETHODIMP ISPY_PostInitialize ( _Inout_ IInitializeSpy pThis,
_In_ HRESULT  hrCoInit,
_In_ DWORD  dwCoInit,
_In_ DWORD  dwNewThreadAptRefs 
)
static

Definition at line 491 of file ctf.c.

496{
497 DWORD CoInitCountSkip;
498
501
502 CoInitCountSkip = Imm32GetCoInitCountSkip();
503
504 if ((hrCoInit != S_FALSE) ||
505 (dwNewThreadAptRefs != CoInitCountSkip + 2) ||
506 !(GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT))
507 {
508 return hrCoInit;
509 }
510
511 return S_OK;
512}
static DWORD Imm32GetCoInitCountSkip(VOID)
Definition: ctf.c:331
static DWORD dwCoInit
Definition: compobj.c:73

◆ ISPY_PostUninitialize()

static STDMETHODIMP ISPY_PostUninitialize ( _In_ IInitializeSpy pThis,
_In_ DWORD  dwNewThreadAptRefs 
)
static

Definition at line 535 of file ctf.c.

538{
540 UNREFERENCED_PARAMETER(dwNewThreadAptRefs);
542 return S_OK;
543}
static DWORD Imm32DecCoInitCountSkip(VOID)
Definition: ctf.c:359

◆ ISPY_PreInitialize()

static STDMETHODIMP ISPY_PreInitialize ( _Inout_ IInitializeSpy pThis,
_In_ DWORD  dwCoInit,
_In_ DWORD  dwCurThreadAptRefs 
)
static

Definition at line 469 of file ctf.c.

473{
474 DWORD cCount;
475
477
478 cCount = Imm32IncCoInitCountSkip();
479 if (!dwCoInit &&
480 (dwCurThreadAptRefs == cCount + 1) &&
481 (GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT))
482 {
485 }
486
487 return S_OK;
488}
static DWORD Imm32IncCoInitCountSkip(VOID)
Definition: ctf.c:341

◆ ISPY_PreUninitialize()

static STDMETHODIMP ISPY_PreUninitialize ( _Inout_ IInitializeSpy pThis,
_In_ DWORD  dwCurThreadAptRefs 
)
static

Definition at line 515 of file ctf.c.

518{
520
521 if (dwCurThreadAptRefs == 1 &&
524 (GetWin32ClientInfo()->CI_flags & CI_CTFCOINIT))
525 {
527 if (pData && !pData->bUninitializing)
529 }
530
531 return S_OK;
532}

◆ ISPY_QueryInterface()

static STDMETHODIMP ISPY_QueryInterface ( _Inout_ IInitializeSpy pThis,
_In_ REFIID  riid,
_Inout_ LPVOID ppvObj 
)
static

Definition at line 422 of file ctf.c.

426{
427 ISPY *pSpy = (ISPY*)pThis;
428
429 if (!ppvObj)
430 return E_INVALIDARG;
431
432 *ppvObj = NULL;
433
434 if (!IsEqualIID(riid, &IID_IUnknown) && !IsEqualIID(riid, &IID_IInitializeSpy))
435 return E_NOINTERFACE;
436
437 ++(pSpy->m_cRefs);
438 *ppvObj = pSpy;
439 return S_OK;
440}
const GUID IID_IUnknown
#define E_INVALIDARG
Definition: ddrawi.h:101
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ MSCTF_FN() [1/2]

◆ MSCTF_FN() [2/2]

◆ OLE32_FN() [1/4]

◆ OLE32_FN() [2/4]

◆ OLE32_FN() [3/4]

◆ OLE32_FN() [4/4]

◆ STDMETHODIMP_()

static STDMETHODIMP_ ( ULONG  )
static

Definition at line 442 of file ctf.c.

445{
446 ISPY *pSpy = (ISPY*)pThis;
447 return ++pSpy->m_cRefs;
448}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( imm  )

Variable Documentation

◆ g_aimm_compat_flags

DWORD g_aimm_compat_flags = 0

Definition at line 204 of file ctf.c.

Referenced by CtfImmSetAppCompatFlags(), and ImmGetAppCompatFlags().

◆ g_disable_CUAS_flag

BOOL g_disable_CUAS_flag = FALSE

Definition at line 207 of file ctf.c.

Referenced by CtfImmTIMActivate(), and ImmDisableTextFrameService().

◆ g_dwTLSIndex

DWORD g_dwTLSIndex = -1

Definition at line 270 of file ctf.c.

Referenced by Imm32AllocateTLS(), Imm32GetTLS(), and Imm32InitTLS().

◆ g_hCtfIme

HINSTANCE g_hCtfIme = NULL

Definition at line 210 of file ctf.c.

Referenced by Imm32LoadCtfIme().

◆ g_hMsctf

HINSTANCE g_hMsctf = NULL

Definition at line 166 of file ctf.c.

◆ g_hOle32

HINSTANCE g_hOle32 = NULL

Definition at line 113 of file ctf.c.

◆ g_vtblISPY

const IInitializeSpyVtbl g_vtblISPY
static
Initial value:
=
{
ISPY_AddRef,
ISPY_Release,
}
static STDMETHODIMP ISPY_PostUninitialize(_In_ IInitializeSpy *pThis, _In_ DWORD dwNewThreadAptRefs)
Definition: ctf.c:535
static STDMETHODIMP ISPY_PreUninitialize(_Inout_ IInitializeSpy *pThis, _In_ DWORD dwCurThreadAptRefs)
Definition: ctf.c:515
static STDMETHODIMP ISPY_PostInitialize(_Inout_ IInitializeSpy *pThis, _In_ HRESULT hrCoInit, _In_ DWORD dwCoInit, _In_ DWORD dwNewThreadAptRefs)
Definition: ctf.c:491
static STDMETHODIMP ISPY_PreInitialize(_Inout_ IInitializeSpy *pThis, _In_ DWORD dwCoInit, _In_ DWORD dwCurThreadAptRefs)
Definition: ctf.c:469
static STDMETHODIMP ISPY_QueryInterface(_Inout_ IInitializeSpy *pThis, _In_ REFIID riid, _Inout_ LPVOID *ppvObj)
Definition: ctf.c:422

Definition at line 545 of file ctf.c.

Referenced by Imm32AllocIMMISPY().