Jacek Caban : mshtml: Added IPersistStreamInit::Load implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 11 07:28:03 CDT 2007


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri May 11 13:17:41 2007 +0200

mshtml: Added IPersistStreamInit::Load implementation.

---

 dlls/mshtml/mshtml_private.h |    1 +
 dlls/mshtml/navigate.c       |   19 ++++++++++++++++++-
 dlls/mshtml/persist.c        |   21 +++++++++++++++++++--
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 432df7e..b2a7c69 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -347,6 +347,7 @@ void nsnode_to_nsstring(nsIDOMNode*,nsAString*);
 
 BSCallback *create_bscallback(IMoniker*);
 HRESULT start_binding(BSCallback*);
+HRESULT load_stream(BSCallback*,IStream*);
 void set_document_bscallback(HTMLDocument*,BSCallback*);
 
 IHlink *Hlink_Create(void);
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 69e7b8d..bcafb6c 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Jacek Caban for CodeWeavers
+ * Copyright 2006-2007 Jacek Caban for CodeWeavers
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -817,3 +817,20 @@ void set_document_bscallback(HTMLDocument *doc, BSCallback *callback)
         callback->doc = doc;
     }
 }
+
+HRESULT load_stream(BSCallback *bscallback, IStream *stream)
+{
+    HRESULT hres;
+
+    const char text_html[] = "text/html";
+
+    add_nsrequest(bscallback);
+
+    bscallback->nschannel->content = mshtml_alloc(sizeof(text_html));
+    memcpy(bscallback->nschannel->content, text_html, sizeof(text_html));
+
+    hres = read_stream_data(bscallback, stream);
+    IBindStatusCallback_OnStopBinding(STATUSCLB(bscallback), hres, ERROR_SUCCESS);
+
+    return hres;
+}
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index a2b6f73..397a307 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -558,8 +558,25 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
 {
     HTMLDocument *This = PERSTRINIT_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, pStm);
-    return E_NOTIMPL;
+    IMoniker *mon;
+    HRESULT hres;
+
+    static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
+
+    TRACE("(%p)->(%p)\n", This, pStm);
+
+    hres = CreateURLMoniker(NULL, about_blankW, &mon);
+    if(FAILED(hres)) {
+        WARN("CreateURLMoniker failed: %08x\n", hres);
+        return hres;
+    }
+
+    hres = set_moniker(This, mon, NULL);
+    IMoniker_Release(mon);
+    if(FAILED(hres))
+        return hres;
+
+    return load_stream(This->bscallback, pStm);
 }
 
 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,




More information about the wine-cvs mailing list