May 28, 2026
9:19 p.m.
Piotr Caban (@piotr) commented about dlls/combase/roapi.c:
if (impl->is_agile) return IUnknown_QueryInterface(impl->obj, riid, obj);
+ if (FAILED(hr = CoGetContextToken((ULONG_PTR *)&cur_ctx))) + return hr; + EnterCriticalSection(&impl->cs); if (impl->option == AGILEREFERENCE_DELAYEDMARSHAL && impl->marshal_stream == NULL) { - if (FAILED(hr = marshal_object_in_agile_reference(impl, riid, impl->obj))) + if (cur_ctx != impl->ctx)
Is there any reason for doing this check instead of always going through ContextCallback path? There's similar optimization in ContextCallback so there should be no visible performance impact. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11018#note_141572