From 1f6febea085115b039d198b158d8143a88c6c714 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 24 Jul 2012 15:56:05 +0200 Subject: [PATCH] mshtml: Clean up InvokeEx implementation by using get_dispid_type. --- dlls/mshtml/dispex.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 614c9d54b83..b2f5b81245c 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1147,22 +1147,13 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - if(is_custom_dispid(id) && This->data->vtbl && This->data->vtbl->invoke) + switch(get_dispid_type(id)) { + case DISPEXPROP_CUSTOM: + if(!This->data->vtbl || !This->data->vtbl->invoke) + return DISP_E_UNKNOWNNAME; return This->data->vtbl->invoke(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - if(wFlags == DISPATCH_CONSTRUCT) { - if(id == DISPID_VALUE) { - if(This->data->vtbl && This->data->vtbl->value) { - return This->data->vtbl->value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - } - FIXME("DISPATCH_CONSTRUCT flag but missing value function\n"); - return E_FAIL; - } - FIXME("DISPATCH_CONSTRUCT flag without DISPID_VALUE\n"); - return E_FAIL; - } - - if(is_dynamic_dispid(id)) { + case DISPEXPROP_DYNAMIC: { DWORD idx = id - DISPID_DYNPROP_0; dynamic_prop_t *prop; @@ -1209,8 +1200,24 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc return E_NOTIMPL; } } + case DISPEXPROP_BUILTIN: + if(wFlags == DISPATCH_CONSTRUCT) { + if(id == DISPID_VALUE) { + if(This->data->vtbl && This->data->vtbl->value) { + return This->data->vtbl->value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + } + FIXME("DISPATCH_CONSTRUCT flag but missing value function\n"); + return E_FAIL; + } + FIXME("DISPATCH_CONSTRUCT flag without DISPID_VALUE\n"); + return E_FAIL; + } - return invoke_builtin_prop(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return invoke_builtin_prop(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + default: + assert(0); + return E_FAIL; + } } static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)