Module: wine Branch: master Commit: 92443dca0210741359493d151020b178e4f51e58 URL: http://source.winehq.org/git/wine.git/?a=commit;h=92443dca0210741359493d1510...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Nov 8 18:17:24 2012 +0100
mshtml: Added IPersistHistory::SaveHistory implementation.
---
dlls/mshtml/persist.c | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 0c279c0..aa31067 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -943,8 +943,29 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream) { HTMLDocument *This = impl_from_IPersistHistory(iface); - FIXME("(%p)->(%p)\n", This, pStream); - return E_NOTIMPL; + ULONG len, written; + BSTR display_uri; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, pStream); + + if(!This->window || !This->window->uri) { + FIXME("No current URI\n"); + return E_FAIL; + } + + /* NOTE: The format we store is *not* compatible with native MSHTML. We currently + * store only URI of the page (as a length followed by a string) */ + hres = IUri_GetDisplayUri(This->window->uri, &display_uri); + if(FAILED(hres)) + return hres; + + len = SysStringLen(display_uri); + hres = IStream_Write(pStream, &len, sizeof(len), &written); + if(SUCCEEDED(hres)) + hres = IStream_Write(pStream, display_uri, len*sizeof(WCHAR), &written); + SysFreeString(display_uri); + return hres; }
static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)