Commit 5b16e6e0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Properly handle aggregation attempt.

parent cf30b6ae
...@@ -963,6 +963,11 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn ...@@ -963,6 +963,11 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv); TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
if(pUnkOuter) {
*ppv = NULL;
return CLASS_E_NOAGGREGATION;
}
lock_module(); lock_module();
ret = heap_alloc_zero(sizeof(*ret)); ret = heap_alloc_zero(sizeof(*ret));
......
...@@ -605,6 +605,18 @@ static void test_jscript_uninitializing(void) ...@@ -605,6 +605,18 @@ static void test_jscript_uninitializing(void)
ok(!ref, "ref = %d\n", ref); ok(!ref, "ref = %d\n", ref);
} }
static void test_aggregation(void)
{
IUnknown *unk = (IUnknown*)0xdeadbeef;
HRESULT hres;
hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IUnknown, (void**)&unk);
ok(hres == CLASS_E_NOAGGREGATION || broken(E_INVALIDARG) /* win2k */,
"CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres);
ok(!unk, "unk = %p\n", unk);
}
static BOOL check_jscript(void) static BOOL check_jscript(void)
{ {
IActiveScriptProperty *script_prop; IActiveScriptProperty *script_prop;
...@@ -626,6 +638,7 @@ START_TEST(jscript) ...@@ -626,6 +638,7 @@ START_TEST(jscript)
test_jscript(); test_jscript();
test_jscript2(); test_jscript2();
test_jscript_uninitializing(); test_jscript_uninitializing();
test_aggregation();
}else { }else {
win_skip("Broken engine, probably too old\n"); win_skip("Broken engine, probably too old\n");
} }
......
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