atl: Improved AtlInternalQueryInterface implementation.
This commit is contained in:
parent
c1de11eee5
commit
1dc86ebb9b
|
@ -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),
|
TRACE("Trying entry %i (%s %i %p)\n",i,debugstr_guid(pEntries[i].piid),
|
||||||
pEntries[i].dw, pEntries[i].pFunc);
|
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");
|
TRACE("MATCH\n");
|
||||||
if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
|
if (pEntries[i].pFunc == (_ATL_CREATORARGFUNC*)1)
|
||||||
|
@ -267,14 +267,15 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
|
||||||
TRACE("Offset\n");
|
TRACE("Offset\n");
|
||||||
*ppvObject = ((LPSTR)this+pEntries[i].dw);
|
*ppvObject = ((LPSTR)this+pEntries[i].dw);
|
||||||
IUnknown_AddRef((IUnknown*)*ppvObject);
|
IUnknown_AddRef((IUnknown*)*ppvObject);
|
||||||
rc = S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRACE("Function\n");
|
TRACE("Function\n");
|
||||||
rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
|
rc = pEntries[i].pFunc(this, iid, ppvObject, pEntries[i].dw);
|
||||||
|
if(rc==S_OK || pEntries[i].piid)
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue