Commit 6b75f930 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Return DISP_E_MEMBERNOTFOUND when not finding member by DISPID.

DISP_E_UNKNOWNNAME is for when retrieving the DISPID itself. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent a4d6dc79
......@@ -1009,7 +1009,7 @@ static HRESULT get_builtin_func(dispex_data_t *data, DISPID id, func_info_t **re
}
WARN("invalid id %lx\n", id);
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
}
static HRESULT get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID *ret)
......@@ -1366,7 +1366,7 @@ static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD
HRESULT hres;
hres = get_builtin_func(This->info, id, &func);
if(id == DISPID_VALUE && hres == DISP_E_UNKNOWNNAME)
if(id == DISPID_VALUE && hres == DISP_E_MEMBERNOTFOUND)
return dispex_value(This, lcid, flags, dp, res, ei, caller);
if(FAILED(hres))
return hres;
......@@ -1686,7 +1686,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
switch(get_dispid_type(id)) {
case DISPEXPROP_CUSTOM:
if(!This->info->desc->vtbl || !This->info->desc->vtbl->invoke)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
return This->info->desc->vtbl->invoke(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
case DISPEXPROP_DYNAMIC: {
......@@ -1694,7 +1694,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
dynamic_prop_t *prop;
if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
prop = This->dynamic_data->props+idx;
......@@ -1712,7 +1712,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return invoke_disp_value(This, V_DISPATCH(&prop->var), lcid, wFlags, pdp, pvarRes, pei, pspCaller);
case DISPATCH_PROPERTYGET:
if(prop->flags & DYNPROP_DELETED)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
V_VT(pvarRes) = VT_EMPTY;
return variant_copy(pvarRes, &prop->var);
case DISPATCH_PROPERTYPUT:
......@@ -1826,7 +1826,7 @@ static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BS
DWORD idx = id - DISPID_DYNPROP_0;
if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
*pbstrName = SysAllocString(This->dynamic_data->props[idx].name);
if(!*pbstrName)
......@@ -1874,7 +1874,7 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex,
DWORD idx = id - DISPID_DYNPROP_0;
if(!get_dynamic_data(This) || This->dynamic_data->prop_cnt <= idx)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
return next_dynamic_id(This, idx+1, pid);
}
......
......@@ -5843,7 +5843,7 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
i = id - MSHTML_DISPID_CUSTOM_MIN;
if(!This->nsdoc || i >= This->elem_vars_cnt)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
nsAString_InitDepend(&name_str, This->elem_vars[i]);
nsres = nsIDOMHTMLDocument_GetElementsByName(This->nsdoc, &name_str, &node_list);
......@@ -5854,7 +5854,7 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
nsres = nsIDOMNodeList_Item(node_list, 0, &nsnode);
nsIDOMNodeList_Release(node_list);
if(NS_FAILED(nsres) || !nsnode)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
hres = get_node(nsnode, TRUE, &node);
if(FAILED(hres))
......
......@@ -1124,7 +1124,7 @@ static HRESULT HTMLRectCollection_invoke(DispatchEx *dispex, DISPID id, LCID lci
nsres = nsIDOMClientRectList_Item(This->rect_list, id - MSHTML_DISPID_CUSTOM_MIN, &rect);
if(NS_FAILED(nsres) || !rect) {
WARN("Unknown item\n");
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
}
hres = create_html_rect(rect, dispex_compat_mode(&This->dispex), &html_rect);
......
......@@ -591,7 +591,7 @@ static HRESULT HTMLElementCollection_invoke(DispatchEx *dispex, DISPID id, LCID
idx = id - DISPID_ELEMCOL_0;
if(idx >= This->len)
return DISP_E_UNKNOWNNAME;
return DISP_E_MEMBERNOTFOUND;
switch(flags) {
case DISPATCH_PROPERTYGET:
......
......@@ -2542,12 +2542,10 @@ static void test_timeout(IHTMLDocument2 *doc)
V_VT(&var) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_IHTMLWINDOW2_SETINTERVAL, &IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_METHOD, &dp, &var, NULL, &argerr);
todo_wine
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke(DISPID_IHTMLWINDOW2_SETINTERVAL) returned: %08lx\n", hres);
hres = IDispatch_Invoke(disp, DISPID_IHTMLWINDOW2_SETTIMEOUT, &IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_METHOD, &dp, &var, NULL, &argerr);
todo_wine
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke(DISPID_IHTMLWINDOW2_SETTIMEOUT) returned: %08lx\n", hres);
SysFreeString(V_BSTR(&args[1]));
IDispatch_Release(disp);
......
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