Commit 8d11327e authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

combase: Check that process ID matches before searching the MTA for a stub manager.

Now that MTA objects across processes share a value of 0 in the Data2 field of the stub manager IPID, make sure that we only search the MTA for stub managers that reside in the current process. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com>
parent 6f475608
......@@ -499,13 +499,13 @@ static HRESULT ipid_to_ifstub(const IPID *ipid, struct apartment **stub_apt,
/* FIXME: hack for IRemUnknown */
if (ipid->Data2 == 0xffff)
*stub_apt = apartment_findfromoxid(*(const OXID *)ipid->Data4);
else if (!ipid->Data2)
else if (!ipid->Data2 && (ipid->Data3 == (USHORT)GetCurrentProcessId()))
*stub_apt = apartment_get_mta();
else
*stub_apt = apartment_findfromtid(ipid->Data2);
if (!*stub_apt)
{
TRACE("Couldn't find apartment corresponding to TID 0x%04x\n", ipid->Data2);
TRACE("Couldn't find apartment corresponding to TID 0x%04x, PID 0x%04x\n", ipid->Data2, ipid->Data3);
return RPC_E_INVALID_OBJECT;
}
*stubmgr_ret = get_stub_manager_from_ipid(*stub_apt, ipid, ifstub);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment