ole32: Support activation context redirection in CoGetPSClsid().
This commit is contained in:
parent
1f6e66babe
commit
e02b1687aa
|
@ -123,6 +123,18 @@ struct comclassredirect_data
|
|||
DWORD miscstatusdocprint;
|
||||
};
|
||||
|
||||
struct ifacepsredirect_data
|
||||
{
|
||||
ULONG size;
|
||||
DWORD mask;
|
||||
GUID iid;
|
||||
ULONG nummethods;
|
||||
GUID tlbid;
|
||||
GUID base;
|
||||
ULONG name_len;
|
||||
ULONG name_offset;
|
||||
};
|
||||
|
||||
struct class_reg_data
|
||||
{
|
||||
union
|
||||
|
@ -2359,6 +2371,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
|
|||
HKEY hkey;
|
||||
APARTMENT *apt = COM_CurrentApt();
|
||||
struct registered_psclsid *registered_psclsid;
|
||||
ACTCTX_SECTION_KEYED_DATA data;
|
||||
|
||||
TRACE("() riid=%s, pclsid=%p\n", debugstr_guid(riid), pclsid);
|
||||
|
||||
|
@ -2386,6 +2399,15 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
|
|||
|
||||
LeaveCriticalSection(&apt->cs);
|
||||
|
||||
data.cbSize = sizeof(data);
|
||||
if (FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION,
|
||||
riid, &data))
|
||||
{
|
||||
struct ifacepsredirect_data *ifaceps = (struct ifacepsredirect_data*)data.lpData;
|
||||
*pclsid = ifaceps->iid;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/* Interface\\{string form of riid}\\ProxyStubClsid32 */
|
||||
strcpyW(path, wszInterface);
|
||||
StringFromGUID2(riid, path + ARRAYSIZE(wszInterface) - 1, CHARS_IN_GUID);
|
||||
|
|
|
@ -1031,7 +1031,6 @@ static void test_CoGetPSClsid(void)
|
|||
|
||||
if ((handle = activate_context(actctx_manifest, &cookie)))
|
||||
{
|
||||
todo_wine {
|
||||
memset(&clsid, 0, sizeof(clsid));
|
||||
hr = CoGetPSClsid(&IID_Testiface, &clsid);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
@ -1051,7 +1050,15 @@ todo_wine {
|
|||
hr = CoGetPSClsid(&IID_Testiface4, &clsid);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(IsEqualGUID(&clsid, &GUID_NULL), "got clsid %s\n", debugstr_guid(&clsid));
|
||||
}
|
||||
|
||||
/* register same interface and try to get CLSID back */
|
||||
hr = CoRegisterPSClsid(&IID_Testiface, &IID_Testiface4);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
memset(&clsid, 0, sizeof(clsid));
|
||||
hr = CoGetPSClsid(&IID_Testiface, &clsid);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(IsEqualGUID(&clsid, &IID_Testiface4), "got clsid %s\n", debugstr_guid(&clsid));
|
||||
|
||||
pDeactivateActCtx(0, cookie);
|
||||
pReleaseActCtx(handle);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue