ReactOS  0.4.12-dev-916-gffc4e30
inputprocessor.c File Reference
#include <stdio.h>
#include "wine/test.h"
#include "winuser.h"
#include "initguid.h"
#include "shlwapi.h"
#include "shlguid.h"
#include "comcat.h"
#include "msctf.h"
#include "olectl.h"
Include dependency graph for inputprocessor.c:

Go to the source code of this file.

Classes

struct  tagTextStoreACP
 
struct  tagThreadMgrEventSink
 
struct  tagClassFactory
 
struct  tagTextService
 
struct  tagKeyEventSink
 
struct  tagTextEditSink
 
struct  tagEditSession
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define SINK_UNEXPECTED   0
 
#define SINK_EXPECTED   1
 
#define SINK_FIRED   2
 
#define SINK_IGNORE   3
 
#define SINK_OPTIONAL   4
 
#define SINK_SAVE   5
 
#define SINK_ACTION_MASK   0xff
 
#define SINK_OPTION_MASK   0xff00
 
#define SINK_EXPECTED_COUNT_MASK   0xff0000
 
#define SINK_OPTION_TODO   0x0100
 
#define FOCUS_IGNORE   (ITfDocumentMgr*)0xffffffff
 
#define FOCUS_SAVE   (ITfDocumentMgr*)0xfffffffe
 
#define sink_fire_ok(a, b)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_fire_ok(a,b)
 
#define sink_check_ok(a, b)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_ok(a,b)
 
#define sink_check_saved(s, p, c, n)   (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_saved(s,p,c,n)
 

Typedefs

typedef struct tagTextStoreACP TextStoreACP
 
typedef struct tagThreadMgrEventSink ThreadMgrEventSink
 
typedef HRESULT(* LPFNCONSTRUCTOR) (IUnknown *pUnkOuter, IUnknown **ppvOut)
 
typedef struct tagClassFactory ClassFactory
 
typedef struct tagTextService TextService
 
typedef struct tagKeyEventSink KeyEventSink
 
typedef struct tagTextEditSink TextEditSink
 
typedef struct tagEditSession EditSession
 

Functions

static int expected_count (int *sink)
 
static void _sink_fire_ok (INT *sink, const CHAR *name)
 
static void _sink_check_ok (INT *sink, const CHAR *name)
 
static void _sink_check_saved (INT *sink, ITfDocumentMgr *PrevFocus, ITfDocumentMgr *CurrentFocus, const CHAR *name)
 
static TextStoreACPimpl_from_ITextStoreACP (ITextStoreACP *iface)
 
static void TextStoreACP_Destructor (TextStoreACP *This)
 
static HRESULT WINAPI TextStoreACP_QueryInterface (ITextStoreACP *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI TextStoreACP_AddRef (ITextStoreACP *iface)
 
static ULONG WINAPI TextStoreACP_Release (ITextStoreACP *iface)
 
static HRESULT WINAPI TextStoreACP_AdviseSink (ITextStoreACP *iface, REFIID riid, IUnknown *punk, DWORD dwMask)
 
static HRESULT WINAPI TextStoreACP_UnadviseSink (ITextStoreACP *iface, IUnknown *punk)
 
static HRESULT WINAPI TextStoreACP_RequestLock (ITextStoreACP *iface, DWORD dwLockFlags, HRESULT *phrSession)
 
static HRESULT WINAPI TextStoreACP_GetStatus (ITextStoreACP *iface, TS_STATUS *pdcs)
 
static HRESULT WINAPI TextStoreACP_QueryInsert (ITextStoreACP *iface, LONG acpTestStart, LONG acpTestEnd, ULONG cch, LONG *pacpResultStart, LONG *pacpResultEnd)
 
static HRESULT WINAPI TextStoreACP_GetSelection (ITextStoreACP *iface, ULONG ulIndex, ULONG ulCount, TS_SELECTION_ACP *pSelection, ULONG *pcFetched)
 
static HRESULT WINAPI TextStoreACP_SetSelection (ITextStoreACP *iface, ULONG ulCount, const TS_SELECTION_ACP *pSelection)
 
static HRESULT WINAPI TextStoreACP_GetText (ITextStoreACP *iface, LONG acpStart, LONG acpEnd, WCHAR *pchPlain, ULONG cchPlainReq, ULONG *pcchPlainRet, TS_RUNINFO *prgRunInfo, ULONG cRunInfoReq, ULONG *pcRunInfoRet, LONG *pacpNext)
 
static HRESULT WINAPI TextStoreACP_SetText (ITextStoreACP *iface, DWORD dwFlags, LONG acpStart, LONG acpEnd, const WCHAR *pchText, ULONG cch, TS_TEXTCHANGE *pChange)
 
static HRESULT WINAPI TextStoreACP_GetFormattedText (ITextStoreACP *iface, LONG acpStart, LONG acpEnd, IDataObject **ppDataObject)
 
static HRESULT WINAPI TextStoreACP_GetEmbedded (ITextStoreACP *iface, LONG acpPos, REFGUID rguidService, REFIID riid, IUnknown **ppunk)
 
static HRESULT WINAPI TextStoreACP_QueryInsertEmbedded (ITextStoreACP *iface, const GUID *pguidService, const FORMATETC *pFormatEtc, BOOL *pfInsertable)
 
static HRESULT WINAPI TextStoreACP_InsertEmbedded (ITextStoreACP *iface, DWORD dwFlags, LONG acpStart, LONG acpEnd, IDataObject *pDataObject, TS_TEXTCHANGE *pChange)
 
static HRESULT WINAPI TextStoreACP_InsertTextAtSelection (ITextStoreACP *iface, DWORD dwFlags, const WCHAR *pchText, ULONG cch, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange)
 
static HRESULT WINAPI TextStoreACP_InsertEmbeddedAtSelection (ITextStoreACP *iface, DWORD dwFlags, IDataObject *pDataObject, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange)
 
static HRESULT WINAPI TextStoreACP_RequestSupportedAttrs (ITextStoreACP *iface, DWORD dwFlags, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs)
 
static HRESULT WINAPI TextStoreACP_RequestAttrsAtPosition (ITextStoreACP *iface, LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags)
 
static HRESULT WINAPI TextStoreACP_RequestAttrsTransitioningAtPosition (ITextStoreACP *iface, LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags)
 
static HRESULT WINAPI TextStoreACP_FindNextAttrTransition (ITextStoreACP *iface, LONG acpStart, LONG acpHalt, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags, LONG *pacpNext, BOOL *pfFound, LONG *plFoundOffset)
 
static HRESULT WINAPI TextStoreACP_RetrieveRequestedAttrs (ITextStoreACP *iface, ULONG ulCount, TS_ATTRVAL *paAttrVals, ULONG *pcFetched)
 
static HRESULT WINAPI TextStoreACP_GetEndACP (ITextStoreACP *iface, LONG *pacp)
 
static HRESULT WINAPI TextStoreACP_GetActiveView (ITextStoreACP *iface, TsViewCookie *pvcView)
 
static HRESULT WINAPI TextStoreACP_GetACPFromPoint (ITextStoreACP *iface, TsViewCookie vcView, const POINT *ptScreen, DWORD dwFlags, LONG *pacp)
 
static HRESULT WINAPI TextStoreACP_GetTextExt (ITextStoreACP *iface, TsViewCookie vcView, LONG acpStart, LONG acpEnd, RECT *prc, BOOL *pfClipped)
 
static HRESULT WINAPI TextStoreACP_GetScreenExt (ITextStoreACP *iface, TsViewCookie vcView, RECT *prc)
 
static HRESULT WINAPI TextStoreACP_GetWnd (ITextStoreACP *iface, TsViewCookie vcView, HWND *phwnd)
 
static HRESULT TextStoreACP_Constructor (IUnknown **ppOut)
 
static ThreadMgrEventSinkimpl_from_ITfThreadMgrEventSink (ITfThreadMgrEventSink *iface)
 
static void ThreadMgrEventSink_Destructor (ThreadMgrEventSink *This)
 
static HRESULT WINAPI ThreadMgrEventSink_QueryInterface (ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI ThreadMgrEventSink_AddRef (ITfThreadMgrEventSink *iface)
 
static ULONG WINAPI ThreadMgrEventSink_Release (ITfThreadMgrEventSink *iface)
 
static HRESULT WINAPI ThreadMgrEventSink_OnInitDocumentMgr (ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim)
 
static HRESULT WINAPI ThreadMgrEventSink_OnUninitDocumentMgr (ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim)
 
static HRESULT WINAPI ThreadMgrEventSink_OnSetFocus (ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus)
 
static HRESULT WINAPI ThreadMgrEventSink_OnPushContext (ITfThreadMgrEventSink *iface, ITfContext *pic)
 
static HRESULT WINAPI ThreadMgrEventSink_OnPopContext (ITfThreadMgrEventSink *iface, ITfContext *pic)
 
static HRESULT ThreadMgrEventSink_Constructor (IUnknown **ppOut)
 
static HRESULT WINAPI TfKeyTraceEventSink_QueryInterface (ITfKeyTraceEventSink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TfKeyTraceEventSink_AddRef (ITfKeyTraceEventSink *iface)
 
static ULONG WINAPI TfKeyTraceEventSink_Release (ITfKeyTraceEventSink *iface)
 
static HRESULT WINAPI TfKeyTraceEventSink_OnKeyTraceDown (ITfKeyTraceEventSink *iface, WPARAM wparam, LPARAM lparam)
 
static HRESULT WINAPI TfKeyTraceEventSink_OnKeyTraceUp (ITfKeyTraceEventSink *iface, WPARAM wparam, LPARAM lparam)
 
static HRESULT WINAPI TfTransitoryExtensionSink_QueryInterface (ITfTransitoryExtensionSink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TfTransitoryExtensionSink_AddRef (ITfTransitoryExtensionSink *iface)
 
static ULONG WINAPI TfTransitoryExtensionSink_Release (ITfTransitoryExtensionSink *iface)
 
static HRESULT WINAPI TfTransitoryExtensionSink_OnTransitoryExtensionUpdated (ITfTransitoryExtensionSink *iface, ITfContext *pic, TfEditCookie ecReadOnly, ITfRange *pResultRange, ITfRange *pCompositionRange, BOOL *pfDeleteResultRange)
 
static ClassFactoryimpl_from_IClassFactory (IClassFactory *iface)
 
static TextServiceimpl_from_ITfTextInputProcessor (ITfTextInputProcessor *iface)
 
static void ClassFactory_Destructor (ClassFactory *This)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppvOut)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *punkOuter, REFIID iid, LPVOID *ppvOut)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL fLock)
 
static HRESULT ClassFactory_Constructor (LPFNCONSTRUCTOR ctor, LPVOID *ppvOut)
 
static void TextService_Destructor (TextService *This)
 
static HRESULT WINAPI TextService_QueryInterface (ITfTextInputProcessor *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI TextService_AddRef (ITfTextInputProcessor *iface)
 
static ULONG WINAPI TextService_Release (ITfTextInputProcessor *iface)
 
static HRESULT WINAPI TextService_Activate (ITfTextInputProcessor *iface, ITfThreadMgr *ptim, TfClientId id)
 
static HRESULT WINAPI TextService_Deactivate (ITfTextInputProcessor *iface)
 
static HRESULT TextService_Constructor (IUnknown *pUnkOuter, IUnknown **ppOut)
 
static HRESULT RegisterTextService (REFCLSID rclsid)
 
static HRESULT UnregisterTextService (void)
 
 DEFINE_GUID (CLSID_FakeService, 0xEDE1A7AD, 0x66DE, 0x47E0, 0xB6, 0x20, 0x3E, 0x92, 0xF8, 0x24, 0x6B, 0xF3)
 
 DEFINE_GUID (CLSID_TF_InputProcessorProfiles, 0x33c53a50, 0xf456, 0x4884, 0xb0, 0x49, 0x85, 0xfd, 0x64, 0x3e, 0xcf, 0xed)
 
 DEFINE_GUID (CLSID_TF_CategoryMgr, 0xA4B544A1, 0x438D, 0x4B41, 0x93, 0x25, 0x86, 0x95, 0x23, 0xE2, 0xD6, 0xC7)
 
 DEFINE_GUID (GUID_TFCAT_TIP_KEYBOARD, 0x34745c63, 0xb2f0, 0x4784, 0x8b, 0x67, 0x5e, 0x12, 0xc8, 0x70, 0x1a, 0x31)
 
 DEFINE_GUID (GUID_TFCAT_TIP_SPEECH, 0xB5A73CD1, 0x8355, 0x426B, 0xA1, 0x61, 0x25, 0x98, 0x08, 0xF2, 0x6B, 0x14)
 
 DEFINE_GUID (GUID_TFCAT_TIP_HANDWRITING, 0x246ecb87, 0xc2f2, 0x4abe, 0x90, 0x5b, 0xc8, 0xb3, 0x8a, 0xdd, 0x2c, 0x43)
 
 DEFINE_GUID (GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, 0x046B8C80, 0x1647, 0x40F7, 0x9B, 0x21, 0xB9, 0x3B, 0x81, 0xAA, 0xBC, 0x1B)
 
 DEFINE_GUID (GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
 DEFINE_GUID (CLSID_TF_ThreadMgr, 0x529a9e6b, 0x6587, 0x4f23, 0xab, 0x9e, 0x9c, 0x7d, 0x68, 0x3e, 0x3c, 0x50)
 
 DEFINE_GUID (CLSID_PreservedKey, 0xA0ED8E55, 0xCD3B, 0x4274, 0xB2, 0x95, 0xF6, 0xC9, 0xBA, 0x2B, 0x84, 0x72)
 
 DEFINE_GUID (GUID_COMPARTMENT_KEYBOARD_DISABLED, 0x71a5b253, 0x1951, 0x466b, 0x9f, 0xbc, 0x9c, 0x88, 0x08, 0xfa, 0x84, 0xf2)
 
 DEFINE_GUID (GUID_COMPARTMENT_KEYBOARD_OPENCLOSE, 0x58273aad, 0x01bb, 0x4164, 0x95, 0xc6, 0x75, 0x5b, 0xa0, 0xb5, 0x16, 0x2d)
 
 DEFINE_GUID (GUID_COMPARTMENT_HANDWRITING_OPENCLOSE, 0xf9ae2c6b, 0x1866, 0x4361, 0xaf, 0x72, 0x7a, 0xa3, 0x09, 0x48, 0x89, 0x0e)
 
 DEFINE_GUID (GUID_COMPARTMENT_SPEECH_DISABLED, 0x56c5c607, 0x0703, 0x4e59, 0x8e, 0x52, 0xcb, 0xc8, 0x4e, 0x8b, 0xbe, 0x35)
 
 DEFINE_GUID (GUID_COMPARTMENT_SPEECH_OPENCLOSE, 0x544d6a63, 0xe2e8, 0x4752, 0xbb, 0xd1, 0x00, 0x09, 0x60, 0xbc, 0xa0, 0x83)
 
 DEFINE_GUID (GUID_COMPARTMENT_SPEECH_GLOBALSTATE, 0x2a54fe8e, 0x0d08, 0x460c, 0xa7, 0x5d, 0x87, 0x03, 0x5f, 0xf4, 0x36, 0xc5)
 
 DEFINE_GUID (GUID_COMPARTMENT_PERSISTMENUENABLED, 0x575f3783, 0x70c8, 0x47c8, 0xae, 0x5d, 0x91, 0xa0, 0x1a, 0x1f, 0x75, 0x92)
 
 DEFINE_GUID (GUID_COMPARTMENT_EMPTYCONTEXT, 0xd7487dbf, 0x804e, 0x41c5, 0x89, 0x4d, 0xad, 0x96, 0xfd, 0x4e, 0xea, 0x13)
 
 DEFINE_GUID (GUID_COMPARTMENT_TIPUISTATUS, 0x148ca3ec, 0x0366, 0x401c, 0x8d, 0x75, 0xed, 0x97, 0x8d, 0x85, 0xfb, 0xc9)
 
static HRESULT initialize (void)
 
static void cleanup (void)
 
static void test_Register (void)
 
static void test_Unregister (void)
 
static void test_EnumInputProcessorInfo (void)
 
static void test_EnumLanguageProfiles (void)
 
static void test_RegisterCategory (void)
 
static void test_UnregisterCategory (void)
 
static void test_FindClosestCategory (void)
 
static void test_Enable (void)
 
static void test_Disable (void)
 
static void test_ThreadMgrAdviseSinks (void)
 
static void test_ThreadMgrUnadviseSinks (void)
 
static void test_DocumentMgrAdviseSinks (void)
 
static void test_DocumentMgrUnadviseSinks (void)
 
static KeyEventSinkimpl_from_ITfKeyEventSink (ITfKeyEventSink *iface)
 
static void KeyEventSink_Destructor (KeyEventSink *This)
 
static HRESULT WINAPI KeyEventSink_QueryInterface (ITfKeyEventSink *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI KeyEventSink_AddRef (ITfKeyEventSink *iface)
 
static ULONG WINAPI KeyEventSink_Release (ITfKeyEventSink *iface)
 
static HRESULT WINAPI KeyEventSink_OnSetFocus (ITfKeyEventSink *iface, BOOL fForeground)
 
static HRESULT WINAPI KeyEventSink_OnTestKeyDown (ITfKeyEventSink *iface, ITfContext *pic, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
 
static HRESULT WINAPI KeyEventSink_OnTestKeyUp (ITfKeyEventSink *iface, ITfContext *pic, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
 
static HRESULT WINAPI KeyEventSink_OnKeyDown (ITfKeyEventSink *iface, ITfContext *pic, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
 
static HRESULT WINAPI KeyEventSink_OnKeyUp (ITfKeyEventSink *iface, ITfContext *pic, WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
 
static HRESULT WINAPI KeyEventSink_OnPreservedKey (ITfKeyEventSink *iface, ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
 
static HRESULT KeyEventSink_Constructor (ITfKeyEventSink **ppOut)
 
static void test_KeystrokeMgr (void)
 
static void test_Activate (void)
 
static void test_EnumContexts (ITfDocumentMgr *dm, ITfContext *search)
 
static void test_EnumDocumentMgr (ITfThreadMgr *tm, ITfDocumentMgr *search, ITfDocumentMgr *absent)
 
static int check_context_refcount (ITfContext *iface)
 
static TextEditSinkimpl_from_ITfTextEditSink (ITfTextEditSink *iface)
 
static void TextEditSink_Destructor (TextEditSink *This)
 
static HRESULT WINAPI TextEditSink_QueryInterface (ITfTextEditSink *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI TextEditSink_AddRef (ITfTextEditSink *iface)
 
static ULONG WINAPI TextEditSink_Release (ITfTextEditSink *iface)
 
static HRESULT WINAPI TextEditSink_OnEndEdit (ITfTextEditSink *iface, ITfContext *pic, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord)
 
static HRESULT TextEditSink_Constructor (ITfTextEditSink **ppOut)
 
static void test_startSession (void)
 
static void test_endSession (void)
 
static void test_TfGuidAtom (void)
 
static void test_ClientId (void)
 
static EditSessionimpl_from_ITfEditSession (ITfEditSession *iface)
 
static void EditSession_Destructor (EditSession *This)
 
static HRESULT WINAPI EditSession_QueryInterface (ITfEditSession *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI EditSession_AddRef (ITfEditSession *iface)
 
static ULONG WINAPI EditSession_Release (ITfEditSession *iface)
 
static void test_InsertAtSelection (TfEditCookie ec, ITfContext *cxt)
 
static HRESULT WINAPI EditSession_DoEditSession (ITfEditSession *iface, TfEditCookie ec)
 
static HRESULT EditSession_Constructor (ITfEditSession **ppOut)
 
static void test_TStoApplicationText (void)
 
static void enum_compartments (ITfCompartmentMgr *cmpmgr, REFGUID present, REFGUID absent)
 
static void test_Compartments (void)
 
static void processPendingMessages (void)
 
static void test_AssociateFocus (void)
 
static void test_profile_mgr (void)
 
 START_TEST (inputprocessor)
 

Variables

static ITfInputProcessorProfiles * g_ipp
 
static LANGID gLangid
 
static ITfCategoryMgrg_cm = NULL
 
static ITfThreadMgrg_tm = NULL
 
static ITfDocumentMgrg_dm = NULL
 
static TfClientId cid = 0
 
static TfClientId tid = 0
 
static ITextStoreACPSinkACPSink
 
static BOOL test_ShouldActivate = FALSE
 
static BOOL test_ShouldDeactivate = FALSE
 
static DWORD tmSinkCookie
 
static DWORD tmSinkRefCount
 
static DWORD dmSinkCookie
 
static DWORD documentStatus
 
static DWORD key_trace_sink_cookie
 
static ITfDocumentMgrtest_CurrentFocus = NULL
 
static ITfDocumentMgrtest_PrevFocus = NULL
 
static ITfDocumentMgrtest_LastCurrentFocus = FOCUS_SAVE
 
static ITfDocumentMgrtest_FirstPrevFocus = FOCUS_SAVE
 
static INT test_OnSetFocus = SINK_UNEXPECTED
 
static INT test_OnInitDocumentMgr = SINK_UNEXPECTED
 
static INT test_OnPushContext = SINK_UNEXPECTED
 
static INT test_OnPopContext = SINK_UNEXPECTED
 
static INT test_KEV_OnSetFocus = SINK_UNEXPECTED
 
static INT test_ACP_AdviseSink = SINK_UNEXPECTED
 
static INT test_ACP_UnadviseSink = SINK_UNEXPECTED
 
static INT test_ACP_GetStatus = SINK_UNEXPECTED
 
static INT test_ACP_RequestLock = SINK_UNEXPECTED
 
static INT test_ACP_GetEndACP = SINK_UNEXPECTED
 
static INT test_ACP_GetSelection = SINK_UNEXPECTED
 
static INT test_DoEditSession = SINK_UNEXPECTED
 
static INT test_ACP_InsertTextAtSelection = SINK_UNEXPECTED
 
static INT test_ACP_SetSelection = SINK_UNEXPECTED
 
static INT test_OnEndEdit = SINK_UNEXPECTED
 
static const ITextStoreACPVtbl TextStoreACP_TextStoreACPVtbl
 
static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSink_ThreadMgrEventSinkVtbl
 
static const ITfKeyTraceEventSinkVtbl TfKeyTraceEventSinkVtbl
 
static ITfKeyTraceEventSink TfKeyTraceEventSink = { &TfKeyTraceEventSinkVtbl }
 
static const ITfTransitoryExtensionSinkVtbl TfTransitoryExtensionSinkVtbl
 
static ITfTransitoryExtensionSink TfTransitoryExtensionSink = { &TfTransitoryExtensionSinkVtbl }
 
static LONG TS_refCount
 
static IClassFactorycf
 
static DWORD regid
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static const ITfTextInputProcessorVtbl TextService_TextInputProcessorVtbl
 
static const ITfKeyEventSinkVtbl KeyEventSink_KeyEventSinkVtbl
 
static const ITfTextEditSinkVtbl TextEditSink_TextEditSinkVtbl
 
static const ITfEditSessionVtbl EditSession_EditSessionVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file inputprocessor.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 24 of file inputprocessor.c.

◆ FOCUS_IGNORE

#define FOCUS_IGNORE   (ITfDocumentMgr*)0xffffffff

Definition at line 57 of file inputprocessor.c.

◆ FOCUS_SAVE

#define FOCUS_SAVE   (ITfDocumentMgr*)0xfffffffe

Definition at line 58 of file inputprocessor.c.

◆ SINK_ACTION_MASK

#define SINK_ACTION_MASK   0xff

Definition at line 51 of file inputprocessor.c.

◆ sink_check_ok

#define sink_check_ok (   a,
  b 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_ok(a,b)

Definition at line 157 of file inputprocessor.c.

◆ sink_check_saved

#define sink_check_saved (   s,
  p,
  c,
  n 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_check_saved(s,p,c,n)

Definition at line 171 of file inputprocessor.c.

◆ SINK_EXPECTED

#define SINK_EXPECTED   1

Definition at line 45 of file inputprocessor.c.

◆ SINK_EXPECTED_COUNT_MASK

#define SINK_EXPECTED_COUNT_MASK   0xff0000

Definition at line 53 of file inputprocessor.c.

◆ sink_fire_ok

#define sink_fire_ok (   a,
  b 
)    (winetest_set_location(__FILE__,__LINE__), 0) ? 0 : _sink_fire_ok(a,b)

Definition at line 129 of file inputprocessor.c.

◆ SINK_FIRED

#define SINK_FIRED   2

Definition at line 46 of file inputprocessor.c.

◆ SINK_IGNORE

#define SINK_IGNORE   3

Definition at line 47 of file inputprocessor.c.

◆ SINK_OPTION_MASK

#define SINK_OPTION_MASK   0xff00

Definition at line 52 of file inputprocessor.c.

◆ SINK_OPTION_TODO

#define SINK_OPTION_TODO   0x0100

Definition at line 55 of file inputprocessor.c.

◆ SINK_OPTIONAL

#define SINK_OPTIONAL   4

Definition at line 48 of file inputprocessor.c.

◆ SINK_SAVE

#define SINK_SAVE   5

Definition at line 49 of file inputprocessor.c.

◆ SINK_UNEXPECTED

#define SINK_UNEXPECTED   0

Definition at line 44 of file inputprocessor.c.

Typedef Documentation

◆ ClassFactory

◆ EditSession

◆ KeyEventSink

◆ LPFNCONSTRUCTOR

typedef HRESULT(* LPFNCONSTRUCTOR) (IUnknown *pUnkOuter, IUnknown **ppvOut)

Definition at line 719 of file inputprocessor.c.

◆ TextEditSink

◆ TextService

◆ TextStoreACP

◆ ThreadMgrEventSink

Function Documentation

◆ _sink_check_ok()

static void _sink_check_ok ( INT sink,
const CHAR name 
)
inlinestatic

Definition at line 131 of file inputprocessor.c.

132 {
133  int action = *sink & SINK_ACTION_MASK;
134  int todo = *sink & SINK_OPTION_TODO;
135  int count = expected_count(sink);
136 
137  switch (action)
138  {
139  case SINK_OPTIONAL:
141  winetest_trace("optional sink %s not fired\n",name);
142  case SINK_FIRED:
143  break;
144  case SINK_IGNORE:
145  return;
146  case SINK_SAVE:
147  if (count == 0 && winetest_interactive)
148  winetest_trace("optional sink %s not fired\n",name);
149  break;
150  default:
152  winetest_ok(0, "%s not fired as expected, in state %x\n",name,*sink);
153  }
155 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL todo
Definition: filedlg.c:313
#define SINK_UNEXPECTED
int winetest_interactive
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
#define SINK_SAVE
#define SINK_OPTIONAL
#define SINK_FIRED
#define todo_wine_if(is_todo)
Definition: test.h:155
void __winetest_cdecl winetest_trace(const char *msg,...)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
#define SINK_OPTION_TODO
#define SINK_ACTION_MASK
const WCHAR * action
Definition: action.c:7783
#define SINK_IGNORE
static int expected_count(int *sink)
Definition: name.c:36

Referenced by _sink_check_saved().

◆ _sink_check_saved()

static void _sink_check_saved ( INT sink,
ITfDocumentMgr PrevFocus,
ITfDocumentMgr CurrentFocus,
const CHAR name 
)
inlinestatic

Definition at line 159 of file inputprocessor.c.

160 {
161  int count = expected_count(sink);
163  if (PrevFocus != FOCUS_IGNORE && count != 0)
164  winetest_ok(PrevFocus == test_FirstPrevFocus, "%s expected prev focus %p got %p\n", name, PrevFocus, test_FirstPrevFocus);
165  if (CurrentFocus != FOCUS_IGNORE && count != 0)
166  winetest_ok(CurrentFocus == test_LastCurrentFocus, "%s expected current focus %p got %p\n", name, CurrentFocus, test_LastCurrentFocus);
169 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static ITfDocumentMgr * test_LastCurrentFocus
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
#define FOCUS_IGNORE
static int expected_count(int *sink)
#define FOCUS_SAVE
Definition: name.c:36
static ITfDocumentMgr * test_FirstPrevFocus
static void _sink_check_ok(INT *sink, const CHAR *name)

◆ _sink_fire_ok()

static void _sink_fire_ok ( INT sink,
const CHAR name 
)
inlinestatic

Definition at line 94 of file inputprocessor.c.

95 {
96  int count;
97  int todo = *sink & SINK_OPTION_TODO;
98  int action = *sink & SINK_ACTION_MASK;
99 
101  winetest_trace("firing %s\n",name);
102 
103  switch (action)
104  {
105  case SINK_OPTIONAL:
106  case SINK_EXPECTED:
108  if (count > 1)
109  {
110  count --;
111  *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16);
112  return;
113  }
114  break;
115  case SINK_IGNORE:
116  winetest_trace("Ignoring %s\n",name);
117  return;
118  case SINK_SAVE:
119  count = expected_count(sink) + 1;
120  *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16);
121  return;
122  default:
124  winetest_ok(0, "Unexpected %s sink\n",name);
125  }
126  *sink = SINK_FIRED;
127 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
BOOL todo
Definition: filedlg.c:313
int winetest_interactive
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
#define SINK_SAVE
#define SINK_OPTIONAL
#define SINK_FIRED
#define SINK_EXPECTED
#define todo_wine_if(is_todo)
Definition: test.h:155
void __winetest_cdecl winetest_trace(const char *msg,...)
void __winetest_cdecl winetest_ok(int condition, const char *msg,...)
#define SINK_OPTION_TODO
#define SINK_EXPECTED_COUNT_MASK
#define SINK_ACTION_MASK
const WCHAR * action
Definition: action.c:7783
#define SINK_IGNORE
static int expected_count(int *sink)
Definition: name.c:36

◆ check_context_refcount()

static int check_context_refcount ( ITfContext iface)
inlinestatic

Definition at line 1448 of file inputprocessor.c.

1449 {
1450  ITfContext_AddRef(iface);
1451  return ITfContext_Release(iface);
1452 }

Referenced by test_startSession().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 763 of file inputprocessor.c.

764 {
766  return InterlockedIncrement(&This->ref);
767 }
#define InterlockedIncrement
Definition: armddk.h:53
static ClassFactory * impl_from_IClassFactory(IClassFactory *iface)

◆ ClassFactory_Constructor()

static HRESULT ClassFactory_Constructor ( LPFNCONSTRUCTOR  ctor,
LPVOID ppvOut 
)
static

Definition at line 814 of file inputprocessor.c.

815 {
817  This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl;
818  This->ref = 1;
819  This->ctor = ctor;
820  *ppvOut = &This->IClassFactory_iface;
821  TS_refCount++;
822  return S_OK;
823 }
LPFNCONSTRUCTOR ctor
Definition: msctf.c:85
static const IClassFactoryVtbl ClassFactoryVtbl
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59
static LONG TS_refCount

Referenced by RegisterTextService().

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown punkOuter,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 779 of file inputprocessor.c.

780 {
782  HRESULT ret;
783  IUnknown *obj;
784 
785  ret = This->ctor(punkOuter, &obj);
786  if (FAILED(ret))
787  return ret;
788  ret = IUnknown_QueryInterface(obj, iid, ppvOut);
789  IUnknown_Release(obj);
790  return ret;
791 }
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
LONG HRESULT
Definition: typedefs.h:77
int ret
static ClassFactory * impl_from_IClassFactory(IClassFactory *iface)

◆ ClassFactory_Destructor()

static void ClassFactory_Destructor ( ClassFactory This)
static

Definition at line 744 of file inputprocessor.c.

745 {
747  TS_refCount--;
748 }
#define GetProcessHeap()
Definition: compat.h:395
static LONG TS_refCount
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ClassFactory_Release().

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  fLock 
)
static

Definition at line 793 of file inputprocessor.c.

794 {
795  if(fLock)
797  else
799 
800  return S_OK;
801 }
#define InterlockedDecrement
Definition: armddk.h:52
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
static LONG TS_refCount

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID ppvOut 
)
static

Definition at line 750 of file inputprocessor.c.

751 {
752  *ppvOut = NULL;
754  {
755  IClassFactory_AddRef(iface);
756  *ppvOut = iface;
757  return S_OK;
758  }
759 
760  return E_NOINTERFACE;
761 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 769 of file inputprocessor.c.

770 {
773 
774  if (ret == 0)
776  return ret;
777 }
static void ClassFactory_Destructor(ClassFactory *This)
int ret
#define InterlockedDecrement
Definition: armddk.h:52
static ClassFactory * impl_from_IClassFactory(IClassFactory *iface)
unsigned int ULONG
Definition: retypes.h:1

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 969 of file inputprocessor.c.

970 {
971  if (g_ipp)
972  ITfInputProcessorProfiles_Release(g_ipp);
973  if (g_cm)
974  ITfCategoryMgr_Release(g_cm);
975  if (g_tm)
976  ITfThreadMgr_Release(g_tm);
977  CoUninitialize();
978 }
static ITfCategoryMgr * g_cm
static ITfThreadMgr * g_tm
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
static ITfInputProcessorProfiles * g_ipp

Referenced by START_TEST().

◆ DEFINE_GUID() [1/19]

DEFINE_GUID ( CLSID_FakeService  ,
0xEDE1A7AD  ,
0x66DE  ,
0x47E0  ,
0xB6  ,
0x20  ,
0x3E  ,
0x92  ,
0xF8  ,
0x24  ,
0x6B  ,
0xF3   
)

◆ DEFINE_GUID() [2/19]

DEFINE_GUID ( CLSID_TF_InputProcessorProfiles  ,
0x33c53a50  ,
0xf456  ,
0x4884  ,
0xb0  ,
0x49  ,
0x85  ,
0xfd  ,
0x64  ,
0x3e  ,
0xcf  ,
0xed   
)

◆ DEFINE_GUID() [3/19]

DEFINE_GUID ( CLSID_TF_CategoryMgr  ,
0xA4B544A1  ,
0x438D  ,
0x4B41  ,
0x93  ,
0x25  ,
0x86  ,
0x95  ,
0x23  ,
0xE2  ,
0xD6  ,
0xC7   
)

◆ DEFINE_GUID() [4/19]

DEFINE_GUID ( GUID_TFCAT_TIP_KEYBOARD  ,
0x34745c63  ,
0xb2f0  ,
0x4784  ,
0x8b  ,
0x67  ,
0x5e  ,
0x12  ,
0xc8  ,
0x70  ,
0x1a  ,
0x31   
)

◆ DEFINE_GUID() [5/19]

DEFINE_GUID ( GUID_TFCAT_TIP_SPEECH  ,
0xB5A73CD1  ,
0x8355  ,
0x426B  ,
0xA1  ,
0x61  ,
0x25  ,
0x98  ,
0x08  ,
0xF2  ,
0x6B  ,
0x14   
)

◆ DEFINE_GUID() [6/19]

DEFINE_GUID ( GUID_TFCAT_TIP_HANDWRITING  ,
0x246ecb87  ,
0xc2f2  ,
0x4abe  ,
0x90  ,
0x5b  ,
0xc8  ,
0xb3  ,
0x8a  ,
0xdd  ,
0x2c  ,
0x43   
)

◆ DEFINE_GUID() [7/19]

DEFINE_GUID ( GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER  ,
0x046B8C80  ,
0x1647  ,
0x40F7  ,
0x9B  ,
0x21  ,
0xB9  ,
0x3B  ,
0x81  ,
0xAA  ,
0xBC  ,
0x1B   
)

◆ DEFINE_GUID() [8/19]

DEFINE_GUID ( GUID_NULL  ,
,
,
,
,
,
,
,
,
,
,
 
)

◆ DEFINE_GUID() [9/19]

DEFINE_GUID ( CLSID_TF_ThreadMgr  ,
0x529a9e6b  ,
0x6587  ,
0x4f23  ,
0xab  ,
0x9e  ,
0x9c  ,
0x7d  ,
0x68  ,
0x3e  ,
0x3c  ,
0x50   
)

◆ DEFINE_GUID() [10/19]

DEFINE_GUID ( CLSID_PreservedKey  ,
0xA0ED8E55  ,
0xCD3B  ,
0x4274  ,
0xB2  ,
0x95  ,
0xF6  ,
0xC9  ,
0xBA  ,
0x2B  ,
0x84  ,
0x72   
)

◆ DEFINE_GUID() [11/19]

DEFINE_GUID ( GUID_COMPARTMENT_KEYBOARD_DISABLED  ,
0x71a5b253  ,
0x1951  ,
0x466b  ,
0x9f  ,
0xbc  ,
0x9c  ,
0x88  ,
0x08  ,
0xfa  ,
0x84  ,
0xf2   
)

◆ DEFINE_GUID() [12/19]

DEFINE_GUID ( GUID_COMPARTMENT_KEYBOARD_OPENCLOSE  ,
0x58273aad  ,
0x01bb  ,
0x4164  ,
0x95  ,
0xc6  ,
0x75  ,
0x5b  ,
0xa0  ,
0xb5  ,
0x16  ,
0x2d   
)

◆ DEFINE_GUID() [13/19]

DEFINE_GUID ( GUID_COMPARTMENT_HANDWRITING_OPENCLOSE  ,
0xf9ae2c6b  ,
0x1866  ,
0x4361  ,
0xaf  ,
0x72  ,
0x7a  ,
0xa3  ,
0x09  ,
0x48  ,
0x89  ,
0x0e   
)

◆ DEFINE_GUID() [14/19]

DEFINE_GUID ( GUID_COMPARTMENT_SPEECH_DISABLED  ,
0x56c5c607  ,
0x0703  ,
0x4e59  ,
0x8e  ,
0x52  ,
0xcb  ,
0xc8  ,
0x4e  ,
0x8b  ,
0xbe  ,
0x35   
)

◆ DEFINE_GUID() [15/19]

DEFINE_GUID ( GUID_COMPARTMENT_SPEECH_OPENCLOSE  ,
0x544d6a63  ,
0xe2e8  ,
0x4752  ,
0xbb  ,
0xd1  ,
0x00  ,
0x09  ,
0x60  ,
0xbc  ,
0xa0  ,
0x83   
)

◆ DEFINE_GUID() [16/19]

DEFINE_GUID ( GUID_COMPARTMENT_SPEECH_GLOBALSTATE  ,
0x2a54fe8e  ,
0x0d08  ,
0x460c  ,
0xa7  ,
0x5d  ,
0x87  ,
0x03  ,
0x5f  ,
0xf4  ,
0x36  ,
0xc5   
)

◆ DEFINE_GUID() [17/19]

DEFINE_GUID ( GUID_COMPARTMENT_PERSISTMENUENABLED  ,
0x575f3783  ,
0x70c8  ,
0x47c8  ,
0xae  ,
0x5d  ,
0x91  ,
0xa0  ,
0x1a  ,
0x1f  ,
0x75  ,
0x92   
)

◆ DEFINE_GUID() [18/19]

DEFINE_GUID ( GUID_COMPARTMENT_EMPTYCONTEXT  ,
0xd7487dbf  ,
0x804e  ,
0x41c5  ,
0x89  ,
0x4d  ,
0xad  ,
0x96  ,
0xfd  ,
0x4e  ,
0xea  ,
0x13   
)

◆ DEFINE_GUID() [19/19]

DEFINE_GUID ( GUID_COMPARTMENT_TIPUISTATUS  ,
0x148ca3ec  ,
0x0366  ,
0x401c  ,
0x8d  ,
0x75  ,
0xed  ,
0x97  ,
0x8d  ,
0x85  ,
0xfb  ,
0xc9   
)

◆ EditSession_AddRef()

static ULONG WINAPI EditSession_AddRef ( ITfEditSession iface)
static

Definition at line 1884 of file inputprocessor.c.

1885 {
1887  return InterlockedIncrement(&This->refCount);
1888 }
static EditSession * impl_from_ITfEditSession(ITfEditSession *iface)
#define InterlockedIncrement
Definition: armddk.h:53

◆ EditSession_Constructor()

static HRESULT EditSession_Constructor ( ITfEditSession **  ppOut)
static

Definition at line 2005 of file inputprocessor.c.

2006 {
2007  EditSession *This;
2008 
2009  *ppOut = NULL;
2011  if (This == NULL)
2012  return E_OUTOFMEMORY;
2013 
2014  This->ITfEditSession_iface.lpVtbl = &EditSession_EditSessionVtbl;
2015  This->refCount = 1;
2016 
2017  *ppOut = &This->ITfEditSession_iface;
2018  return S_OK;
2019 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const ITfEditSessionVtbl EditSession_EditSessionVtbl
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by test_TStoApplicationText().

◆ EditSession_Destructor()

static void EditSession_Destructor ( EditSession This)
static

Definition at line 1861 of file inputprocessor.c.

1862 {
1864 }
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by EditSession_Release().

◆ EditSession_DoEditSession()

static HRESULT WINAPI EditSession_DoEditSession ( ITfEditSession iface,
TfEditCookie  ec 
)
static

Definition at line 1919 of file inputprocessor.c.

1921 {
1922  ITfContext *cxt;
1923  ITfDocumentMgr *dm;
1924  ITfRange *range;
1925  TF_SELECTION selection;
1926  ULONG fetched;
1927  HRESULT hr;
1928 
1929  sink_fire_ok(&test_DoEditSession,"EditSession_DoEditSession");
1930  sink_check_ok(&test_ACP_RequestLock,"RequestLock");
1931 
1932  ITfThreadMgr_GetFocus(g_tm, &dm);
1933  ITfDocumentMgr_GetTop(dm,&cxt);
1934 
1935  hr = ITfContext_GetStart(cxt,ec,NULL);
1936  ok(hr == E_INVALIDARG,"Unexpected return code %x\n",hr);
1937 
1938  range = (ITfRange*)0xdeaddead;
1939  hr = ITfContext_GetStart(cxt,0xdeadcafe,&range);
1940  ok(hr == TF_E_NOLOCK,"Unexpected return code %x\n",hr);
1941  ok(range == NULL,"Range not set to NULL\n");
1942 
1943  hr = ITfContext_GetStart(cxt,ec,&range);
1944  ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
1945  ok(range != NULL,"Range set to NULL\n");
1946 
1947  ITfRange_Release(range);
1948 
1949  hr = ITfContext_GetEnd(cxt,ec,NULL);
1950  ok(hr == E_INVALIDARG,"Unexpected return code %x\n",hr);
1951 
1952  range = (ITfRange*)0xdeaddead;
1953  hr = ITfContext_GetEnd(cxt,0xdeadcafe,&range);
1954  ok(hr == TF_E_NOLOCK,"Unexpected return code %x\n",hr);
1955  ok(range == NULL,"Range not set to NULL\n");
1956 
1958  hr = ITfContext_GetEnd(cxt,ec,&range);
1959  ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
1960  ok(range != NULL,"Range set to NULL\n");
1961  sink_check_ok(&test_ACP_GetEndACP,"GetEndACP");
1962 
1963  ITfRange_Release(range);
1964 
1965  selection.range = NULL;
1967  hr = ITfContext_GetSelection(cxt, ec, TF_DEFAULT_SELECTION, 1, &selection, &fetched);
1968  ok(SUCCEEDED(hr),"ITfContext_GetSelection failed\n");
1969  ok(fetched == 1,"fetched incorrect\n");
1970  ok(selection.range != NULL,"NULL range\n");
1971  sink_check_ok(&test_ACP_GetSelection,"GetSelection");
1972  ITfRange_Release(selection.range);
1973 
1974  test_InsertAtSelection(ec, cxt);
1975 
1977  hr = ITfContext_GetEnd(cxt,ec,&range);
1978  ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
1979  ok(range != NULL,"Range set to NULL\n");
1980  sink_check_ok(&test_ACP_GetEndACP,"GetEndACP");
1981 
1982  selection.range = range;
1983  selection.style.ase = TF_AE_NONE;
1984  selection.style.fInterimChar = FALSE;
1986  hr = ITfContext_SetSelection(cxt, ec, 1, &selection);
1987  ok(SUCCEEDED(hr),"ITfContext_SetSelection failed\n");
1988  sink_check_ok(&test_ACP_SetSelection,"SetSelection");
1989  ITfRange_Release(range);
1990 
1991  ITfContext_Release(cxt);
1992  ITfDocumentMgr_Release(dm);
1993  return 0xdeadcafe;
1994 }
HRESULT hr
Definition: shlfolder.c:183
static INT test_ACP_SetSelection
int selection
Definition: ctm.c:92
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static void test_InsertAtSelection(TfEditCookie ec, ITfContext *cxt)
#define ok(value,...)
Definition: CComObject.cpp:34
#define SINK_EXPECTED
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
static INT test_ACP_GetEndACP
#define sink_fire_ok(a, b)
static INT test_ACP_GetSelection
static INT test_DoEditSession
GLenum GLint * range
Definition: glext.h:7539
static INT test_ACP_RequestLock
#define sink_check_ok(a, b)
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ EditSession_QueryInterface()

static HRESULT WINAPI EditSession_QueryInterface ( ITfEditSession iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 1866 of file inputprocessor.c.

1867 {
1868  *ppvOut = NULL;
1869 
1870  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfEditSession))
1871  {
1872  *ppvOut = iface;
1873  }
1874 
1875  if (*ppvOut)
1876  {
1877  ITfEditSession_AddRef(iface);
1878  return S_OK;
1879  }
1880 
1881  return E_NOINTERFACE;
1882 }
#define E_NOINTERFACE
Definition: winerror.h:2364
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ EditSession_Release()

static ULONG WINAPI EditSession_Release ( ITfEditSession iface)
static

Definition at line 1890 of file inputprocessor.c.

1891 {
1893  ULONG ret;
1894 
1895  ret = InterlockedDecrement(&This->refCount);
1896  if (ret == 0)
1898  return ret;
1899 }
static EditSession * impl_from_ITfEditSession(ITfEditSession *iface)
static void EditSession_Destructor(EditSession *This)
int ret
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

◆ enum_compartments()

static void enum_compartments ( ITfCompartmentMgr cmpmgr,
REFGUID  present,
REFGUID  absent 
)
static

Definition at line 2089 of file inputprocessor.c.

2090 {
2091  BOOL found,found2;
2092  IEnumGUID *ppEnum;
2093  found = FALSE;
2094  found2 = FALSE;
2095  if (SUCCEEDED(ITfCompartmentMgr_EnumCompartments(cmpmgr, &ppEnum)))
2096  {
2097  ULONG fetched;
2098  GUID g;
2099  while (IEnumGUID_Next(ppEnum, 1, &g, &fetched) == S_OK)
2100  {
2101  WCHAR str[50];
2102  CHAR strA[50];
2104  WideCharToMultiByte(CP_ACP,0,str,-1,strA,sizeof(strA),0,0);
2105  trace("found %s\n",strA);
2106  if (present && IsEqualGUID(present,&g))
2107  found = TRUE;
2108  if (absent && IsEqualGUID(absent, &g))
2109  found2 = TRUE;
2110  }
2111  IEnumGUID_Release(ppEnum);
2112  }
2113  if (present)
2114  ok(found,"Did not find compartment\n");
2115  if (absent)
2116  ok(!found2,"Found compartment that should be absent\n");
2117 }
char strA[12]
Definition: clipboard.c:2028
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
#define ok(value,...)
Definition: CComObject.cpp:34
GLboolean GLboolean g
Definition: glext.h:6204
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_Compartments().

◆ expected_count()

◆ impl_from_IClassFactory()

static ClassFactory* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 728 of file inputprocessor.c.

729 {
730  return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
731 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ClassFactory_AddRef(), ClassFactory_CreateInstance(), and ClassFactory_Release().

◆ impl_from_ITextStoreACP()

static TextStoreACP* impl_from_ITextStoreACP ( ITextStoreACP iface)
inlinestatic

Definition at line 183 of file inputprocessor.c.

184 {
185  return CONTAINING_RECORD(iface, TextStoreACP, ITextStoreACP_iface);
186 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by TextStoreACP_AddRef(), and TextStoreACP_Release().

◆ impl_from_ITfEditSession()

static EditSession* impl_from_ITfEditSession ( ITfEditSession iface)
inlinestatic

Definition at line 1856 of file inputprocessor.c.

1857 {
1858  return CONTAINING_RECORD(iface, EditSession, ITfEditSession_iface);
1859 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by EditSession_AddRef(), and EditSession_Release().

◆ impl_from_ITfKeyEventSink()

static KeyEventSink* impl_from_ITfKeyEventSink ( ITfKeyEventSink iface)
inlinestatic

Definition at line 1203 of file inputprocessor.c.

1204 {
1205  return CONTAINING_RECORD(iface, KeyEventSink, ITfKeyEventSink_iface);
1206 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by KeyEventSink_AddRef(), and KeyEventSink_Release().

◆ impl_from_ITfTextEditSink()

static TextEditSink* impl_from_ITfTextEditSink ( ITfTextEditSink iface)
inlinestatic

Definition at line 1464 of file inputprocessor.c.

1465 {
1466  return CONTAINING_RECORD(iface, TextEditSink, ITfTextEditSink_iface);
1467 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by TextEditSink_AddRef(), and TextEditSink_Release().

◆ impl_from_ITfTextInputProcessor()

static TextService* impl_from_ITfTextInputProcessor ( ITfTextInputProcessor iface)
inlinestatic

Definition at line 739 of file inputprocessor.c.

740 {
741  return CONTAINING_RECORD(iface, TextService, ITfTextInputProcessor_iface);
742 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by TextService_AddRef(), and TextService_Release().

◆ impl_from_ITfThreadMgrEventSink()

static ThreadMgrEventSink* impl_from_ITfThreadMgrEventSink ( ITfThreadMgrEventSink iface)
inlinestatic

Definition at line 480 of file inputprocessor.c.

481 {
482  return CONTAINING_RECORD(iface, ThreadMgrEventSink, ITfThreadMgrEventSink_iface);
483 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by ThreadMgrEventSink_AddRef(), and ThreadMgrEventSink_Release().

◆ initialize()

static HRESULT initialize ( void  )
static

Definition at line 943 of file inputprocessor.c.

944 {
945  HRESULT hr;
946  HKEY hkey;
947 
949 
950  if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\CTF\\TIP", 0,
951  KEY_READ|KEY_WRITE, &hkey) != ERROR_SUCCESS)
952  {
953  skip("Not enough permission to register input processor\n");
954  return E_FAIL;
955  }
956  RegCloseKey(hkey);
957 
959  CLSCTX_INPROC_SERVER, &IID_ITfInputProcessorProfiles, (void**)&g_ipp);
960  if (SUCCEEDED(hr))
962  CLSCTX_INPROC_SERVER, &IID_ITfCategoryMgr, (void**)&g_cm);
963  if (SUCCEEDED(hr))
965  CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (void**)&g_tm);
966  return hr;
967 }
static ITfCategoryMgr * g_cm
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3346
#define E_FAIL
Definition: ddrawi.h:102
EXTERN_C const CLSID CLSID_TF_CategoryMgr
Definition: msctf.idl:47
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles
Definition: msctf.idl:45
#define KEY_WRITE
Definition: nt_native.h:1031
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
EXTERN_C const CLSID CLSID_TF_ThreadMgr
Definition: msctf.idl:44
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define skip(...)
Definition: CString.cpp:57
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by START_TEST().

◆ KeyEventSink_AddRef()

static ULONG WINAPI KeyEventSink_AddRef ( ITfKeyEventSink iface)
static

Definition at line 1231 of file inputprocessor.c.

1232 {
1234  return InterlockedIncrement(&This->refCount);
1235 }
static KeyEventSink * impl_from_ITfKeyEventSink(ITfKeyEventSink *iface)
#define InterlockedIncrement
Definition: armddk.h:53

◆ KeyEventSink_Constructor()

static HRESULT KeyEventSink_Constructor ( ITfKeyEventSink **  ppOut)
static

Definition at line 1304 of file inputprocessor.c.

1305 {
1306  KeyEventSink *This;
1307 
1309  if (This == NULL)
1310  return E_OUTOFMEMORY;
1311 
1312  This->ITfKeyEventSink_iface.lpVtbl = &KeyEventSink_KeyEventSinkVtbl;
1313  This->refCount = 1;
1314 
1315  *ppOut = &This->ITfKeyEventSink_iface;
1316  return S_OK;
1317 }
static const ITfKeyEventSinkVtbl KeyEventSink_KeyEventSinkVtbl
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by test_KeystrokeMgr().

◆ KeyEventSink_Destructor()

static void KeyEventSink_Destructor ( KeyEventSink This)
static

Definition at line 1208 of file inputprocessor.c.

1209 {
1211 }
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by KeyEventSink_Release().

◆ KeyEventSink_OnKeyDown()

static HRESULT WINAPI KeyEventSink_OnKeyDown ( ITfKeyEventSink iface,
ITfContext pic,
WPARAM  wParam,
LPARAM  lParam,
BOOL pfEaten 
)
static

Definition at line 1269 of file inputprocessor.c.

1271 {
1272  trace("\n");
1273  return S_OK;
1274 }
#define trace(...)
Definition: kmt_test.h:217
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_OnKeyUp()

static HRESULT WINAPI KeyEventSink_OnKeyUp ( ITfKeyEventSink iface,
ITfContext pic,
WPARAM  wParam,
LPARAM  lParam,
BOOL pfEaten 
)
static

Definition at line 1276 of file inputprocessor.c.

1278 {
1279  trace("\n");
1280  return S_OK;
1281 }
#define trace(...)
Definition: kmt_test.h:217
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_OnPreservedKey()

static HRESULT WINAPI KeyEventSink_OnPreservedKey ( ITfKeyEventSink iface,
ITfContext pic,
REFGUID  rguid,
BOOL pfEaten 
)
static

Definition at line 1283 of file inputprocessor.c.

1285 {
1286  trace("\n");
1287  return S_OK;
1288 }
#define trace(...)
Definition: kmt_test.h:217
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_OnSetFocus()

static HRESULT WINAPI KeyEventSink_OnSetFocus ( ITfKeyEventSink iface,
BOOL  fForeground 
)
static

Definition at line 1248 of file inputprocessor.c.

1250 {
1251  sink_fire_ok(&test_KEV_OnSetFocus,"KeyEventSink_OnSetFocus");
1252  return S_OK;
1253 }
static INT test_KEV_OnSetFocus
#define sink_fire_ok(a, b)
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_OnTestKeyDown()

static HRESULT WINAPI KeyEventSink_OnTestKeyDown ( ITfKeyEventSink iface,
ITfContext pic,
WPARAM  wParam,
LPARAM  lParam,
BOOL pfEaten 
)
static

Definition at line 1255 of file inputprocessor.c.

1257 {
1258  trace("\n");
1259  return S_OK;
1260 }
#define trace(...)
Definition: kmt_test.h:217
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_OnTestKeyUp()

static HRESULT WINAPI KeyEventSink_OnTestKeyUp ( ITfKeyEventSink iface,
ITfContext pic,
WPARAM  wParam,
LPARAM  lParam,
BOOL pfEaten 
)
static

Definition at line 1262 of file inputprocessor.c.

1264 {
1265  trace("\n");
1266  return S_OK;
1267 }
#define trace(...)
Definition: kmt_test.h:217
#define S_OK
Definition: intsafe.h:59

◆ KeyEventSink_QueryInterface()

static HRESULT WINAPI KeyEventSink_QueryInterface ( ITfKeyEventSink iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 1213 of file inputprocessor.c.

1214 {
1215  *ppvOut = NULL;
1216 
1217  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfKeyEventSink))
1218  {
1219  *ppvOut = iface;
1220  }
1221 
1222  if (*ppvOut)
1223  {
1224  ITfKeyEventSink_AddRef(iface);
1225  return S_OK;
1226  }
1227 
1228  return E_NOINTERFACE;
1229 }
#define E_NOINTERFACE
Definition: winerror.h:2364
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ KeyEventSink_Release()

static ULONG WINAPI KeyEventSink_Release ( ITfKeyEventSink iface)
static

Definition at line 1237 of file inputprocessor.c.

1238 {
1240  ULONG ret;
1241 
1242  ret = InterlockedDecrement(&This->refCount);
1243  if (ret == 0)
1245  return ret;
1246 }
static KeyEventSink * impl_from_ITfKeyEventSink(ITfKeyEventSink *iface)
static void KeyEventSink_Destructor(KeyEventSink *This)
int ret
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

◆ processPendingMessages()

static void processPendingMessages ( void  )
static

Definition at line 2169 of file inputprocessor.c.

2170 {
2171  MSG msg;
2172  int diff = 200;
2173  int min_timeout = 100;
2174  DWORD time = GetTickCount() + diff;
2175 
2176  while (diff > 0)
2177  {
2178  if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT)
2179  break;
2180  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
2181  {
2184  }
2185  diff = time - GetTickCount();
2186  }
2187 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
__u16 time
Definition: mkdosfs.c:366
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define QS_ALLINPUT
Definition: winuser.h:874
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by START_TEST(), and test_AssociateFocus().

◆ RegisterTextService()

static HRESULT RegisterTextService ( REFCLSID  rclsid)
static

Definition at line 908 of file inputprocessor.c.

909 {
911  return CoRegisterClassObject(rclsid, (IUnknown*) cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &regid);
912 }
static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut)
static HRESULT TextService_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2806
static DWORD regid

Referenced by test_Register().

◆ START_TEST()

START_TEST ( inputprocessor  )

Definition at line 2388 of file inputprocessor.c.

2389 {
2390  if (SUCCEEDED(initialize()))
2391  {
2392  test_Register();
2394  Sleep(2000); /* Win7 needs some time before the registrations become active */
2398  test_Enable();
2400  test_Activate();
2403  test_TfGuidAtom();
2404  test_ClientId();
2409  test_endSession();
2411  test_Disable();
2415  test_Unregister();
2416  test_profile_mgr();
2417 
2418  ITextStoreACPSink_Release(ACPSink);
2419  ITfDocumentMgr_Release(g_dm);
2420  }
2421  else
2422  skip("Unable to create InputProcessor\n");
2423  cleanup();
2424 }
static void processPendingMessages(void)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:736
static void test_ThreadMgrUnadviseSinks(void)
static void test_EnumInputProcessorInfo(void)
static void test_RegisterCategory(void)
static void test_DocumentMgrUnadviseSinks(void)
static void test_EnumLanguageProfiles(void)
static ITextStoreACPSink * ACPSink
static void test_TfGuidAtom(void)
static void test_Disable(void)
static void test_Enable(void)
static void test_ClientId(void)
static void cleanup(void)
static void test_TStoApplicationText(void)
static void test_Register(void)
static void test_endSession(void)
static void test_Unregister(void)
static void test_Compartments(void)
static void test_FindClosestCategory(void)
static void test_KeystrokeMgr(void)
static void test_UnregisterCategory(void)
static void test_profile_mgr(void)
#define skip(...)
Definition: CString.cpp:57
static void test_startSession(void)
static HRESULT initialize(void)
static void test_Activate(void)
static void test_ThreadMgrAdviseSinks(void)
static void test_AssociateFocus(void)
static void test_DocumentMgrAdviseSinks(void)
static ITfDocumentMgr * g_dm
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ test_Activate()

static void test_Activate ( void  )
static

Definition at line 1376 of file inputprocessor.c.

1377 {
1378  HRESULT hr;
1379 
1380  test_ShouldActivate = TRUE; /* Win7 */
1381  hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService);
1382  ok(SUCCEEDED(hr),"Failed to Activate text service\n");
1384 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static BOOL test_ShouldActivate
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
static LANGID gLangid
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_AssociateFocus()

static void test_AssociateFocus ( void  )
static

Definition at line 2189 of file inputprocessor.c.

2190 {
2191  ITfDocumentMgr *dm1, *dm2, *olddm, *dmcheck, *dmorig;
2192  HWND wnd1, wnd2, wnd3;
2193  HRESULT hr;
2194 
2195  ITfThreadMgr_GetFocus(g_tm, &dmorig);
2197  test_PrevFocus = dmorig;
2198  test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */
2200  hr = ITfThreadMgr_SetFocus(g_tm,NULL);
2201  ok(SUCCEEDED(hr),"ITfThreadMgr_SetFocus failed\n");
2202  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2204  ITfDocumentMgr_Release(dmorig);
2205 
2206  hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dm1);
2207  ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
2208 
2209  hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dm2);
2210  ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
2211 
2212  wnd1 = CreateWindowA("edit",NULL,WS_POPUP,0,0,200,60,NULL,NULL,NULL,NULL);
2213  ok(wnd1!=NULL,"Unable to create window 1\n");
2214  wnd2 = CreateWindowA("edit",NULL,WS_POPUP,0,65,200,60,NULL,NULL,NULL,NULL);
2215  ok(wnd2!=NULL,"Unable to create window 2\n");
2216  wnd3 = CreateWindowA("edit",NULL,WS_POPUP,0,130,200,60,NULL,NULL,NULL,NULL);
2217  ok(wnd3!=NULL,"Unable to create window 3\n");
2218 
2220 
2221  test_OnInitDocumentMgr = SINK_OPTIONAL; /* Vista and greater */
2222  test_OnPushContext = SINK_OPTIONAL; /* Vista and greater */
2223  test_OnSetFocus = SINK_OPTIONAL; /* Win7 */
2224  test_PrevFocus = NULL;
2226 
2227  ShowWindow(wnd1,SW_SHOWNORMAL);
2229  SetFocus(wnd1);
2230  sink_check_ok(&test_OnInitDocumentMgr,"OnInitDocumentMgr");
2231  sink_check_ok(&test_OnPushContext,"OnPushContext");
2232 
2233  test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */
2234  test_ACP_RequestLock = SINK_OPTIONAL; /* Win7 x64 */
2235  test_ACP_GetSelection = SINK_OPTIONAL; /* Win7 x64 */
2236  ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus);
2237  test_CurrentFocus = FOCUS_IGNORE; /* This is a default system context */
2239  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2242 
2243  test_CurrentFocus = dm1;
2247  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd1,dm1,&olddm);
2248  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2249  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2251 
2253 
2254  ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2255  ok(dmcheck == dm1 || broken(dmcheck == dmorig /* Win7+ */), "Expected DocumentMgr not focused\n");
2256  ITfDocumentMgr_Release(dmcheck);
2257 
2258  /* We need to explicitly set focus on Win7+ */
2259  test_CurrentFocus = dm1;
2261  test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7+ */
2262  ITfThreadMgr_SetFocus(g_tm, dm1);
2263  sink_check_ok(&test_OnSetFocus, "OnSetFocus");
2264 
2265  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,dm2,&olddm);
2266  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2268  ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2269  ok(dmcheck == dm1, "Expected DocumentMgr not focused\n");
2270  ITfDocumentMgr_Release(dmcheck);
2271 
2272  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd3,dm2,&olddm);
2273  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2275  ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2276  ok(dmcheck == dm1, "Expected DocumentMgr not focused\n");
2277  ITfDocumentMgr_Release(dmcheck);
2278 
2282  test_ShouldDeactivate = TRUE; /* win 8/10 */
2283  ShowWindow(wnd2,SW_SHOWNORMAL);
2284  SetFocus(wnd2);
2285  sink_check_saved(&test_OnSetFocus,dm1,dm2,"OnSetFocus");
2286  test_CurrentFocus = FOCUS_IGNORE; /* occasional wine race */
2287  test_PrevFocus = FOCUS_IGNORE; /* occasional wine race */
2288  test_OnSetFocus = SINK_IGNORE; /* occasional wine race */
2291 
2292  ShowWindow(wnd3,SW_SHOWNORMAL);
2293  SetFocus(wnd3);
2295 
2299  SetFocus(wnd1);
2301  sink_check_saved(&test_OnSetFocus,dm2,dm1,"OnSetFocus");
2302 
2303  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd3,NULL,&olddm);
2304  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2305  ok(olddm == dm2, "incorrect old DocumentMgr returned\n");
2306  ITfDocumentMgr_Release(olddm);
2307 
2308  test_CurrentFocus = dmorig;
2309  test_PrevFocus = dm1;
2310  test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7+ */
2312  ITfThreadMgr_SetFocus(g_tm,dmorig);
2313  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2314 
2318  SetFocus(wnd3);
2320  sink_check_saved(&test_OnSetFocus,dmorig,FOCUS_IGNORE,"OnSetFocus"); /* CurrentFocus NULL on XP, system default on Vista */
2321 
2322  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,NULL,&olddm);
2323  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2324  ok(olddm == dm2, "incorrect old DocumentMgr returned\n");
2325  ITfDocumentMgr_Release(olddm);
2326  hr = ITfThreadMgr_AssociateFocus(g_tm,wnd1,NULL,&olddm);
2327  ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2328  ok(olddm == dm1, "incorrect old DocumentMgr returned\n");
2329  ITfDocumentMgr_Release(olddm);
2330 
2331  test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */
2334  SetFocus(wnd2);
2336  SetFocus(wnd1);
2339 
2340  ITfDocumentMgr_Release(dm1);
2341  ITfDocumentMgr_Release(dm2);
2342 
2343  test_CurrentFocus = dmorig;
2347  ITfThreadMgr_SetFocus(g_tm,dmorig);
2348  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2349 
2350  test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */
2353  DestroyWindow(wnd1);
2354  DestroyWindow(wnd2);
2355  test_OnPopContext = SINK_OPTIONAL; /* Vista and greater */
2356  test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */
2357  ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus);
2359  test_ShouldDeactivate = TRUE; /* Win7 */
2360  DestroyWindow(wnd3);
2362  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2363  sink_check_ok(&test_OnPopContext,"OnPopContext");
2364 }
static void processPendingMessages(void)
#define TRUE
Definition: types.h:120
static INT test_OnPopContext
HRESULT hr
Definition: shlfolder.c:183
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SINK_UNEXPECTED
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
static BOOL test_ShouldDeactivate
#define SINK_SAVE
#define SINK_OPTIONAL
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
static INT test_OnPushContext
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfDocumentMgr * test_CurrentFocus
#define sink_check_saved(s, p, c, n)
static ITfThreadMgr * g_tm
static INT test_ACP_GetStatus
static INT test_OnInitDocumentMgr
LONG HRESULT
Definition: typedefs.h:77
static INT test_OnSetFocus
static INT test_ACP_GetSelection
#define FOCUS_IGNORE
#define broken(x)
Definition: _sntprintf.h:21
#define SW_SHOWNORMAL
Definition: winuser.h:764
static INT test_ACP_RequestLock
static ITfDocumentMgr * test_PrevFocus
#define SINK_IGNORE
#define WS_POPUP
Definition: pedump.c:616
#define sink_check_ok(a, b)
#define FOCUS_SAVE
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_ClientId()

static void test_ClientId ( void  )
static

Definition at line 1817 of file inputprocessor.c.

1818 {
1819  ITfClientId *pcid;
1820  TfClientId id1,id2;
1821  HRESULT hr;
1822  GUID g2;
1823 
1824  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfClientId, (LPVOID*)&pcid);
1825  ok(SUCCEEDED(hr),"Unable to acquire ITfClientId interface\n");
1826 
1827  CoCreateGuid(&g2);
1828 
1829  hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id1);
1830  ok(SUCCEEDED(hr),"GetClientId failed\n");
1831  hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id2);
1832  ok(SUCCEEDED(hr),"GetClientId failed\n");
1833  ok(id1==id2,"Id's for GUID_NULL do not match\n");
1834  hr = ITfClientId_GetClientId(pcid,&CLSID_FakeService,&id2);
1835  ok(SUCCEEDED(hr),"GetClientId failed\n");
1836  ok(id2!=id1,"Id matches GUID_NULL\n");
1837  ok(id2==tid,"Id for CLSID_FakeService not matching tid\n");
1838  ok(id2!=cid,"Id for CLSID_FakeService matching cid\n");
1839  hr = ITfClientId_GetClientId(pcid,&g2,&id2);
1840  ok(SUCCEEDED(hr),"GetClientId failed\n");
1841  ok(id2!=id1,"Id matches GUID_NULL\n");
1842  ok(id2!=tid,"Id for random guid matching tid\n");
1843  ok(id2!=cid,"Id for random guid matching cid\n");
1844  ITfClientId_Release(pcid);
1845 }
HRESULT hr
Definition: shlfolder.c:183
static TfClientId cid
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI CoCreateGuid(GUID *pguid)
Definition: compobj.c:2115
#define GUID_NULL
Definition: ks.h:106
DWORD TfClientId
Definition: msctf.idl:68
static TfClientId tid
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_Compartments()

static void test_Compartments ( void  )
static

Definition at line 2119 of file inputprocessor.c.

2120 {
2121  ITfContext *cxt;
2122  ITfDocumentMgr *dm;
2123  ITfCompartmentMgr *cmpmgr;
2125  HRESULT hr;
2126 
2127  ITfThreadMgr_GetFocus(g_tm, &dm);
2128  ITfDocumentMgr_GetTop(dm,&cxt);
2129 
2130  /* Global */
2131  hr = ITfThreadMgr_GetGlobalCompartment(g_tm, &cmpmgr);
2132  ok(SUCCEEDED(hr),"GetGlobalCompartment failed\n");
2133  hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &GUID_COMPARTMENT_SPEECH_OPENCLOSE, &cmp);
2134  ok(SUCCEEDED(hr),"GetCompartment failed\n");
2135  ITfCompartment_Release(cmp);
2137  ITfCompartmentMgr_Release(cmpmgr);
2138 
2139  /* Thread */
2140  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2141  ok(SUCCEEDED(hr),"ThreadMgr QI for IID_ITfCompartmentMgr failed\n");
2142  hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &CLSID_FakeService, &cmp);
2143  ok(SUCCEEDED(hr),"GetCompartment failed\n");
2144  enum_compartments(cmpmgr,&CLSID_FakeService,&GUID_COMPARTMENT_SPEECH_OPENCLOSE);
2145  ITfCompartmentMgr_ClearCompartment(cmpmgr,tid,&CLSID_FakeService);
2146  enum_compartments(cmpmgr,NULL,&CLSID_FakeService);
2147  ITfCompartmentMgr_Release(cmpmgr);
2148  ITfCompartment_Release(cmp);
2149 
2150  /* DocumentMgr */
2151  hr = ITfDocumentMgr_QueryInterface(dm, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2152  ok(SUCCEEDED(hr),"DocumentMgr QI for IID_ITfCompartmentMgr failed\n");
2153 
2154  hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &GUID_COMPARTMENT_PERSISTMENUENABLED, &cmp);
2155  ok(SUCCEEDED(hr),"GetCompartment failed\n");
2157  ITfCompartmentMgr_Release(cmpmgr);
2158 
2159  /* Context */
2160  hr = ITfContext_QueryInterface(cxt, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2161  ok(SUCCEEDED(hr),"Context QI for IID_ITfCompartmentMgr failed\n");
2163  ITfCompartmentMgr_Release(cmpmgr);
2164 
2165  ITfContext_Release(cxt);
2166  ITfDocumentMgr_Release(dm);
2167 }
static void enum_compartments(ITfCompartmentMgr *cmpmgr, REFGUID present, REFGUID absent)
HRESULT hr
Definition: shlfolder.c:183
EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_OPENCLOSE
Definition: msctf.idl:55
#define cmp(status, error)
Definition: error.c:114
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
EXTERN_C const GUID GUID_COMPARTMENT_PERSISTMENUENABLED
Definition: msctf.idl:57
static TfClientId tid
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_Disable()

static void test_Disable ( void  )
static

Definition at line 1104 of file inputprocessor.c.

1105 {
1106  HRESULT hr;
1107 
1108  trace("Disabling\n");
1109  hr = ITfInputProcessorProfiles_EnableLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, FALSE);
1110  ok(SUCCEEDED(hr),"Failed to disable text service\n");
1111 }
#define trace(...)
Definition: kmt_test.h:217
HRESULT hr
Definition: shlfolder.c:183
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
static LANGID gLangid
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_DocumentMgrAdviseSinks()

static void test_DocumentMgrAdviseSinks ( void  )
static

Definition at line 1166 of file inputprocessor.c.

1167 {
1168  ITfSource *source;
1169  HRESULT hr;
1170 
1171  hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source);
1172  ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n");
1173 
1174  dmSinkCookie = 0;
1175  hr = ITfSource_AdviseSink(source, &IID_ITfTransitoryExtensionSink, (IUnknown*)&TfTransitoryExtensionSink, &dmSinkCookie);
1176  ok(hr == S_OK,"Failed to Advise Sink\n");
1177 
1178  ITfSource_Release(source);
1179 }
HRESULT hr
Definition: shlfolder.c:183
static ITfTransitoryExtensionSink TfTransitoryExtensionSink
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static DWORD dmSinkCookie
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
static ITfDocumentMgr * g_dm

Referenced by START_TEST().

◆ test_DocumentMgrUnadviseSinks()

static void test_DocumentMgrUnadviseSinks ( void  )
static

Definition at line 1181 of file inputprocessor.c.

1182 {
1183  ITfSource *source = NULL;
1184  HRESULT hr;
1185 
1186  hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source);
1187  ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n");
1188 
1189  hr = ITfSource_UnadviseSink(source, dmSinkCookie);
1190  ok(hr == S_OK,"Failed to unadvise Sink\n");
1191  ITfSource_Release(source);
1192 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static DWORD dmSinkCookie
static ITfDocumentMgr * g_dm

Referenced by START_TEST().

◆ test_Enable()

static void test_Enable ( void  )
static

Definition at line 1092 of file inputprocessor.c.

1093 {
1094  HRESULT hr;
1095  BOOL enabled = FALSE;
1096 
1097  hr = ITfInputProcessorProfiles_EnableLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, TRUE);
1098  ok(SUCCEEDED(hr),"Failed to enable text service\n");
1099  hr = ITfInputProcessorProfiles_IsEnabledLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, &enabled);
1100  ok(SUCCEEDED(hr),"Failed to get enabled state\n");
1101  ok(enabled == TRUE,"enabled state incorrect\n");
1102 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
static LANGID gLangid
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_endSession()

static void test_endSession ( void  )
static

Definition at line 1765 of file inputprocessor.c.

1766 {
1767  HRESULT hr;
1770  test_PrevFocus = g_dm;
1771  test_OnSetFocus = SINK_OPTIONAL; /* Doesn't fire on Win7 */
1772  hr = ITfThreadMgr_Deactivate(g_tm);
1773  ok(SUCCEEDED(hr),"Failed to Deactivate\n");
1774  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
1776 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define SINK_UNEXPECTED
static BOOL test_ShouldDeactivate
#define SINK_OPTIONAL
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfDocumentMgr * test_CurrentFocus
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
static INT test_OnSetFocus
static ITfDocumentMgr * test_PrevFocus
#define sink_check_ok(a, b)
static ITfDocumentMgr * g_dm
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_EnumContexts()

static void test_EnumContexts ( ITfDocumentMgr dm,
ITfContext search 
)
static

Definition at line 1387 of file inputprocessor.c.

1388 {
1389  HRESULT hr;
1390  IEnumTfContexts* pEnum;
1391  BOOL found = FALSE;
1392 
1393  hr = ITfDocumentMgr_EnumContexts(dm,&pEnum);
1394  ok(SUCCEEDED(hr),"EnumContexts failed\n");
1395  if (SUCCEEDED(hr))
1396  {
1397  ULONG fetched;
1398  ITfContext *cxt;
1399  while (IEnumTfContexts_Next(pEnum, 1, &cxt, &fetched) == S_OK)
1400  {
1401  if (!search)
1402  found = TRUE;
1403  else if (search == cxt)
1404  found = TRUE;
1405  ITfContext_Release(cxt);
1406  }
1407  IEnumTfContexts_Release(pEnum);
1408  }
1409  if (search)
1410  ok(found,"Did not find proper ITfContext\n");
1411  else
1412  ok(!found,"Found an ITfContext we should should not have\n");
1413 }
static short search(int val, const short *table, int size)
Definition: msg711.c:255
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_startSession().

◆ test_EnumDocumentMgr()

static void test_EnumDocumentMgr ( ITfThreadMgr tm,
ITfDocumentMgr search,
ITfDocumentMgr absent 
)
static

Definition at line 1415 of file inputprocessor.c.

1416 {
1417  HRESULT hr;
1418  IEnumTfDocumentMgrs* pEnum;
1419  BOOL found = FALSE;
1420  BOOL notfound = TRUE;
1421 
1422  hr = ITfThreadMgr_EnumDocumentMgrs(tm,&pEnum);
1423  ok(SUCCEEDED(hr),"EnumDocumentMgrs failed\n");
1424  if (SUCCEEDED(hr))
1425  {
1426  ULONG fetched;
1427  ITfDocumentMgr *dm;
1428  while (IEnumTfDocumentMgrs_Next(pEnum, 1, &dm, &fetched) == S_OK)
1429  {
1430  if (!search)
1431  found = TRUE;
1432  else if (search == dm)
1433  found = TRUE;
1434  if (absent && dm == absent)
1435  notfound = FALSE;
1436  ITfDocumentMgr_Release(dm);
1437  }
1438  IEnumTfDocumentMgrs_Release(pEnum);
1439  }
1440  if (search)
1441  ok(found,"Did not find proper ITfDocumentMgr\n");
1442  else
1443  ok(!found,"Found an ITfDocumentMgr we should should not have\n");
1444  if (absent)
1445  ok(notfound,"Found an ITfDocumentMgr we believe should be absent\n");
1446 }
static short search(int val, const short *table, int size)
Definition: msg711.c:255
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
Definition: time.h:76
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_startSession().

◆ test_EnumInputProcessorInfo()

static void test_EnumInputProcessorInfo ( void  )
static

Definition at line 1008 of file inputprocessor.c.

1009 {
1010  IEnumGUID *ppEnum;
1011  BOOL found = FALSE;
1012 
1013  if (SUCCEEDED(ITfInputProcessorProfiles_EnumInputProcessorInfo(g_ipp, &ppEnum)))
1014  {
1015  ULONG fetched;
1016  GUID g;
1017  while (IEnumGUID_Next(ppEnum, 1, &g, &fetched) == S_OK)
1018  {
1019  if(IsEqualGUID(&g,&CLSID_FakeService))
1020  found = TRUE;
1021  }
1022  IEnumGUID_Release(ppEnum);
1023  }
1024  ok(found,"Did not find registered text service\n");
1025 }
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
Definition: CComObject.cpp:34
GLboolean GLboolean g
Definition: glext.h:6204
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
unsigned int ULONG
Definition: retypes.h:1
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_EnumLanguageProfiles()

static void test_EnumLanguageProfiles ( void  )
static

Definition at line 1027 of file inputprocessor.c.

1028 {
1029  BOOL found = FALSE;
1030  IEnumTfLanguageProfiles *ppEnum;
1031  HRESULT hr;
1032 
1033  hr = ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp, gLangid, NULL);
1034  ok(hr == E_INVALIDARG, "EnumLanguageProfiles failed: %x\n", hr);
1035 
1036  if (SUCCEEDED(ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp,gLangid,&ppEnum)))
1037  {
1039  while (IEnumTfLanguageProfiles_Next(ppEnum,1,&profile,NULL)==S_OK)
1040  {
1041  if (IsEqualGUID(&profile.clsid,&CLSID_FakeService))
1042  {
1043  found = TRUE;
1044  ok(profile.langid == gLangid, "LangId Incorrect\n");
1046  broken(IsEqualGUID(&profile.catid,&GUID_NULL) /* Win8 */), "CatId Incorrect\n");
1047  ok(IsEqualGUID(&profile.guidProfile,&CLSID_FakeService), "guidProfile Incorrect\n");
1048  }
1049  }
1050  IEnumTfLanguageProfiles_Release(ppEnum);
1051  }
1052  ok(found,"Registered text service not found\n");
1053 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
unsigned int BOOL
Definition: ntddk_ex.h:94
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
#define GUID_NULL
Definition: ks.h:106
#define broken(x)
Definition: _sntprintf.h:21
#define S_OK
Definition: intsafe.h:59
static LANGID gLangid
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:62
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define profile
Definition: kernel32.h:12
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_FindClosestCategory()

static void test_FindClosestCategory ( void  )
static

Definition at line 1073 of file inputprocessor.c.

1074 {
1075  GUID output;
1076  HRESULT hr;
1078 
1079  hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, NULL, 0);
1080  ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1082 
1083  hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, list, 1);
1084  ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1085  ok(IsEqualGUID(&output,&GUID_NULL),"Wrong GUID\n");
1086 
1087  hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, list, 3);
1088  ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1089  ok(IsEqualGUID(&output,&GUID_TFCAT_TIP_KEYBOARD),"Wrong GUID\n");
1090 }
static ITfCategoryMgr * g_cm
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
HRESULT hr
Definition: shlfolder.c:183
EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH
Definition: msctf.idl:63
EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING
Definition: msctf.idl:64
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
#define GUID_NULL
Definition: ks.h:106
Definition: _list.h:228
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:62
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER
Definition: msctf.idl:65
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_InsertAtSelection()

static void test_InsertAtSelection ( TfEditCookie  ec,
ITfContext cxt 
)
static

Definition at line 1901 of file inputprocessor.c.

1902 {
1903  HRESULT hr;
1904  ITfInsertAtSelection *iis;
1905  ITfRange *range=NULL;
1906  static const WCHAR txt[] = {'H','e','l','l','o',' ','W','o','r','l','d',0};
1907 
1908  hr = ITfContext_QueryInterface(cxt, &IID_ITfInsertAtSelection , (LPVOID*)&iis);
1909  ok(SUCCEEDED(hr),"Failed to get ITfInsertAtSelection interface\n");
1911  hr = ITfInsertAtSelection_InsertTextAtSelection(iis, ec, 0, txt, 11, &range);
1912  ok(SUCCEEDED(hr),"ITfInsertAtSelection_InsertTextAtSelection failed %x\n",hr);
1913  sink_check_ok(&test_ACP_InsertTextAtSelection,"InsertTextAtSelection");
1914  ok(range != NULL,"No range returned\n");
1915  ITfRange_Release(range);
1916  ITfInsertAtSelection_Release(iis);
1917 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
#define SINK_EXPECTED
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
GLenum GLint * range
Definition: glext.h:7539
static INT test_ACP_InsertTextAtSelection
#define sink_check_ok(a, b)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by EditSession_DoEditSession().

◆ test_KeystrokeMgr()

static void test_KeystrokeMgr ( void  )
static

Definition at line 1320 of file inputprocessor.c.

1321 {
1322  ITfKeystrokeMgr *keymgr= NULL;
1323  HRESULT hr;
1324  TF_PRESERVEDKEY tfpk;
1325  BOOL preserved;
1327 
1329 
1330  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfKeystrokeMgr, (LPVOID*)&keymgr);
1331  ok(SUCCEEDED(hr),"Failed to get IID_ITfKeystrokeMgr for ThreadMgr\n");
1332 
1333  tfpk.uVKey = 'A';
1334  tfpk.uModifiers = TF_MOD_SHIFT;
1335 
1337  hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
1338  ok(SUCCEEDED(hr),"ITfKeystrokeMgr_AdviseKeyEventSink failed\n");
1339  sink_check_ok(&test_KEV_OnSetFocus,"KeyEventSink_OnSetFocus");
1340  hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
1341  ok(hr == CONNECT_E_ADVISELIMIT,"Wrong return, expected CONNECT_E_ADVISELIMIT\n");
1342  hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,cid,sink,TRUE);
1343  ok(hr == E_INVALIDARG,"Wrong return, expected E_INVALIDARG\n");
1344 
1345  hr =ITfKeystrokeMgr_PreserveKey(keymgr, 0, &CLSID_PreservedKey, &tfpk, NULL, 0);
1346  ok(hr==E_INVALIDARG,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n");
1347 
1348  hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0);
1349  ok(SUCCEEDED(hr),"ITfKeystrokeMgr_PreserveKey failed\n");
1350 
1351  hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0);
1352  ok(hr == TF_E_ALREADY_EXISTS,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n");
1353 
1354  preserved = FALSE;
1355  hr = ITfKeystrokeMgr_IsPreservedKey(keymgr, &CLSID_PreservedKey, &tfpk, &preserved);
1356  ok(hr == S_OK, "ITfKeystrokeMgr_IsPreservedKey failed\n");
1357  if (hr == S_OK) ok(preserved == TRUE,"misreporting preserved key\n");
1358 
1359  hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk);
1360  ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnpreserveKey failed\n");
1361 
1362  hr = ITfKeystrokeMgr_IsPreservedKey(keymgr, &CLSID_PreservedKey, &tfpk, &preserved);
1363  ok(hr == S_FALSE, "ITfKeystrokeMgr_IsPreservedKey failed\n");
1364  if (hr == S_FALSE) ok(preserved == FALSE,"misreporting preserved key\n");
1365 
1366  hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk);
1367  ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey improperly succeeded\n");
1368 
1369  hr = ITfKeystrokeMgr_UnadviseKeyEventSink(keymgr,tid);
1370  ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnadviseKeyEventSink failed\n");
1371 
1372  ITfKeystrokeMgr_Release(keymgr);
1373  ITfKeyEventSink_Release(sink);
1374 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define CONNECT_E_ADVISELIMIT
Definition: olectl.h:252
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251
static HRESULT KeyEventSink_Constructor(ITfKeyEventSink **ppOut)
static INT test_KEV_OnSetFocus
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
UINT uModifiers
Definition: msctf.idl:129
static TfClientId cid
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
#define SINK_EXPECTED
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define sink_check_ok(a, b)
static TfClientId tid
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_profile_mgr()

static void test_profile_mgr ( void  )
static

Definition at line 2366 of file inputprocessor.c.

2367 {
2368  IEnumTfInputProcessorProfiles *enum_profiles;
2369  ITfInputProcessorProfileMgr *ipp_mgr;
2370  HRESULT hres;
2371 
2372  hres = ITfInputProcessorProfiles_QueryInterface(g_ipp, &IID_ITfInputProcessorProfileMgr, (void**)&ipp_mgr);
2373  if (hres != S_OK)
2374  {
2375  win_skip("ITfInputProcessorProfileMgr is not supported.\n");
2376  return;
2377  }
2378  ok(hres == S_OK, "Could not get ITfInputProcessorProfileMgr iface: %08x\n", hres);
2379 
2380  hres = ITfInputProcessorProfileMgr_EnumProfiles(ipp_mgr, 0, &enum_profiles);
2381  ok(hres == S_OK, "EnumProfiles failed: %08x\n", hres);
2382 
2383  IEnumTfInputProcessorProfiles_Release(enum_profiles);
2384 
2385  ITfInputProcessorProfileMgr_Release(ipp_mgr);
2386 }
#define ok(value,...)
Definition: CComObject.cpp:34
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static ITfInputProcessorProfiles * g_ipp
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_Register()

static void test_Register ( void  )
static

Definition at line 980 of file inputprocessor.c.

981 {
982  HRESULT hr;
983 
984  static const WCHAR szDesc[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',0};
985  static const WCHAR szFile[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',' ','F','i','l','e',0};
986 
987  hr = ITfInputProcessorProfiles_GetCurrentLanguage(g_ipp,&gLangid);
988  ok(SUCCEEDED(hr),"Unable to get current language id\n");
989  trace("Current Language %x\n",gLangid);
990 
991  hr = RegisterTextService(&CLSID_FakeService);
992  ok(SUCCEEDED(hr),"Unable to register COM for TextService\n");
993  hr = ITfInputProcessorProfiles_Register(g_ipp, &CLSID_FakeService);
994  ok(SUCCEEDED(hr),"Unable to register text service(%x)\n",hr);
995  hr = ITfInputProcessorProfiles_AddLanguageProfile(g_ipp, &CLSID_FakeService, gLangid,
996  &CLSID_FakeService, szDesc, ARRAY_SIZE(szDesc), szFile, ARRAY_SIZE(szFile), 1);
997  ok(SUCCEEDED(hr),"Unable to add Language Profile (%x)\n",hr);
998 }
#define trace(...)
Definition: kmt_test.h:217
HRESULT hr
Definition: shlfolder.c:183
#define ok(value,...)
Definition: CComObject.cpp:34
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HRESULT RegisterTextService(REFCLSID rclsid)
static LANGID gLangid
#define ARRAY_SIZE(a)
Definition: main.h:24
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_RegisterCategory()

static void test_RegisterCategory ( void  )
static

Definition at line 1055 of file inputprocessor.c.

1056 {
1057  HRESULT hr;
1058  hr = ITfCategoryMgr_RegisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_TIP_KEYBOARD, &CLSID_FakeService);
1059  ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterCategory failed\n");
1060  hr = ITfCategoryMgr_RegisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &CLSID_FakeService);
1061  ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterCategory failed\n");
1062 }
static ITfCategoryMgr * g_cm
HRESULT hr
Definition: shlfolder.c:183
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:62
EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER
Definition: msctf.idl:65
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_startSession()

static void test_startSession ( void  )
static

Definition at line 1541 of file inputprocessor.c.

1542 {
1543  HRESULT hr;
1544  DWORD cnt;
1545  DWORD editCookie;
1546  ITfDocumentMgr *dmtest;
1547  ITfContext *cxt,*cxt2,*cxt3,*cxtTest;
1548  ITextStoreACP *ts = NULL;
1549  TfClientId cid2 = 0;
1550  ITfThreadMgrEx *tmex;
1551 
1552  hr = ITfThreadMgr_Deactivate(g_tm);
1553  ok(hr == E_UNEXPECTED,"Deactivate should have failed with E_UNEXPECTED\n");
1554 
1556  hr = ITfThreadMgr_Activate(g_tm,&cid);
1557  ok(SUCCEEDED(hr),"Failed to Activate\n");
1558  ok(cid != tid,"TextService id mistakenly matches Client id\n");
1559 
1561  hr = ITfThreadMgr_Activate(g_tm,&cid2);
1562  ok(SUCCEEDED(hr),"Failed to Activate\n");
1563  ok(cid == cid2, "Second activate client ID does not match\n");
1564 
1565  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfThreadMgrEx, (void **)&tmex);
1566  if (hr == S_OK)
1567  {
1568  hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0);
1569  ok(SUCCEEDED(hr), "Failed to Activate\n");
1570  ok(cid == cid2, "ActivateEx client ID does not match\n");
1571 
1572  ITfThreadMgrEx_Release(tmex);
1573  }
1574  else
1575  win_skip("ITfThreadMgrEx is not supported\n");
1576 
1577  hr = ITfThreadMgr_Deactivate(g_tm);
1578  ok(SUCCEEDED(hr), "Failed to Deactivate\n");
1579  hr = ITfThreadMgr_Deactivate(g_tm);
1580  ok(SUCCEEDED(hr), "Failed to Deactivate\n");
1581 
1583 
1584  hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&g_dm);
1585  ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
1586 
1588 
1589  hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dmtest);
1590  ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
1591 
1592  test_EnumDocumentMgr(g_tm,dmtest,NULL);
1593 
1594  ITfDocumentMgr_Release(dmtest);
1595  test_EnumDocumentMgr(g_tm,g_dm,dmtest);
1596 
1597  hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1598  ok(SUCCEEDED(hr),"GetFocus Failed\n");
1599  ok(dmtest == NULL,"Initial focus not null\n");
1600 
1602  test_PrevFocus = NULL;
1603  test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */
1604  hr = ITfThreadMgr_SetFocus(g_tm,g_dm);
1605  ok(SUCCEEDED(hr),"SetFocus Failed\n");
1606  sink_check_ok(&test_OnSetFocus,"OnSetFocus");
1607 
1608  hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1609  ok(SUCCEEDED(hr),"GetFocus Failed\n");
1610  ok(g_dm == dmtest,"Expected DocumentMgr not focused\n");
1611 
1612  ITfDocumentMgr_Release(g_dm);
1613 
1614  hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1615  ok(SUCCEEDED(hr),"GetFocus Failed\n");
1616  ok(g_dm == dmtest,"Expected DocumentMgr not focused\n");
1617  ITfDocumentMgr_Release(dmtest);
1618 
1620  ok(SUCCEEDED(hr),"Constructor Failed\n");
1621  if (FAILED(hr)) return;
1622 
1623  hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt, &editCookie);
1624  ok(SUCCEEDED(hr),"CreateContext Failed\n");
1625 
1626  hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, NULL, &cxt2, &editCookie);
1627  ok(SUCCEEDED(hr),"CreateContext Failed\n");
1628 
1629  hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, NULL, &cxt3, &editCookie);
1630  ok(SUCCEEDED(hr),"CreateContext Failed\n");
1631 
1633 
1634  hr = ITfContext_GetDocumentMgr(cxt,&dmtest);
1635  ok(hr == S_OK, "ITfContext_GetDocumentMgr failed with %x\n",hr);
1636  ok(dmtest == g_dm, "Wrong documentmgr\n");
1637  ITfDocumentMgr_Release(dmtest);
1638 
1639  cnt = check_context_refcount(cxt);
1643  hr = ITfDocumentMgr_Push(g_dm, cxt);
1644  ok(SUCCEEDED(hr),"Push Failed\n");
1645  ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1646  sink_check_ok(&test_OnPushContext,"OnPushContext");
1647  sink_check_ok(&test_OnInitDocumentMgr,"OnInitDocumentMgr");
1648  sink_check_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
1649 
1650  test_EnumContexts(g_dm, cxt);
1651 
1652  hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1653  ok(SUCCEEDED(hr),"GetTop Failed\n");
1654  ok(cxtTest == cxt, "Wrong context on top\n");
1655  ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1656  cnt = ITfContext_Release(cxtTest);
1657 
1658  hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1659  ok(SUCCEEDED(hr),"GetBase Failed\n");
1660  ok(cxtTest == cxt, "Wrong context on Base\n");
1661  ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1662  ITfContext_Release(cxtTest);
1663 
1664  check_context_refcount(cxt2);
1666  hr = ITfDocumentMgr_Push(g_dm, cxt2);
1667  ok(SUCCEEDED(hr),"Push Failed\n");
1668  sink_check_ok(&test_OnPushContext,"OnPushContext");
1669 
1670  cnt = check_context_refcount(cxt2);
1671  hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1672  ok(SUCCEEDED(hr),"GetTop Failed\n");
1673  ok(cxtTest == cxt2, "Wrong context on top\n");
1674  ok(check_context_refcount(cxt2) > cnt, "Ref count did not increase\n");
1675  ITfContext_Release(cxtTest);
1676 
1677  cnt = check_context_refcount(cxt);
1678  hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1679  ok(SUCCEEDED(hr),"GetBase Failed\n");
1680  ok(cxtTest == cxt, "Wrong context on Base\n");
1681  ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1682  ITfContext_Release(cxtTest);
1683 
1684  cnt = check_context_refcount(cxt3);
1685  hr = ITfDocumentMgr_Push(g_dm, cxt3);
1686  ok(FAILED(hr),"Push Succeeded\n");
1687  ok(check_context_refcount(cxt3) == cnt, "Ref changed\n");
1688 
1689  cnt = check_context_refcount(cxt2);
1690  hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1691  ok(SUCCEEDED(hr),"GetTop Failed\n");
1692  ok(cxtTest == cxt2, "Wrong context on top\n");
1693  ok(check_context_refcount(cxt2) > cnt, "Ref count did not increase\n");
1694  ITfContext_Release(cxtTest);
1695 
1696  cnt = check_context_refcount(cxt);
1697  hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1698  ok(SUCCEEDED(hr),"GetBase Failed\n");
1699  ok(cxtTest == cxt, "Wrong context on Base\n");
1700  ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1701  ITfContext_Release(cxtTest);
1702 
1703  cnt = check_context_refcount(cxt2);
1705  hr = ITfDocumentMgr_Pop(g_dm, 0);
1706  ok(SUCCEEDED(hr),"Pop Failed\n");
1707  ok(check_context_refcount(cxt2) < cnt, "Ref count did not decrease\n");
1708  sink_check_ok(&test_OnPopContext,"OnPopContext");
1709 
1710  dmtest = (void *)0xfeedface;
1711  hr = ITfContext_GetDocumentMgr(cxt2,&dmtest);
1712  ok(hr == S_FALSE, "ITfContext_GetDocumentMgr wrong rc %x\n",hr);
1713  ok(dmtest == NULL,"returned documentmgr should be null\n");
1714 
1715  ITfContext_Release(cxt2);
1716 
1717  hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1718  ok(SUCCEEDED(hr),"GetTop Failed\n");
1719  ok(cxtTest == cxt, "Wrong context on top\n");
1720  ITfContext_Release(cxtTest);
1721 
1722  hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1723  ok(SUCCEEDED(hr),"GetBase Failed\n");
1724  ok(cxtTest == cxt, "Wrong context on base\n");
1725  ITfContext_Release(cxtTest);
1726 
1727  hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt2, &editCookie);
1728  ok(hr == S_OK,"CreateContext Failed\n");
1729 
1732  hr = ITfDocumentMgr_Push(g_dm, cxt2);
1733  ok(hr == S_OK,"Push Failed\n");
1734  sink_check_ok(&test_OnPushContext,"OnPushContext");
1735  sink_check_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
1736 
1738  cnt = check_context_refcount(cxt2);
1740  hr = ITfDocumentMgr_Pop(g_dm, 0);
1741  ok(hr == S_OK,"Pop Failed\n");
1742  ok(check_context_refcount(cxt2) < cnt, "Ref count did not decrease\n");
1743  sink_check_ok(&test_OnPopContext,"OnPopContext");
1744  sink_check_ok(&test_ACP_UnadviseSink,"TextStoreACP_AdviseSink");
1745 
1746  hr = ITfDocumentMgr_Pop(g_dm, 0);
1747  ok(FAILED(hr),"Pop Succeeded\n");
1748 
1749  hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1750  ok(SUCCEEDED(hr),"GetTop Failed\n");
1751  ok(cxtTest == cxt, "Wrong context on top\n");
1752  ITfContext_Release(cxtTest);
1753 
1754  hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1755  ok(SUCCEEDED(hr),"GetBase Failed\n");
1756  ok(cxtTest == cxt, "Wrong context on base\n");
1757  ITfContext_Release(cxtTest);
1758 
1759  ITfContext_Release(cxt);
1760  ITfContext_Release(cxt2);
1761  ITfContext_Release(cxt3);
1762  ITextStoreACP_Release(ts);
1763 }
#define TRUE
Definition: types.h:120
static INT test_OnPopContext
HRESULT hr
Definition: shlfolder.c:183
static TfClientId cid
#define SINK_OPTIONAL
#define S_FALSE
Definition: winerror.h:2357
static INT test_OnPushContext
static const char * ts(int t)
static BOOL test_ShouldActivate
smooth NULL
Definition: ftsmooth.c:416
static INT test_ACP_AdviseSink
#define ok(value,...)
Definition: CComObject.cpp:34
static int check_context_refcount(ITfContext *iface)
#define SINK_EXPECTED
static ITfDocumentMgr * test_CurrentFocus
static ITfThreadMgr * g_tm
static INT test_OnInitDocumentMgr
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static INT test_OnSetFocus
static INT test_ACP_UnadviseSink
static void test_EnumDocumentMgr(ITfThreadMgr *tm, ITfDocumentMgr *search, ITfDocumentMgr *absent)
#define S_OK
Definition: intsafe.h:59
static ITfDocumentMgr * test_PrevFocus
static void test_EnumContexts(ITfDocumentMgr *dm, ITfContext *search)
#define sink_check_ok(a, b)
#define E_UNEXPECTED
Definition: winerror.h:2456
DWORD TfClientId
Definition: msctf.idl:68
static HRESULT TextStoreACP_Constructor(IUnknown **ppOut)
#define win_skip
Definition: test.h:141
static TfClientId tid
static ITfDocumentMgr * g_dm
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_TfGuidAtom()

static void test_TfGuidAtom ( void  )
static

Definition at line 1778 of file inputprocessor.c.

1779 {
1780  GUID gtest,g1;
1781  HRESULT hr;
1782  TfGuidAtom atom1,atom2;
1783  BOOL equal;
1784 
1785  CoCreateGuid(&gtest);
1786 
1787  /* msdn reports this should return E_INVALIDARG. However my test show it crashing (winxp)*/
1788  /*
1789  hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,NULL);
1790  ok(hr==E_INVALIDARG,"ITfCategoryMgr_RegisterGUID should have failed\n");
1791  */
1792  hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,&atom1);
1793  ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterGUID failed\n");
1794  hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,&atom2);
1795  ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterGUID failed\n");
1796  ok(atom1 == atom2,"atoms do not match\n");
1797  hr = ITfCategoryMgr_GetGUID(g_cm,atom2,NULL);
1798  ok(hr==E_INVALIDARG,"ITfCategoryMgr_GetGUID should have failed\n");
1799  hr = ITfCategoryMgr_GetGUID(g_cm,atom2,&g1);
1800  ok(SUCCEEDED(hr),"ITfCategoryMgr_GetGUID failed\n");
1801  ok(IsEqualGUID(&g1,&gtest),"guids do not match\n");
1802  hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,atom1,&gtest,NULL);
1803  ok(hr==E_INVALIDARG,"ITfCategoryMgr_IsEqualTfGuidAtom should have failed\n");
1804  hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,atom1,&gtest,&equal);
1805  ok(SUCCEEDED(hr),"ITfCategoryMgr_IsEqualTfGuidAtom failed\n");
1806  ok(equal == TRUE,"Equal value invalid\n");
1807 
1808  /* show that cid and tid TfClientIds are also TfGuidAtoms */
1809  hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,tid,&CLSID_FakeService,&equal);
1810  ok(SUCCEEDED(hr),"ITfCategoryMgr_IsEqualTfGuidAtom failed\n");
1811  ok(equal == TRUE,"Equal value invalid\n");
1812  hr = ITfCategoryMgr_GetGUID(g_cm,cid,&g1);
1813  ok(SUCCEEDED(hr),"ITfCategoryMgr_GetGUID failed\n");
1814  ok(!IsEqualGUID(&g1,&GUID_NULL),"guid should not be NULL\n");
1815 }
static ITfCategoryMgr * g_cm
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define equal(x, y)
Definition: reader.cc:56
static TfClientId cid
unsigned int BOOL
Definition: ntddk_ex.h:94
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI CoCreateGuid(GUID *pguid)
Definition: compobj.c:2115
#define GUID_NULL
Definition: ks.h:106
DWORD TfGuidAtom
Definition: msctf.idl:69
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static TfClientId tid
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_ThreadMgrAdviseSinks()

static void test_ThreadMgrAdviseSinks ( void  )
static

Definition at line 1113 of file inputprocessor.c.

1114 {
1115  ITfSource *source = NULL;
1116  HRESULT hr;
1117  IUnknown *sink;
1118 
1119  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfSource, (LPVOID*)&source);
1120  ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for ThreadMgr\n");
1121  if (!source)
1122  return;
1123 
1125  ok(hr == S_OK, "got %08x\n", hr);
1126  if(FAILED(hr)) return;
1127 
1128  tmSinkRefCount = 1;
1129  tmSinkCookie = 0;
1130  hr = ITfSource_AdviseSink(source,&IID_ITfThreadMgrEventSink, sink, &tmSinkCookie);
1131  ok(hr == S_OK, "Failed to Advise Sink\n");
1132  ok(tmSinkCookie!=0,"Failed to get sink cookie\n");
1133 
1134  /* Advising the sink adds a ref, Releasing here lets the object be deleted
1135  when unadvised */
1136  tmSinkRefCount = 2;
1137  IUnknown_Release(sink);
1138 
1139  hr = ITfSource_AdviseSink(source, &IID_ITfKeyTraceEventSink, (IUnknown*)&TfKeyTraceEventSink,
1141  ok(hr == S_OK, "Failed to Advise Sink\n");
1142 
1143  ITfSource_Release(source);
1144 }
HRESULT hr
Definition: shlfolder.c:183
static DWORD key_trace_sink_cookie
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static DWORD tmSinkCookie
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfKeyTraceEventSink TfKeyTraceEventSink
static ITfThreadMgr * g_tm
static HRESULT ThreadMgrEventSink_Constructor(IUnknown **ppOut)
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static DWORD tmSinkRefCount
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_ThreadMgrUnadviseSinks()

static void test_ThreadMgrUnadviseSinks ( void  )
static

Definition at line 1146 of file inputprocessor.c.

1147 {
1148  ITfSource *source = NULL;
1149  HRESULT hr;
1150 
1151  hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfSource, (LPVOID*)&source);
1152  ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for ThreadMgr\n");
1153  if (!source)
1154  return;
1155 
1156  tmSinkRefCount = 1;
1157  hr = ITfSource_UnadviseSink(source, tmSinkCookie);
1158  ok(hr == S_OK, "Failed to unadvise Sink\n");
1159 
1160  hr = ITfSource_UnadviseSink(source, key_trace_sink_cookie);
1161  ok(hr == S_OK, "Failed to unadvise Sink\n");
1162 
1163  ITfSource_Release(source);
1164 }
HRESULT hr
Definition: shlfolder.c:183
static DWORD key_trace_sink_cookie
static DWORD tmSinkCookie
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
static ITfThreadMgr * g_tm
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static DWORD tmSinkRefCount
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_TStoApplicationText()

static void test_TStoApplicationText ( void  )
static

Definition at line 2021 of file inputprocessor.c.

2022 {
2023  HRESULT hr, hrSession;
2024  ITfEditSession *es;
2025  ITfContext *cxt;
2026  ITfDocumentMgr *dm;
2028  ITfSource *source = NULL;
2029  DWORD editSinkCookie = -1;
2030 
2031  ITfThreadMgr_GetFocus(g_tm, &dm);
2033  ITfDocumentMgr_GetTop(dm,&cxt);
2034 
2036  hr = ITfContext_QueryInterface(cxt,&IID_ITfSource,(LPVOID*)&source);
2037  ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for Context\n");
2038  if (source)
2039  {
2040  hr = ITfSource_AdviseSink(source, &IID_ITfTextEditSink, (LPVOID)sink, &editSinkCookie);
2041  ok(SUCCEEDED(hr),"Failed to advise Sink\n");
2042  ok(editSinkCookie != -1,"Failed to get sink cookie\n");
2043  }
2044 
2045  hrSession = 0xfeedface;
2046  /* Test no permissions flags */
2047  hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC, &hrSession);
2048  ok(hr == E_INVALIDARG,"RequestEditSession should have failed with %x not %x\n",E_INVALIDARG,hr);
2049  ok(hrSession == E_FAIL,"hrSession should be %x not %x\n",E_FAIL,hrSession);
2050 
2052  hrSession = 0xfeedface;
2054  hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC|TF_ES_READWRITE, &hrSession);
2055  ok(SUCCEEDED(hr),"ITfContext_RequestEditSession failed\n");
2056  ok(hrSession == TS_E_READONLY,"Unexpected hrSession (%x)\n",hrSession);
2057  sink_check_ok(&test_ACP_GetStatus,"GetStatus");
2058 
2059  /* signal a change to allow readwrite sessions */
2060  documentStatus = 0;
2062  ITextStoreACPSink_OnStatusChange(ACPSink,documentStatus);
2063  sink_check_ok(&test_ACP_RequestLock,"RequestLock");
2064 
2068  hrSession = 0xfeedface;
2070  hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC|TF_ES_READWRITE, &hrSession);
2071  ok(SUCCEEDED(hr),"ITfContext_RequestEditSession failed\n");
2072  sink_check_ok(&test_OnEndEdit,"OnEndEdit");
2073  sink_check_ok(&test_DoEditSession,"DoEditSession");
2074  sink_check_ok(&test_ACP_GetStatus,"GetStatus");
2075  ok(hrSession == 0xdeadcafe,"Unexpected hrSession (%x)\n",hrSession);
2076 
2077  if (source)
2078  {
2079  hr = ITfSource_UnadviseSink(source, editSinkCookie);
2080  ok(SUCCEEDED(hr),"Failed to unadvise Sink\n");
2081  ITfSource_Release(source);
2082  }
2083  ITfTextEditSink_Release(sink);
2084  ITfContext_Release(cxt);
2085  ITfDocumentMgr_Release(dm);
2086  ITfEditSession_Release(es);
2087 }
static INT test_OnEndEdit
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static ITextStoreACPSink * ACPSink
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT TextEditSink_Constructor(ITfTextEditSink **ppOut)
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: CComObject.cpp:34
#define SINK_EXPECTED
static ITfThreadMgr * g_tm
static INT test_ACP_GetStatus
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static INT test_DoEditSession
static HRESULT EditSession_Constructor(ITfEditSession **ppOut)
static INT test_ACP_RequestLock
static DWORD documentStatus
#define sink_check_ok(a, b)
const DWORD TS_SD_READONLY
Definition: textstor.idl:40
#define es
Definition: i386-dis.c:431
static TfClientId tid
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_Unregister()

static void test_Unregister ( void  )
static

Definition at line 1000 of file inputprocessor.c.

1001 {
1002  HRESULT hr;
1003  hr = ITfInputProcessorProfiles_Unregister(g_ipp, &CLSID_FakeService);
1004  ok(SUCCEEDED(hr),"Unable to unregister text service(%x)\n",hr);
1006 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT UnregisterTextService(void)
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
static ITfInputProcessorProfiles * g_ipp
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_UnregisterCategory()

static void test_UnregisterCategory ( void  )
static

Definition at line 1064 of file inputprocessor.c.

1065 {
1066  HRESULT hr;
1067  hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_TIP_KEYBOARD, &CLSID_FakeService);
1068  ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
1069  hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &CLSID_FakeService);
1070  ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
1071 }
static ITfCategoryMgr * g_cm
HRESULT hr
Definition: shlfolder.c:183
#define ok(value,...)
Definition: CComObject.cpp:34
LONG HRESULT
Definition: typedefs.h:77
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:62
EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER
Definition: msctf.idl:65
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ TextEditSink_AddRef()

static ULONG WINAPI TextEditSink_AddRef ( ITfTextEditSink iface)
static

Definition at line 1492 of file inputprocessor.c.

1493 {
1495  return InterlockedIncrement(&This->refCount);
1496 }
static TextEditSink * impl_from_ITfTextEditSink(ITfTextEditSink *iface)
#define InterlockedIncrement
Definition: armddk.h:53

◆ TextEditSink_Constructor()

static HRESULT TextEditSink_Constructor ( ITfTextEditSink **  ppOut)
static

Definition at line 1525 of file inputprocessor.c.

1526 {
1527  TextEditSink *This;
1528 
1529  *ppOut = NULL;
1531  if (This == NULL)
1532  return E_OUTOFMEMORY;
1533 
1534  This->ITfTextEditSink_iface.lpVtbl = &TextEditSink_TextEditSinkVtbl;
1535  This->refCount = 1;
1536 
1537  *ppOut = &This->ITfTextEditSink_iface;
1538  return S_OK;
1539 }
static const ITfTextEditSinkVtbl TextEditSink_TextEditSinkVtbl
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by test_TStoApplicationText().

◆ TextEditSink_Destructor()

static void TextEditSink_Destructor ( TextEditSink This)
static

Definition at line 1469 of file inputprocessor.c.

1470 {
1472 }
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by TextEditSink_Release().

◆ TextEditSink_OnEndEdit()

static HRESULT WINAPI TextEditSink_OnEndEdit ( ITfTextEditSink iface,
ITfContext pic,
TfEditCookie  ecReadOnly,
ITfEditRecord pEditRecord 
)
static

Definition at line 1509 of file inputprocessor.c.

1511 {
1512  sink_fire_ok(&test_OnEndEdit,"TextEditSink_OnEndEdit");
1513  return S_OK;
1514 }
static INT test_OnEndEdit
#define sink_fire_ok(a, b)
#define S_OK
Definition: intsafe.h:59

◆ TextEditSink_QueryInterface()

static HRESULT WINAPI TextEditSink_QueryInterface ( ITfTextEditSink iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 1474 of file inputprocessor.c.

1475 {
1476  *ppvOut = NULL;
1477 
1478  if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfTextEditSink))
1479  {
1480  *ppvOut = iface;
1481  }
1482 
1483  if (*ppvOut)
1484  {
1485  ITfTextEditSink_AddRef(iface);
1486  return S_OK;
1487  }
1488 
1489  return E_NOINTERFACE;
1490 }
#define E_NOINTERFACE
Definition: winerror.h:2364
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90

◆ TextEditSink_Release()

static ULONG WINAPI TextEditSink_Release ( ITfTextEditSink iface)
static

Definition at line 1498 of file inputprocessor.c.

1499 {
1501  ULONG ret;
1502 
1503  ret = InterlockedDecrement(&This->refCount);
1504  if (ret == 0)
1506  return ret;
1507 }
static void TextEditSink_Destructor(TextEditSink *This)
static TextEditSink * impl_from_ITfTextEditSink(ITfTextEditSink *iface)
int ret
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

◆ TextService_Activate()

static HRESULT WINAPI TextService_Activate ( ITfTextInputProcessor iface,
ITfThreadMgr *