From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44502 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/msctf/msctf_internal.h | 1 + dlls/msctf/threadmgr.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h index 584bb1044ed..9d60e18e6f3 100644 --- a/dlls/msctf/msctf_internal.h +++ b/dlls/msctf/msctf_internal.h @@ -34,6 +34,7 @@ #define COOKIE_MAGIC_KEYTRACESINK 0x0090 #define COOKIE_MAGIC_UIELEMENTSINK 0x00a0 #define COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK 0x00b0 +#define COOKIE_MAGIC_ACTIVELANGSINK 0x00c0
extern DWORD tlsIndex DECLSPEC_HIDDEN; extern TfClientId processId DECLSPEC_HIDDEN; diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c index 77cf47ca4f6..0e054d4e654 100644 --- a/dlls/msctf/threadmgr.c +++ b/dlls/msctf/threadmgr.c @@ -621,6 +621,13 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface, return advise_sink(&This->ThreadFocusSink, &IID_ITfThreadFocusSink, COOKIE_MAGIC_THREADFOCUSSINK, punk, pdwCookie); }
+ if (IsEqualIID(riid, &IID_ITfActiveLanguageProfileNotifySink)) + { + WARN("semi-stub for ITfActiveLanguageProfileNotifySink: sink won't be used.\n"); + return advise_sink(&This->ActiveLanguageProfileNotifySink, &IID_ITfActiveLanguageProfileNotifySink, + COOKIE_MAGIC_ACTIVELANGSINK, punk, pdwCookie); + } + if (IsEqualIID(riid, &IID_ITfKeyTraceEventSink)) { WARN("semi-stub for ITfKeyTraceEventSink: sink won't be used.\n"); @@ -656,7 +663,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_INPUTPROCESSORPROFILEACTIVATIONSINK) + && magic != COOKIE_MAGIC_INPUTPROCESSORPROFILEACTIVATIONSINK + && magic != COOKIE_MAGIC_ACTIVELANGSINK) return E_INVALIDARG;
return unadvise_sink(pdwCookie);
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/msctf/tests/inputprocessor.c | 48 ++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c index f21042a794c..1c97d2c5d1c 100644 --- a/dlls/msctf/tests/inputprocessor.c +++ b/dlls/msctf/tests/inputprocessor.c @@ -63,7 +63,7 @@ static BOOL test_ShouldDeactivate = FALSE; static DWORD tmSinkCookie; static DWORD dmSinkCookie; static DWORD documentStatus; -static DWORD key_trace_sink_cookie, ui_element_sink_cookie, profile_activation_sink_cookie; +static DWORD key_trace_sink_cookie, ui_element_sink_cookie, profile_activation_sink_cookie, active_lang_sink_cookie; static DWORD fake_service_onactivated_flags = 0; static ITfDocumentMgr *test_CurrentFocus = NULL; static ITfDocumentMgr *test_PrevFocus = NULL; @@ -801,6 +801,45 @@ static const ITfTransitoryExtensionSinkVtbl TfTransitoryExtensionSinkVtbl = {
static ITfTransitoryExtensionSink TfTransitoryExtensionSink = { &TfTransitoryExtensionSinkVtbl };
+static HRESULT WINAPI TfActiveLanguageProfileNotifySink_QueryInterface(ITfActiveLanguageProfileNotifySink *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITfActiveLanguageProfileNotifySink, riid)) { + *ppv = iface; + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI TfActiveLanguageProfileNotifySink_AddRef(ITfActiveLanguageProfileNotifySink *iface) +{ + return 2; +} + +static ULONG WINAPI TfActiveLanguageProfileNotifySink_Release(ITfActiveLanguageProfileNotifySink *iface) +{ + return 1; +} + +static HRESULT WINAPI TfActiveLanguageProfileNotifySink_OnActivated(ITfActiveLanguageProfileNotifySink *iface, REFCLSID clsid, + REFGUID guidProfile, BOOL activated) +{ + trace("Got OnActivated: {clsid %s, guidProfile %s, activated %d}\n", wine_dbgstr_guid(clsid), + wine_dbgstr_guid(guidProfile), activated); + + return S_OK; +} + +static const ITfActiveLanguageProfileNotifySinkVtbl TfActiveLanguageProfileNotifySinkVtbl = { + TfActiveLanguageProfileNotifySink_QueryInterface, + TfActiveLanguageProfileNotifySink_AddRef, + TfActiveLanguageProfileNotifySink_Release, + TfActiveLanguageProfileNotifySink_OnActivated +}; + +static ITfActiveLanguageProfileNotifySink TfActiveLanguageProfileNotifySink = { &TfActiveLanguageProfileNotifySinkVtbl }; + /******************************************************************************************** * Stub text service for testing ********************************************************************************************/ @@ -1231,6 +1270,10 @@ static void test_ThreadMgrAdviseSinks(void) &profile_activation_sink_cookie); ok(hr == S_OK, "Failed to Advise ITfInputProcessorProfileActivationSink\n");
+ hr = ITfSource_AdviseSink(source, &IID_ITfActiveLanguageProfileNotifySink, (IUnknown*)&TfActiveLanguageProfileNotifySink, + &active_lang_sink_cookie); + ok(hr == S_OK, "Failed to Advise ITfActiveLanguageProfileNotifySink\n"); + ITfSource_Release(source); }
@@ -1258,6 +1301,9 @@ static void test_ThreadMgrUnadviseSinks(void) hr = ITfSource_UnadviseSink(source, profile_activation_sink_cookie); ok(hr == S_OK, "Failed to unadvise ITfInputProcessorProfileActivationSink\n");
+ hr = ITfSource_UnadviseSink(source, active_lang_sink_cookie); + ok(hr == S_OK, "Failed to unadvise ITfActiveLanguageProfileNotifySink\n"); + ITfSource_Release(source); }
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=82297
Your paranoid android.
=== w1064_2qxl (64 bit report) ===
msctf: inputprocessor.c:2464: Test failed: OnSetFocus expected prev focus 000000000082AAC0 got 0000000000000000