atl: Use the first entry in the object map in
AtlInternalQueryInterface when IUnknown is requested.
Robert Shearman
rob at codeweavers.com
Wed Apr 25 05:21:03 CDT 2007
---
dlls/atl/atl_main.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
-------------- next part --------------
diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c
index 69d62e7..a25f747 100644
--- a/dlls/atl/atl_main.c
+++ b/dlls/atl/atl_main.c
@@ -213,19 +213,19 @@ HRESULT WINAPI AtlInternalQueryInterface
{
int i = 0;
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))
{
TRACE("Returning IUnknown\n");
- *ppvObject = this;
- IUnknown_AddRef((IUnknown*)this);
+ *ppvObject = ((LPSTR)this+pEntries[0].dw);
+ IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
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);
if (pEntries[i].piid && IsEqualGUID(iid,pEntries[i].piid))
More information about the wine-patches
mailing list