Jacek Caban : mshtml: Added IPersistHistory stub implementation.

Alexandre Julliard julliard at winehq.org
Thu Apr 16 14:34:52 CDT 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Apr 15 19:58:05 2009 +0200

mshtml: Added IPersistHistory stub implementation.

---

 dlls/mshtml/htmldoc.c        |    4 +-
 dlls/mshtml/mshtml_private.h |    3 ++
 dlls/mshtml/persist.c        |   72 ++++++++++++++++++++++++++++++++++++++++++
 dlls/mshtml/tests/htmldoc.c  |    2 +-
 4 files changed, 78 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 1675c5c..0b95229 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -134,8 +134,8 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
         TRACE("(%p)->(IID_ISupportErrorInfo %p)\n", This, ppvObject);
         *ppvObject = SUPPERRINFO(This);
     }else if(IsEqualGUID(&IID_IPersistHistory, riid)) {
-        FIXME("(%p)->(IID_IPersistHistory currently not supported %p)\n", This, ppvObject);
-        *ppvObject = NULL;
+        TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppvObject);
+        *ppvObject = PERSISTHIST(This);
     }else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
         FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppvObject);
         return E_NOINTERFACE;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 3ecfdea..ebb63bb 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -21,6 +21,7 @@
 #include "mshtml.h"
 #include "mshtmhst.h"
 #include "hlink.h"
+#include "perhist.h"
 #include "dispex.h"
 
 #include "wine/list.h"
@@ -229,6 +230,7 @@ struct HTMLDocument {
     const IHTMLDocument5Vtbl              *lpHTMLDocument5Vtbl;
     const IPersistMonikerVtbl             *lpPersistMonikerVtbl;
     const IPersistFileVtbl                *lpPersistFileVtbl;
+    const IPersistHistoryVtbl             *lpPersistHistoryVtbl;
     const IMonikerPropVtbl                *lpMonikerPropVtbl;
     const IOleObjectVtbl                  *lpOleObjectVtbl;
     const IOleDocumentVtbl                *lpOleDocumentVtbl;
@@ -442,6 +444,7 @@ typedef struct {
 #define HLNKTARGET(x)    ((IHlinkTarget*)                 &(x)->lpHlinkTargetVtbl)
 #define CONPTCONT(x)     ((IConnectionPointContainer*)    &(x)->lpConnectionPointContainerVtbl)
 #define PERSTRINIT(x)    ((IPersistStreamInit*)           &(x)->lpPersistStreamInitVtbl)
+#define PERSISTHIST(x)   ((IPersistHistory*)              &(x)->lpPersistHistoryVtbl)
 #define CUSTOMDOC(x)     ((ICustomDoc*)                   &(x)->lpCustomDocVtbl)
 
 #define NSWBCHROME(x)    ((nsIWebBrowserChrome*)          &(x)->lpWebBrowserChromeVtbl)
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index 81f9216..c8a0c57 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -748,12 +748,84 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
     PersistStreamInit_InitNew
 };
 
+/**********************************************************
+ * IPersistHistory implementation
+ */
+
+#define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
+
+static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppvObject)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
+}
+
+static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    return IHTMLDocument2_AddRef(HTMLDOC(This));
+}
+
+static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    return IHTMLDocument2_Release(HTMLDOC(This));
+}
+
+static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    return IPersist_GetClassID(PERSIST(This), pClassID);
+}
+
+static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pStream);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    FIXME("(%p)->(%x)\n", This, dwPositioncookie);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
+{
+    HTMLDocument *This = PERSISTHIST_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
+    return E_NOTIMPL;
+}
+
+#undef PERSISTHIST_THIS
+
+static const IPersistHistoryVtbl PersistHistoryVtbl = {
+    PersistHistory_QueryInterface,
+    PersistHistory_AddRef,
+    PersistHistory_Release,
+    PersistHistory_GetClassID,
+    PersistHistory_LoadHistory,
+    PersistHistory_SaveHistory,
+    PersistHistory_SetPositionCookie,
+    PersistHistory_GetPositionCookie
+};
+
 void HTMLDocument_Persist_Init(HTMLDocument *This)
 {
     This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
     This->lpPersistFileVtbl = &PersistFileVtbl;
     This->lpMonikerPropVtbl = &MonikerPropVtbl;
     This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
+    This->lpPersistHistoryVtbl = &PersistHistoryVtbl;
 
     This->bscallback = NULL;
     This->mon = NULL;
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 45fc00c..60b3d2e 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -4191,7 +4191,7 @@ static void test_IPersistHistory(void)
         return;
 
     hres = IUnknown_QueryInterface(unk, &IID_IPersistHistory, (void**)&phist);
-    todo_wine ok(hres == S_OK, "QueryInterface returned %08x, expected S_OK\n", hres);
+    ok(hres == S_OK, "QueryInterface returned %08x, expected S_OK\n", hres);
     if(hres == S_OK)
         IPersistHistory_Release(phist);
 




More information about the wine-cvs mailing list