Skip to content
Snippets Groups Projects
Commit 4d49d8ca authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard
Browse files

Avoid infinite loop when doing a typelib marshalled

IUnknown::QueryInterface by only doing an extra QI if requested IID is
not equal to marshalled IID.
parent 80380eaa
No related branches found
No related tags found
No related merge requests found
......@@ -1416,11 +1416,19 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
if (hr == S_OK)
{
hr = IUnknown_QueryInterface(object, &iid, ppv);
if (hr)
ERR("Couldn't query for interface %s, hr = 0x%08lx\n",
debugstr_guid(riid), hr);
IUnknown_Release(object);
if (!IsEqualIID(riid, &iid))
{
TRACE("requested interface != marshalled interface, additional QI needed\n");
hr = IUnknown_QueryInterface(object, &iid, ppv);
if (hr)
ERR("Couldn't query for interface %s, hr = 0x%08lx\n",
debugstr_guid(riid), hr);
IUnknown_Release(object);
}
else
{
*ppv = object;
}
}
IMarshal_Release(pMarshal);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment