msvcrt/tests: Remove a space before a '\n'.
[wine/gsoc-2012-control.git] / dlls / mshtml / persist.c
bloba207266700e20f4dfda40e638ec4ffaf13bfff52
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 static BOOL use_gecko_script(LPCWSTR url)
163 static const WCHAR fileW[] = {'f','i','l','e',':'};
164 return strncmpiW(fileW, url, sizeof(fileW)/sizeof(WCHAR));
167 void set_current_mon(HTMLDocument *This, IMoniker *mon)
169 HRESULT hres;
171 if(This->mon) {
172 IMoniker_Release(This->mon);
173 This->mon = NULL;
176 if(This->url) {
177 CoTaskMemFree(This->url);
178 This->url = NULL;
181 if(!mon)
182 return;
184 IMoniker_AddRef(mon);
185 This->mon = mon;
187 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
188 if(FAILED(hres))
189 WARN("GetDisplayName failed: %08x\n", hres);
191 set_script_mode(This, use_gecko_script(This->url) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
194 static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL *bind_complete)
196 nsChannelBSC *bscallback;
197 LPOLESTR url = NULL;
198 task_t *task;
199 HRESULT hres;
200 nsresult nsres;
202 if(pibc) {
203 IUnknown *unk = NULL;
205 /* FIXME:
206 * Use params:
207 * "__PrecreatedObject"
208 * "BIND_CONTEXT_PARAM"
209 * "__HTMLLOADOPTIONS"
210 * "__DWNBINDINFO"
211 * "URL Context"
212 * "CBinding Context"
213 * "_ITransData_Object_"
214 * "_EnumFORMATETC_"
217 IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
218 if(unk) {
219 IOleClientSite *client = NULL;
221 hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
222 if(SUCCEEDED(hres)) {
223 TRACE("Got client site %p\n", client);
224 IOleObject_SetClientSite(OLEOBJ(This), client);
225 IOleClientSite_Release(client);
228 IUnknown_Release(unk);
232 This->readystate = READYSTATE_LOADING;
233 call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
234 update_doc(This, UPDATE_TITLE);
236 HTMLDocument_LockContainer(This, TRUE);
238 hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
239 if(FAILED(hres)) {
240 WARN("GetDiaplayName failed: %08x\n", hres);
241 return hres;
244 TRACE("got url: %s\n", debugstr_w(url));
246 set_current_mon(This, mon);
248 if(This->client) {
249 VARIANT silent, offline;
250 IOleCommandTarget *cmdtrg = NULL;
252 hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
253 if(SUCCEEDED(hres)) {
254 if(V_VT(&silent) != VT_BOOL)
255 WARN("V_VT(silent) = %d\n", V_VT(&silent));
256 else if(V_BOOL(&silent))
257 FIXME("silent == true\n");
260 hres = get_client_disp_property(This->client,
261 DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
262 if(SUCCEEDED(hres)) {
263 if(V_VT(&silent) != VT_BOOL)
264 WARN("V_VT(offline) = %d\n", V_VT(&silent));
265 else if(V_BOOL(&silent))
266 FIXME("offline == true\n");
269 hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
270 (void**)&cmdtrg);
271 if(SUCCEEDED(hres)) {
272 VARIANT var;
274 V_VT(&var) = VT_I4;
275 V_I4(&var) = 0;
276 IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
278 IOleCommandTarget_Release(cmdtrg);
282 bscallback = create_channelbsc(mon);
284 if(This->frame) {
285 task = heap_alloc(sizeof(task_t));
287 task->doc = This;
288 task->task_id = TASK_SETPROGRESS;
289 task->next = NULL;
291 push_task(task);
294 task = heap_alloc(sizeof(task_t));
296 task->doc = This;
297 task->task_id = TASK_SETDOWNLOADSTATE;
298 task->next = NULL;
300 push_task(task);
302 if(This->nscontainer) {
303 nsIInputStream *post_data_stream = get_post_data_stream(pibc);
305 This->nscontainer->bscallback = bscallback;
306 nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url,
307 LOAD_FLAGS_NONE, NULL, post_data_stream, NULL);
308 This->nscontainer->bscallback = NULL;
310 if(post_data_stream)
311 nsIInputStream_Release(post_data_stream);
313 if(NS_SUCCEEDED(nsres)) {
314 /* FIXME: don't return here (URL Moniker needs to be good enough) */
316 IUnknown_Release((IUnknown*)bscallback);
317 CoTaskMemFree(url);
319 if(bind_complete)
320 *bind_complete = TRUE;
321 return S_OK;
322 }else if(nsres != WINE_NS_LOAD_FROM_MONIKER) {
323 WARN("LoadURI failed: %08x\n", nsres);
327 set_document_bscallback(This, bscallback);
328 IUnknown_Release((IUnknown*)bscallback);
329 CoTaskMemFree(url);
331 if(bind_complete)
332 *bind_complete = FALSE;
333 return S_OK;
336 static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len)
338 nsIDOMNode *nsnode;
339 LPCWSTR strw;
340 nsAString nsstr;
341 nsresult nsres;
343 if(!This->nsdoc) {
344 WARN("NULL nsdoc\n");
345 return E_UNEXPECTED;
348 nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
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(SUCCEEDED(hres))
597 WriteFile(file, str, len, &written, NULL);
599 CloseHandle(file);
600 return hres;
603 static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
605 HTMLDocument *This = PERSISTFILE_THIS(iface);
606 FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
607 return E_NOTIMPL;
610 static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
612 HTMLDocument *This = PERSISTFILE_THIS(iface);
613 FIXME("(%p)->(%p)\n", This, pszFileName);
614 return E_NOTIMPL;
617 static const IPersistFileVtbl PersistFileVtbl = {
618 PersistFile_QueryInterface,
619 PersistFile_AddRef,
620 PersistFile_Release,
621 PersistFile_GetClassID,
622 PersistFile_IsDirty,
623 PersistFile_Load,
624 PersistFile_Save,
625 PersistFile_SaveCompleted,
626 PersistFile_GetCurFile
629 #define PERSTRINIT_THIS(iface) DEFINE_THIS(HTMLDocument, PersistStreamInit, iface)
631 static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface,
632 REFIID riid, void **ppv)
634 HTMLDocument *This = PERSTRINIT_THIS(iface);
635 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
638 static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
640 HTMLDocument *This = PERSTRINIT_THIS(iface);
641 return IHTMLDocument2_AddRef(HTMLDOC(This));
644 static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
646 HTMLDocument *This = PERSTRINIT_THIS(iface);
647 return IHTMLDocument2_Release(HTMLDOC(This));
650 static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
652 HTMLDocument *This = PERSTRINIT_THIS(iface);
653 return IPersist_GetClassID(PERSIST(This), pClassID);
656 static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
658 HTMLDocument *This = PERSTRINIT_THIS(iface);
660 TRACE("(%p)\n", This);
662 if(This->usermode == EDITMODE)
663 return editor_is_dirty(This);
665 return S_FALSE;
668 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStm)
670 HTMLDocument *This = PERSTRINIT_THIS(iface);
671 IMoniker *mon;
672 HRESULT hres;
674 static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
676 TRACE("(%p)->(%p)\n", This, pStm);
678 hres = CreateURLMoniker(NULL, about_blankW, &mon);
679 if(FAILED(hres)) {
680 WARN("CreateURLMoniker failed: %08x\n", hres);
681 return hres;
684 hres = set_moniker(This, mon, NULL, NULL);
685 IMoniker_Release(mon);
686 if(FAILED(hres))
687 return hres;
689 return channelbsc_load_stream(This->bscallback, pStm);
692 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
693 BOOL fClearDirty)
695 HTMLDocument *This = PERSTRINIT_THIS(iface);
696 char *str;
697 DWORD len, written=0;
698 HRESULT hres;
700 TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
702 hres = get_doc_string(This, &str, &len);
703 if(FAILED(hres))
704 return hres;
706 hres = IStream_Write(pStm, str, len, &written);
707 if(FAILED(hres))
708 FIXME("Write failed: %08x\n", hres);
710 heap_free(str);
712 if(fClearDirty)
713 set_dirty(This, VARIANT_FALSE);
715 return S_OK;
718 static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface,
719 ULARGE_INTEGER *pcbSize)
721 HTMLDocument *This = PERSTRINIT_THIS(iface);
722 FIXME("(%p)->(%p)\n", This, pcbSize);
723 return E_NOTIMPL;
726 static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
728 HTMLDocument *This = PERSTRINIT_THIS(iface);
729 FIXME("(%p)\n", This);
730 return E_NOTIMPL;
733 #undef PERSTRINIT_THIS
735 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
736 PersistStreamInit_QueryInterface,
737 PersistStreamInit_AddRef,
738 PersistStreamInit_Release,
739 PersistStreamInit_GetClassID,
740 PersistStreamInit_IsDirty,
741 PersistStreamInit_Load,
742 PersistStreamInit_Save,
743 PersistStreamInit_GetSizeMax,
744 PersistStreamInit_InitNew
747 void HTMLDocument_Persist_Init(HTMLDocument *This)
749 This->lpPersistMonikerVtbl = &PersistMonikerVtbl;
750 This->lpPersistFileVtbl = &PersistFileVtbl;
751 This->lpMonikerPropVtbl = &MonikerPropVtbl;
752 This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
754 This->bscallback = NULL;
755 This->mon = NULL;
756 This->url = NULL;
757 This->mime = NULL;