Michael Stefaniuc : mshtml: COM cleanup for the ISupportErrorInfo iface.

Alexandre Julliard julliard at winehq.org
Mon Dec 27 10:03:55 CST 2010


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Dec 27 01:48:10 2010 +0100

mshtml: COM cleanup for the ISupportErrorInfo iface.

---

 dlls/mshtml/htmldoc.c        |   15 +++++++++------
 dlls/mshtml/mshtml_private.h |    4 +---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index c25f7f3..466fc05 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1511,23 +1511,26 @@ static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp)
         update_cp_events(This->window, &This->doc_node->node.event_target, cp, This->doc_node->node.nsnode);
 }
 
-#define SUPPINFO_THIS(iface) DEFINE_THIS(HTMLDocument, SupportErrorInfo, iface)
+static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface);
+}
 
 static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv)
 {
-    HTMLDocument *This = SUPPINFO_THIS(iface);
+    HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
     return htmldoc_query_interface(This, riid, ppv);
 }
 
 static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
 {
-    HTMLDocument *This = SUPPINFO_THIS(iface);
+    HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
     return htmldoc_addref(This);
 }
 
 static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
 {
-    HTMLDocument *This = SUPPINFO_THIS(iface);
+    HTMLDocument *This = impl_from_ISupportErrorInfo(iface);
     return htmldoc_release(This);
 }
 
@@ -1794,7 +1797,7 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
         *ppv = &This->IHTMLDocument2_iface;
     }else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) {
         TRACE("(%p)->(IID_ISupportErrorInfo %p)\n", This, ppv);
-        *ppv = SUPPERRINFO(This);
+        *ppv = &This->ISupportErrorInfo_iface;
     }else if(IsEqualGUID(&IID_IPersistHistory, riid)) {
         TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppv);
         *ppv = &This->IPersistHistory_iface;
@@ -1837,7 +1840,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
 {
     doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl;
     doc->lpIDispatchExVtbl = &DocDispatchExVtbl;
-    doc->lpSupportErrorInfoVtbl = &SupportErrorInfoVtbl;
+    doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl;
 
     doc->unk_impl = unk_impl;
     doc->dispex = dispex;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 97940e2..355c325 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -363,7 +363,7 @@ struct HTMLDocument {
     IHlinkTarget                IHlinkTarget_iface;
     IPersistStreamInit          IPersistStreamInit_iface;
     const IDispatchExVtbl                 *lpIDispatchExVtbl;
-    const ISupportErrorInfoVtbl           *lpSupportErrorInfoVtbl;
+    ISupportErrorInfo           ISupportErrorInfo_iface;
     const IObjectWithSiteVtbl             *lpObjectWithSiteVtbl;
     IOleContainer    IOleContainer_iface;
 
@@ -668,8 +668,6 @@ struct HTMLDocumentNode {
 
 #define DISPATCHEX(x)    ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
 
-#define SUPPERRINFO(x)   ((ISupportErrorInfo*) &(x)->lpSupportErrorInfoVtbl)
-
 #define HOSTSECMGR(x)    ((IInternetHostSecurityManager*)  &(x)->lpIInternetHostSecurityManagerVtbl)
 
 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))




More information about the wine-cvs mailing list