From 954cb31448b0e4e2b074095f47cc8e6f83ca2f4a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 3 Sep 2008 10:23:10 +1000 Subject: [PATCH] msxml3: Add IDispatchEx support to IXMLDOMDocument2. --- dlls/msxml3/dispex.c | 1 + dlls/msxml3/domdoc.c | 25 +++++++++++++++++++++++++ dlls/msxml3/msxml_private.h | 1 + 3 files changed, 27 insertions(+) diff --git a/dlls/msxml3/dispex.c b/dlls/msxml3/dispex.c index 438cf48b077..0ccda74bca2 100644 --- a/dlls/msxml3/dispex.c +++ b/dlls/msxml3/dispex.c @@ -79,6 +79,7 @@ static REFIID tid_ids[] = { &IID_IXMLDOMAttribute, &IID_IXMLDOMCDATASection, &IID_IXMLDOMComment, + &IID_IXMLDOMDocument, &IID_IXMLDOMDocument2, &IID_IXMLDOMDocumentFragment, &IID_IXMLDOMElement, diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 062ce7a3c54..3c5aedef483 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -36,6 +36,7 @@ #include "shlwapi.h" #include "ocidl.h" #include "objsafe.h" +#include "dispex.h" #include "wine/debug.h" @@ -75,6 +76,9 @@ typedef struct _domdoc /* IObjectSafety */ DWORD safeopt; + + /* IDispatchEx */ + DispatchEx dispex; } domdoc; static xmlDocPtr doparse( char *ptr, int len ) @@ -290,6 +294,10 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument2 *iface, REFIID rii { *ppvObject = (IObjectWithSite*)&(This->lpvtblIObjectWithSite); } + else if(dispex_query_interface(&This->dispex, riid, ppvObject)) + { + return *ppvObject ? S_OK : E_NOINTERFACE; + } else if(IsEqualGUID(&IID_IRunnableObject, riid)) { TRACE("IID_IRunnableObject not supported returning NULL\n"); @@ -1967,6 +1975,20 @@ static const IObjectSafetyVtbl domdocObjectSafetyVtbl = { xmldoc_Safety_SetInterfaceSafetyOptions }; + +static const tid_t domdoc_iface_tids[] = { + IXMLDOMNode_tid, + IXMLDOMDocument_tid, + IXMLDOMDocument2_tid, + 0 +}; +static dispex_static_data_t domdoc_dispex = { + NULL, + IXMLDOMDocument2_tid, + NULL, + domdoc_iface_tids +}; + HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2 **document) { domdoc *doc; @@ -2007,6 +2029,9 @@ HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2 **docu HeapFree( GetProcessHeap(), 0, doc ); return E_FAIL; } + + init_dispex(&doc->dispex, (IUnknown*)&doc->lpVtbl, &domdoc_dispex); + /* The ref on doc->node is actually looped back into this object, so release it */ IXMLDOMNode_Release(doc->node); diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index ae3a4e6cbd2..55b84dfa1d8 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -107,6 +107,7 @@ typedef enum tid_t { IXMLDOMAttribute_tid, IXMLDOMCDATASection_tid, IXMLDOMComment_tid, + IXMLDOMDocument_tid, IXMLDOMDocument2_tid, IXMLDOMDocumentFragment_tid, IXMLDOMElement_tid, -- 2.11.4.GIT