From 1dc86ebb9b4aca5aa8c9de6e12a940c872792574 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 22 Jul 2010 18:37:12 +0200 Subject: [PATCH] atl: Improved AtlInternalQueryInterface implementation. --- dlls/atl/atl_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 7780b411ee4..88795c90be7 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -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++; }