Jacek Caban : mshtml: Added IDispatchEx support to HTMLDOMAttribute object.

Alexandre Julliard julliard at winehq.org
Thu Feb 24 11:43:26 CST 2011


Module: wine
Branch: master
Commit: 17736769c41720905b290b691abdd42d272a8e51
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=17736769c41720905b290b691abdd42d272a8e51

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb 24 13:04:18 2011 +0100

mshtml: Added IDispatchEx support to HTMLDOMAttribute object.

---

 dlls/mshtml/htmlattr.c       |   31 +++++++++++++++++++++++--------
 dlls/mshtml/mshtml_private.h |    3 +++
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c
index 05b13fc..3d6de22 100644
--- a/dlls/mshtml/htmlattr.c
+++ b/dlls/mshtml/htmlattr.c
@@ -48,6 +48,8 @@ static HRESULT WINAPI HTMLDOMAttribute_QueryInterface(IHTMLDOMAttribute *iface,
     }else if(IsEqualGUID(&IID_IHTMLDOMAttribute, riid)) {
         TRACE("(%p)->(IID_IHTMLDOMAttribute %p)\n", This, ppv);
         *ppv = &This->IHTMLDOMAttribute_iface;
+    }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
+        return *ppv ? S_OK : E_NOINTERFACE;
     }else {
         WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
         *ppv =  NULL;
@@ -77,6 +79,7 @@ static ULONG WINAPI HTMLDOMAttribute_Release(IHTMLDOMAttribute *iface)
 
     if(!ref) {
         nsIDOMAttr_Release(This->nsattr);
+        release_dispex(&This->dispex);
         heap_free(This);
     }
 
@@ -86,16 +89,14 @@ static ULONG WINAPI HTMLDOMAttribute_Release(IHTMLDOMAttribute *iface)
 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfoCount(IHTMLDOMAttribute *iface, UINT *pctinfo)
 {
     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
-    FIXME("%p\n", This);
-    return E_NOTIMPL;
+    return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
 }
 
 static HRESULT WINAPI HTMLDOMAttribute_GetTypeInfo(IHTMLDOMAttribute *iface, UINT iTInfo,
                                               LCID lcid, ITypeInfo **ppTInfo)
 {
     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
-    FIXME("%p\n", This);
-    return E_NOTIMPL;
+    return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
 }
 
 static HRESULT WINAPI HTMLDOMAttribute_GetIDsOfNames(IHTMLDOMAttribute *iface, REFIID riid,
@@ -103,8 +104,8 @@ static HRESULT WINAPI HTMLDOMAttribute_GetIDsOfNames(IHTMLDOMAttribute *iface, R
                                                 LCID lcid, DISPID *rgDispId)
 {
     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
-    FIXME("%p\n", This);
-    return E_NOTIMPL;
+    return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
+            lcid, rgDispId);
 }
 
 static HRESULT WINAPI HTMLDOMAttribute_Invoke(IHTMLDOMAttribute *iface, DISPID dispIdMember,
@@ -112,8 +113,8 @@ static HRESULT WINAPI HTMLDOMAttribute_Invoke(IHTMLDOMAttribute *iface, DISPID d
                             VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 {
     HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute(iface);
-    FIXME("%p\n", This);
-    return E_NOTIMPL;
+    return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
+            wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
 }
 
 static HRESULT WINAPI HTMLDOMAttribute_get_nodeName(IHTMLDOMAttribute *iface, BSTR *p)
@@ -158,6 +159,17 @@ static const IHTMLDOMAttributeVtbl HTMLDOMAttributeVtbl = {
     HTMLDOMAttribute_get_specified
 };
 
+static const tid_t HTMLDOMAttribute_iface_tids[] = {
+    IHTMLDOMAttribute_tid,
+    0
+};
+static dispex_static_data_t HTMLDOMAttribute_dispex = {
+    NULL,
+    DispHTMLDOMAttribute_tid,
+    0,
+    HTMLDOMAttribute_iface_tids
+};
+
 HRESULT HTMLDOMAttribute_Create(HTMLDocumentNode *doc, nsIDOMAttr *nsattr, HTMLDOMAttribute **attr)
 {
     HTMLDOMAttribute *ret;
@@ -172,6 +184,9 @@ HRESULT HTMLDOMAttribute_Create(HTMLDocumentNode *doc, nsIDOMAttr *nsattr, HTMLD
     nsIDOMAttr_AddRef(nsattr);
     ret->nsattr = nsattr;
 
+    init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLDOMAttribute_iface,
+            &HTMLDOMAttribute_dispex);
+
     *attr = ret;
     return S_OK;
 }
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index dc99fbf..e69949e 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -74,6 +74,7 @@ typedef struct event_target_t event_target_t;
     XDIID(DispHTMLCommentElement) \
     XDIID(DispHTMLCurrentStyle) \
     XDIID(DispHTMLDocument) \
+    XDIID(DispHTMLDOMAttribute) \
     XDIID(DispHTMLDOMTextNode) \
     XDIID(DispHTMLElementCollection) \
     XDIID(DispHTMLEmbed) \
@@ -111,6 +112,7 @@ typedef struct event_target_t event_target_t;
     XIID(IHTMLDocument3) \
     XIID(IHTMLDocument4) \
     XIID(IHTMLDocument5) \
+    XIID(IHTMLDOMAttribute) \
     XIID(IHTMLDOMChildrenCollection) \
     XIID(IHTMLDOMNode) \
     XIID(IHTMLDOMNode2) \
@@ -740,6 +742,7 @@ HRESULT create_nselem(HTMLDocumentNode*,const WCHAR*,nsIDOMHTMLElement**);
 HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**);
 
 typedef struct {
+    DispatchEx dispex;
     IHTMLDOMAttribute IHTMLDOMAttribute_iface;
 
     LONG ref;




More information about the wine-cvs mailing list