ReactOS 0.4.16-dev-340-g0540c21
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

 DEFINE_GUID (CLSID_FakeService, 0xEDE1A7AD, 0x66DE, 0x47E0, 0xB6, 0x20, 0x3E, 0x92, 0xF8, 0x24, 0x6B, 0xF3)
 
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 TfUIElementSink_QueryInterface (ITfUIElementSink *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI TfUIElementSink_AddRef (ITfUIElementSink *iface)
 
static ULONG WINAPI TfUIElementSink_Release (ITfUIElementSink *iface)
 
static HRESULT WINAPI TfUIElementSink_BeginUIElement (ITfUIElementSink *iface, DWORD id, BOOL *show)
 
static HRESULT WINAPI TfUIElementSink_UpdateUIElement (ITfUIElementSink *iface, DWORD id)
 
static HRESULT WINAPI TfUIElementSink_EndUIElement (ITfUIElementSink *iface, DWORD id)
 
static HRESULT WINAPI ProfileActivationSink_QueryInterface (ITfInputProcessorProfileActivationSink *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ProfileActivationSink_AddRef (ITfInputProcessorProfileActivationSink *iface)
 
static ULONG WINAPI ProfileActivationSink_Release (ITfInputProcessorProfileActivationSink *iface)
 
static HRESULT WINAPI ProfileActivationSink_OnActivated (ITfInputProcessorProfileActivationSink *iface, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
 
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_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)
 
static DWORD WINAPI test_MultiThreadApartment_Thread (void *param)
 
static void test_MultiThreadApartment (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 DWORD ui_element_sink_cookie
 
static DWORD profile_activation_sink_cookie
 
static DWORD fake_service_onactivated_flags = 0
 
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 ITfUIElementSinkVtbl TfUIElementSinkVtbl
 
static ITfUIElementSink TfUIElementSink = { &TfUIElementSinkVtbl }
 
static const ITfInputProcessorProfileActivationSinkVtbl TfInputProcessorProfileActivationSinkVtbl
 
static ITfInputProcessorProfileActivationSink TfInputProcessorProfileActivationSink
 
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 159 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 173 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 131 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 830 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 133 of file inputprocessor.c.

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

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 161 of file inputprocessor.c.

162{
165 if (PrevFocus != FOCUS_IGNORE && count != 0)
166 winetest_ok(PrevFocus == test_FirstPrevFocus, "%s expected prev focus %p got %p\n", name, PrevFocus, test_FirstPrevFocus);
167 if (CurrentFocus != FOCUS_IGNORE && count != 0)
168 winetest_ok(CurrentFocus == test_LastCurrentFocus, "%s expected current focus %p got %p\n", name, CurrentFocus, test_LastCurrentFocus);
171}
static ITfDocumentMgr * test_FirstPrevFocus
#define FOCUS_IGNORE
static void _sink_check_ok(INT *sink, const CHAR *name)
static ITfDocumentMgr * test_LastCurrentFocus
#define FOCUS_SAVE

◆ _sink_fire_ok()

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

Definition at line 96 of file inputprocessor.c.

97{
98 int count;
99 int todo = *sink & SINK_OPTION_TODO;
101
103 winetest_trace("firing %s\n",name);
104
105 switch (action)
106 {
107 case SINK_OPTIONAL:
108 case SINK_EXPECTED:
110 if (count > 1)
111 {
112 count --;
113 *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16);
114 return;
115 }
116 break;
117 case SINK_IGNORE:
118 winetest_trace("Ignoring %s\n",name);
119 return;
120 case SINK_SAVE:
122 *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16);
123 return;
124 default:
126 winetest_ok(0, "Unexpected %s sink\n",name);
127 }
128 *sink = SINK_FIRED;
129}
#define SINK_EXPECTED

◆ check_context_refcount()

static int check_context_refcount ( ITfContext iface)
inlinestatic

Definition at line 1572 of file inputprocessor.c.

1573{
1574 ITfContext_AddRef(iface);
1575 return ITfContext_Release(iface);
1576}

Referenced by test_startSession().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 874 of file inputprocessor.c.

875{
877 return InterlockedIncrement(&This->ref);
878}
#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 925 of file inputprocessor.c.

926{
928 This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl;
929 This->ref = 1;
930 This->ctor = ctor;
931 *ppvOut = &This->IClassFactory_iface;
932 TS_refCount++;
933 return S_OK;
934}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define S_OK
Definition: intsafe.h:52
static const IClassFactoryVtbl ClassFactoryVtbl
static LONG TS_refCount
LPFNCONSTRUCTOR ctor
Definition: msctf.c:83

Referenced by RegisterTextService().

◆ ClassFactory_CreateInstance()

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

Definition at line 890 of file inputprocessor.c.

891{
893 HRESULT ret;
894 IUnknown *obj;
895
896 ret = This->ctor(punkOuter, &obj);
897 if (FAILED(ret))
898 return ret;
899 ret = IUnknown_QueryInterface(obj, iid, ppvOut);
900 IUnknown_Release(obj);
901 return ret;
902}
#define FAILED(hr)
Definition: intsafe.h:51
int ret

◆ ClassFactory_Destructor()

static void ClassFactory_Destructor ( ClassFactory This)
static

Definition at line 855 of file inputprocessor.c.

856{
858 TS_refCount--;
859}
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by ClassFactory_Release().

◆ ClassFactory_LockServer()

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

Definition at line 904 of file inputprocessor.c.

905{
906 if(fLock)
908 else
910
911 return S_OK;
912}
#define InterlockedDecrement
Definition: armddk.h:52

◆ ClassFactory_QueryInterface()

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

Definition at line 861 of file inputprocessor.c.

862{
863 *ppvOut = NULL;
865 {
866 IClassFactory_AddRef(iface);
867 *ppvOut = iface;
868 return S_OK;
869 }
870
871 return E_NOINTERFACE;
872}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 880 of file inputprocessor.c.

881{
884
885 if (ret == 0)
887 return ret;
888}
static void ClassFactory_Destructor(ClassFactory *This)
uint32_t ULONG
Definition: typedefs.h:59

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 1079 of file inputprocessor.c.

1080{
1081 if (g_ipp)
1082 ITfInputProcessorProfiles_Release(g_ipp);
1083 if (g_cm)
1084 ITfCategoryMgr_Release(g_cm);
1085 if (g_tm)
1086 ITfThreadMgr_Release(g_tm);
1088}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static ITfCategoryMgr * g_cm
static ITfThreadMgr * g_tm
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_PreservedKey  ,
0xA0ED8E55  ,
0xCD3B  ,
0x4274  ,
0xB2  ,
0x95  ,
0xF6  ,
0xC9  ,
0xBA  ,
0x2B  ,
0x84  ,
0x72   
)

◆ 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 ( CLSID_TF_InputProcessorProfiles  ,
0x33c53a50  ,
0xf456  ,
0x4884  ,
0xb0  ,
0x49  ,
0x85  ,
0xfd  ,
0x64  ,
0x3e  ,
0xcf  ,
0xed   
)

◆ DEFINE_GUID() [5/19]

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

◆ DEFINE_GUID() [6/19]

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

◆ DEFINE_GUID() [7/19]

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

◆ DEFINE_GUID() [8/19]

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

◆ DEFINE_GUID() [9/19]

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

◆ DEFINE_GUID() [10/19]

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

◆ DEFINE_GUID() [11/19]

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

◆ DEFINE_GUID() [12/19]

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

◆ DEFINE_GUID() [13/19]

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

◆ DEFINE_GUID() [14/19]

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

◆ DEFINE_GUID() [15/19]

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

◆ DEFINE_GUID() [16/19]

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

◆ DEFINE_GUID() [17/19]

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

◆ DEFINE_GUID() [18/19]

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

◆ DEFINE_GUID() [19/19]

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

◆ EditSession_AddRef()

static ULONG WINAPI EditSession_AddRef ( ITfEditSession iface)
static

Definition at line 2010 of file inputprocessor.c.

2011{
2013 return InterlockedIncrement(&This->refCount);
2014}
static EditSession * impl_from_ITfEditSession(ITfEditSession *iface)

◆ EditSession_Constructor()

static HRESULT EditSession_Constructor ( ITfEditSession **  ppOut)
static

Definition at line 2131 of file inputprocessor.c.

2132{
2134
2135 *ppOut = NULL;
2137 if (This == NULL)
2138 return E_OUTOFMEMORY;
2139
2140 This->ITfEditSession_iface.lpVtbl = &EditSession_EditSessionVtbl;
2141 This->refCount = 1;
2142
2143 *ppOut = &This->ITfEditSession_iface;
2144 return S_OK;
2145}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const ITfEditSessionVtbl EditSession_EditSessionVtbl

Referenced by test_TStoApplicationText().

◆ EditSession_Destructor()

static void EditSession_Destructor ( EditSession This)
static

Definition at line 1987 of file inputprocessor.c.

1988{
1990}

Referenced by EditSession_Release().

◆ EditSession_DoEditSession()

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

Definition at line 2045 of file inputprocessor.c.

2047{
2048 ITfContext *cxt;
2049 ITfDocumentMgr *dm;
2050 ITfRange *range;
2051 TF_SELECTION selection;
2052 ULONG fetched;
2053 HRESULT hr;
2054
2055 sink_fire_ok(&test_DoEditSession,"EditSession_DoEditSession");
2056 sink_check_ok(&test_ACP_RequestLock,"RequestLock");
2057
2058 ITfThreadMgr_GetFocus(g_tm, &dm);
2059 ITfDocumentMgr_GetTop(dm,&cxt);
2060
2061 hr = ITfContext_GetStart(cxt,ec,NULL);
2062 ok(hr == E_INVALIDARG,"Unexpected return code %x\n",hr);
2063
2064 range = (ITfRange*)0xdeaddead;
2065 hr = ITfContext_GetStart(cxt,0xdeadcafe,&range);
2066 ok(hr == TF_E_NOLOCK,"Unexpected return code %x\n",hr);
2067 ok(range == NULL,"Range not set to NULL\n");
2068
2069 hr = ITfContext_GetStart(cxt,ec,&range);
2070 ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
2071 ok(range != NULL,"Range set to NULL\n");
2072
2073 ITfRange_Release(range);
2074
2075 hr = ITfContext_GetEnd(cxt,ec,NULL);
2076 ok(hr == E_INVALIDARG,"Unexpected return code %x\n",hr);
2077
2078 range = (ITfRange*)0xdeaddead;
2079 hr = ITfContext_GetEnd(cxt,0xdeadcafe,&range);
2080 ok(hr == TF_E_NOLOCK,"Unexpected return code %x\n",hr);
2081 ok(range == NULL,"Range not set to NULL\n");
2082
2084 hr = ITfContext_GetEnd(cxt,ec,&range);
2085 ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
2086 ok(range != NULL,"Range set to NULL\n");
2087 sink_check_ok(&test_ACP_GetEndACP,"GetEndACP");
2088
2089 ITfRange_Release(range);
2090
2091 selection.range = NULL;
2093 hr = ITfContext_GetSelection(cxt, ec, TF_DEFAULT_SELECTION, 1, &selection, &fetched);
2094 ok(SUCCEEDED(hr),"ITfContext_GetSelection failed\n");
2095 ok(fetched == 1,"fetched incorrect\n");
2096 ok(selection.range != NULL,"NULL range\n");
2097 sink_check_ok(&test_ACP_GetSelection,"GetSelection");
2098 ITfRange_Release(selection.range);
2099
2100 test_InsertAtSelection(ec, cxt);
2101
2103 hr = ITfContext_GetEnd(cxt,ec,&range);
2104 ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
2105 ok(range != NULL,"Range set to NULL\n");
2106 sink_check_ok(&test_ACP_GetEndACP,"GetEndACP");
2107
2108 selection.range = range;
2109 selection.style.ase = TF_AE_NONE;
2110 selection.style.fInterimChar = FALSE;
2112 hr = ITfContext_SetSelection(cxt, ec, 1, &selection);
2113 ok(SUCCEEDED(hr),"ITfContext_SetSelection failed\n");
2114 sink_check_ok(&test_ACP_SetSelection,"SetSelection");
2115 ITfRange_Release(range);
2116
2117 ITfContext_Release(cxt);
2118 ITfDocumentMgr_Release(dm);
2119 return 0xdeadcafe;
2120}
#define ok(value,...)
Definition: atltest.h:57
int selection
Definition: ctm.c:92
#define E_INVALIDARG
Definition: ddrawi.h:101
#define FALSE
Definition: types.h:117
GLenum GLint * range
Definition: glext.h:7539
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static INT test_ACP_RequestLock
static INT test_DoEditSession
#define sink_fire_ok(a, b)
static INT test_ACP_GetSelection
static INT test_ACP_GetEndACP
static INT test_ACP_SetSelection
static void test_InsertAtSelection(TfEditCookie ec, ITfContext *cxt)
#define sink_check_ok(a, b)
HRESULT hr
Definition: shlfolder.c:183

◆ EditSession_QueryInterface()

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

Definition at line 1992 of file inputprocessor.c.

1993{
1994 *ppvOut = NULL;
1995
1996 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfEditSession))
1997 {
1998 *ppvOut = iface;
1999 }
2000
2001 if (*ppvOut)
2002 {
2003 ITfEditSession_AddRef(iface);
2004 return S_OK;
2005 }
2006
2007 return E_NOINTERFACE;
2008}

◆ EditSession_Release()

static ULONG WINAPI EditSession_Release ( ITfEditSession iface)
static

Definition at line 2016 of file inputprocessor.c.

2017{
2019 ULONG ret;
2020
2021 ret = InterlockedDecrement(&This->refCount);
2022 if (ret == 0)
2024 return ret;
2025}
static void EditSession_Destructor(EditSession *This)

◆ enum_compartments()

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

Definition at line 2215 of file inputprocessor.c.

2216{
2217 BOOL found,found2;
2218 IEnumGUID *ppEnum;
2219 found = FALSE;
2220 found2 = FALSE;
2221 if (SUCCEEDED(ITfCompartmentMgr_EnumCompartments(cmpmgr, &ppEnum)))
2222 {
2223 ULONG fetched;
2224 GUID g;
2225 while (IEnumGUID_Next(ppEnum, 1, &g, &fetched) == S_OK)
2226 {
2227 WCHAR str[50];
2228 CHAR strA[50];
2230 WideCharToMultiByte(CP_ACP,0,str,-1,strA,sizeof(strA),0,0);
2231 trace("found %s\n",strA);
2232 if (present && IsEqualGUID(present,&g))
2233 found = TRUE;
2234 if (absent && IsEqualGUID(absent, &g))
2235 found2 = TRUE;
2236 }
2237 IEnumGUID_Release(ppEnum);
2238 }
2239 if (present)
2240 ok(found,"Did not find compartment\n");
2241 if (absent)
2242 ok(!found2,"Found compartment that should be absent\n");
2243}
#define trace
Definition: atltest.h:70
#define ARRAY_SIZE(A)
Definition: main.h:20
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
unsigned int BOOL
Definition: ntddk_ex.h:94
GLboolean GLboolean g
Definition: glext.h:6204
char strA[12]
Definition: clipboard.c:2028
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175

Referenced by test_Compartments().

◆ expected_count()

◆ impl_from_IClassFactory()

static ClassFactory * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 839 of file inputprocessor.c.

840{
841 return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
842}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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

◆ impl_from_ITextStoreACP()

static TextStoreACP * impl_from_ITextStoreACP ( ITextStoreACP iface)
inlinestatic

Definition at line 185 of file inputprocessor.c.

186{
187 return CONTAINING_RECORD(iface, TextStoreACP, ITextStoreACP_iface);
188}

Referenced by TextStoreACP_AddRef(), and TextStoreACP_Release().

◆ impl_from_ITfEditSession()

static EditSession * impl_from_ITfEditSession ( ITfEditSession iface)
inlinestatic

Definition at line 1982 of file inputprocessor.c.

1983{
1984 return CONTAINING_RECORD(iface, EditSession, ITfEditSession_iface);
1985}

Referenced by EditSession_AddRef(), and EditSession_Release().

◆ impl_from_ITfKeyEventSink()

static KeyEventSink * impl_from_ITfKeyEventSink ( ITfKeyEventSink iface)
inlinestatic

Definition at line 1327 of file inputprocessor.c.

1328{
1329 return CONTAINING_RECORD(iface, KeyEventSink, ITfKeyEventSink_iface);
1330}

Referenced by KeyEventSink_AddRef(), and KeyEventSink_Release().

◆ impl_from_ITfTextEditSink()

static TextEditSink * impl_from_ITfTextEditSink ( ITfTextEditSink iface)
inlinestatic

Definition at line 1588 of file inputprocessor.c.

1589{
1590 return CONTAINING_RECORD(iface, TextEditSink, ITfTextEditSink_iface);
1591}

Referenced by TextEditSink_AddRef(), and TextEditSink_Release().

◆ impl_from_ITfTextInputProcessor()

static TextService * impl_from_ITfTextInputProcessor ( ITfTextInputProcessor iface)
inlinestatic

Definition at line 850 of file inputprocessor.c.

851{
852 return CONTAINING_RECORD(iface, TextService, ITfTextInputProcessor_iface);
853}

Referenced by TextService_AddRef(), and TextService_Release().

◆ impl_from_ITfThreadMgrEventSink()

static ThreadMgrEventSink * impl_from_ITfThreadMgrEventSink ( ITfThreadMgrEventSink iface)
inlinestatic

Definition at line 482 of file inputprocessor.c.

483{
484 return CONTAINING_RECORD(iface, ThreadMgrEventSink, ITfThreadMgrEventSink_iface);
485}

Referenced by ThreadMgrEventSink_AddRef(), and ThreadMgrEventSink_Release().

◆ initialize()

static HRESULT initialize ( void  )
static

Definition at line 1053 of file inputprocessor.c.

1054{
1055 HRESULT hr;
1056 HKEY hkey;
1057
1059
1060 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\CTF\\TIP", 0,
1061 KEY_READ|KEY_WRITE, &hkey) != ERROR_SUCCESS)
1062 {
1063 skip("Not enough permission to register input processor\n");
1064 return E_FAIL;
1065 }
1066 RegCloseKey(hkey);
1067
1069 CLSCTX_INPROC_SERVER, &IID_ITfInputProcessorProfiles, (void**)&g_ipp);
1070 if (SUCCEEDED(hr))
1072 CLSCTX_INPROC_SERVER, &IID_ITfCategoryMgr, (void**)&g_cm);
1073 if (SUCCEEDED(hr))
1075 CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (void**)&g_tm);
1076 return hr;
1077}
#define skip(...)
Definition: atltest.h:64
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
EXTERN_C const CLSID CLSID_TF_InputProcessorProfiles
Definition: msctf.idl:82
EXTERN_C const CLSID CLSID_TF_ThreadMgr
Definition: msctf.idl:81
EXTERN_C const CLSID CLSID_TF_CategoryMgr
Definition: msctf.idl:84
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_WRITE
Definition: nt_native.h:1031
#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 1355 of file inputprocessor.c.

1356{
1358 return InterlockedIncrement(&This->refCount);
1359}
static KeyEventSink * impl_from_ITfKeyEventSink(ITfKeyEventSink *iface)

◆ KeyEventSink_Constructor()

static HRESULT KeyEventSink_Constructor ( ITfKeyEventSink **  ppOut)
static

Definition at line 1428 of file inputprocessor.c.

1429{
1431
1433 if (This == NULL)
1434 return E_OUTOFMEMORY;
1435
1436 This->ITfKeyEventSink_iface.lpVtbl = &KeyEventSink_KeyEventSinkVtbl;
1437 This->refCount = 1;
1438
1439 *ppOut = &This->ITfKeyEventSink_iface;
1440 return S_OK;
1441}
static const ITfKeyEventSinkVtbl KeyEventSink_KeyEventSinkVtbl

Referenced by test_KeystrokeMgr().

◆ KeyEventSink_Destructor()

static void KeyEventSink_Destructor ( KeyEventSink This)
static

Definition at line 1332 of file inputprocessor.c.

1333{
1335}

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 1393 of file inputprocessor.c.

1395{
1396 trace("\n");
1397 return S_OK;
1398}

◆ KeyEventSink_OnKeyUp()

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

Definition at line 1400 of file inputprocessor.c.

1402{
1403 trace("\n");
1404 return S_OK;
1405}

◆ KeyEventSink_OnPreservedKey()

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

Definition at line 1407 of file inputprocessor.c.

1409{
1410 trace("\n");
1411 return S_OK;
1412}

◆ KeyEventSink_OnSetFocus()

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

Definition at line 1372 of file inputprocessor.c.

1374{
1375 sink_fire_ok(&test_KEV_OnSetFocus,"KeyEventSink_OnSetFocus");
1376 return S_OK;
1377}
static INT test_KEV_OnSetFocus

◆ KeyEventSink_OnTestKeyDown()

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

Definition at line 1379 of file inputprocessor.c.

1381{
1382 trace("\n");
1383 return S_OK;
1384}

◆ KeyEventSink_OnTestKeyUp()

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

Definition at line 1386 of file inputprocessor.c.

1388{
1389 trace("\n");
1390 return S_OK;
1391}

◆ KeyEventSink_QueryInterface()

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

Definition at line 1337 of file inputprocessor.c.

1338{
1339 *ppvOut = NULL;
1340
1341 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfKeyEventSink))
1342 {
1343 *ppvOut = iface;
1344 }
1345
1346 if (*ppvOut)
1347 {
1348 ITfKeyEventSink_AddRef(iface);
1349 return S_OK;
1350 }
1351
1352 return E_NOINTERFACE;
1353}

◆ KeyEventSink_Release()

static ULONG WINAPI KeyEventSink_Release ( ITfKeyEventSink iface)
static

Definition at line 1361 of file inputprocessor.c.

1362{
1364 ULONG ret;
1365
1366 ret = InterlockedDecrement(&This->refCount);
1367 if (ret == 0)
1369 return ret;
1370}
static void KeyEventSink_Destructor(KeyEventSink *This)

◆ processPendingMessages()

static void processPendingMessages ( void  )
static

Definition at line 2295 of file inputprocessor.c.

2296{
2297 MSG msg;
2298 int diff = 200;
2299 int min_timeout = 100;
2300 DWORD time = GetTickCount() + diff;
2301
2302 while (diff > 0)
2303 {
2305 break;
2306 while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
2307 {
2310 }
2311 diff = time - GetTickCount();
2312 }
2313}
#define msg(x)
Definition: auth_time.c:54
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
unsigned long DWORD
Definition: ntddk_ex.h:95
__u16 time
Definition: mkdosfs.c:8
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define QS_ALLINPUT
Definition: winuser.h:906
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1199
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by START_TEST(), and test_AssociateFocus().

◆ ProfileActivationSink_AddRef()

static ULONG WINAPI ProfileActivationSink_AddRef ( ITfInputProcessorProfileActivationSink iface)
static

Definition at line 742 of file inputprocessor.c.

743{
744 return 2;
745}

◆ ProfileActivationSink_OnActivated()

static HRESULT WINAPI ProfileActivationSink_OnActivated ( ITfInputProcessorProfileActivationSink iface,
DWORD  dwProfileType,
LANGID  langid,
REFCLSID  clsid,
REFGUID  catid,
REFGUID  guidProfile,
HKL  hkl,
DWORD  dwFlags 
)
static

Definition at line 752 of file inputprocessor.c.

755{
756 trace("Got OnActivated: {dwProfileType %08x, langid %08x, clsid %s, catid %s, guidProfile %s, %p, dwFlags %08x}\n",
757 dwProfileType, langid, wine_dbgstr_guid(clsid),
759
760 ok(dwProfileType == TF_PROFILETYPE_INPUTPROCESSOR || dwProfileType == TF_PROFILETYPE_KEYBOARDLAYOUT,
761 "unexpected dwProfileType: 0x%x\n", dwProfileType);
762
763 if(dwProfileType == TF_PROFILETYPE_INPUTPROCESSOR && IsEqualGUID(&CLSID_FakeService, clsid)){
764 if(dwFlags & TF_IPSINK_FLAG_ACTIVE){
765 ok(test_ShouldActivate, "OnActivated: Activation came unexpectedly\n");
766 }
767
769 }
770
771 return S_OK;
772}
static DWORD fake_service_onactivated_flags
static BOOL test_ShouldActivate
REFCLSID clsid
Definition: msctf.c:82
GUID guidProfile
Definition: msctf.idl:646
HKL hkl
Definition: msctf.idl:650
GUID catid
Definition: msctf.idl:647
LANGID langid
Definition: msctf.idl:644
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ ProfileActivationSink_QueryInterface()

static HRESULT WINAPI ProfileActivationSink_QueryInterface ( ITfInputProcessorProfileActivationSink iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 730 of file inputprocessor.c.

732{
733 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITfInputProcessorProfileActivationSink, riid)){
734 *ppvObject = iface;
735 return S_OK;
736 }
737
738 *ppvObject = NULL;
739 return E_NOINTERFACE;
740}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ ProfileActivationSink_Release()

static ULONG WINAPI ProfileActivationSink_Release ( ITfInputProcessorProfileActivationSink iface)
static

Definition at line 747 of file inputprocessor.c.

748{
749 return 1;
750}

◆ RegisterTextService()

static HRESULT RegisterTextService ( REFCLSID  rclsid)
static

Definition at line 1019 of file inputprocessor.c.

1020{
1022 return CoRegisterClassObject(rclsid, (IUnknown*) cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &regid);
1023}
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
static HRESULT TextService_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
static DWORD regid
static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut)
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393

Referenced by test_Register().

◆ START_TEST()

START_TEST ( inputprocessor  )

Definition at line 2570 of file inputprocessor.c.

2571{
2572 if (SUCCEEDED(initialize()))
2573 {
2574 test_Register();
2576 Sleep(2000); /* Win7 needs some time before the registrations become active */
2580 test_Enable();
2582 test_Activate();
2586 test_ClientId();
2593 test_Disable();
2600
2601 ITextStoreACPSink_Release(ACPSink);
2602 ITfDocumentMgr_Release(g_dm);
2603 }
2604 else
2605 skip("Unable to create InputProcessor\n");
2606 cleanup();
2607}
static void test_Enable(void)
static void test_FindClosestCategory(void)
static void test_profile_mgr(void)
static void test_Activate(void)
static void test_EnumInputProcessorInfo(void)
static void test_DocumentMgrUnadviseSinks(void)
static void test_ThreadMgrUnadviseSinks(void)
static ITextStoreACPSink * ACPSink
static void test_RegisterCategory(void)
static void cleanup(void)
static void test_Disable(void)
static void test_UnregisterCategory(void)
static ITfDocumentMgr * g_dm
static void test_Compartments(void)
static void test_startSession(void)
static void test_Register(void)
static void test_endSession(void)
static void test_MultiThreadApartment(void)
static void test_TfGuidAtom(void)
static void test_KeystrokeMgr(void)
static void test_Unregister(void)
static HRESULT initialize(void)
static void test_AssociateFocus(void)
static void test_ThreadMgrAdviseSinks(void)
static void test_TStoApplicationText(void)
static void test_DocumentMgrAdviseSinks(void)
static void test_ClientId(void)
static void processPendingMessages(void)
static void test_EnumLanguageProfiles(void)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790

◆ test_Activate()

static void test_Activate ( void  )
static

Definition at line 1500 of file inputprocessor.c.

1501{
1502 HRESULT hr;
1503
1504 test_ShouldActivate = TRUE; /* Win7 */
1505 hr = ITfInputProcessorProfiles_ActivateLanguageProfile(g_ipp,&CLSID_FakeService,gLangid,&CLSID_FakeService);
1506 ok(SUCCEEDED(hr),"Failed to Activate text service\n");
1508}
static LANGID gLangid

Referenced by START_TEST(), and test_HTMLDocument().

◆ test_AssociateFocus()

static void test_AssociateFocus ( void  )
static

Definition at line 2315 of file inputprocessor.c.

2316{
2317 ITfDocumentMgr *dm1, *dm2, *olddm, *dmcheck, *dmorig;
2318 HWND wnd1, wnd2, wnd3;
2319 HRESULT hr;
2320
2321 ITfThreadMgr_GetFocus(g_tm, &dmorig);
2323 test_PrevFocus = dmorig;
2324 test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */
2326 hr = ITfThreadMgr_SetFocus(g_tm,NULL);
2327 ok(SUCCEEDED(hr),"ITfThreadMgr_SetFocus failed\n");
2328 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2330 ITfDocumentMgr_Release(dmorig);
2331
2332 hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dm1);
2333 ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
2334
2335 hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dm2);
2336 ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
2337
2338 wnd1 = CreateWindowA("edit",NULL,WS_POPUP,0,0,200,60,NULL,NULL,NULL,NULL);
2339 ok(wnd1!=NULL,"Unable to create window 1\n");
2340 wnd2 = CreateWindowA("edit",NULL,WS_POPUP,0,65,200,60,NULL,NULL,NULL,NULL);
2341 ok(wnd2!=NULL,"Unable to create window 2\n");
2342 wnd3 = CreateWindowA("edit",NULL,WS_POPUP,0,130,200,60,NULL,NULL,NULL,NULL);
2343 ok(wnd3!=NULL,"Unable to create window 3\n");
2344
2346
2347 test_OnInitDocumentMgr = SINK_OPTIONAL; /* Vista and greater */
2348 test_OnPushContext = SINK_OPTIONAL; /* Vista and greater */
2349 test_OnSetFocus = SINK_OPTIONAL; /* Win7 */
2352
2355 SetFocus(wnd1);
2356 sink_check_ok(&test_OnInitDocumentMgr,"OnInitDocumentMgr");
2357 sink_check_ok(&test_OnPushContext,"OnPushContext");
2358
2359 test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */
2360 test_ACP_RequestLock = SINK_OPTIONAL; /* Win7 x64 */
2361 test_ACP_GetSelection = SINK_OPTIONAL; /* Win7 x64 */
2362 ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus);
2363 test_CurrentFocus = FOCUS_IGNORE; /* This is a default system context */
2365 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2368
2369 test_CurrentFocus = dm1;
2373 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd1,dm1,&olddm);
2374 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2375 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2377
2379
2380 ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2381 ok(dmcheck == dm1 || broken(dmcheck == dmorig /* Win7+ */), "Expected DocumentMgr not focused\n");
2382 ITfDocumentMgr_Release(dmcheck);
2383
2384 /* We need to explicitly set focus on Win7+ */
2385 test_CurrentFocus = dm1;
2387 test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7+ */
2388 ITfThreadMgr_SetFocus(g_tm, dm1);
2389 sink_check_ok(&test_OnSetFocus, "OnSetFocus");
2390
2391 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,dm2,&olddm);
2392 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2394 ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2395 ok(dmcheck == dm1, "Expected DocumentMgr not focused\n");
2396 ITfDocumentMgr_Release(dmcheck);
2397
2398 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd3,dm2,&olddm);
2399 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2401 ITfThreadMgr_GetFocus(g_tm, &dmcheck);
2402 ok(dmcheck == dm1, "Expected DocumentMgr not focused\n");
2403 ITfDocumentMgr_Release(dmcheck);
2404
2408 test_ShouldDeactivate = TRUE; /* win 8/10 */
2410 SetFocus(wnd2);
2411 sink_check_saved(&test_OnSetFocus,dm1,dm2,"OnSetFocus");
2412 test_CurrentFocus = FOCUS_IGNORE; /* occasional wine race */
2413 test_PrevFocus = FOCUS_IGNORE; /* occasional wine race */
2414 test_OnSetFocus = SINK_IGNORE; /* occasional wine race */
2417
2419 SetFocus(wnd3);
2421
2425 SetFocus(wnd1);
2427 sink_check_saved(&test_OnSetFocus,dm2,dm1,"OnSetFocus");
2428
2429 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd3,NULL,&olddm);
2430 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2431 ok(olddm == dm2, "incorrect old DocumentMgr returned\n");
2432 ITfDocumentMgr_Release(olddm);
2433
2434 test_CurrentFocus = dmorig;
2435 test_PrevFocus = dm1;
2436 test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7+ */
2438 ITfThreadMgr_SetFocus(g_tm,dmorig);
2439 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2440
2444 SetFocus(wnd3);
2446 sink_check_saved(&test_OnSetFocus,dmorig,FOCUS_IGNORE,"OnSetFocus"); /* CurrentFocus NULL on XP, system default on Vista */
2447
2448 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd2,NULL,&olddm);
2449 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2450 ok(olddm == dm2, "incorrect old DocumentMgr returned\n");
2451 ITfDocumentMgr_Release(olddm);
2452 hr = ITfThreadMgr_AssociateFocus(g_tm,wnd1,NULL,&olddm);
2453 ok(SUCCEEDED(hr),"AssociateFocus failed\n");
2454 ok(olddm == dm1, "incorrect old DocumentMgr returned\n");
2455 ITfDocumentMgr_Release(olddm);
2456
2457 test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */
2460 SetFocus(wnd2);
2462 SetFocus(wnd1);
2465
2466 ITfDocumentMgr_Release(dm1);
2467 ITfDocumentMgr_Release(dm2);
2468
2469 test_CurrentFocus = dmorig;
2473 ITfThreadMgr_SetFocus(g_tm,dmorig);
2474 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2475
2476 test_OnSetFocus = SINK_IGNORE; /* OnSetFocus fires a couple of times on Win7 */
2479 DestroyWindow(wnd1);
2480 DestroyWindow(wnd2);
2481 test_OnPopContext = SINK_OPTIONAL; /* Vista and greater */
2482 test_OnSetFocus = SINK_OPTIONAL; /* Vista and greater */
2483 ITfThreadMgr_GetFocus(g_tm, &test_PrevFocus);
2485 test_ShouldDeactivate = TRUE; /* Win7 */
2486 DestroyWindow(wnd3);
2488 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
2489 sink_check_ok(&test_OnPopContext,"OnPopContext");
2490}
#define broken(x)
Definition: atltest.h:178
static INT test_OnSetFocus
static BOOL test_ShouldDeactivate
static INT test_OnPushContext
#define sink_check_saved(s, p, c, n)
static INT test_OnPopContext
static ITfDocumentMgr * test_PrevFocus
static INT test_ACP_GetStatus
static INT test_OnInitDocumentMgr
static ITfDocumentMgr * test_CurrentFocus
#define WS_POPUP
Definition: pedump.c:616
#define SW_SHOWNORMAL
Definition: winuser.h:773
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by START_TEST().

◆ test_ClientId()

static void test_ClientId ( void  )
static

Definition at line 1943 of file inputprocessor.c.

1944{
1945 ITfClientId *pcid;
1946 TfClientId id1,id2;
1947 HRESULT hr;
1948 GUID g2;
1949
1950 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfClientId, (LPVOID*)&pcid);
1951 ok(SUCCEEDED(hr),"Unable to acquire ITfClientId interface\n");
1952
1953 CoCreateGuid(&g2);
1954
1955 hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id1);
1956 ok(SUCCEEDED(hr),"GetClientId failed\n");
1957 hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id2);
1958 ok(SUCCEEDED(hr),"GetClientId failed\n");
1959 ok(id1==id2,"Id's for GUID_NULL do not match\n");
1960 hr = ITfClientId_GetClientId(pcid,&CLSID_FakeService,&id2);
1961 ok(SUCCEEDED(hr),"GetClientId failed\n");
1962 ok(id2!=id1,"Id matches GUID_NULL\n");
1963 ok(id2==tid,"Id for CLSID_FakeService not matching tid\n");
1964 ok(id2!=cid,"Id for CLSID_FakeService matching cid\n");
1965 hr = ITfClientId_GetClientId(pcid,&g2,&id2);
1966 ok(SUCCEEDED(hr),"GetClientId failed\n");
1967 ok(id2!=id1,"Id matches GUID_NULL\n");
1968 ok(id2!=tid,"Id for random guid matching tid\n");
1969 ok(id2!=cid,"Id for random guid matching cid\n");
1970 ITfClientId_Release(pcid);
1971}
HRESULT WINAPI CoCreateGuid(GUID *pguid)
Definition: compobj.c:2206
#define GUID_NULL
Definition: ks.h:106
static TfClientId tid
static TfClientId cid
DWORD TfClientId
Definition: msctf.idl:105

Referenced by START_TEST().

◆ test_Compartments()

static void test_Compartments ( void  )
static

Definition at line 2245 of file inputprocessor.c.

2246{
2247 ITfContext *cxt;
2248 ITfDocumentMgr *dm;
2249 ITfCompartmentMgr *cmpmgr;
2251 HRESULT hr;
2252
2253 ITfThreadMgr_GetFocus(g_tm, &dm);
2254 ITfDocumentMgr_GetTop(dm,&cxt);
2255
2256 /* Global */
2257 hr = ITfThreadMgr_GetGlobalCompartment(g_tm, &cmpmgr);
2258 ok(SUCCEEDED(hr),"GetGlobalCompartment failed\n");
2259 hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &GUID_COMPARTMENT_SPEECH_OPENCLOSE, &cmp);
2260 ok(SUCCEEDED(hr),"GetCompartment failed\n");
2261 ITfCompartment_Release(cmp);
2263 ITfCompartmentMgr_Release(cmpmgr);
2264
2265 /* Thread */
2266 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2267 ok(SUCCEEDED(hr),"ThreadMgr QI for IID_ITfCompartmentMgr failed\n");
2268 hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &CLSID_FakeService, &cmp);
2269 ok(SUCCEEDED(hr),"GetCompartment failed\n");
2270 enum_compartments(cmpmgr,&CLSID_FakeService,&GUID_COMPARTMENT_SPEECH_OPENCLOSE);
2271 ITfCompartmentMgr_ClearCompartment(cmpmgr,tid,&CLSID_FakeService);
2272 enum_compartments(cmpmgr,NULL,&CLSID_FakeService);
2273 ITfCompartmentMgr_Release(cmpmgr);
2274 ITfCompartment_Release(cmp);
2275
2276 /* DocumentMgr */
2277 hr = ITfDocumentMgr_QueryInterface(dm, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2278 ok(SUCCEEDED(hr),"DocumentMgr QI for IID_ITfCompartmentMgr failed\n");
2279
2280 hr = ITfCompartmentMgr_GetCompartment(cmpmgr, &GUID_COMPARTMENT_PERSISTMENUENABLED, &cmp);
2281 ok(SUCCEEDED(hr),"GetCompartment failed\n");
2283 ITfCompartmentMgr_Release(cmpmgr);
2284
2285 /* Context */
2286 hr = ITfContext_QueryInterface(cxt, &IID_ITfCompartmentMgr, (LPVOID*)&cmpmgr);
2287 ok(SUCCEEDED(hr),"Context QI for IID_ITfCompartmentMgr failed\n");
2289 ITfCompartmentMgr_Release(cmpmgr);
2290
2291 ITfContext_Release(cxt);
2292 ITfDocumentMgr_Release(dm);
2293}
static void enum_compartments(ITfCompartmentMgr *cmpmgr, REFGUID present, REFGUID absent)
#define cmp(status, error)
Definition: error.c:114
EXTERN_C const GUID GUID_COMPARTMENT_PERSISTMENUENABLED
Definition: msctf.idl:94
EXTERN_C const GUID GUID_COMPARTMENT_SPEECH_OPENCLOSE
Definition: msctf.idl:92

Referenced by START_TEST().

◆ test_Disable()

static void test_Disable ( void  )
static

Definition at line 1214 of file inputprocessor.c.

1215{
1216 HRESULT hr;
1217
1218 trace("Disabling\n");
1219 hr = ITfInputProcessorProfiles_EnableLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, FALSE);
1220 ok(SUCCEEDED(hr),"Failed to disable text service\n");
1221}

Referenced by START_TEST().

◆ test_DocumentMgrAdviseSinks()

static void test_DocumentMgrAdviseSinks ( void  )
static

Definition at line 1290 of file inputprocessor.c.

1291{
1293 HRESULT hr;
1294
1295 hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source);
1296 ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n");
1297
1298 dmSinkCookie = 0;
1299 hr = ITfSource_AdviseSink(source, &IID_ITfTransitoryExtensionSink, (IUnknown*)&TfTransitoryExtensionSink, &dmSinkCookie);
1300 ok(hr == S_OK,"Failed to Advise Sink\n");
1301
1302 ITfSource_Release(source);
1303}
static DWORD dmSinkCookie
static ITfTransitoryExtensionSink TfTransitoryExtensionSink

Referenced by START_TEST().

◆ test_DocumentMgrUnadviseSinks()

static void test_DocumentMgrUnadviseSinks ( void  )
static

Definition at line 1305 of file inputprocessor.c.

1306{
1308 HRESULT hr;
1309
1310 hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source);
1311 ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n");
1312
1313 hr = ITfSource_UnadviseSink(source, dmSinkCookie);
1314 ok(hr == S_OK,"Failed to unadvise Sink\n");
1315 ITfSource_Release(source);
1316}

Referenced by START_TEST().

◆ test_Enable()

static void test_Enable ( void  )
static

Definition at line 1202 of file inputprocessor.c.

1203{
1204 HRESULT hr;
1205 BOOL enabled = FALSE;
1206
1207 hr = ITfInputProcessorProfiles_EnableLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, TRUE);
1208 ok(SUCCEEDED(hr),"Failed to enable text service\n");
1209 hr = ITfInputProcessorProfiles_IsEnabledLanguageProfile(g_ipp,&CLSID_FakeService, gLangid, &CLSID_FakeService, &enabled);
1210 ok(SUCCEEDED(hr),"Failed to get enabled state\n");
1211 ok(enabled == TRUE,"enabled state incorrect\n");
1212}
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750

Referenced by START_TEST().

◆ test_endSession()

static void test_endSession ( void  )
static

Definition at line 1891 of file inputprocessor.c.

1892{
1893 HRESULT hr;
1897 test_OnSetFocus = SINK_OPTIONAL; /* Doesn't fire on Win7 */
1898 hr = ITfThreadMgr_Deactivate(g_tm);
1899 ok(SUCCEEDED(hr),"Failed to Deactivate\n");
1900 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
1902}

Referenced by START_TEST().

◆ test_EnumContexts()

static void test_EnumContexts ( ITfDocumentMgr dm,
ITfContext search 
)
static

Definition at line 1511 of file inputprocessor.c.

1512{
1513 HRESULT hr;
1514 IEnumTfContexts* pEnum;
1515 BOOL found = FALSE;
1516
1517 hr = ITfDocumentMgr_EnumContexts(dm,&pEnum);
1518 ok(SUCCEEDED(hr),"EnumContexts failed\n");
1519 if (SUCCEEDED(hr))
1520 {
1521 ULONG fetched;
1522 ITfContext *cxt;
1523 while (IEnumTfContexts_Next(pEnum, 1, &cxt, &fetched) == S_OK)
1524 {
1525 if (!search)
1526 found = TRUE;
1527 else if (search == cxt)
1528 found = TRUE;
1529 ITfContext_Release(cxt);
1530 }
1531 IEnumTfContexts_Release(pEnum);
1532 }
1533 if (search)
1534 ok(found,"Did not find proper ITfContext\n");
1535 else
1536 ok(!found,"Found an ITfContext we should should not have\n");
1537}
static short search(int val, const short *table, int size)
Definition: msg711.c:255

Referenced by test_startSession().

◆ test_EnumDocumentMgr()

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

Definition at line 1539 of file inputprocessor.c.

1540{
1541 HRESULT hr;
1542 IEnumTfDocumentMgrs* pEnum;
1543 BOOL found = FALSE;
1544 BOOL notfound = TRUE;
1545
1546 hr = ITfThreadMgr_EnumDocumentMgrs(tm,&pEnum);
1547 ok(SUCCEEDED(hr),"EnumDocumentMgrs failed\n");
1548 if (SUCCEEDED(hr))
1549 {
1550 ULONG fetched;
1551 ITfDocumentMgr *dm;
1552 while (IEnumTfDocumentMgrs_Next(pEnum, 1, &dm, &fetched) == S_OK)
1553 {
1554 if (!search)
1555 found = TRUE;
1556 else if (search == dm)
1557 found = TRUE;
1558 if (absent && dm == absent)
1559 notfound = FALSE;
1560 ITfDocumentMgr_Release(dm);
1561 }
1562 IEnumTfDocumentMgrs_Release(pEnum);
1563 }
1564 if (search)
1565 ok(found,"Did not find proper ITfDocumentMgr\n");
1566 else
1567 ok(!found,"Found an ITfDocumentMgr we should should not have\n");
1568 if (absent)
1569 ok(notfound,"Found an ITfDocumentMgr we believe should be absent\n");
1570}
Definition: time.h:68

Referenced by test_startSession().

◆ test_EnumInputProcessorInfo()

static void test_EnumInputProcessorInfo ( void  )
static

Definition at line 1118 of file inputprocessor.c.

1119{
1120 IEnumGUID *ppEnum;
1121 BOOL found = FALSE;
1122
1123 if (SUCCEEDED(ITfInputProcessorProfiles_EnumInputProcessorInfo(g_ipp, &ppEnum)))
1124 {
1125 ULONG fetched;
1126 GUID g;
1127 while (IEnumGUID_Next(ppEnum, 1, &g, &fetched) == S_OK)
1128 {
1129 if(IsEqualGUID(&g,&CLSID_FakeService))
1130 found = TRUE;
1131 }
1132 IEnumGUID_Release(ppEnum);
1133 }
1134 ok(found,"Did not find registered text service\n");
1135}

Referenced by START_TEST().

◆ test_EnumLanguageProfiles()

static void test_EnumLanguageProfiles ( void  )
static

Definition at line 1137 of file inputprocessor.c.

1138{
1139 BOOL found = FALSE;
1141 HRESULT hr;
1142
1143 hr = ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp, gLangid, NULL);
1144 ok(hr == E_INVALIDARG, "EnumLanguageProfiles failed: %x\n", hr);
1145
1146 if (SUCCEEDED(ITfInputProcessorProfiles_EnumLanguageProfiles(g_ipp,gLangid,&ppEnum)))
1147 {
1149 while (IEnumTfLanguageProfiles_Next(ppEnum,1,&profile,NULL)==S_OK)
1150 {
1151 if (IsEqualGUID(&profile.clsid,&CLSID_FakeService))
1152 {
1153 found = TRUE;
1154 ok(profile.langid == gLangid, "LangId Incorrect\n");
1156 broken(IsEqualGUID(&profile.catid,&GUID_NULL) /* Win8 */), "CatId Incorrect\n");
1157 ok(IsEqualGUID(&profile.guidProfile,&CLSID_FakeService), "guidProfile Incorrect\n");
1158 }
1159 }
1160 IEnumTfLanguageProfiles_Release(ppEnum);
1161 }
1162 ok(found,"Registered text service not found\n");
1163}
#define profile
Definition: kernel32.h:12
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:99

Referenced by START_TEST().

◆ test_FindClosestCategory()

static void test_FindClosestCategory ( void  )
static

Definition at line 1183 of file inputprocessor.c.

1184{
1185 GUID output;
1186 HRESULT hr;
1188
1189 hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, NULL, 0);
1190 ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1191 ok(IsEqualGUID(&output,&GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER),"Wrong GUID\n");
1192
1193 hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, list, 1);
1194 ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1195 ok(IsEqualGUID(&output,&GUID_NULL),"Wrong GUID\n");
1196
1197 hr = ITfCategoryMgr_FindClosestCategory(g_cm, &CLSID_FakeService, &output, list, 3);
1198 ok(SUCCEEDED(hr),"ITfCategoryMgr_FindClosestCategory failed (%x)\n",hr);
1199 ok(IsEqualGUID(&output,&GUID_TFCAT_TIP_KEYBOARD),"Wrong GUID\n");
1200}
Definition: list.h:37
EXTERN_C const GUID GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER
Definition: msctf.idl:102
EXTERN_C const GUID GUID_TFCAT_TIP_SPEECH
Definition: msctf.idl:100
EXTERN_C const GUID GUID_TFCAT_TIP_HANDWRITING
Definition: msctf.idl:101

Referenced by START_TEST().

◆ test_InsertAtSelection()

static void test_InsertAtSelection ( TfEditCookie  ec,
ITfContext cxt 
)
static

Definition at line 2027 of file inputprocessor.c.

2028{
2029 HRESULT hr;
2032 static const WCHAR txt[] = {'H','e','l','l','o',' ','W','o','r','l','d',0};
2033
2034 hr = ITfContext_QueryInterface(cxt, &IID_ITfInsertAtSelection , (LPVOID*)&iis);
2035 ok(SUCCEEDED(hr),"Failed to get ITfInsertAtSelection interface\n");
2037 hr = ITfInsertAtSelection_InsertTextAtSelection(iis, ec, 0, txt, 11, &range);
2038 ok(SUCCEEDED(hr),"ITfInsertAtSelection_InsertTextAtSelection failed %x\n",hr);
2039 sink_check_ok(&test_ACP_InsertTextAtSelection,"InsertTextAtSelection");
2040 ok(range != NULL,"No range returned\n");
2041 ITfRange_Release(range);
2042 ITfInsertAtSelection_Release(iis);
2043}
static INT test_ACP_InsertTextAtSelection

Referenced by EditSession_DoEditSession().

◆ test_KeystrokeMgr()

static void test_KeystrokeMgr ( void  )
static

Definition at line 1444 of file inputprocessor.c.

1445{
1446 ITfKeystrokeMgr *keymgr= NULL;
1447 HRESULT hr;
1448 TF_PRESERVEDKEY tfpk;
1449 BOOL preserved;
1451
1453
1454 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfKeystrokeMgr, (LPVOID*)&keymgr);
1455 ok(SUCCEEDED(hr),"Failed to get IID_ITfKeystrokeMgr for ThreadMgr\n");
1456
1457 tfpk.uVKey = 'A';
1458 tfpk.uModifiers = TF_MOD_SHIFT;
1459
1461 hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
1462 ok(SUCCEEDED(hr),"ITfKeystrokeMgr_AdviseKeyEventSink failed\n");
1463 sink_check_ok(&test_KEV_OnSetFocus,"KeyEventSink_OnSetFocus");
1464 hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,tid,sink,TRUE);
1465 ok(hr == CONNECT_E_ADVISELIMIT,"Wrong return, expected CONNECT_E_ADVISELIMIT\n");
1466 hr = ITfKeystrokeMgr_AdviseKeyEventSink(keymgr,cid,sink,TRUE);
1467 ok(hr == E_INVALIDARG,"Wrong return, expected E_INVALIDARG\n");
1468
1469 hr =ITfKeystrokeMgr_PreserveKey(keymgr, 0, &CLSID_PreservedKey, &tfpk, NULL, 0);
1470 ok(hr==E_INVALIDARG,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n");
1471
1472 hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0);
1473 ok(SUCCEEDED(hr),"ITfKeystrokeMgr_PreserveKey failed\n");
1474
1475 hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0);
1476 ok(hr == TF_E_ALREADY_EXISTS,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n");
1477
1478 preserved = FALSE;
1479 hr = ITfKeystrokeMgr_IsPreservedKey(keymgr, &CLSID_PreservedKey, &tfpk, &preserved);
1480 ok(hr == S_OK, "ITfKeystrokeMgr_IsPreservedKey failed\n");
1481 if (hr == S_OK) ok(preserved == TRUE,"misreporting preserved key\n");
1482
1483 hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk);
1484 ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnpreserveKey failed\n");
1485
1486 hr = ITfKeystrokeMgr_IsPreservedKey(keymgr, &CLSID_PreservedKey, &tfpk, &preserved);
1487 ok(hr == S_FALSE, "ITfKeystrokeMgr_IsPreservedKey failed\n");
1488 if (hr == S_FALSE) ok(preserved == FALSE,"misreporting preserved key\n");
1489
1490 hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk);
1491 ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey improperly succeeded\n");
1492
1493 hr = ITfKeystrokeMgr_UnadviseKeyEventSink(keymgr,tid);
1494 ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnadviseKeyEventSink failed\n");
1495
1496 ITfKeystrokeMgr_Release(keymgr);
1497 ITfKeyEventSink_Release(sink);
1498}
static HRESULT KeyEventSink_Constructor(ITfKeyEventSink **ppOut)
#define CONNECT_E_ADVISELIMIT
Definition: olectl.h:252
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251
UINT uModifiers
Definition: msctf.idl:168
#define S_FALSE
Definition: winerror.h:2357

Referenced by START_TEST().

◆ test_MultiThreadApartment()

static void test_MultiThreadApartment ( void  )
static

Definition at line 2553 of file inputprocessor.c.

2554{
2555 DWORD ret;
2556 HANDLE thread;
2557
2559 ok(thread != NULL, "Failed to create test thread\n");
2560
2562 ok(ret == WAIT_OBJECT_0, "Failed to wait for thread completion\n");
2563
2565 ok(ret == 0xdeadcafe, "Thread terminated in an unexpected way\n");
2566
2568}
static HANDLE thread
Definition: service.c:33
#define CloseHandle
Definition: compat.h:739
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:541
#define INFINITE
Definition: serial.h:102
static DWORD WINAPI test_MultiThreadApartment_Thread(void *param)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define WAIT_OBJECT_0
Definition: winbase.h:432

Referenced by START_TEST().

◆ test_MultiThreadApartment_Thread()

static DWORD WINAPI test_MultiThreadApartment_Thread ( void param)
static

Definition at line 2514 of file inputprocessor.c.

2514 {
2515 ITfThreadMgrEx *thmgr;
2517 DWORD cookie;
2518 HRESULT hr;
2519
2521 ok(SUCCEEDED(hr), "Failed to initialize multi-threaded apartment\n");
2522
2523 hr = CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&thmgr);
2524 ok(SUCCEEDED(hr), "Failed to create ITfThreadMgrEx instance\n");
2525
2526#ifdef __REACTOS__
2527 // See CORE-16797
2528 if (!SUCCEEDED(hr))
2529 goto err_out;
2530#endif
2531
2532 hr = ITfThreadMgrEx_QueryInterface(thmgr, &IID_ITfSource, (LPVOID *)&source);
2533 ok(SUCCEEDED(hr), "Failed to query ITfSource interface\n");
2534
2535 hr = ITfSource_AdviseSink(source, &IID_ITfUIElementSink, (IUnknown*)&TfUIElementSink, &cookie);
2536 ok(hr == REGDB_E_IIDNOTREG /* native */ || hr == E_NOINTERFACE /* wine */,
2537 "Advise ITfUIElementSink should return marshalling failure: %08x\n", hr);
2538
2539 hr = ITfSource_Release(source);
2540 ok(SUCCEEDED(hr), "Failed to Release source\n");
2541
2542 hr = ITfThreadMgrEx_Release(thmgr);
2543 ok(SUCCEEDED(hr), "Failed to Release thread manager\n");
2544#ifdef __REACTOS__
2545err_out:
2546#endif
2547
2549
2550 return 0xdeadcafe;
2551}
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
static ITfUIElementSink TfUIElementSink
@ COINIT_MULTITHREADED
Definition: objbase.h:279
Definition: cookie.c:34
#define REGDB_E_IIDNOTREG
Definition: winerror.h:2697

Referenced by test_MultiThreadApartment().

◆ test_profile_mgr()

static void test_profile_mgr ( void  )
static

Definition at line 2492 of file inputprocessor.c.

2493{
2494 IEnumTfInputProcessorProfiles *enum_profiles;
2495 ITfInputProcessorProfileMgr *ipp_mgr;
2496 HRESULT hres;
2497
2498 hres = ITfInputProcessorProfiles_QueryInterface(g_ipp, &IID_ITfInputProcessorProfileMgr, (void**)&ipp_mgr);
2499 if (hres != S_OK)
2500 {
2501 win_skip("ITfInputProcessorProfileMgr is not supported.\n");
2502 return;
2503 }
2504 ok(hres == S_OK, "Could not get ITfInputProcessorProfileMgr iface: %08x\n", hres);
2505
2506 hres = ITfInputProcessorProfileMgr_EnumProfiles(ipp_mgr, 0, &enum_profiles);
2507 ok(hres == S_OK, "EnumProfiles failed: %08x\n", hres);
2508
2509 IEnumTfInputProcessorProfiles_Release(enum_profiles);
2510
2511 ITfInputProcessorProfileMgr_Release(ipp_mgr);
2512}
HRESULT hres
Definition: protocol.c:465
#define win_skip
Definition: test.h:163

Referenced by START_TEST().

◆ test_Register()

static void test_Register ( void  )
static

Definition at line 1090 of file inputprocessor.c.

1091{
1092 HRESULT hr;
1093
1094 static const WCHAR szDesc[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',0};
1095 static const WCHAR szFile[] = {'F','a','k','e',' ','W','i','n','e',' ','S','e','r','v','i','c','e',' ','F','i','l','e',0};
1096
1097 hr = ITfInputProcessorProfiles_GetCurrentLanguage(g_ipp,&gLangid);
1098 ok(SUCCEEDED(hr),"Unable to get current language id\n");
1099 trace("Current Language %x\n",gLangid);
1100
1101 hr = RegisterTextService(&CLSID_FakeService);
1102 ok(SUCCEEDED(hr),"Unable to register COM for TextService\n");
1103 hr = ITfInputProcessorProfiles_Register(g_ipp, &CLSID_FakeService);
1104 ok(SUCCEEDED(hr),"Unable to register text service(%x)\n",hr);
1105 hr = ITfInputProcessorProfiles_AddLanguageProfile(g_ipp, &CLSID_FakeService, gLangid,
1106 &CLSID_FakeService, szDesc, ARRAY_SIZE(szDesc), szFile, ARRAY_SIZE(szFile), 1);
1107 ok(SUCCEEDED(hr),"Unable to add Language Profile (%x)\n",hr);
1108}
static HRESULT RegisterTextService(REFCLSID rclsid)

Referenced by START_TEST().

◆ test_RegisterCategory()

static void test_RegisterCategory ( void  )
static

Definition at line 1165 of file inputprocessor.c.

1166{
1167 HRESULT hr;
1168 hr = ITfCategoryMgr_RegisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_TIP_KEYBOARD, &CLSID_FakeService);
1169 ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterCategory failed\n");
1170 hr = ITfCategoryMgr_RegisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &CLSID_FakeService);
1171 ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterCategory failed\n");
1172}

Referenced by START_TEST().

◆ test_startSession()

static void test_startSession ( void  )
static

Definition at line 1665 of file inputprocessor.c.

1666{
1667 HRESULT hr;
1668 DWORD cnt;
1669 DWORD editCookie;
1670 ITfDocumentMgr *dmtest;
1671 ITfContext *cxt,*cxt2,*cxt3,*cxtTest;
1672 ITextStoreACP *ts = NULL;
1673 TfClientId cid2 = 0;
1674 ITfThreadMgrEx *tmex;
1675
1676 hr = ITfThreadMgr_Deactivate(g_tm);
1677 ok(hr == E_UNEXPECTED,"Deactivate should have failed with E_UNEXPECTED\n");
1678
1680 hr = ITfThreadMgr_Activate(g_tm,&cid);
1681 ok(SUCCEEDED(hr),"Failed to Activate\n");
1682 ok(cid != tid,"TextService id mistakenly matches Client id\n");
1683
1684 todo_wine ok(fake_service_onactivated_flags & TF_IPSINK_FLAG_ACTIVE, "Expected OnActivated callback\n");
1685
1687 hr = ITfThreadMgr_Activate(g_tm,&cid2);
1688 ok(SUCCEEDED(hr),"Failed to Activate\n");
1689 ok(cid == cid2, "Second activate client ID does not match\n");
1690
1691 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfThreadMgrEx, (void **)&tmex);
1692 if (hr == S_OK)
1693 {
1694 hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0);
1695 ok(SUCCEEDED(hr), "Failed to Activate\n");
1696 ok(cid == cid2, "ActivateEx client ID does not match\n");
1697
1698 ITfThreadMgrEx_Release(tmex);
1699 }
1700 else
1701 win_skip("ITfThreadMgrEx is not supported\n");
1702
1703 hr = ITfThreadMgr_Deactivate(g_tm);
1704 ok(SUCCEEDED(hr), "Failed to Deactivate\n");
1705 hr = ITfThreadMgr_Deactivate(g_tm);
1706 ok(SUCCEEDED(hr), "Failed to Deactivate\n");
1707
1709
1710 hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&g_dm);
1711 ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
1712
1714
1715 hr = ITfThreadMgr_CreateDocumentMgr(g_tm,&dmtest);
1716 ok(SUCCEEDED(hr),"CreateDocumentMgr failed\n");
1717
1719
1720 ITfDocumentMgr_Release(dmtest);
1722
1723 hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1724 ok(SUCCEEDED(hr),"GetFocus Failed\n");
1725 ok(dmtest == NULL,"Initial focus not null\n");
1726
1729 test_OnSetFocus = SINK_OPTIONAL; /* Doesn't always fire on Win7 */
1730 hr = ITfThreadMgr_SetFocus(g_tm,g_dm);
1731 ok(SUCCEEDED(hr),"SetFocus Failed\n");
1732 sink_check_ok(&test_OnSetFocus,"OnSetFocus");
1733
1734 hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1735 ok(SUCCEEDED(hr),"GetFocus Failed\n");
1736 ok(g_dm == dmtest,"Expected DocumentMgr not focused\n");
1737
1738 ITfDocumentMgr_Release(g_dm);
1739
1740 hr = ITfThreadMgr_GetFocus(g_tm,&dmtest);
1741 ok(SUCCEEDED(hr),"GetFocus Failed\n");
1742 ok(g_dm == dmtest,"Expected DocumentMgr not focused\n");
1743 ITfDocumentMgr_Release(dmtest);
1744
1746 ok(SUCCEEDED(hr),"Constructor Failed\n");
1747 if (FAILED(hr)) return;
1748
1749 hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt, &editCookie);
1750 ok(SUCCEEDED(hr),"CreateContext Failed\n");
1751
1752 hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, NULL, &cxt2, &editCookie);
1753 ok(SUCCEEDED(hr),"CreateContext Failed\n");
1754
1755 hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, NULL, &cxt3, &editCookie);
1756 ok(SUCCEEDED(hr),"CreateContext Failed\n");
1757
1759
1760 hr = ITfContext_GetDocumentMgr(cxt,&dmtest);
1761 ok(hr == S_OK, "ITfContext_GetDocumentMgr failed with %x\n",hr);
1762 ok(dmtest == g_dm, "Wrong documentmgr\n");
1763 ITfDocumentMgr_Release(dmtest);
1764
1765 cnt = check_context_refcount(cxt);
1769 hr = ITfDocumentMgr_Push(g_dm, cxt);
1770 ok(SUCCEEDED(hr),"Push Failed\n");
1771 ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1772 sink_check_ok(&test_OnPushContext,"OnPushContext");
1773 sink_check_ok(&test_OnInitDocumentMgr,"OnInitDocumentMgr");
1774 sink_check_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
1775
1776 test_EnumContexts(g_dm, cxt);
1777
1778 hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1779 ok(SUCCEEDED(hr),"GetTop Failed\n");
1780 ok(cxtTest == cxt, "Wrong context on top\n");
1781 ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1782 cnt = ITfContext_Release(cxtTest);
1783
1784 hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1785 ok(SUCCEEDED(hr),"GetBase Failed\n");
1786 ok(cxtTest == cxt, "Wrong context on Base\n");
1787 ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1788 ITfContext_Release(cxtTest);
1789
1792 hr = ITfDocumentMgr_Push(g_dm, cxt2);
1793 ok(SUCCEEDED(hr),"Push Failed\n");
1794 sink_check_ok(&test_OnPushContext,"OnPushContext");
1795
1796 cnt = check_context_refcount(cxt2);
1797 hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1798 ok(SUCCEEDED(hr),"GetTop Failed\n");
1799 ok(cxtTest == cxt2, "Wrong context on top\n");
1800 ok(check_context_refcount(cxt2) > cnt, "Ref count did not increase\n");
1801 ITfContext_Release(cxtTest);
1802
1803 cnt = check_context_refcount(cxt);
1804 hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1805 ok(SUCCEEDED(hr),"GetBase Failed\n");
1806 ok(cxtTest == cxt, "Wrong context on Base\n");
1807 ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1808 ITfContext_Release(cxtTest);
1809
1810 cnt = check_context_refcount(cxt3);
1811 hr = ITfDocumentMgr_Push(g_dm, cxt3);
1812 ok(FAILED(hr),"Push Succeeded\n");
1813 ok(check_context_refcount(cxt3) == cnt, "Ref changed\n");
1814
1815 cnt = check_context_refcount(cxt2);
1816 hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1817 ok(SUCCEEDED(hr),"GetTop Failed\n");
1818 ok(cxtTest == cxt2, "Wrong context on top\n");
1819 ok(check_context_refcount(cxt2) > cnt, "Ref count did not increase\n");
1820 ITfContext_Release(cxtTest);
1821
1822 cnt = check_context_refcount(cxt);
1823 hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1824 ok(SUCCEEDED(hr),"GetBase Failed\n");
1825 ok(cxtTest == cxt, "Wrong context on Base\n");
1826 ok(check_context_refcount(cxt) > cnt, "Ref count did not increase\n");
1827 ITfContext_Release(cxtTest);
1828
1829 cnt = check_context_refcount(cxt2);
1831 hr = ITfDocumentMgr_Pop(g_dm, 0);
1832 ok(SUCCEEDED(hr),"Pop Failed\n");
1833 ok(check_context_refcount(cxt2) < cnt, "Ref count did not decrease\n");
1834 sink_check_ok(&test_OnPopContext,"OnPopContext");
1835
1836 dmtest = (void *)0xfeedface;
1837 hr = ITfContext_GetDocumentMgr(cxt2,&dmtest);
1838 ok(hr == S_FALSE, "ITfContext_GetDocumentMgr wrong rc %x\n",hr);
1839 ok(dmtest == NULL,"returned documentmgr should be null\n");
1840
1841 ITfContext_Release(cxt2);
1842
1843 hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1844 ok(SUCCEEDED(hr),"GetTop Failed\n");
1845 ok(cxtTest == cxt, "Wrong context on top\n");
1846 ITfContext_Release(cxtTest);
1847
1848 hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1849 ok(SUCCEEDED(hr),"GetBase Failed\n");
1850 ok(cxtTest == cxt, "Wrong context on base\n");
1851 ITfContext_Release(cxtTest);
1852
1853 hr = ITfDocumentMgr_CreateContext(g_dm, cid, 0, (IUnknown*)ts, &cxt2, &editCookie);
1854 ok(hr == S_OK,"CreateContext Failed\n");
1855
1858 hr = ITfDocumentMgr_Push(g_dm, cxt2);
1859 ok(hr == S_OK,"Push Failed\n");
1860 sink_check_ok(&test_OnPushContext,"OnPushContext");
1861 sink_check_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
1862
1864 cnt = check_context_refcount(cxt2);
1866 hr = ITfDocumentMgr_Pop(g_dm, 0);
1867 ok(hr == S_OK,"Pop Failed\n");
1868 ok(check_context_refcount(cxt2) < cnt, "Ref count did not decrease\n");
1869 sink_check_ok(&test_OnPopContext,"OnPopContext");
1870 sink_check_ok(&test_ACP_UnadviseSink,"TextStoreACP_AdviseSink");
1871
1872 hr = ITfDocumentMgr_Pop(g_dm, 0);
1873 ok(FAILED(hr),"Pop Succeeded\n");
1874
1875 hr = ITfDocumentMgr_GetTop(g_dm, &cxtTest);
1876 ok(SUCCEEDED(hr),"GetTop Failed\n");
1877 ok(cxtTest == cxt, "Wrong context on top\n");
1878 ITfContext_Release(cxtTest);
1879
1880 hr = ITfDocumentMgr_GetBase(g_dm, &cxtTest);
1881 ok(SUCCEEDED(hr),"GetBase Failed\n");
1882 ok(cxtTest == cxt, "Wrong context on base\n");
1883 ITfContext_Release(cxtTest);
1884
1885 ITfContext_Release(cxt);
1886 ITfContext_Release(cxt2);
1887 ITfContext_Release(cxt3);
1888 ITextStoreACP_Release(ts);
1889}
static int check_context_refcount(ITfContext *iface)
static INT test_ACP_UnadviseSink
static HRESULT TextStoreACP_Constructor(IUnknown **ppOut)
static void test_EnumDocumentMgr(ITfThreadMgr *tm, ITfDocumentMgr *search, ITfDocumentMgr *absent)
static void test_EnumContexts(ITfDocumentMgr *dm, ITfContext *search)
static INT test_ACP_AdviseSink
#define todo_wine
Definition: custom.c:89
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by START_TEST().

◆ test_TfGuidAtom()

static void test_TfGuidAtom ( void  )
static

Definition at line 1904 of file inputprocessor.c.

1905{
1906 GUID gtest,g1;
1907 HRESULT hr;
1908 TfGuidAtom atom1,atom2;
1909 BOOL equal;
1910
1911 CoCreateGuid(&gtest);
1912
1913 /* msdn reports this should return E_INVALIDARG. However my test show it crashing (winxp)*/
1914 /*
1915 hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,NULL);
1916 ok(hr==E_INVALIDARG,"ITfCategoryMgr_RegisterGUID should have failed\n");
1917 */
1918 hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,&atom1);
1919 ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterGUID failed\n");
1920 hr = ITfCategoryMgr_RegisterGUID(g_cm,&gtest,&atom2);
1921 ok(SUCCEEDED(hr),"ITfCategoryMgr_RegisterGUID failed\n");
1922 ok(atom1 == atom2,"atoms do not match\n");
1923 hr = ITfCategoryMgr_GetGUID(g_cm,atom2,NULL);
1924 ok(hr==E_INVALIDARG,"ITfCategoryMgr_GetGUID should have failed\n");
1925 hr = ITfCategoryMgr_GetGUID(g_cm,atom2,&g1);
1926 ok(SUCCEEDED(hr),"ITfCategoryMgr_GetGUID failed\n");
1927 ok(IsEqualGUID(&g1,&gtest),"guids do not match\n");
1928 hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,atom1,&gtest,NULL);
1929 ok(hr==E_INVALIDARG,"ITfCategoryMgr_IsEqualTfGuidAtom should have failed\n");
1930 hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,atom1,&gtest,&equal);
1931 ok(SUCCEEDED(hr),"ITfCategoryMgr_IsEqualTfGuidAtom failed\n");
1932 ok(equal == TRUE,"Equal value invalid\n");
1933
1934 /* show that cid and tid TfClientIds are also TfGuidAtoms */
1935 hr = ITfCategoryMgr_IsEqualTfGuidAtom(g_cm,tid,&CLSID_FakeService,&equal);
1936 ok(SUCCEEDED(hr),"ITfCategoryMgr_IsEqualTfGuidAtom failed\n");
1937 ok(equal == TRUE,"Equal value invalid\n");
1938 hr = ITfCategoryMgr_GetGUID(g_cm,cid,&g1);
1939 ok(SUCCEEDED(hr),"ITfCategoryMgr_GetGUID failed\n");
1940 ok(!IsEqualGUID(&g1,&GUID_NULL),"guid should not be NULL\n");
1941}
DWORD TfGuidAtom
Definition: msctf.idl:106
#define equal(x, y)
Definition: reader.cc:56

Referenced by START_TEST().

◆ test_ThreadMgrAdviseSinks()

static void test_ThreadMgrAdviseSinks ( void  )
static

Definition at line 1223 of file inputprocessor.c.

1224{
1226 HRESULT hr;
1227 IUnknown *sink;
1228
1229 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfSource, (LPVOID*)&source);
1230 ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for ThreadMgr\n");
1231 if (!source)
1232 return;
1233
1235 ok(hr == S_OK, "got %08x\n", hr);
1236 if(FAILED(hr)) return;
1237
1238 tmSinkRefCount = 1;
1239 tmSinkCookie = 0;
1240 hr = ITfSource_AdviseSink(source,&IID_ITfThreadMgrEventSink, sink, &tmSinkCookie);
1241 ok(hr == S_OK, "Failed to Advise ITfThreadMgrEventSink\n");
1242 ok(tmSinkCookie!=0,"Failed to get sink cookie\n");
1243
1244 /* Advising the sink adds a ref, Releasing here lets the object be deleted
1245 when unadvised */
1246 tmSinkRefCount = 2;
1247 IUnknown_Release(sink);
1248
1249 hr = ITfSource_AdviseSink(source, &IID_ITfKeyTraceEventSink, (IUnknown*)&TfKeyTraceEventSink,
1251 ok(hr == S_OK, "Failed to Advise ITfKeyTraceEventSink\n");
1252
1253 hr = ITfSource_AdviseSink(source, &IID_ITfUIElementSink, (IUnknown*)&TfUIElementSink,
1255 ok(hr == S_OK, "Failed to Advise ITfUIElementSink\n");
1256
1257 hr = ITfSource_AdviseSink(source, &IID_ITfInputProcessorProfileActivationSink, (IUnknown*)&TfInputProcessorProfileActivationSink,
1259 ok(hr == S_OK, "Failed to Advise ITfInputProcessorProfileActivationSink\n");
1260
1261 ITfSource_Release(source);
1262}
static DWORD tmSinkCookie
static DWORD tmSinkRefCount
static DWORD profile_activation_sink_cookie
static ITfInputProcessorProfileActivationSink TfInputProcessorProfileActivationSink
static DWORD ui_element_sink_cookie
static HRESULT ThreadMgrEventSink_Constructor(IUnknown **ppOut)
static DWORD key_trace_sink_cookie
static ITfKeyTraceEventSink TfKeyTraceEventSink

Referenced by START_TEST().

◆ test_ThreadMgrUnadviseSinks()

static void test_ThreadMgrUnadviseSinks ( void  )
static

Definition at line 1264 of file inputprocessor.c.

1265{
1267 HRESULT hr;
1268
1269 hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfSource, (LPVOID*)&source);
1270 ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for ThreadMgr\n");
1271 if (!source)
1272 return;
1273
1274 tmSinkRefCount = 1;
1275 hr = ITfSource_UnadviseSink(source, tmSinkCookie);
1276 ok(hr == S_OK, "Failed to unadvise ITfThreadMgrEventSink\n");
1277
1278 hr = ITfSource_UnadviseSink(source, key_trace_sink_cookie);
1279 ok(hr == S_OK, "Failed to unadvise ITfKeyTraceEventSink\n");
1280
1281 hr = ITfSource_UnadviseSink(source, ui_element_sink_cookie);
1282 ok(hr == S_OK, "Failed to unadvise ITfUIElementSink\n");
1283
1284 hr = ITfSource_UnadviseSink(source, profile_activation_sink_cookie);
1285 ok(hr == S_OK, "Failed to unadvise ITfInputProcessorProfileActivationSink\n");
1286
1287 ITfSource_Release(source);
1288}

Referenced by START_TEST().

◆ test_TStoApplicationText()

static void test_TStoApplicationText ( void  )
static

Definition at line 2147 of file inputprocessor.c.

2148{
2149 HRESULT hr, hrSession;
2151 ITfContext *cxt;
2152 ITfDocumentMgr *dm;
2155 DWORD editSinkCookie = -1;
2156
2157 ITfThreadMgr_GetFocus(g_tm, &dm);
2159 ITfDocumentMgr_GetTop(dm,&cxt);
2160
2162 hr = ITfContext_QueryInterface(cxt,&IID_ITfSource,(LPVOID*)&source);
2163 ok(SUCCEEDED(hr),"Failed to get IID_ITfSource for Context\n");
2164 if (source)
2165 {
2166 hr = ITfSource_AdviseSink(source, &IID_ITfTextEditSink, (LPVOID)sink, &editSinkCookie);
2167 ok(SUCCEEDED(hr),"Failed to advise Sink\n");
2168 ok(editSinkCookie != -1,"Failed to get sink cookie\n");
2169 }
2170
2171 hrSession = 0xfeedface;
2172 /* Test no permissions flags */
2173 hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC, &hrSession);
2174 ok(hr == E_INVALIDARG,"RequestEditSession should have failed with %x not %x\n",E_INVALIDARG,hr);
2175 ok(hrSession == E_FAIL,"hrSession should be %x not %x\n",E_FAIL,hrSession);
2176
2178 hrSession = 0xfeedface;
2180 hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC|TF_ES_READWRITE, &hrSession);
2181 ok(SUCCEEDED(hr),"ITfContext_RequestEditSession failed\n");
2182 ok(hrSession == TS_E_READONLY,"Unexpected hrSession (%x)\n",hrSession);
2183 sink_check_ok(&test_ACP_GetStatus,"GetStatus");
2184
2185 /* signal a change to allow readwrite sessions */
2186 documentStatus = 0;
2188 ITextStoreACPSink_OnStatusChange(ACPSink,documentStatus);
2189 sink_check_ok(&test_ACP_RequestLock,"RequestLock");
2190
2194 hrSession = 0xfeedface;
2196 hr = ITfContext_RequestEditSession(cxt, tid, es, TF_ES_SYNC|TF_ES_READWRITE, &hrSession);
2197 ok(SUCCEEDED(hr),"ITfContext_RequestEditSession failed\n");
2198 sink_check_ok(&test_OnEndEdit,"OnEndEdit");
2199 sink_check_ok(&test_DoEditSession,"DoEditSession");
2200 sink_check_ok(&test_ACP_GetStatus,"GetStatus");
2201 ok(hrSession == 0xdeadcafe,"Unexpected hrSession (%x)\n",hrSession);
2202
2203 if (source)
2204 {
2205 hr = ITfSource_UnadviseSink(source, editSinkCookie);
2206 ok(SUCCEEDED(hr),"Failed to unadvise Sink\n");
2207 ITfSource_Release(source);
2208 }
2209 ITfTextEditSink_Release(sink);
2210 ITfContext_Release(cxt);
2211 ITfDocumentMgr_Release(dm);
2212 ITfEditSession_Release(es);
2213}
#define es
Definition: i386-dis.c:440
static HRESULT TextEditSink_Constructor(ITfTextEditSink **ppOut)
static HRESULT EditSession_Constructor(ITfEditSession **ppOut)
static DWORD documentStatus
static INT test_OnEndEdit
const DWORD TS_SD_READONLY
Definition: textstor.idl:40

Referenced by START_TEST().

◆ test_Unregister()

static void test_Unregister ( void  )
static

Definition at line 1110 of file inputprocessor.c.

1111{
1112 HRESULT hr;
1113 hr = ITfInputProcessorProfiles_Unregister(g_ipp, &CLSID_FakeService);
1114 ok(SUCCEEDED(hr),"Unable to unregister text service(%x)\n",hr);
1116}
static HRESULT UnregisterTextService(void)

Referenced by START_TEST().

◆ test_UnregisterCategory()

static void test_UnregisterCategory ( void  )
static

Definition at line 1174 of file inputprocessor.c.

1175{
1176 HRESULT hr;
1177 hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_TIP_KEYBOARD, &CLSID_FakeService);
1178 ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
1179 hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &CLSID_FakeService);
1180 ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
1181}

Referenced by START_TEST().

◆ TextEditSink_AddRef()

static ULONG WINAPI TextEditSink_AddRef ( ITfTextEditSink iface)
static

Definition at line 1616 of file inputprocessor.c.

1617{
1619 return InterlockedIncrement(&This->refCount);
1620}
static TextEditSink * impl_from_ITfTextEditSink(ITfTextEditSink *iface)

◆ TextEditSink_Constructor()

static HRESULT TextEditSink_Constructor ( ITfTextEditSink **  ppOut)
static

Definition at line 1649 of file inputprocessor.c.

1650{
1652
1653 *ppOut = NULL;
1655 if (This == NULL)
1656 return E_OUTOFMEMORY;
1657
1658 This->ITfTextEditSink_iface.lpVtbl = &TextEditSink_TextEditSinkVtbl;
1659 This->refCount = 1;
1660
1661 *ppOut = &This->ITfTextEditSink_iface;
1662 return S_OK;
1663}
static const ITfTextEditSinkVtbl TextEditSink_TextEditSinkVtbl

Referenced by test_TStoApplicationText().

◆ TextEditSink_Destructor()

static void TextEditSink_Destructor ( TextEditSink This)
static

Definition at line 1593 of file inputprocessor.c.

1594{
1596}

Referenced by TextEditSink_Release().

◆ TextEditSink_OnEndEdit()

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

Definition at line 1633 of file inputprocessor.c.

1635{
1636 sink_fire_ok(&test_OnEndEdit,"TextEditSink_OnEndEdit");
1637 return S_OK;
1638}

◆ TextEditSink_QueryInterface()

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

Definition at line 1598 of file inputprocessor.c.

1599{
1600 *ppvOut = NULL;
1601
1602 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfTextEditSink))
1603 {
1604 *ppvOut = iface;
1605 }
1606
1607 if (*ppvOut)
1608 {
1609 ITfTextEditSink_AddRef(iface);
1610 return S_OK;
1611 }
1612
1613 return E_NOINTERFACE;
1614}

◆ TextEditSink_Release()

static ULONG WINAPI TextEditSink_Release ( ITfTextEditSink iface)
static

Definition at line 1622 of file inputprocessor.c.

1623{
1625 ULONG ret;
1626
1627 ret = InterlockedDecrement(&This->refCount);
1628 if (ret == 0)
1630 return ret;
1631}
static void TextEditSink_Destructor(TextEditSink *This)

◆ TextService_Activate()

static HRESULT WINAPI TextService_Activate ( ITfTextInputProcessor iface,
ITfThreadMgr ptim,
TfClientId  id 
)
static

Definition at line 976 of file inputprocessor.c.

978{
979 trace("TextService_Activate\n");
980 ok(test_ShouldActivate,"Activation came unexpectedly\n");
981 tid = id;
982 return S_OK;
983}
GLuint id
Definition: glext.h:5910

◆ TextService_AddRef()

static ULONG WINAPI TextService_AddRef ( ITfTextInputProcessor iface)
static

Definition at line 959 of file inputprocessor.c.

960{
962 return InterlockedIncrement(&This->refCount);
963}
static TextService * impl_from_ITfTextInputProcessor(ITfTextInputProcessor *iface)

◆ TextService_Constructor()

static HRESULT TextService_Constructor ( IUnknown pUnkOuter,
IUnknown **  ppOut 
)
static

Definition at line 1002 of file inputprocessor.c.

1003{
1005 if (pUnkOuter)
1006 return CLASS_E_NOAGGREGATION;
1007
1009 if (This == NULL)
1010 return E_OUTOFMEMORY;
1011
1012 This->ITfTextInputProcessor_iface.lpVtbl = &TextService_TextInputProcessorVtbl;
1013 This->refCount = 1;
1014
1015 *ppOut = (IUnknown*)&This->ITfTextInputProcessor_iface;
1016 return S_OK;
1017}
static const ITfTextInputProcessorVtbl TextService_TextInputProcessorVtbl
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

Referenced by RegisterTextService().

◆ TextService_Deactivate()

static HRESULT WINAPI TextService_Deactivate ( ITfTextInputProcessor iface)
static

Definition at line 985 of file inputprocessor.c.

986{
987 trace("TextService_Deactivate\n");
988 ok(test_ShouldDeactivate,"Deactivation came unexpectedly\n");
989 return S_OK;
990}

◆ TextService_Destructor()

static void TextService_Destructor ( TextService This)
static

Definition at line 936 of file inputprocessor.c.

937{
939}

Referenced by TextService_Release().

◆ TextService_QueryInterface()

static HRESULT WINAPI TextService_QueryInterface ( ITfTextInputProcessor iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 941 of file inputprocessor.c.

942{
943 *ppvOut = NULL;
944
945 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfTextInputProcessor))
946 {
947 *ppvOut = iface;
948 }
949
950 if (*ppvOut)
951 {
952 ITfTextInputProcessor_AddRef(iface);
953 return S_OK;
954 }
955
956 return E_NOINTERFACE;
957}

◆ TextService_Release()

static ULONG WINAPI TextService_Release ( ITfTextInputProcessor iface)
static

Definition at line 965 of file inputprocessor.c.

966{
968 ULONG ret;
969
970 ret = InterlockedDecrement(&This->refCount);
971 if (ret == 0)
973 return ret;
974}
static void TextService_Destructor(TextService *This)

◆ TextStoreACP_AddRef()

static ULONG WINAPI TextStoreACP_AddRef ( ITextStoreACP iface)
static

Definition at line 213 of file inputprocessor.c.

214{
216 return InterlockedIncrement(&This->refCount);
217}
static TextStoreACP * impl_from_ITextStoreACP(ITextStoreACP *iface)

◆ TextStoreACP_AdviseSink()

static HRESULT WINAPI TextStoreACP_AdviseSink ( ITextStoreACP iface,
REFIID  riid,
IUnknown punk,
DWORD  dwMask 
)
static

Definition at line 230 of file inputprocessor.c.

232{
234 HRESULT hr;
235
236 sink_fire_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink");
237
238 if(ACPSink)
239 return S_OK;
240
241 hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink, (void**)&ACPSink);
242 ok(SUCCEEDED(hr),"Unable to QueryInterface on sink\n");
243
244 hr = ITextStoreACPSink_QueryInterface(ACPSink, &IID_ITextStoreACPServices, (void**)&services);
245 ok(hr == S_OK, "got 0x%08x\n", hr);
246 ITextStoreACPServices_Release(services);
247
248 return S_OK;
249}

◆ TextStoreACP_Constructor()

static HRESULT TextStoreACP_Constructor ( IUnknown **  ppOut)
static

Definition at line 458 of file inputprocessor.c.

459{
461
463 if (This == NULL)
464 return E_OUTOFMEMORY;
465
466 This->ITextStoreACP_iface.lpVtbl = &TextStoreACP_TextStoreACPVtbl;
467 This->refCount = 1;
468
469 *ppOut = (IUnknown*)&This->ITextStoreACP_iface;
470 return S_OK;
471}
static const ITextStoreACPVtbl TextStoreACP_TextStoreACPVtbl

Referenced by test_startSession().

◆ TextStoreACP_Destructor()

static void TextStoreACP_Destructor ( TextStoreACP This)
static

Definition at line 190 of file inputprocessor.c.

191{
193}

Referenced by TextStoreACP_Release().

◆ TextStoreACP_FindNextAttrTransition()

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

Definition at line 372 of file inputprocessor.c.

375{
376 trace("\n");
377 return S_OK;
378}

◆ TextStoreACP_GetACPFromPoint()

static HRESULT WINAPI TextStoreACP_GetACPFromPoint ( ITextStoreACP iface,
TsViewCookie  vcView,
const POINT ptScreen,
DWORD  dwFlags,
LONG pacp 
)
static

Definition at line 397 of file inputprocessor.c.

400{
401 trace("\n");
402 return S_OK;
403}

◆ TextStoreACP_GetActiveView()

static HRESULT WINAPI TextStoreACP_GetActiveView ( ITextStoreACP iface,
TsViewCookie pvcView 
)
static

Definition at line 391 of file inputprocessor.c.

393{
394 trace("\n");
395 return S_OK;
396}

◆ TextStoreACP_GetEmbedded()

static HRESULT WINAPI TextStoreACP_GetEmbedded ( ITextStoreACP iface,
LONG  acpPos,
REFGUID  rguidService,
REFIID  riid,
IUnknown **  ppunk 
)
static

Definition at line 319 of file inputprocessor.c.

321{
322 trace("\n");
323 return S_OK;
324}

◆ TextStoreACP_GetEndACP()

static HRESULT WINAPI TextStoreACP_GetEndACP ( ITextStoreACP iface,
LONG pacp 
)
static

Definition at line 385 of file inputprocessor.c.

387{
388 sink_fire_ok(&test_ACP_GetEndACP,"TextStoreACP_GetEndACP");
389 return S_OK;
390}

◆ TextStoreACP_GetFormattedText()

static HRESULT WINAPI TextStoreACP_GetFormattedText ( ITextStoreACP iface,
LONG  acpStart,
LONG  acpEnd,
IDataObject **  ppDataObject 
)
static

Definition at line 313 of file inputprocessor.c.

315{
316 trace("\n");
317 return S_OK;
318}

◆ TextStoreACP_GetScreenExt()

static HRESULT WINAPI TextStoreACP_GetScreenExt ( ITextStoreACP iface,
TsViewCookie  vcView,
RECT prc 
)
static

Definition at line 411 of file inputprocessor.c.

413{
414 trace("\n");
415 return S_OK;
416}

◆ TextStoreACP_GetSelection()

static HRESULT WINAPI TextStoreACP_GetSelection ( ITextStoreACP iface,
ULONG  ulIndex,
ULONG  ulCount,
TS_SELECTION_ACP pSelection,
ULONG pcFetched 
)
static

Definition at line 279 of file inputprocessor.c.

281{
282 sink_fire_ok(&test_ACP_GetSelection,"TextStoreACP_GetSelection");
283
284 pSelection->acpStart = 10;
285 pSelection->acpEnd = 20;
286 pSelection->style.fInterimChar = 0;
287 pSelection->style.ase = TS_AE_NONE;
288 *pcFetched = 1;
289
290 return S_OK;
291}
TsActiveSelEnd ase
Definition: textstor.idl:86
TS_SELECTIONSTYLE style
Definition: textstor.idl:94
@ TS_AE_NONE
Definition: textstor.idl:67

◆ TextStoreACP_GetStatus()

static HRESULT WINAPI TextStoreACP_GetStatus ( ITextStoreACP iface,
TS_STATUS pdcs 
)
static

Definition at line 265 of file inputprocessor.c.

267{
268 sink_fire_ok(&test_ACP_GetStatus,"TextStoreACP_GetStatus");
270 return S_OK;
271}
DWORD dwDynamicFlags
Definition: textstor.idl:73

◆ TextStoreACP_GetText()

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

Definition at line 298 of file inputprocessor.c.

302{
303 trace("\n");
304 return S_OK;
305}

◆ TextStoreACP_GetTextExt()

static HRESULT WINAPI TextStoreACP_GetTextExt ( ITextStoreACP iface,
TsViewCookie  vcView,
LONG  acpStart,
LONG  acpEnd,
RECT prc,
BOOL pfClipped 
)
static

Definition at line 404 of file inputprocessor.c.

407{
408 trace("\n");
409 return S_OK;
410}

◆ TextStoreACP_GetWnd()

static HRESULT WINAPI TextStoreACP_GetWnd ( ITextStoreACP iface,
TsViewCookie  vcView,
HWND phwnd 
)
static

Definition at line 417 of file inputprocessor.c.

419{
420 trace("\n");
421 return S_OK;
422}

◆ TextStoreACP_InsertEmbedded()

static HRESULT WINAPI TextStoreACP_InsertEmbedded ( ITextStoreACP iface,
DWORD  dwFlags,
LONG  acpStart,
LONG  acpEnd,
IDataObject pDataObject,
TS_TEXTCHANGE pChange 
)
static

Definition at line 331 of file inputprocessor.c.

334{
335 trace("\n");
336 return S_OK;
337}

◆ TextStoreACP_InsertEmbeddedAtSelection()

static HRESULT WINAPI TextStoreACP_InsertEmbeddedAtSelection ( ITextStoreACP iface,
DWORD  dwFlags,
IDataObject pDataObject,
LONG pacpStart,
LONG pacpEnd,
TS_TEXTCHANGE pChange 
)
static

Definition at line 345 of file inputprocessor.c.

348{
349 trace("\n");
350 return S_OK;
351}

◆ TextStoreACP_InsertTextAtSelection()

static HRESULT WINAPI TextStoreACP_InsertTextAtSelection ( ITextStoreACP iface,
DWORD  dwFlags,
const WCHAR pchText,
ULONG  cch,
LONG pacpStart,
LONG pacpEnd,
TS_TEXTCHANGE pChange 
)
static

Definition at line 338 of file inputprocessor.c.

341{
342 sink_fire_ok(&test_ACP_InsertTextAtSelection,"TextStoreACP_InsertTextAtSelection");
343 return S_OK;
344}

◆ TextStoreACP_QueryInsert()

static HRESULT WINAPI TextStoreACP_QueryInsert ( ITextStoreACP iface,
LONG  acpTestStart,
LONG  acpTestEnd,
ULONG  cch,
LONG pacpResultStart,
LONG pacpResultEnd 
)
static

Definition at line 272 of file inputprocessor.c.

275{
276 trace("\n");
277 return S_OK;
278}

◆ TextStoreACP_QueryInsertEmbedded()

static HRESULT WINAPI TextStoreACP_QueryInsertEmbedded ( ITextStoreACP iface,
const GUID pguidService,
const FORMATETC *  pFormatEtc,
BOOL pfInsertable 
)
static

Definition at line 325 of file inputprocessor.c.

327{
328 trace("\n");
329 return S_OK;
330}

◆ TextStoreACP_QueryInterface()

static HRESULT WINAPI TextStoreACP_QueryInterface ( ITextStoreACP iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 195 of file inputprocessor.c.

196{
197 *ppvOut = NULL;
198
199 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACP))
200 {
201 *ppvOut = iface;
202 }
203
204 if (*ppvOut)
205 {
206 ITextStoreACP_AddRef(iface);
207 return S_OK;
208 }
209
210 return E_NOINTERFACE;
211}

◆ TextStoreACP_Release()

static ULONG WINAPI TextStoreACP_Release ( ITextStoreACP iface)
static

Definition at line 219 of file inputprocessor.c.

220{
222 ULONG ret;
223
224 ret = InterlockedDecrement(&This->refCount);
225 if (ret == 0)
227 return ret;
228}
static void TextStoreACP_Destructor(TextStoreACP *This)

◆ TextStoreACP_RequestAttrsAtPosition()

static HRESULT WINAPI TextStoreACP_RequestAttrsAtPosition ( ITextStoreACP iface,
LONG  acpPos,
ULONG  cFilterAttrs,
const TS_ATTRID paFilterAttrs,
DWORD  dwFlags 
)
static

Definition at line 358 of file inputprocessor.c.

361{
362 trace("\n");
363 return S_OK;
364}

◆ TextStoreACP_RequestAttrsTransitioningAtPosition()

static HRESULT WINAPI TextStoreACP_RequestAttrsTransitioningAtPosition ( ITextStoreACP iface,
LONG  acpPos,
ULONG  cFilterAttrs,
const TS_ATTRID paFilterAttrs,
DWORD  dwFlags 
)
static

Definition at line 365 of file inputprocessor.c.

368{
369 trace("\n");
370 return S_OK;
371}

◆ TextStoreACP_RequestLock()

static HRESULT WINAPI TextStoreACP_RequestLock ( ITextStoreACP iface,
DWORD  dwLockFlags,
HRESULT phrSession 
)
static

Definition at line 258 of file inputprocessor.c.

260{
261 sink_fire_ok(&test_ACP_RequestLock,"TextStoreACP_RequestLock");
262 *phrSession = ITextStoreACPSink_OnLockGranted(ACPSink, dwLockFlags);
263 return S_OK;
264}

◆ TextStoreACP_RequestSupportedAttrs()

static HRESULT WINAPI TextStoreACP_RequestSupportedAttrs ( ITextStoreACP iface,
DWORD  dwFlags,
ULONG  cFilterAttrs,
const TS_ATTRID paFilterAttrs 
)
static

Definition at line 352 of file inputprocessor.c.

354{
355 trace("\n");
356 return S_OK;
357}

◆ TextStoreACP_RetrieveRequestedAttrs()

static HRESULT WINAPI TextStoreACP_RetrieveRequestedAttrs ( ITextStoreACP iface,
ULONG  ulCount,
TS_ATTRVAL paAttrVals,
ULONG pcFetched 
)
static

Definition at line 379 of file inputprocessor.c.

381{
382 trace("\n");
383 return S_OK;
384}

◆ TextStoreACP_SetSelection()

static HRESULT WINAPI TextStoreACP_SetSelection ( ITextStoreACP iface,
ULONG  ulCount,
const TS_SELECTION_ACP pSelection 
)