Commit 3af74c5e authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

atl: Use the first entry in the object map in AtlInternalQueryInterface when IUnknown is requested.

parent 5fcc5d3f
...@@ -213,19 +213,19 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE ...@@ -213,19 +213,19 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
{ {
int i = 0; int i = 0;
HRESULT rc = E_NOINTERFACE; HRESULT rc = E_NOINTERFACE;
TRACE("(%p, %p, %p, %p)\n",this, pEntries, iid, ppvObject); TRACE("(%p, %p, %s, %p)\n",this, pEntries, debugstr_guid(iid), ppvObject);
if (IsEqualGUID(iid,&IID_IUnknown)) if (IsEqualGUID(iid,&IID_IUnknown))
{ {
TRACE("Returning IUnknown\n"); TRACE("Returning IUnknown\n");
*ppvObject = this; *ppvObject = ((LPSTR)this+pEntries[0].dw);
IUnknown_AddRef((IUnknown*)this); IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK; return S_OK;
} }
while (pEntries[i].pFunc != 0) while (pEntries[i].pFunc != 0)
{ {
TRACE("Trying entry %i (%p %i %p)\n",i,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))
......
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