From 8b8e91a50faae121af0af476e0cda8d6cc987bd3 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 31 Aug 2009 20:43:44 +0200 Subject: [PATCH] mshtml: Added support for DISPID_VALUE. --- dlls/mshtml/dispex.c | 26 ++++++++++++++++++++++++++ dlls/mshtml/htmlelemcol.c | 1 + dlls/mshtml/htmlnode.c | 1 + dlls/mshtml/htmlstyle.c | 1 + dlls/mshtml/mshtml_private.h | 1 + 5 files changed, 30 insertions(+) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 3dd11b18e4d..0a09de7a2be 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -407,6 +407,29 @@ HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VA return S_OK; } +static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0}; + + if(This->data->vtbl && This->data->vtbl->value) + return This->data->vtbl->value(This->outer, lcid, flags, params, res, ei, caller); + + switch(flags) { + case DISPATCH_PROPERTYGET: + V_VT(res) = VT_BSTR; + V_BSTR(res) = SysAllocString(objectW); + if(!V_BSTR(res)) + return E_OUTOFMEMORY; + break; + default: + FIXME("Unimplemented flags %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + #define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface) static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -556,6 +579,9 @@ 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(id == DISPID_VALUE) + return dispex_value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(is_custom_dispid(id) && This->data->vtbl && This->data->vtbl->invoke) return This->data->vtbl->invoke(This->outer, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index 43628907943..ba9a4402b88 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -428,6 +428,7 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = { }; static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl = { + NULL, HTMLElementCollection_get_dispid, HTMLElementCollection_invoke }; diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 720bbfef4be..9b132b16b98 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -250,6 +250,7 @@ static const tid_t HTMLDOMChildrenCollection_iface_tids[] = { }; static const dispex_static_data_vtbl_t HTMLDOMChildrenCollection_dispex_vtbl = { + NULL, HTMLDOMChildrenCollection_get_dispid, HTMLDOMChildrenCollection_invoke }; diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index cd9ae4d1005..612dc2f2eaf 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -2610,6 +2610,7 @@ static const IHTMLStyleVtbl HTMLStyleVtbl = { }; static const dispex_static_data_vtbl_t HTMLStyle_dispex_vtbl = { + NULL, HTMLStyle_get_dispid, NULL }; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c3be4b98760..db127b572d6 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -127,6 +127,7 @@ typedef struct dispex_dynamic_data_t dispex_dynamic_data_t; #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff typedef struct { + HRESULT (*value)(IUnknown*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*); HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); } dispex_static_data_vtbl_t;