>From ab3f9f3670a249676d24b154f7c9ccc0531f7da8 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Sat, 19 Nov 2011 19:32:23 +0300
Subject: [PATCH 3/4] Forward IDispatch to IDispatchEx when supported

---
 dlls/msxml3/attribute.c  |   51 +++++----------------------------------
 dlls/msxml3/cdata.c      |   52 +++++-----------------------------------
 dlls/msxml3/comment.c    |   52 +++++-----------------------------------
 dlls/msxml3/docfrag.c    |   52 +++++-----------------------------------
 dlls/msxml3/doctype.c    |   52 +++++-----------------------------------
 dlls/msxml3/domdoc.c     |   58 ++++++---------------------------------------
 dlls/msxml3/domimpl.c    |   49 +++++---------------------------------
 dlls/msxml3/element.c    |   52 +++++-----------------------------------
 dlls/msxml3/entityref.c  |   51 +++++----------------------------------
 dlls/msxml3/nodemap.c    |   47 +++++-------------------------------
 dlls/msxml3/parseerror.c |   49 +++++---------------------------------
 dlls/msxml3/selection.c  |   49 +++++---------------------------------
 dlls/msxml3/text.c       |   52 +++++-----------------------------------
 13 files changed, 92 insertions(+), 574 deletions(-)

diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c
index a78d10b..aec1679 100644
--- a/dlls/msxml3/attribute.c
+++ b/dlls/msxml3/attribute.c
@@ -125,12 +125,7 @@ static HRESULT WINAPI domattr_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domattr_GetTypeInfo(
@@ -139,13 +134,8 @@ static HRESULT WINAPI domattr_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMAttribute_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domattr_GetIDsOfNames(
@@ -154,23 +144,8 @@ static HRESULT WINAPI domattr_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMAttribute_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domattr_Invoke(
@@ -180,20 +155,8 @@ static HRESULT WINAPI domattr_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMAttribute_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMAttribute_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domattr_get_nodeName(
diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c
index cd42db0..0058314 100644
--- a/dlls/msxml3/cdata.c
+++ b/dlls/msxml3/cdata.c
@@ -125,12 +125,7 @@ static HRESULT WINAPI domcdata_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domcdata_GetTypeInfo(
@@ -139,13 +134,8 @@ static HRESULT WINAPI domcdata_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMCDATASection_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domcdata_GetIDsOfNames(
@@ -154,23 +144,8 @@ static HRESULT WINAPI domcdata_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMCDATASection_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domcdata_Invoke(
@@ -180,21 +155,8 @@ static HRESULT WINAPI domcdata_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMCDATASection_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMCDATASection_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domcdata_get_nodeName(
diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c
index 8aa10ff..5663632 100644
--- a/dlls/msxml3/comment.c
+++ b/dlls/msxml3/comment.c
@@ -125,12 +125,7 @@ static HRESULT WINAPI domcomment_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domcomment_GetTypeInfo(
@@ -139,13 +134,8 @@ static HRESULT WINAPI domcomment_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMComment_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domcomment_GetIDsOfNames(
@@ -154,23 +144,8 @@ static HRESULT WINAPI domcomment_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMComment_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domcomment_Invoke(
@@ -180,21 +155,8 @@ static HRESULT WINAPI domcomment_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMComment_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMComment_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domcomment_get_nodeName(
diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c
index 8c01690..0821ba9 100644
--- a/dlls/msxml3/docfrag.c
+++ b/dlls/msxml3/docfrag.c
@@ -124,12 +124,7 @@ static HRESULT WINAPI domfrag_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domfrag_GetTypeInfo(
@@ -138,13 +133,8 @@ static HRESULT WINAPI domfrag_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMDocumentFragment_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domfrag_GetIDsOfNames(
@@ -153,23 +143,8 @@ static HRESULT WINAPI domfrag_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMDocumentFragment_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domfrag_Invoke(
@@ -179,21 +154,8 @@ static HRESULT WINAPI domfrag_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMDocumentFragment_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMDocumentFragment_iface, dispIdMember,
-                wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domfrag_get_nodeName(
diff --git a/dlls/msxml3/doctype.c b/dlls/msxml3/doctype.c
index 6a1952f..c045c79 100644
--- a/dlls/msxml3/doctype.c
+++ b/dlls/msxml3/doctype.c
@@ -116,12 +116,7 @@ static HRESULT WINAPI domdoctype_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domdoctype_GetTypeInfo(
@@ -130,13 +125,8 @@ static HRESULT WINAPI domdoctype_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMDocumentType_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domdoctype_GetIDsOfNames(
@@ -145,23 +135,8 @@ static HRESULT WINAPI domdoctype_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMDocumentType_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domdoctype_Invoke(
@@ -171,21 +146,8 @@ static HRESULT WINAPI domdoctype_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMDocumentType_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMDocumentType_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domdoctype_get_nodeName(
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 7d51255..4640e62 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -870,9 +870,7 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument3 *iface, REFIID rii
     return S_OK;
 }
 
-
-static ULONG WINAPI domdoc_AddRef(
-     IXMLDOMDocument3 *iface )
+static ULONG WINAPI domdoc_AddRef( IXMLDOMDocument3 *iface )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
     ULONG ref = InterlockedIncrement( &This->ref );
@@ -880,9 +878,7 @@ static ULONG WINAPI domdoc_AddRef(
     return ref;
 }
 
-
-static ULONG WINAPI domdoc_Release(
-     IXMLDOMDocument3 *iface )
+static ULONG WINAPI domdoc_Release( IXMLDOMDocument3 *iface )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
     LONG ref = InterlockedDecrement( &This->ref );
@@ -914,12 +910,7 @@ static ULONG WINAPI domdoc_Release(
 static HRESULT WINAPI domdoc_GetTypeInfoCount( IXMLDOMDocument3 *iface, UINT* pctinfo )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domdoc_GetTypeInfo(
@@ -927,10 +918,7 @@ static HRESULT WINAPI domdoc_GetTypeInfo(
     UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    return get_typeinfo(IXMLDOMDocument3_tid, ppTInfo);
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domdoc_GetIDsOfNames(
@@ -942,26 +930,10 @@ static HRESULT WINAPI domdoc_GetIDsOfNames(
     DISPID* rgDispId)
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMDocument3_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
-
 static HRESULT WINAPI domdoc_Invoke(
     IXMLDOMDocument3 *iface,
     DISPID dispIdMember,
@@ -974,24 +946,10 @@ static HRESULT WINAPI domdoc_Invoke(
     UINT* puArgErr)
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMDocument3_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMDocument3_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
-
 static HRESULT WINAPI domdoc_get_nodeName(
     IXMLDOMDocument3 *iface,
     BSTR* name )
diff --git a/dlls/msxml3/domimpl.c b/dlls/msxml3/domimpl.c
index 501d596..7deb617 100644
--- a/dlls/msxml3/domimpl.c
+++ b/dlls/msxml3/domimpl.c
@@ -114,12 +114,7 @@ static HRESULT WINAPI dimimpl_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domimpl *This = impl_from_IXMLDOMImplementation( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI dimimpl_GetTypeInfo(
@@ -128,10 +123,8 @@ static HRESULT WINAPI dimimpl_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domimpl *This = impl_from_IXMLDOMImplementation( iface );
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    return get_typeinfo(IXMLDOMImplementation_tid, ppTInfo);
+    return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI dimimpl_GetIDsOfNames(
@@ -140,23 +133,8 @@ static HRESULT WINAPI dimimpl_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domimpl *This = impl_from_IXMLDOMImplementation( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMImplementation_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI dimimpl_Invoke(
@@ -166,21 +144,8 @@ static HRESULT WINAPI dimimpl_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domimpl *This = impl_from_IXMLDOMImplementation( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMImplementation_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMImplementation_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI dimimpl_hasFeature(IXMLDOMImplementation* This, BSTR feature, BSTR version, VARIANT_BOOL *hasFeature)
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c
index 08a9d1e..2d920cd 100644
--- a/dlls/msxml3/element.c
+++ b/dlls/msxml3/element.c
@@ -138,12 +138,7 @@ static HRESULT WINAPI domelem_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domelem_GetTypeInfo(
@@ -152,13 +147,8 @@ static HRESULT WINAPI domelem_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMElement_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domelem_GetIDsOfNames(
@@ -167,23 +157,8 @@ static HRESULT WINAPI domelem_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMElement_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domelem_Invoke(
@@ -193,21 +168,8 @@ static HRESULT WINAPI domelem_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMElement_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMElement_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domelem_get_nodeName(
diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c
index dd6c699..d9171ca 100644
--- a/dlls/msxml3/entityref.c
+++ b/dlls/msxml3/entityref.c
@@ -124,11 +124,7 @@ static HRESULT WINAPI entityref_GetTypeInfoCount(
     UINT* pctinfo )
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI entityref_GetTypeInfo(
@@ -137,13 +133,8 @@ static HRESULT WINAPI entityref_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMEntityReference_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI entityref_GetIDsOfNames(
@@ -152,23 +143,8 @@ static HRESULT WINAPI entityref_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMEntityReference_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI entityref_Invoke(
@@ -178,21 +154,8 @@ static HRESULT WINAPI entityref_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMEntityReference_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMEntityReference_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI entityref_get_nodeName(
diff --git a/dlls/msxml3/nodemap.c b/dlls/msxml3/nodemap.c
index 027416f..d8cc8f3 100644
--- a/dlls/msxml3/nodemap.c
+++ b/dlls/msxml3/nodemap.c
@@ -131,12 +131,7 @@ static HRESULT WINAPI xmlnodemap_GetTypeInfoCount(
     UINT* pctinfo )
 {
     xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI xmlnodemap_GetTypeInfo(
@@ -145,8 +140,8 @@ static HRESULT WINAPI xmlnodemap_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-    return get_typeinfo(IXMLDOMNamedNodeMap_tid, ppTInfo);
+    return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI xmlnodemap_GetIDsOfNames(
@@ -155,23 +150,8 @@ static HRESULT WINAPI xmlnodemap_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMNamedNodeMap_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI xmlnodemap_Invoke(
@@ -181,21 +161,8 @@ static HRESULT WINAPI xmlnodemap_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     xmlnodemap *This = impl_from_IXMLDOMNamedNodeMap( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMNamedNodeMap_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMNamedNodeMap_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI xmlnodemap_getNamedItem(
diff --git a/dlls/msxml3/parseerror.c b/dlls/msxml3/parseerror.c
index 3d32b32..dd5f914 100644
--- a/dlls/msxml3/parseerror.c
+++ b/dlls/msxml3/parseerror.c
@@ -120,12 +120,7 @@ static HRESULT WINAPI parseError_GetTypeInfoCount(
     UINT* pctinfo )
 {
     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI parseError_GetTypeInfo(
@@ -135,10 +130,8 @@ static HRESULT WINAPI parseError_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    return get_typeinfo(IXMLDOMParseError_tid, ppTInfo);
+    return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI parseError_GetIDsOfNames(
@@ -150,23 +143,8 @@ static HRESULT WINAPI parseError_GetIDsOfNames(
     DISPID* rgDispId )
 {
     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMParseError_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI parseError_Invoke(
@@ -181,21 +159,8 @@ static HRESULT WINAPI parseError_Invoke(
     UINT* puArgErr )
 {
     parse_error_t *This = impl_from_IXMLDOMParseError( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMParseError_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMParseError_iface, dispIdMember, wFlags,
-                pDispParams, pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI parseError_get_errorCode(
diff --git a/dlls/msxml3/selection.c b/dlls/msxml3/selection.c
index 18b82bb..aba8e7d 100644
--- a/dlls/msxml3/selection.c
+++ b/dlls/msxml3/selection.c
@@ -170,12 +170,7 @@ static HRESULT WINAPI domselection_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domselection *This = impl_from_IXMLDOMSelection( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domselection_GetTypeInfo(
@@ -185,10 +180,8 @@ static HRESULT WINAPI domselection_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domselection *This = impl_from_IXMLDOMSelection( iface );
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    return get_typeinfo(IXMLDOMSelection_tid, ppTInfo);
+    return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domselection_GetIDsOfNames(
@@ -200,23 +193,8 @@ static HRESULT WINAPI domselection_GetIDsOfNames(
     DISPID* rgDispId )
 {
     domselection *This = impl_from_IXMLDOMSelection( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMSelection_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domselection_Invoke(
@@ -231,21 +209,8 @@ static HRESULT WINAPI domselection_Invoke(
     UINT* puArgErr )
 {
     domselection *This = impl_from_IXMLDOMSelection( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMSelection_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMSelection_iface, dispIdMember, wFlags, pDispParams,
-                pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domselection_get_item(
diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c
index 9bda653..6540773 100644
--- a/dlls/msxml3/text.c
+++ b/dlls/msxml3/text.c
@@ -116,12 +116,7 @@ static HRESULT WINAPI domtext_GetTypeInfoCount(
     UINT* pctinfo )
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-
-    TRACE("(%p)->(%p)\n", This, pctinfo);
-
-    *pctinfo = 1;
-
-    return S_OK;
+    return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI domtext_GetTypeInfo(
@@ -130,13 +125,8 @@ static HRESULT WINAPI domtext_GetTypeInfo(
     ITypeInfo** ppTInfo )
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-    HRESULT hr;
-
-    TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
-
-    hr = get_typeinfo(IXMLDOMText_tid, ppTInfo);
-
-    return hr;
+    return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
+        iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI domtext_GetIDsOfNames(
@@ -145,23 +135,8 @@ static HRESULT WINAPI domtext_GetIDsOfNames(
     UINT cNames, LCID lcid, DISPID* rgDispId )
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
-          lcid, rgDispId);
-
-    if(!rgszNames || cNames == 0 || !rgDispId)
-        return E_INVALIDARG;
-
-    hr = get_typeinfo(IXMLDOMText_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
+        riid, rgszNames, cNames, lcid, rgDispId);
 }
 
 static HRESULT WINAPI domtext_Invoke(
@@ -171,21 +146,8 @@ static HRESULT WINAPI domtext_Invoke(
     EXCEPINFO* pExcepInfo, UINT* puArgErr )
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-    ITypeInfo *typeinfo;
-    HRESULT hr;
-
-    TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
-          lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
-
-    hr = get_typeinfo(IXMLDOMText_tid, &typeinfo);
-    if(SUCCEEDED(hr))
-    {
-        hr = ITypeInfo_Invoke(typeinfo, &This->IXMLDOMText_iface, dispIdMember, wFlags, pDispParams,
-                pVarResult, pExcepInfo, puArgErr);
-        ITypeInfo_Release(typeinfo);
-    }
-
-    return hr;
+    return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
+        dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI domtext_get_nodeName(
-- 
1.5.6.5


