Commit 6d4c1931 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Added IDispatchEx support for IXMLDOMImplementation.

parent b6d3068c
......@@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
typedef struct _domimpl
{
DispatchEx dispex;
IXMLDOMImplementation IXMLDOMImplementation_iface;
LONG ref;
} domimpl;
......@@ -67,6 +68,10 @@ static HRESULT WINAPI dimimpl_QueryInterface(
{
*ppvObject = iface;
}
else if (dispex_query_interface(&This->dispex, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
TRACE("Unsupported interface %s\n", debugstr_guid(riid));
......@@ -97,6 +102,7 @@ static ULONG WINAPI dimimpl_Release(
TRACE("(%p)->(%d)\n", This, ref);
if ( ref == 0 )
{
release_dispex(&This->dispex);
heap_free( This );
}
......@@ -122,13 +128,10 @@ static HRESULT WINAPI dimimpl_GetTypeInfo(
ITypeInfo** ppTInfo )
{
domimpl *This = impl_from_IXMLDOMImplementation( iface );
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
hr = get_typeinfo(IXMLDOMImplementation_tid, ppTInfo);
return hr;
return get_typeinfo(IXMLDOMImplementation_tid, ppTInfo);
}
static HRESULT WINAPI dimimpl_GetIDsOfNames(
......@@ -220,6 +223,18 @@ static const struct IXMLDOMImplementationVtbl dimimpl_vtbl =
dimimpl_hasFeature
};
static const tid_t dimimpl_iface_tids[] = {
IXMLDOMImplementation_tid,
0
};
static dispex_static_data_t dimimpl_dispex = {
NULL,
IXMLDOMImplementation_tid,
NULL,
dimimpl_iface_tids
};
IUnknown* create_doc_Implementation(void)
{
domimpl *This;
......@@ -230,6 +245,7 @@ IUnknown* create_doc_Implementation(void)
This->IXMLDOMImplementation_iface.lpVtbl = &dimimpl_vtbl;
This->ref = 1;
init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMImplementation_iface, &dimimpl_dispex);
return (IUnknown*)&This->IXMLDOMImplementation_iface;
}
......
......@@ -10507,6 +10507,7 @@ static const DOMNodeType dispex_types_test[] =
static void test_dispex(void)
{
const DOMNodeType *type = dispex_types_test;
IXMLDOMImplementation *impl;
IXMLDOMNodeList *node_list;
IXMLDOMParseError *error;
IXMLDOMNamedNodeMap *map;
......@@ -10612,6 +10613,15 @@ static void test_dispex(void)
IXMLDOMNamedNodeMap_Release(map);
IXMLDOMElement_Release(elem);
/* IXMLDOMImplementation */
hr = IXMLDOMDocument_get_implementation(doc, &impl);
EXPECT_HR(hr, S_OK);
hr = IXMLDOMImplementation_QueryInterface(impl, &IID_IDispatchEx, (void**)&dispex);
EXPECT_HR(hr, S_OK);
IDispatchEx_Release(dispex);
IXMLDOMImplementation_Release(impl);
IXMLDOMDocument_Release(doc);
/* IXMLHTTPRequest */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment