Commit 72ddcb5f authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

atl: AtlModuleGetClassObject should store an intermediate pointer in obj->pCF…

atl: AtlModuleGetClassObject should store an intermediate pointer in obj->pCF and then query this for the requested interface. Return CLASS_E_CLASSNOTAVAILABLE instead of E_FAIL.
parent 3af74c5e
......@@ -340,6 +340,7 @@ HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid,
REFIID riid, LPVOID *ppv)
{
int i;
HRESULT hres = CLASS_E_CLASSNOTAVAILABLE;
TRACE("%p %s %s %p\n", pm, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
......@@ -354,13 +355,21 @@ HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid,
TRACE("found object %i\n", i);
if (obj->pfnGetClassObject)
return obj->pfnGetClassObject(obj->pfnCreateInstance, riid, ppv);
{
if (!obj->pCF)
hres = obj->pfnGetClassObject(obj->pfnCreateInstance,
&IID_IUnknown,
(void **)&obj->pCF);
if (obj->pCF)
hres = IUnknown_QueryInterface(obj->pCF, riid, ppv);
break;
}
}
}
WARN("no class object found for %s\n", debugstr_guid(rclsid));
return E_FAIL;
return hres;
}
/***********************************************************************
......
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