Signed-off-by: Andrew Eikum aeikum@codeweavers.com --- dlls/msctf/msctf_internal.h | 1 + dlls/msctf/tests/inputprocessor.c | 50 ++++++++++++++++++++++++++++++- dlls/msctf/threadmgr.c | 13 +++++++- 3 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index 71ed10bb8dd..584bb1044ed 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -33,6 +33,7 @@ #define COOKIE_MAGIC_THREADFOCUSSINK 0x0080 #define COOKIE_MAGIC_KEYTRACESINK 0x0090 #define COOKIE_MAGIC_UIELEMENTSINK 0x00a0 +#define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK 0x00b0
extern DWORD tlsIndex DECLSPEC_HIDDEN; extern TfClientId processId DECLSPEC_HIDDEN; diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c index d440b536764..c5125827827 100644 --- a/dlls/msctf/tests/inputprocessor.c +++ b/dlls/msctf/tests/inputprocessor.c @@ -64,7 +64,7 @@ static DWORD tmSinkCookie; static DWORD tmSinkRefCount; static DWORD dmSinkCookie; static DWORD documentStatus; -static DWORD key_trace_sink_cookie, ui_element_sink_cookie; +static DWORD key_trace_sink_cookie, ui_element_sink_cookie, profile_activation_sink_cookie; static ITfDocumentMgr *test_CurrentFocus = NULL; static ITfDocumentMgr *test_PrevFocus = NULL; static ITfDocumentMgr *test_LastCurrentFocus = FOCUS_SAVE; @@ -725,6 +725,47 @@ static const ITfUIElementSinkVtbl TfUIElementSinkVtbl = {
static ITfUIElementSink TfUIElementSink = { &TfUIElementSinkVtbl };
+static HRESULT WINAPI ProfileActivationSink_QueryInterface(ITfInputProcessorProfileActivationSink *iface, + REFIID riid, void **ppvObject) +{ + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITfInputProcessorProfileActivationSink, riid)){ + *ppvObject = iface; + return S_OK; + } + + *ppvObject = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI ProfileActivationSink_AddRef(ITfInputProcessorProfileActivationSink *iface) +{ + return 2; +} + +static ULONG WINAPI ProfileActivationSink_Release(ITfInputProcessorProfileActivationSink *iface) +{ + return 1; +} + +static HRESULT WINAPI ProfileActivationSink_OnActivated(ITfInputProcessorProfileActivationSink *iface, + DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, + REFGUID guidProfile, HKL hkl, DWORD dwFlags) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const ITfInputProcessorProfileActivationSinkVtbl TfInputProcessorProfileActivationSinkVtbl = { + ProfileActivationSink_QueryInterface, + ProfileActivationSink_AddRef, + ProfileActivationSink_Release, + ProfileActivationSink_OnActivated +}; + +static ITfInputProcessorProfileActivationSink TfInputProcessorProfileActivationSink = { + &TfInputProcessorProfileActivationSinkVtbl +}; + static HRESULT WINAPI TfTransitoryExtensionSink_QueryInterface(ITfTransitoryExtensionSink *iface, REFIID riid, void **ppv) { if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITfTransitoryExtensionSink, riid)) { @@ -1198,6 +1239,10 @@ static void test_ThreadMgrAdviseSinks(void) &ui_element_sink_cookie); ok(hr == S_OK, "Failed to Advise ITfUIElementSink\n");
+ hr = ITfSource_AdviseSink(source, &IID_ITfInputProcessorProfileActivationSink, (IUnknown*)&TfInputProcessorProfileActivationSink, + &profile_activation_sink_cookie); + ok(hr == S_OK, "Failed to Advise ITfInputProcessorProfileActivationSink\n"); + ITfSource_Release(source); }
@@ -1221,6 +1266,9 @@ static void test_ThreadMgrUnadviseSinks(void) hr = ITfSource_UnadviseSink(source, ui_element_sink_cookie); ok(hr == S_OK, "Failed to unadvise ITfUIElementSink\n");
+ hr = ITfSource_UnadviseSink(source, profile_activation_sink_cookie); + ok(hr == S_OK, "Failed to unadvise ITfInputProcessorProfileActivationSink\n"); + ITfSource_Release(source); }
diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 7afef3cdd53..2c208fbc04f 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -97,6 +97,7 @@ typedef struct tagACLMulti { struct list ThreadFocusSink; struct list ThreadMgrEventSink; struct list UIElementSink; + struct list InputProcessorProfileActivationSink; } ThreadMgr;
typedef struct tagEnumTfDocumentMgr { @@ -174,6 +175,7 @@ static void ThreadMgr_Destructor(ThreadMgr *This) free_sinks(&This->ThreadFocusSink); free_sinks(&This->ThreadMgrEventSink); free_sinks(&This->UIElementSink); + free_sinks(&This->InputProcessorProfileActivationSink);
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->CurrentPreservedKeys) { @@ -633,6 +635,13 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface, COOKIE_MAGIC_UIELEMENTSINK, punk, pdwCookie); }
+ if (IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink)) + { + WARN("semi-stub for ITfInputProcessorProfileActivationSink: sink won't be used.\n"); + return advise_sink(&This->InputProcessorProfileActivationSink, &IID_ITfInputProcessorProfileActivationSink, + COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK, punk, pdwCookie); + } + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); return E_NOTIMPL; } @@ -646,7 +655,8 @@ static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCo
magic = get_Cookie_magic(pdwCookie); if (magic != COOKIE_MAGIC_TMSINK && magic != COOKIE_MAGIC_THREADFOCUSSINK - && magic != COOKIE_MAGIC_KEYTRACESINK && magic != COOKIE_MAGIC_UIELEMENTSINK) + && magic != COOKIE_MAGIC_KEYTRACESINK && magic != COOKIE_MAGIC_UIELEMENTSINK + && magic != COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK) return E_INVALIDARG;
return unadvise_sink(pdwCookie); @@ -1364,6 +1374,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) list_init(&This->ThreadFocusSink); list_init(&This->ThreadMgrEventSink); list_init(&This->UIElementSink); + list_init(&This->InputProcessorProfileActivationSink);
TRACE("returning %p\n", This); *ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=54846
Your paranoid android.
=== wvistau64 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== wvistau64_zh_CN (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== wvistau64_fr (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== wvistau64_he (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== w2008s64 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== w7u (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w7pro64 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w8 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w864 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w1064v1507 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w1064v1809 (32 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== wvistau64 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== w2008s64 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call
=== w7pro64 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w864 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w1064v1507 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call
=== w1064v1809 (64 bit report) ===
msctf: inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call inputprocessor.c:754: Test failed: unexpected call