From 5996de5c2e5b8f1b27aa345714cb9dca401333d8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 24 Feb 2016 15:21:14 +0100 Subject: [PATCH] mshtml: Added HTMLXMLHttpRequestFactory DISPID_VALUE implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/xmlhttprequest.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index d18847830f5..ba6dc0506be 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -828,12 +828,44 @@ static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl = { HTMLXMLHttpRequestFactory_create }; +static inline HTMLXMLHttpRequestFactory *factory_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLXMLHttpRequestFactory, dispex); +} + +static HRESULT HTMLXMLHttpRequestFactory_value(DispatchEx *iface, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + HTMLXMLHttpRequestFactory *This = factory_from_DispatchEx(iface); + IHTMLXMLHttpRequest *xhr; + HRESULT hres; + + TRACE("\n"); + + if(flags != DISPATCH_CONSTRUCT) { + FIXME("flags %x not supported\n", flags); + return E_NOTIMPL; + } + + hres = IHTMLXMLHttpRequestFactory_create(&This->IHTMLXMLHttpRequestFactory_iface, &xhr); + if(FAILED(hres)) + return hres; + + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)xhr; + return S_OK; +} + +static const dispex_static_data_vtbl_t HTMLXMLHttpRequestFactory_dispex_vtbl = { + HTMLXMLHttpRequestFactory_value +}; + static const tid_t HTMLXMLHttpRequestFactory_iface_tids[] = { IHTMLXMLHttpRequestFactory_tid, 0 }; static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { - NULL, + &HTMLXMLHttpRequestFactory_dispex_vtbl, IHTMLXMLHttpRequestFactory_tid, NULL, HTMLXMLHttpRequestFactory_iface_tids