winemine: Updated Slovenian translation.
[wine/gsoc_dplay.git] / dlls / mshtml / persist.c
blob78a5d6b4190286a58fb9b672dc4483ab3ae44bc6
1 /*
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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winuser.h"
31 #include "ole2.h"
32 #include "shlguid.h"
33 #include "idispids.h"
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++);
52 if(*ptr2)
53 ptr2 += 2;
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);
61 }else {
62 ptr = ptr2;
66 *ptr = 0;
67 return ptr-buf;
70 static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
72 nsIInputStream *ret = NULL;
73 IUnknown *unk;
74 IBindStatusCallback *callback;
75 IServiceProvider *service_provider;
76 BINDINFO bindinfo;
77 DWORD bindf = 0;
78 DWORD post_len = 0, headers_len = 0;
79 LPWSTR headers = NULL;
80 WCHAR emptystr[] = {0};
81 char *data;
82 HRESULT hres;
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 */
89 if(!bctx)
90 return NULL;
92 hres = IBindCtx_GetObjectParam(bctx, _BSCB_Holder_, &unk);
93 if(FAILED(hres))
94 return NULL;
96 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&callback);
97 if(FAILED(hres)) {
98 IUnknown_Release(unk);
99 return NULL;
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) {
130 int len = 0;
132 static const char content_length[] = "Content-Length: %u\r\n\r\n";
134 data = heap_alloc(headers_len+post_len+sizeof(content_length)+8);
136 if(headers_len) {
137 WideCharToMultiByte(CP_ACP, 0, headers, -1, data, headers_len, NULL, NULL);
138 len = fix_headers(data, post_len);
141 if(post_len) {
142 sprintf(data+len, content_length, post_len);
143 len += strlen(data+len);
145 memcpy(data+len, bindinfo.stgmedData.u.hGlobal, post_len);
148 TRACE("data = %s\n", debugstr_an(data, len+post_len));
150 if(len)
151 ret = create_nsstream(data, len+post_len);
154 CoTaskMemFree(headers);
155 ReleaseBindInfo(&bindinfo);
156 IBindStatusCallback_Release(callback);
158 return ret;
161 void set_current_mon(HTMLDocument *This, IMoniker *mon)
163 HRESULT hres;
165 if(This->mon) {
166 IMoniker_Release(This->mon);
167 This->mon = NULL;
170 if(This->url) {
171 CoTaskMemFree(This->url);
172 This->url = NULL;
175 if(!mon)
176 return;
178 IMoniker_AddRef(mon);
179 This->mon = mon;
181 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
182 if(FAILED(hres))
183 WARN("GetDisplayName failed: %08x\n", hres);
186 static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL *bind_complete)
188 nsChannelBSC *bscallback;
189 LPOLESTR url = NULL;
190 task_t *task;
191 HRESULT hres;
192 nsresult nsres;
194 if(pibc) {
195 IUnknown *unk = NULL;
197 /* FIXME:
198 * Use params:
199 * "__PrecreatedObject"
200 * "BIND_CONTEXT_PARAM"
201 * "__HTMLLOADOPTIONS"
202 * "__DWNBINDINFO"
203 * "URL Context"
204 * "CBinding Context"
205 * "_ITransData_Object_"
206 * "_EnumFORMATETC_"
209 IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
210 if(unk) {
211 IOleClientSite *client = NULL;
213 hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
214 if(SUCCEEDED(hres)) {
215 TRACE("Got client site %p\n", client);
216 IOleObject_SetClientSite(OLEOBJ(This), client);
217 IOleClientSite_Release(client);
220 IUnknown_Release(unk);
224 This->readystate = READYSTATE_LOADING;
225 call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
226 update_doc(This, UPDATE_TITLE);
228 HTMLDocument_LockContainer(This, TRUE);
230 hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
231 if(FAILED(hres)) {
232 WARN("GetDiaplayName failed: %08x\n", hres);
233 return hres;
236 TRACE("got url: %s\n", debugstr_w(url));
238 set_current_mon(This, mon);
240 if(This->client) {
241 VARIANT silent, offline;
242 IOleCommandTarget *cmdtrg = NULL;
244 hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
245 if(SUCCEEDED(hres)) {
246 if(V_VT(&silent) != VT_BOOL)
247 WARN("V_VT(silent) = %d\n", V_VT(&silent));
248 else if(V_BOOL(&silent))
249 FIXME("silent == true\n");
252 hres = get_client_disp_property(This->client,
253 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
254 if(SUCCEEDED(hres)) {
255 if(V_VT(&silent) != VT_BOOL)
256 WARN("V_VT(offline) = %d\n", V_VT(&silent));
257 else if(V_BOOL(&silent))
258 FIXME("offline == true\n");
261 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
262 (void**)&cmdtrg);
263 if(SUCCEEDED(hres)) {
264 VARIANT var;
266 V_VT(&var) = VT_I4;
267 V_I4(&var) = 0;
268 IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
270 IOleCommandTarget_Release(cmdtrg);
274 bscallback = create_channelbsc(mon);
276 if(This->frame) {
277 task = heap_alloc(sizeof(task_t));
279 task->doc = This;
280 task->task_id = TASK_SETPROGRESS;
281 task->next = NULL;
283 push_task(task);
286 task = heap_alloc(sizeof(task_t));
288 task->doc = This;
289 task->task_id = TASK_SETDOWNLOADSTATE;
290 task->next = NULL;
292 push_task(task);
294 if(This->nscontainer) {
295 nsIInputStream *post_data_stream = get_post_data_stream(pibc);
297 This->nscontainer->bscallback = bscallback;
298 nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url,
299 LOAD_FLAGS_NONE, NULL, post_data_stream, NULL);
300 This->nscontainer->bscallback = NULL;
302 if(post_data_stream)
303 nsIInputStream_Release(post_data_stream);
305 if(NS_SUCCEEDED(nsres)) {
306 /* FIXME: don't return here (URL Moniker needs to be good enough) */
308 IUnknown_Release((IUnknown*)bscallback);
309 CoTaskMemFree(url);
311 if(bind_complete)
312 *bind_complete = TRUE;
313 return S_OK;
314 }else if(nsres != WINE_NS_LOAD_FROM_MONIKER) {
315 WARN("LoadURI failed: %08x\n", nsres);
319 set_document_bscallback(This, bscallback);
320 IUnknown_Release((IUnknown*)bscallback);
321 CoTaskMemFree(url);
323 if(bind_complete)
324 *bind_complete = FALSE;
325 return S_OK;
328 static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len)
330 nsIDOMDocument *nsdoc;
331 nsIDOMNode *nsnode;
332 LPCWSTR strw;
333 nsAString nsstr;
334 nsresult nsres;
336 if(!This->nscontainer) {
337 WARN("no nscontainer, returning NULL\n");
338 return S_OK;
341 nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
342 if(NS_FAILED(nsres)) {
343 ERR("GetDocument failed: %08x\n", nsres);
344 return E_FAIL;
347 nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
348 nsIDOMDocument_Release(nsdoc);
349 if(NS_FAILED(nsres)) {
350 ERR("Could not get nsIDOMNode failed: %08x\n", nsres);
351 return E_FAIL;
354 nsAString_Init(&nsstr, NULL);
355 nsnode_to_nsstring(nsnode, &nsstr);
356 nsIDOMNode_Release(nsnode);
358 nsAString_GetData(&nsstr, &strw);
359 TRACE("%s\n", debugstr_w(strw));
361 *len = WideCharToMultiByte(CP_ACP, 0, strw, -1, NULL, 0, NULL, NULL);
362 *str = heap_alloc(*len);
363 WideCharToMultiByte(CP_ACP, 0, strw, -1, *str, *len, NULL, NULL);
365 nsAString_Finish(&nsstr);
367 return S_OK;
371 /**********************************************************
372 * IPersistMoniker implementation
375 #define PERSISTMON_THIS(iface) DEFINE_THIS(HTMLDocument, PersistMoniker, iface)
377 static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid,
378 void **ppvObject)
380 HTMLDocument *This = PERSISTMON_THIS(iface);
381 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
384 static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
386 HTMLDocument *This = PERSISTMON_THIS(iface);
387 return IHTMLDocument2_AddRef(HTMLDOC(This));
390 static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
392 HTMLDocument *This = PERSISTMON_THIS(iface);
393 return IHTMLDocument2_Release(HTMLDOC(This));
396 static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
398 HTMLDocument *This = PERSISTMON_THIS(iface);
399 return IPersist_GetClassID(PERSIST(This), pClassID);
402 static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
404 HTMLDocument *This = PERSISTMON_THIS(iface);
406 TRACE("(%p)\n", This);
408 return IPersistStreamInit_IsDirty(PERSTRINIT(This));
411 static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable,
412 IMoniker *pimkName, LPBC pibc, DWORD grfMode)
414 HTMLDocument *This = PERSISTMON_THIS(iface);
415 BOOL bind_complete = FALSE;
416 HRESULT hres;
418 TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
420 hres = set_moniker(This, pimkName, pibc, &bind_complete);
421 if(FAILED(hres))
422 return hres;
424 if(!bind_complete)
425 return start_binding(This, (BSCallback*)This->bscallback, pibc);
427 return S_OK;
430 static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName,
431 LPBC pbc, BOOL fRemember)
433 HTMLDocument *This = PERSISTMON_THIS(iface);
434 FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
435 return E_NOTIMPL;
438 static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
440 HTMLDocument *This = PERSISTMON_THIS(iface);
441 FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
442 return E_NOTIMPL;
445 static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
447 HTMLDocument *This = PERSISTMON_THIS(iface);
449 TRACE("(%p)->(%p)\n", This, ppimkName);
451 if(!This->mon)
452 return E_UNEXPECTED;
454 IMoniker_AddRef(This->mon);
455 *ppimkName = This->mon;
456 return S_OK;
459 static const IPersistMonikerVtbl PersistMonikerVtbl = {
460 PersistMoniker_QueryInterface,
461 PersistMoniker_AddRef,
462 PersistMoniker_Release,
463 PersistMoniker_GetClassID,
464 PersistMoniker_IsDirty,
465 PersistMoniker_Load,
466 PersistMoniker_Save,
467 PersistMoniker_SaveCompleted,
468 PersistMoniker_GetCurMoniker
471 /**********************************************************
472 * IMonikerProp implementation
475 #define MONPROP_THIS(iface) DEFINE_THIS(HTMLDocument, MonikerProp, iface)
477 static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppvObject)
479 HTMLDocument *This = MONPROP_THIS(iface);
480 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
483 static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
485 HTMLDocument *This = MONPROP_THIS(iface);
486 return IHTMLDocument2_AddRef(HTMLDOC(This));
489 static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
491 HTMLDocument *This = MONPROP_THIS(iface);
492 return IHTMLDocument_Release(HTMLDOC(This));
495 static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
497 HTMLDocument *This = MONPROP_THIS(iface);
499 TRACE("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
501 switch(mkp) {
502 case MIMETYPEPROP:
503 heap_free(This->mime);
504 This->mime = heap_strdupW(val);
505 break;
507 case CLASSIDPROP:
508 break;
510 default:
511 FIXME("mkp %d\n", mkp);
512 return E_NOTIMPL;
515 return S_OK;
518 static const IMonikerPropVtbl MonikerPropVtbl = {
519 MonikerProp_QueryInterface,
520 MonikerProp_AddRef,
521 MonikerProp_Release,
522 MonikerProp_PutProperty
525 /**********************************************************
526 * IPersistFile implementation
529 #define PERSISTFILE_THIS(iface) DEFINE_THIS(HTMLDocument, PersistFile, iface)
531 static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppvObject)
533 HTMLDocument *This = PERSISTFILE_THIS(iface);
534 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
537 static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
539 HTMLDocument *This = PERSISTFILE_THIS(iface);
540 return IHTMLDocument2_AddRef(HTMLDOC(This));
543 static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
545 HTMLDocument *This = PERSISTFILE_THIS(iface);
546 return IHTMLDocument2_Release(HTMLDOC(This));
549 static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
551 HTMLDocument *This = PERSISTFILE_THIS(iface);
553 TRACE("(%p)->(%p)\n", This, pClassID);
555 if(!pClassID)
556 return E_INVALIDARG;
558 *pClassID = CLSID_HTMLDocument;
559 return S_OK;
562 static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
564 HTMLDocument *This = PERSISTFILE_THIS(iface);
566 TRACE("(%p)\n", This);
568 return IPersistStreamInit_IsDirty(PERSTRINIT(This));
571 static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
573 HTMLDocument *This = PERSISTFILE_THIS(iface);
574 FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode);
575 return E_NOTIMPL;
578 static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
580 HTMLDocument *This = PERSISTFILE_THIS(iface);
581 char *str;
582 DWORD len, written=0;
583 HANDLE file;
584 HRESULT hres;
586 TRACE("(%p)->(%s %x)\n", This, debugstr_w(pszFileName), fRemember);
588 file = CreateFileW(pszFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
589 FILE_ATTRIBUTE_NORMAL, NULL);
590 if(file == INVALID_HANDLE_VALUE) {
591 WARN("Could not create file: %u\n", GetLastError());
592 return E_FAIL;
595 hres = get_doc_string(This, &str, &len);
596 if(FAILED(hres))
597 return hres;
599 WriteFile(file, str, len, &written, NULL);
600 CloseHandle(file);
601 return S_OK;
604 static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
606 HTMLDocument *This = PERSISTFILE_THIS(iface);
607 FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
608 return E_NOTIMPL;
611 static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
613 HTMLDocument *This = PERSISTFILE_THIS(iface);
614 FIXME("(%p)->(%p)\n", This, pszFileName);
615 return E_NOTIMPL;
618 static const IPersistFileVtbl PersistFileVtbl = {
619 PersistFile_QueryInterface,
620 PersistFile_AddRef,
621 PersistFile_Release,
622 PersistFile_GetClassID,
623 PersistFile_IsDirty,
624 PersistFile_Load,
625 PersistFile_Save,
626 PersistFile_SaveCompleted,
627 PersistFile_GetCurFile
630 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
632 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
633 REFIID riid, void **ppv)
635 HTMLDocument *This = PERSTRINIT_THIS(iface);
636 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
639 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
641 HTMLDocument *This = PERSTRINIT_THIS(iface);
642 return IHTMLDocument2_AddRef(HTMLDOC(This));
645 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
647 HTMLDocument *This = PERSTRINIT_THIS(iface);
648 return IHTMLDocument2_Release(HTMLDOC(This));
651 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
653 HTMLDocument *This = PERSTRINIT_THIS(iface);
654 return IPersist_GetClassID(PERSIST(This), pClassID);
657 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
659 HTMLDocument *This = PERSTRINIT_THIS(iface);
661 TRACE("(%p)\n", This);
663 if(This->usermode == EDITMODE)
664 return editor_is_dirty(This);
666 return S_FALSE;
669 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
671 HTMLDocument *This = PERSTRINIT_THIS(iface);
672 IMoniker *mon;
673 HRESULT hres;
675 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
677 TRACE("(%p)->(%p)\n", This, pStm);
679 hres = CreateURLMoniker(NULL, about_blankW, &mon);
680 if(FAILED(hres)) {
681 WARN("CreateURLMoniker failed: %08x\n", hres);
682 return hres;
685 hres = set_moniker(This, mon, NULL, NULL);
686 IMoniker_Release(mon);
687 if(FAILED(hres))
688 return hres;
690 return channelbsc_load_stream(This->bscallback, pStm);
693 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
694 BOOL fClearDirty)
696 HTMLDocument *This = PERSTRINIT_THIS(iface);
697 char *str;
698 DWORD len, written=0;
699 HRESULT hres;
701 TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
703 hres = get_doc_string(This, &str, &len);
704 if(FAILED(hres))
705 return hres;
707 hres = IStream_Write(pStm, str, len, &written);
708 if(FAILED(hres))
709 FIXME("Write failed: %08x\n", hres);
711 heap_free(str);
713 if(fClearDirty)
714 set_dirty(This, VARIANT_FALSE);
716 return S_OK;
719 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
720 ULARGE_INTEGER *pcbSize)
722 HTMLDocument *This = PERSTRINIT_THIS(iface);
723 FIXME("(%p)->(%p)\n", This, pcbSize);
724 return E_NOTIMPL;
727 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
729 HTMLDocument *This = PERSTRINIT_THIS(iface);
730 FIXME("(%p)\n", This);
731 return E_NOTIMPL;
734 #undef PERSTRINIT_THIS
736 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
737 PersistStreamInit_QueryInterface,
738 PersistStreamInit_AddRef,
739 PersistStreamInit_Release,
740 PersistStreamInit_GetClassID,
741 PersistStreamInit_IsDirty,
742 PersistStreamInit_Load,
743 PersistStreamInit_Save,
744 PersistStreamInit_GetSizeMax,
745 PersistStreamInit_InitNew
748 void HTMLDocument_Persist_Init(HTMLDocument *This)
750 This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
751 This->lpPersistFileVtbl = &PersistFileVtbl;
752 This->lpMonikerPropVtbl = &MonikerPropVtbl;
753 This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
755 This->bscallback = NULL;
756 This->mon = NULL;
757 This->url = NULL;
758 This->mime = NULL;