Commit 1dc86ebb authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

atl: Improved AtlInternalQueryInterface implementation.

parent c1de11ee
......@@ -259,7 +259,7 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
TRACE("Trying entry %i (%s %i %p)\n",i,debugstr_guid(pEntries[i].piid),
pEntries[i].dw, pEntries[i].pFunc);
if (pEntries[i].piid && IsEqualGUID(iid,pEntries[i].piid))
if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))
{
TRACE("MATCH\n");
if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
......@@ -267,14 +267,15 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
TRACE("Offset\n");
*ppvObject = ((LPSTR)this+pEntries[i].dw);
IUnknown_AddRef((IUnknown*)*ppvObject);
rc = S_OK;
return S_OK;
}
else
{
TRACE("Function\n");
rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
if(rc==S_OK || pEntries[i].piid)
return rc;
}
break;
}
i++;
}
......
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