From 72ddcb5f362748c040dc902bb5c1c75760c675b1 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Wed, 25 Apr 2007 11:21:48 +0100 Subject: [PATCH] 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. --- dlls/atl/atl_main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index a25f7472751..3b5703e9d66 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -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; } /***********************************************************************