Module: wine Branch: master Commit: 8d11327ecfc515f8156ae6d19c3c86627c0a2411 URL: https://gitlab.winehq.org/wine/wine/-/commit/8d11327ecfc515f8156ae6d19c3c866...
Author: Connor McAdams cmcadams@codeweavers.com Date: Fri May 5 14:20:13 2023 -0400
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: Connor McAdams cmcadams@codeweavers.com
---
dlls/combase/stubmanager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/combase/stubmanager.c b/dlls/combase/stubmanager.c index 5bb87c60c1d..ff8937d7bd7 100644 --- a/dlls/combase/stubmanager.c +++ b/dlls/combase/stubmanager.c @@ -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);