2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
38 #include "mshtml_private.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
42 #define USER_AGENT "User-Agent:"
43 #define CONTENT_TYPE "Content-Type:"
45 static int fix_headers(char *buf
, DWORD post_len
)
47 char *ptr
= buf
, *ptr2
;
49 while(*ptr
&& (ptr
[0] != '\r' || ptr
[1] != '\n')) {
50 for(ptr2
=ptr
+1; *ptr2
&& (ptr2
[0] != '\r' || ptr2
[1] != '\n'); ptr2
++);
55 if(!strncasecmp(ptr
, USER_AGENT
, sizeof(USER_AGENT
)-1)) {
56 FIXME("Ignoring User-Agent header\n");
57 memmove(ptr
, ptr2
, strlen(ptr2
)+1);
58 }else if(!post_len
&& !strncasecmp(ptr
, CONTENT_TYPE
, sizeof(CONTENT_TYPE
)-1)) {
59 TRACE("Ignoring Content-Type header\n");
60 memmove(ptr
, ptr2
, strlen(ptr2
)+1);
70 static nsIInputStream
*get_post_data_stream(IBindCtx
*bctx
)
72 nsIInputStream
*ret
= NULL
;
74 IBindStatusCallback
*callback
;
75 IServiceProvider
*service_provider
;
78 DWORD post_len
= 0, headers_len
= 0;
79 LPWSTR headers
= NULL
;
80 WCHAR emptystr
[] = {0};
84 static WCHAR _BSCB_Holder_
[] =
85 {'_','B','S','C','B','_','H','o','l','d','e','r','_',0};
88 /* FIXME: This should be done in URLMoniker */
92 hres
= IBindCtx_GetObjectParam(bctx
, _BSCB_Holder_
, &unk
);
96 hres
= IUnknown_QueryInterface(unk
, &IID_IBindStatusCallback
, (void**)&callback
);
98 IUnknown_Release(unk
);
102 hres
= IUnknown_QueryInterface(unk
, &IID_IServiceProvider
, (void**)&service_provider
);
103 IUnknown_Release(unk
);
104 if(SUCCEEDED(hres
)) {
105 IHttpNegotiate
*http_negotiate
;
107 hres
= IServiceProvider_QueryService(service_provider
, &IID_IHttpNegotiate
, &IID_IHttpNegotiate
,
108 (void**)&http_negotiate
);
109 if(SUCCEEDED(hres
)) {
110 hres
= IHttpNegotiate_BeginningTransaction(http_negotiate
, emptystr
,
111 emptystr
, 0, &headers
);
112 IHttpNegotiate_Release(http_negotiate
);
114 if(SUCCEEDED(hres
) && headers
)
115 headers_len
= WideCharToMultiByte(CP_ACP
, 0, headers
, -1, NULL
, 0, NULL
, NULL
);
118 IServiceProvider_Release(service_provider
);
121 memset(&bindinfo
, 0, sizeof(bindinfo
));
122 bindinfo
.cbSize
= sizeof(bindinfo
);
124 hres
= IBindStatusCallback_GetBindInfo(callback
, &bindf
, &bindinfo
);
126 if(SUCCEEDED(hres
) && bindinfo
.dwBindVerb
== BINDVERB_POST
)
127 post_len
= bindinfo
.cbstgmedData
;
129 if(headers_len
|| post_len
) {
132 static const char content_length
[] = "Content-Length: %u\r\n\r\n";
134 data
= heap_alloc(headers_len
+post_len
+sizeof(content_length
)+10);
137 WideCharToMultiByte(CP_ACP
, 0, headers
, -1, data
, headers_len
, NULL
, NULL
);
138 len
= fix_headers(data
, post_len
);
139 if(len
>= 2 && (data
[len
-1] != '\n' || data
[len
-2] != '\r')) {
146 sprintf(data
+len
, content_length
, post_len
);
147 len
+= strlen(data
+len
);
149 memcpy(data
+len
, bindinfo
.stgmedData
.u
.hGlobal
, post_len
);
152 TRACE("data = %s\n", debugstr_an(data
, len
+post_len
));
155 ret
= create_nsstream(data
, len
+post_len
);
158 CoTaskMemFree(headers
);
159 ReleaseBindInfo(&bindinfo
);
160 IBindStatusCallback_Release(callback
);
165 static BOOL
use_gecko_script(LPCWSTR url
)
167 static const WCHAR fileW
[] = {'f','i','l','e',':'};
168 return strncmpiW(fileW
, url
, sizeof(fileW
)/sizeof(WCHAR
));
171 void set_current_mon(HTMLDocument
*This
, IMoniker
*mon
)
176 IMoniker_Release(This
->mon
);
181 CoTaskMemFree(This
->url
);
188 IMoniker_AddRef(mon
);
191 hres
= IMoniker_GetDisplayName(mon
, NULL
, NULL
, &This
->url
);
193 WARN("GetDisplayName failed: %08x\n", hres
);
195 set_script_mode(This
, use_gecko_script(This
->url
) ? SCRIPTMODE_GECKO
: SCRIPTMODE_ACTIVESCRIPT
);
198 static HRESULT
set_moniker(HTMLDocument
*This
, IMoniker
*mon
, IBindCtx
*pibc
, BOOL
*bind_complete
)
200 nsChannelBSC
*bscallback
;
207 IUnknown
*unk
= NULL
;
211 * "__PrecreatedObject"
212 * "BIND_CONTEXT_PARAM"
213 * "__HTMLLOADOPTIONS"
217 * "_ITransData_Object_"
221 IBindCtx_GetObjectParam(pibc
, (LPOLESTR
)SZ_HTML_CLIENTSITE_OBJECTPARAM
, &unk
);
223 IOleClientSite
*client
= NULL
;
225 hres
= IUnknown_QueryInterface(unk
, &IID_IOleClientSite
, (void**)&client
);
226 if(SUCCEEDED(hres
)) {
227 TRACE("Got client site %p\n", client
);
228 IOleObject_SetClientSite(OLEOBJ(This
), client
);
229 IOleClientSite_Release(client
);
232 IUnknown_Release(unk
);
236 This
->readystate
= READYSTATE_LOADING
;
237 call_property_onchanged(&This
->cp_propnotif
, DISPID_READYSTATE
);
238 update_doc(This
, UPDATE_TITLE
);
240 HTMLDocument_LockContainer(This
, TRUE
);
242 hres
= IMoniker_GetDisplayName(mon
, pibc
, NULL
, &url
);
244 WARN("GetDiaplayName failed: %08x\n", hres
);
248 TRACE("got url: %s\n", debugstr_w(url
));
250 set_current_mon(This
, mon
);
253 VARIANT silent
, offline
;
254 IOleCommandTarget
*cmdtrg
= NULL
;
256 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_SILENT
, &silent
);
257 if(SUCCEEDED(hres
)) {
258 if(V_VT(&silent
) != VT_BOOL
)
259 WARN("V_VT(silent) = %d\n", V_VT(&silent
));
260 else if(V_BOOL(&silent
))
261 FIXME("silent == true\n");
264 hres
= get_client_disp_property(This
->client
,
265 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
, &offline
);
266 if(SUCCEEDED(hres
)) {
267 if(V_VT(&silent
) != VT_BOOL
)
268 WARN("V_VT(offline) = %d\n", V_VT(&silent
));
269 else if(V_BOOL(&silent
))
270 FIXME("offline == true\n");
273 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IOleCommandTarget
,
275 if(SUCCEEDED(hres
)) {
280 IOleCommandTarget_Exec(cmdtrg
, &CGID_ShellDocView
, 37, 0, &var
, NULL
);
282 IOleCommandTarget_Release(cmdtrg
);
286 bscallback
= create_channelbsc(mon
);
289 task
= heap_alloc(sizeof(task_t
));
292 task
->task_id
= TASK_SETPROGRESS
;
298 task
= heap_alloc(sizeof(task_t
));
301 task
->task_id
= TASK_SETDOWNLOADSTATE
;
306 if(This
->nscontainer
) {
307 nsIInputStream
*post_data_stream
= get_post_data_stream(pibc
);
309 This
->nscontainer
->bscallback
= bscallback
;
310 nsres
= nsIWebNavigation_LoadURI(This
->nscontainer
->navigation
, url
,
311 LOAD_FLAGS_NONE
, NULL
, post_data_stream
, NULL
);
312 This
->nscontainer
->bscallback
= NULL
;
315 nsIInputStream_Release(post_data_stream
);
317 if(NS_SUCCEEDED(nsres
)) {
318 /* FIXME: don't return here (URL Moniker needs to be good enough) */
320 IUnknown_Release((IUnknown
*)bscallback
);
324 *bind_complete
= TRUE
;
326 }else if(nsres
!= WINE_NS_LOAD_FROM_MONIKER
) {
327 WARN("LoadURI failed: %08x\n", nsres
);
331 set_document_bscallback(This
, bscallback
);
332 IUnknown_Release((IUnknown
*)bscallback
);
336 *bind_complete
= FALSE
;
340 static HRESULT
get_doc_string(HTMLDocument
*This
, char **str
, DWORD
*len
)
348 WARN("NULL nsdoc\n");
352 nsres
= nsIDOMHTMLDocument_QueryInterface(This
->nsdoc
, &IID_nsIDOMNode
, (void**)&nsnode
);
353 if(NS_FAILED(nsres
)) {
354 ERR("Could not get nsIDOMNode failed: %08x\n", nsres
);
358 nsAString_Init(&nsstr
, NULL
);
359 nsnode_to_nsstring(nsnode
, &nsstr
);
360 nsIDOMNode_Release(nsnode
);
362 nsAString_GetData(&nsstr
, &strw
);
363 TRACE("%s\n", debugstr_w(strw
));
365 *len
= WideCharToMultiByte(CP_ACP
, 0, strw
, -1, NULL
, 0, NULL
, NULL
);
366 *str
= heap_alloc(*len
);
367 WideCharToMultiByte(CP_ACP
, 0, strw
, -1, *str
, *len
, NULL
, NULL
);
369 nsAString_Finish(&nsstr
);
375 /**********************************************************
376 * IPersistMoniker implementation
379 #define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
381 static HRESULT WINAPI
PersistMoniker_QueryInterface(IPersistMoniker
*iface
, REFIID riid
,
384 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
385 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
388 static ULONG WINAPI
PersistMoniker_AddRef(IPersistMoniker
*iface
)
390 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
391 return IHTMLDocument2_AddRef(HTMLDOC(This
));
394 static ULONG WINAPI
PersistMoniker_Release(IPersistMoniker
*iface
)
396 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
397 return IHTMLDocument2_Release(HTMLDOC(This
));
400 static HRESULT WINAPI
PersistMoniker_GetClassID(IPersistMoniker
*iface
, CLSID
*pClassID
)
402 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
403 return IPersist_GetClassID(PERSIST(This
), pClassID
);
406 static HRESULT WINAPI
PersistMoniker_IsDirty(IPersistMoniker
*iface
)
408 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
410 TRACE("(%p)\n", This
);
412 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
415 static HRESULT WINAPI
PersistMoniker_Load(IPersistMoniker
*iface
, BOOL fFullyAvailable
,
416 IMoniker
*pimkName
, LPBC pibc
, DWORD grfMode
)
418 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
419 BOOL bind_complete
= FALSE
;
422 TRACE("(%p)->(%x %p %p %08x)\n", This
, fFullyAvailable
, pimkName
, pibc
, grfMode
);
424 hres
= set_moniker(This
, pimkName
, pibc
, &bind_complete
);
429 return start_binding(This
, (BSCallback
*)This
->bscallback
, pibc
);
434 static HRESULT WINAPI
PersistMoniker_Save(IPersistMoniker
*iface
, IMoniker
*pimkName
,
435 LPBC pbc
, BOOL fRemember
)
437 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
438 FIXME("(%p)->(%p %p %x)\n", This
, pimkName
, pbc
, fRemember
);
442 static HRESULT WINAPI
PersistMoniker_SaveCompleted(IPersistMoniker
*iface
, IMoniker
*pimkName
, LPBC pibc
)
444 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
445 FIXME("(%p)->(%p %p)\n", This
, pimkName
, pibc
);
449 static HRESULT WINAPI
PersistMoniker_GetCurMoniker(IPersistMoniker
*iface
, IMoniker
**ppimkName
)
451 HTMLDocument
*This
= PERSISTMON_THIS(iface
);
453 TRACE("(%p)->(%p)\n", This
, ppimkName
);
458 IMoniker_AddRef(This
->mon
);
459 *ppimkName
= This
->mon
;
463 static const IPersistMonikerVtbl PersistMonikerVtbl
= {
464 PersistMoniker_QueryInterface
,
465 PersistMoniker_AddRef
,
466 PersistMoniker_Release
,
467 PersistMoniker_GetClassID
,
468 PersistMoniker_IsDirty
,
471 PersistMoniker_SaveCompleted
,
472 PersistMoniker_GetCurMoniker
475 /**********************************************************
476 * IMonikerProp implementation
479 #define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
481 static HRESULT WINAPI
MonikerProp_QueryInterface(IMonikerProp
*iface
, REFIID riid
, void **ppvObject
)
483 HTMLDocument
*This
= MONPROP_THIS(iface
);
484 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
487 static ULONG WINAPI
MonikerProp_AddRef(IMonikerProp
*iface
)
489 HTMLDocument
*This
= MONPROP_THIS(iface
);
490 return IHTMLDocument2_AddRef(HTMLDOC(This
));
493 static ULONG WINAPI
MonikerProp_Release(IMonikerProp
*iface
)
495 HTMLDocument
*This
= MONPROP_THIS(iface
);
496 return IHTMLDocument_Release(HTMLDOC(This
));
499 static HRESULT WINAPI
MonikerProp_PutProperty(IMonikerProp
*iface
, MONIKERPROPERTY mkp
, LPCWSTR val
)
501 HTMLDocument
*This
= MONPROP_THIS(iface
);
503 TRACE("(%p)->(%d %s)\n", This
, mkp
, debugstr_w(val
));
507 heap_free(This
->mime
);
508 This
->mime
= heap_strdupW(val
);
515 FIXME("mkp %d\n", mkp
);
522 static const IMonikerPropVtbl MonikerPropVtbl
= {
523 MonikerProp_QueryInterface
,
526 MonikerProp_PutProperty
529 /**********************************************************
530 * IPersistFile implementation
533 #define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
535 static HRESULT WINAPI
PersistFile_QueryInterface(IPersistFile
*iface
, REFIID riid
, void **ppvObject
)
537 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
538 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
541 static ULONG WINAPI
PersistFile_AddRef(IPersistFile
*iface
)
543 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
544 return IHTMLDocument2_AddRef(HTMLDOC(This
));
547 static ULONG WINAPI
PersistFile_Release(IPersistFile
*iface
)
549 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
550 return IHTMLDocument2_Release(HTMLDOC(This
));
553 static HRESULT WINAPI
PersistFile_GetClassID(IPersistFile
*iface
, CLSID
*pClassID
)
555 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
557 TRACE("(%p)->(%p)\n", This
, pClassID
);
562 *pClassID
= CLSID_HTMLDocument
;
566 static HRESULT WINAPI
PersistFile_IsDirty(IPersistFile
*iface
)
568 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
570 TRACE("(%p)\n", This
);
572 return IPersistStreamInit_IsDirty(PERSTRINIT(This
));
575 static HRESULT WINAPI
PersistFile_Load(IPersistFile
*iface
, LPCOLESTR pszFileName
, DWORD dwMode
)
577 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
578 FIXME("(%p)->(%s %08x)\n", This
, debugstr_w(pszFileName
), dwMode
);
582 static HRESULT WINAPI
PersistFile_Save(IPersistFile
*iface
, LPCOLESTR pszFileName
, BOOL fRemember
)
584 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
586 DWORD len
, written
=0;
590 TRACE("(%p)->(%s %x)\n", This
, debugstr_w(pszFileName
), fRemember
);
592 file
= CreateFileW(pszFileName
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
,
593 FILE_ATTRIBUTE_NORMAL
, NULL
);
594 if(file
== INVALID_HANDLE_VALUE
) {
595 WARN("Could not create file: %u\n", GetLastError());
599 hres
= get_doc_string(This
, &str
, &len
);
601 WriteFile(file
, str
, len
, &written
, NULL
);
607 static HRESULT WINAPI
PersistFile_SaveCompleted(IPersistFile
*iface
, LPCOLESTR pszFileName
)
609 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
610 FIXME("(%p)->(%s)\n", This
, debugstr_w(pszFileName
));
614 static HRESULT WINAPI
PersistFile_GetCurFile(IPersistFile
*iface
, LPOLESTR
*pszFileName
)
616 HTMLDocument
*This
= PERSISTFILE_THIS(iface
);
617 FIXME("(%p)->(%p)\n", This
, pszFileName
);
621 static const IPersistFileVtbl PersistFileVtbl
= {
622 PersistFile_QueryInterface
,
625 PersistFile_GetClassID
,
629 PersistFile_SaveCompleted
,
630 PersistFile_GetCurFile
633 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
635 static HRESULT WINAPI
PersistStreamInit_QueryInterface(IPersistStreamInit
*iface
,
636 REFIID riid
, void **ppv
)
638 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
639 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
642 static ULONG WINAPI
PersistStreamInit_AddRef(IPersistStreamInit
*iface
)
644 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
645 return IHTMLDocument2_AddRef(HTMLDOC(This
));
648 static ULONG WINAPI
PersistStreamInit_Release(IPersistStreamInit
*iface
)
650 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
651 return IHTMLDocument2_Release(HTMLDOC(This
));
654 static HRESULT WINAPI
PersistStreamInit_GetClassID(IPersistStreamInit
*iface
, CLSID
*pClassID
)
656 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
657 return IPersist_GetClassID(PERSIST(This
), pClassID
);
660 static HRESULT WINAPI
PersistStreamInit_IsDirty(IPersistStreamInit
*iface
)
662 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
664 TRACE("(%p)\n", This
);
666 if(This
->usermode
== EDITMODE
)
667 return editor_is_dirty(This
);
672 static HRESULT WINAPI
PersistStreamInit_Load(IPersistStreamInit
*iface
, LPSTREAM pStm
)
674 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
678 static const WCHAR about_blankW
[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
680 TRACE("(%p)->(%p)\n", This
, pStm
);
682 hres
= CreateURLMoniker(NULL
, about_blankW
, &mon
);
684 WARN("CreateURLMoniker failed: %08x\n", hres
);
688 hres
= set_moniker(This
, mon
, NULL
, NULL
);
689 IMoniker_Release(mon
);
693 return channelbsc_load_stream(This
->bscallback
, pStm
);
696 static HRESULT WINAPI
PersistStreamInit_Save(IPersistStreamInit
*iface
, LPSTREAM pStm
,
699 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
701 DWORD len
, written
=0;
704 TRACE("(%p)->(%p %x)\n", This
, pStm
, fClearDirty
);
706 hres
= get_doc_string(This
, &str
, &len
);
710 hres
= IStream_Write(pStm
, str
, len
, &written
);
712 FIXME("Write failed: %08x\n", hres
);
717 set_dirty(This
, VARIANT_FALSE
);
722 static HRESULT WINAPI
PersistStreamInit_GetSizeMax(IPersistStreamInit
*iface
,
723 ULARGE_INTEGER
*pcbSize
)
725 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
726 FIXME("(%p)->(%p)\n", This
, pcbSize
);
730 static HRESULT WINAPI
PersistStreamInit_InitNew(IPersistStreamInit
*iface
)
732 HTMLDocument
*This
= PERSTRINIT_THIS(iface
);
733 FIXME("(%p)\n", This
);
737 #undef PERSTRINIT_THIS
739 static const IPersistStreamInitVtbl PersistStreamInitVtbl
= {
740 PersistStreamInit_QueryInterface
,
741 PersistStreamInit_AddRef
,
742 PersistStreamInit_Release
,
743 PersistStreamInit_GetClassID
,
744 PersistStreamInit_IsDirty
,
745 PersistStreamInit_Load
,
746 PersistStreamInit_Save
,
747 PersistStreamInit_GetSizeMax
,
748 PersistStreamInit_InitNew
751 /**********************************************************
752 * IPersistHistory implementation
755 #define PERSISTHIST_THIS(iface) DEFINE_THIS(HTMLDocument, PersistHistory, iface)
757 static HRESULT WINAPI
PersistHistory_QueryInterface(IPersistHistory
*iface
, REFIID riid
, void **ppvObject
)
759 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
760 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
763 static ULONG WINAPI
PersistHistory_AddRef(IPersistHistory
*iface
)
765 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
766 return IHTMLDocument2_AddRef(HTMLDOC(This
));
769 static ULONG WINAPI
PersistHistory_Release(IPersistHistory
*iface
)
771 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
772 return IHTMLDocument2_Release(HTMLDOC(This
));
775 static HRESULT WINAPI
PersistHistory_GetClassID(IPersistHistory
*iface
, CLSID
*pClassID
)
777 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
778 return IPersist_GetClassID(PERSIST(This
), pClassID
);
781 static HRESULT WINAPI
PersistHistory_LoadHistory(IPersistHistory
*iface
, IStream
*pStream
, IBindCtx
*pbc
)
783 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
784 FIXME("(%p)->(%p %p)\n", This
, pStream
, pbc
);
788 static HRESULT WINAPI
PersistHistory_SaveHistory(IPersistHistory
*iface
, IStream
*pStream
)
790 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
791 FIXME("(%p)->(%p)\n", This
, pStream
);
795 static HRESULT WINAPI
PersistHistory_SetPositionCookie(IPersistHistory
*iface
, DWORD dwPositioncookie
)
797 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
798 FIXME("(%p)->(%x)\n", This
, dwPositioncookie
);
802 static HRESULT WINAPI
PersistHistory_GetPositionCookie(IPersistHistory
*iface
, DWORD
*pdwPositioncookie
)
804 HTMLDocument
*This
= PERSISTHIST_THIS(iface
);
805 FIXME("(%p)->(%p)\n", This
, pdwPositioncookie
);
809 #undef PERSISTHIST_THIS
811 static const IPersistHistoryVtbl PersistHistoryVtbl
= {
812 PersistHistory_QueryInterface
,
813 PersistHistory_AddRef
,
814 PersistHistory_Release
,
815 PersistHistory_GetClassID
,
816 PersistHistory_LoadHistory
,
817 PersistHistory_SaveHistory
,
818 PersistHistory_SetPositionCookie
,
819 PersistHistory_GetPositionCookie
822 void HTMLDocument_Persist_Init(HTMLDocument
*This
)
824 This
->lpPersistMonikerVtbl
= &PersistMonikerVtbl
;
825 This
->lpPersistFileVtbl
= &PersistFileVtbl
;
826 This
->lpMonikerPropVtbl
= &MonikerPropVtbl
;
827 This
->lpPersistStreamInitVtbl
= &PersistStreamInitVtbl
;
828 This
->lpPersistHistoryVtbl
= &PersistHistoryVtbl
;
830 This
->bscallback
= NULL
;