mshtml: Skip unused named args in Invoke calls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0ea5a01ca2
commit
8a20cf4cf8
|
@ -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, ¶ms, 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);
|
||||
|
|
Loading…
Reference in New Issue