Commit 920f628c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IPersistStreamInit::Load implementation.

parent 09adb8cf
......@@ -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);
......
/*
* 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;
}
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment