Commit 4d49d8ca authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

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
...@@ -1416,11 +1416,19 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv) ...@@ -1416,11 +1416,19 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
if (hr == S_OK) if (hr == S_OK)
{ {
hr = IUnknown_QueryInterface(object, &iid, ppv); if (!IsEqualIID(riid, &iid))
if (hr) {
ERR("Couldn't query for interface %s, hr = 0x%08lx\n", TRACE("requested interface != marshalled interface, additional QI needed\n");
debugstr_guid(riid), hr); hr = IUnknown_QueryInterface(object, &iid, ppv);
IUnknown_Release(object); 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); IMarshal_Release(pMarshal);
......
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