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.
This commit is contained in:
parent
80380eaa32
commit
4d49d8ca36
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue