sti: allow CoCreateInstance aggregation and fix a broken test

Damjan Jovanovic damjan.jov at gmail.com
Tue Oct 6 12:15:40 CDT 2009


Changelog:
* sti: allow CoCreateInstance aggregation and fix a broken test

Damjan Jovanovic
-------------- next part --------------
diff --git a/dlls/sti/sti_main.c b/dlls/sti/sti_main.c
index 15c946d..4e91698 100644
--- a/dlls/sti/sti_main.c
+++ b/dlls/sti/sti_main.c
@@ -97,9 +97,6 @@ static HRESULT WINAPI sti_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOu
 
     *ppobj = NULL;
 
-    if (pOuter)
-        return CLASS_E_NOAGGREGATION;
-
     r = This->pfnCreateInstance( riid, pOuter, (LPVOID *)&punk );
     if (FAILED(r))
         return r;
diff --git a/dlls/sti/tests/sti.c b/dlls/sti/tests/sti.c
index 9a1aeee..0575d29 100644
--- a/dlls/sti/tests/sti.c
+++ b/dlls/sti/tests/sti.c
@@ -218,7 +218,9 @@ static void test_stillimage_aggregation(void)
         if (SUCCEEDED(hr))
             IStillImage_Release(pStiW);
         hr = CoCreateInstance(&CLSID_Sti, &aggregator, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
-        ok(FAILED(hr), "CoCreateInstance unexpectedly succeeded when querying for IUnknown during aggregation\n");
+        ok(SUCCEEDED(hr) ||
+            broken(hr == CLASS_E_NOAGGREGATION), /* Win 2000 */
+                "CoCreateInstance unexpectedly failed when querying for IUnknown during aggregation, hr = 0x%x\n", hr);
         if (SUCCEEDED(hr))
             IUnknown_Release(pUnknown);
     }


More information about the wine-patches mailing list