msctf: Implement ITfClientId.
This commit is contained in:
parent
f6f2f9346e
commit
f1d7cfa93a
|
@ -648,6 +648,36 @@ static void test_TfGuidAtom(void)
|
||||||
todo_wine ok(!IsEqualGUID(&g1,&GUID_NULL),"guid should not be NULL\n");
|
todo_wine ok(!IsEqualGUID(&g1,&GUID_NULL),"guid should not be NULL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_ClientId(void)
|
||||||
|
{
|
||||||
|
ITfClientId *pcid;
|
||||||
|
TfClientId id1,id2;
|
||||||
|
HRESULT hr;
|
||||||
|
GUID g2;
|
||||||
|
|
||||||
|
hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfClientId, (LPVOID*)&pcid);
|
||||||
|
ok(SUCCEEDED(hr),"Unable to aquire ITfClientId interface\n");
|
||||||
|
|
||||||
|
CoCreateGuid(&g2);
|
||||||
|
|
||||||
|
hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id1);
|
||||||
|
ok(SUCCEEDED(hr),"GetClientId failed\n");
|
||||||
|
hr = ITfClientId_GetClientId(pcid,&GUID_NULL,&id2);
|
||||||
|
ok(SUCCEEDED(hr),"GetClientId failed\n");
|
||||||
|
ok(id1==id2,"Id's for GUID_NULL do not match\n");
|
||||||
|
hr = ITfClientId_GetClientId(pcid,&CLSID_FakeService,&id2);
|
||||||
|
ok(SUCCEEDED(hr),"GetClientId failed\n");
|
||||||
|
ok(id2!=id1,"Id matches GUID_NULL\n");
|
||||||
|
todo_wine ok(id2==tid,"Id for CLSID_FakeService not matching tid\n");
|
||||||
|
ok(id2!=cid,"Id for CLSID_FakeService matching cid\n");
|
||||||
|
hr = ITfClientId_GetClientId(pcid,&g2,&id2);
|
||||||
|
ok(SUCCEEDED(hr),"GetClientId failed\n");
|
||||||
|
ok(id2!=id1,"Id matches GUID_NULL\n");
|
||||||
|
ok(id2!=tid,"Id for random guid matching tid\n");
|
||||||
|
ok(id2!=cid,"Id for random guid matching cid\n");
|
||||||
|
ITfClientId_Release(pcid);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(inputprocessor)
|
START_TEST(inputprocessor)
|
||||||
{
|
{
|
||||||
if (SUCCEEDED(initialize()))
|
if (SUCCEEDED(initialize()))
|
||||||
|
@ -660,6 +690,7 @@ START_TEST(inputprocessor)
|
||||||
test_Activate();
|
test_Activate();
|
||||||
test_startSession();
|
test_startSession();
|
||||||
test_TfGuidAtom();
|
test_TfGuidAtom();
|
||||||
|
test_ClientId();
|
||||||
test_KeystrokeMgr();
|
test_KeystrokeMgr();
|
||||||
test_endSession();
|
test_endSession();
|
||||||
test_EnumLanguageProfiles();
|
test_EnumLanguageProfiles();
|
||||||
|
|
|
@ -61,6 +61,7 @@ typedef struct tagACLMulti {
|
||||||
const ITfSourceVtbl *SourceVtbl;
|
const ITfSourceVtbl *SourceVtbl;
|
||||||
const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl;
|
const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl;
|
||||||
const ITfMessagePumpVtbl *MessagePumpVtbl;
|
const ITfMessagePumpVtbl *MessagePumpVtbl;
|
||||||
|
const ITfClientIdVtbl *ClientIdVtbl;
|
||||||
LONG refCount;
|
LONG refCount;
|
||||||
|
|
||||||
const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
|
const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
|
||||||
|
@ -91,6 +92,11 @@ static inline ThreadMgr *impl_from_ITfMessagePumpVtbl(ITfMessagePump *iface)
|
||||||
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,MessagePumpVtbl));
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,MessagePumpVtbl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline ThreadMgr *impl_from_ITfClientIdVtbl(ITfClientId *iface)
|
||||||
|
{
|
||||||
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ClientIdVtbl));
|
||||||
|
}
|
||||||
|
|
||||||
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
|
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
|
||||||
{
|
{
|
||||||
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
|
return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
|
||||||
|
@ -173,6 +179,10 @@ static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid,
|
||||||
{
|
{
|
||||||
*ppvOut = &This->MessagePumpVtbl;
|
*ppvOut = &This->MessagePumpVtbl;
|
||||||
}
|
}
|
||||||
|
else if (IsEqualIID(iid, &IID_ITfClientId))
|
||||||
|
{
|
||||||
|
*ppvOut = &This->ClientIdVtbl;
|
||||||
|
}
|
||||||
|
|
||||||
if (*ppvOut)
|
if (*ppvOut)
|
||||||
{
|
{
|
||||||
|
@ -659,6 +669,54 @@ static const ITfMessagePumpVtbl ThreadMgr_MessagePumpVtbl =
|
||||||
MessagePump_GetMessageW
|
MessagePump_GetMessageW
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*****************************************************
|
||||||
|
* ITfClientId functions
|
||||||
|
*****************************************************/
|
||||||
|
|
||||||
|
static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
|
||||||
|
return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ClientId_AddRef(ITfClientId *iface)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
|
||||||
|
return ThreadMgr_AddRef((ITfThreadMgr*)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI ClientId_Release(ITfClientId *iface)
|
||||||
|
{
|
||||||
|
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
|
||||||
|
return ThreadMgr_Release((ITfThreadMgr *)This);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface,
|
||||||
|
REFCLSID rclsid, TfClientId *ptid)
|
||||||
|
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
ITfCategoryMgr *catmgr;
|
||||||
|
ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
|
||||||
|
|
||||||
|
TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
|
||||||
|
|
||||||
|
CategoryMgr_Constructor(NULL,(IUnknown**)&catmgr);
|
||||||
|
hr = ITfCategoryMgr_RegisterGUID(catmgr,rclsid,ptid);
|
||||||
|
ITfCategoryMgr_Release(catmgr);
|
||||||
|
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const ITfClientIdVtbl ThreadMgr_ClientIdVtbl =
|
||||||
|
{
|
||||||
|
ClientId_QueryInterface,
|
||||||
|
ClientId_AddRef,
|
||||||
|
ClientId_Release,
|
||||||
|
|
||||||
|
ClientId_GetClientId
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
* ITfThreadMgrEventSink functions (internal)
|
* ITfThreadMgrEventSink functions (internal)
|
||||||
*****************************************************/
|
*****************************************************/
|
||||||
|
@ -803,6 +861,7 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
|
||||||
This->SourceVtbl = &ThreadMgr_SourceVtbl;
|
This->SourceVtbl = &ThreadMgr_SourceVtbl;
|
||||||
This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl;
|
This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl;
|
||||||
This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl;
|
This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl;
|
||||||
|
This->ClientIdVtbl = &ThreadMgr_ClientIdVtbl;
|
||||||
This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
|
This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
|
||||||
This->refCount = 1;
|
This->refCount = 1;
|
||||||
TlsSetValue(tlsIndex,This);
|
TlsSetValue(tlsIndex,This);
|
||||||
|
|
|
@ -686,3 +686,16 @@ interface ITfMessagePump : IUnknown
|
||||||
[in] UINT wMsgFilterMax,
|
[in] UINT wMsgFilterMax,
|
||||||
[out] BOOL *pfResult);
|
[out] BOOL *pfResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
object,
|
||||||
|
local,
|
||||||
|
uuid(d60a7b49-1b9f-4be2-b702-47e9dc05dec3),
|
||||||
|
pointer_default(unique)
|
||||||
|
]
|
||||||
|
interface ITfClientId : IUnknown
|
||||||
|
{
|
||||||
|
HRESULT GetClientId(
|
||||||
|
[in] REFCLSID rclsid,
|
||||||
|
[out] TfClientId *ptid);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue