Module: wine Branch: master Commit: 7a62e46fa153aac9ad544e30fd29d3ed29a9aae9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7a62e46fa153aac9ad544e30fd...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Nov 1 23:50:56 2011 +0300
msxml3: Support IDispatchEx for IXMLDOMParseError.
---
dlls/msxml3/parseerror.c | 20 ++++++++++++++++++++ dlls/msxml3/tests/domdoc.c | 9 +++++++++ 2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/msxml3/parseerror.c b/dlls/msxml3/parseerror.c index 8e67816..b8cc381 100644 --- a/dlls/msxml3/parseerror.c +++ b/dlls/msxml3/parseerror.c @@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
typedef struct { + DispatchEx dispex; IXMLDOMParseError IXMLDOMParseError_iface; LONG ref; LONG code, line, linepos, filepos; @@ -70,6 +71,10 @@ static HRESULT WINAPI parseError_QueryInterface( { *ppvObject = iface; } + else if (dispex_query_interface(&This->dispex, riid, ppvObject)) + { + return *ppvObject ? S_OK : E_NOINTERFACE; + } else { FIXME("interface %s not implemented\n", debugstr_guid(riid)); @@ -103,6 +108,7 @@ static ULONG WINAPI parseError_Release( SysFreeString(This->url); SysFreeString(This->reason); SysFreeString(This->srcText); + release_dispex(&This->dispex); heap_free( This ); }
@@ -289,6 +295,18 @@ static const struct IXMLDOMParseErrorVtbl parseError_vtbl = parseError_get_filepos };
+static const tid_t parseError_iface_tids[] = { + IXMLDOMParseError_tid, + 0 +}; + +static dispex_static_data_t parseError_dispex = { + NULL, + IXMLDOMParseError_tid, + NULL, + parseError_iface_tids +}; + IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText, LONG line, LONG linepos, LONG filepos ) { @@ -309,5 +327,7 @@ IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR src This->linepos = linepos; This->filepos = filepos;
+ init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMParseError_iface, &parseError_dispex); + return &This->IXMLDOMParseError_iface; } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 41fb835..e1be912 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -10627,6 +10627,7 @@ static void test_dispex(void) { const DOMNodeType *type = dispex_types_test; IXMLDOMNodeList *node_list; + IXMLDOMParseError *error; IXMLDOMDocument *doc; IUnknown *unk; HRESULT hr; @@ -10663,6 +10664,14 @@ static void test_dispex(void) IUnknown_Release(unk); IXMLDOMNodeList_Release(node_list);
+ /* IXMLDOMParseError */ + hr = IXMLDOMDocument_get_parseError(doc, &error); + EXPECT_HR(hr, S_OK); + IXMLDOMParseError_QueryInterface(error, &IID_IUnknown, (void**)&unk); + test_domobj_dispex(unk); + IUnknown_Release(unk); + IXMLDOMParseError_Release(error); + IXMLDOMDocument_Release(doc); free_bstrs(); }