Commit 8a20cf4c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Skip unused named args in Invoke calls.

parent 0ea5a01c
......@@ -617,6 +617,7 @@ static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS
static HRESULT typeinfo_invoke(DispatchEx *This, func_info_t *func, WORD flags, DISPPARAMS *dp, VARIANT *res,
EXCEPINFO *ei)
{
DISPPARAMS params = {dp->rgvarg+dp->cNamedArgs, NULL, dp->cArgs-dp->cNamedArgs, 0};
ITypeInfo *ti;
IUnknown *unk;
UINT argerr=0;
......@@ -634,7 +635,7 @@ static HRESULT typeinfo_invoke(DispatchEx *This, func_info_t *func, WORD flags,
return E_FAIL;
}
hres = ITypeInfo_Invoke(ti, unk, func->id, flags, dp, res, ei, &argerr);
hres = ITypeInfo_Invoke(ti, unk, func->id, flags, &params, res, ei, &argerr);
IUnknown_Release(unk);
return hres;
......
......@@ -1926,6 +1926,23 @@ static void test_func(IDispatchEx *obj)
hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL);
ok(hres == S_OK || broken(E_ACCESSDENIED), "InvokeEx failed: %08x\n", hres);
if(SUCCEEDED(hres)) {
DISPID named_args[2] = { DISPID_THIS, 0xdeadbeef };
VARIANT args[2];
ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var));
ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var);
dp.rgdispidNamedArgs = named_args;
dp.cNamedArgs = 2;
dp.cArgs = 2;
dp.rgvarg = &var;
V_VT(args) = VT_DISPATCH;
V_DISPATCH(args) = (IDispatch*)obj;
V_VT(args+1) = VT_I4;
V_I4(args+1) = 3;
hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var));
ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var);
......
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