ReactOS 0.4.15-dev-7788-g1ad9096
persist.c File Reference
#include "mshtml_private.h"
Include dependency graph for persist.c:

Go to the source code of this file.

Classes

struct  download_proc_task_t
 
struct  readystate_task_t
 

Macros

#define CMDID_EXPLORER_UPDATEHISTORY   38
 

Functions

static BOOL use_gecko_script (HTMLOuterWindow *window)
 
static void notify_travellog_update (HTMLDocumentObj *doc)
 
void set_current_uri (HTMLOuterWindow *window, IUri *uri)
 
void set_current_mon (HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
 
HRESULT create_uri (const WCHAR *uri_str, DWORD flags, IUri **uri)
 
HRESULT create_relative_uri (HTMLOuterWindow *window, const WCHAR *rel_uri, IUri **uri)
 
void set_download_state (HTMLDocumentObj *doc, int state)
 
static void set_progress_proc (task_t *_task)
 
static void set_downloading_proc (task_t *_task)
 
static void set_downloading_task_destr (task_t *_task)
 
void prepare_for_binding (HTMLDocument *This, IMoniker *mon, DWORD flags)
 
HRESULT set_moniker (HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBindCtx *pibc, nsChannelBSC *async_bsc, BOOL set_download)
 
static void notif_readystate (HTMLOuterWindow *window)
 
static void notif_readystate_proc (task_t *_task)
 
static void notif_readystate_destr (task_t *_task)
 
void set_ready_state (HTMLOuterWindow *window, READYSTATE readystate)
 
static HRESULT get_doc_string (HTMLDocumentNode *This, char **str)
 
static HTMLDocumentimpl_from_IPersistMoniker (IPersistMoniker *iface)
 
static HRESULT WINAPI PersistMoniker_QueryInterface (IPersistMoniker *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PersistMoniker_AddRef (IPersistMoniker *iface)
 
static ULONG WINAPI PersistMoniker_Release (IPersistMoniker *iface)
 
static HRESULT WINAPI PersistMoniker_GetClassID (IPersistMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI PersistMoniker_IsDirty (IPersistMoniker *iface)
 
static HRESULT WINAPI PersistMoniker_Load (IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode)
 
static HRESULT WINAPI PersistMoniker_Save (IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
 
static HRESULT WINAPI PersistMoniker_SaveCompleted (IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
 
static HRESULT WINAPI PersistMoniker_GetCurMoniker (IPersistMoniker *iface, IMoniker **ppimkName)
 
static HTMLDocumentimpl_from_IMonikerProp (IMonikerProp *iface)
 
static HRESULT WINAPI MonikerProp_QueryInterface (IMonikerProp *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MonikerProp_AddRef (IMonikerProp *iface)
 
static ULONG WINAPI MonikerProp_Release (IMonikerProp *iface)
 
static HRESULT WINAPI MonikerProp_PutProperty (IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
 
static HTMLDocumentimpl_from_IPersistFile (IPersistFile *iface)
 
static HRESULT WINAPI PersistFile_QueryInterface (IPersistFile *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PersistFile_AddRef (IPersistFile *iface)
 
static ULONG WINAPI PersistFile_Release (IPersistFile *iface)
 
static HRESULT WINAPI PersistFile_GetClassID (IPersistFile *iface, CLSID *pClassID)
 
static HRESULT WINAPI PersistFile_IsDirty (IPersistFile *iface)
 
static HRESULT WINAPI PersistFile_Load (IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
 
static HRESULT WINAPI PersistFile_Save (IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
 
static HRESULT WINAPI PersistFile_SaveCompleted (IPersistFile *iface, LPCOLESTR pszFileName)
 
static HRESULT WINAPI PersistFile_GetCurFile (IPersistFile *iface, LPOLESTR *pszFileName)
 
static HTMLDocumentimpl_from_IPersistStreamInit (IPersistStreamInit *iface)
 
static HRESULT WINAPI PersistStreamInit_QueryInterface (IPersistStreamInit *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PersistStreamInit_AddRef (IPersistStreamInit *iface)
 
static ULONG WINAPI PersistStreamInit_Release (IPersistStreamInit *iface)
 
static HRESULT WINAPI PersistStreamInit_GetClassID (IPersistStreamInit *iface, CLSID *pClassID)
 
static HRESULT WINAPI PersistStreamInit_IsDirty (IPersistStreamInit *iface)
 
static HRESULT WINAPI PersistStreamInit_Load (IPersistStreamInit *iface, LPSTREAM pStm)
 
static HRESULT WINAPI PersistStreamInit_Save (IPersistStreamInit *iface, LPSTREAM pStm, BOOL fClearDirty)
 
static HRESULT WINAPI PersistStreamInit_GetSizeMax (IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI PersistStreamInit_InitNew (IPersistStreamInit *iface)
 
static HTMLDocumentimpl_from_IPersistHistory (IPersistHistory *iface)
 
static HRESULT WINAPI PersistHistory_QueryInterface (IPersistHistory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PersistHistory_AddRef (IPersistHistory *iface)
 
static ULONG WINAPI PersistHistory_Release (IPersistHistory *iface)
 
static HRESULT WINAPI PersistHistory_GetClassID (IPersistHistory *iface, CLSID *pClassID)
 
static HRESULT WINAPI PersistHistory_LoadHistory (IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
 
static HRESULT WINAPI PersistHistory_SaveHistory (IPersistHistory *iface, IStream *pStream)
 
static HRESULT WINAPI PersistHistory_SetPositionCookie (IPersistHistory *iface, DWORD dwPositioncookie)
 
static HRESULT WINAPI PersistHistory_GetPositionCookie (IPersistHistory *iface, DWORD *pdwPositioncookie)
 
void HTMLDocument_Persist_Init (HTMLDocument *This)
 

Variables

static const WCHAR about_blankW [] = {'a','b','o','u','t',':','b','l','a','n','k',0}
 
static const IPersistMonikerVtbl PersistMonikerVtbl
 
static const IMonikerPropVtbl MonikerPropVtbl
 
static const IPersistFileVtbl PersistFileVtbl
 
static const IPersistStreamInitVtbl PersistStreamInitVtbl
 
static const IPersistHistoryVtbl PersistHistoryVtbl
 

Macro Definition Documentation

◆ CMDID_EXPLORER_UPDATEHISTORY

#define CMDID_EXPLORER_UPDATEHISTORY   38

Definition at line 22 of file persist.c.

Function Documentation

◆ create_relative_uri()

HRESULT create_relative_uri ( HTMLOuterWindow window,
const WCHAR rel_uri,
IUri **  uri 
)

Definition at line 163 of file persist.c.

164{
165 return window->uri
167 : create_uri(rel_uri, 0, uri);
168}
HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, IUri **ppCombinedUri, DWORD_PTR dwReserved)
Definition: uri.c:6762
static IHTMLWindow2 * window
Definition: events.c:77
const char * uri
Definition: sec_mgr.c:1588
HRESULT create_uri(const WCHAR *uri_str, DWORD flags, IUri **uri)
Definition: persist.c:158
#define URL_DONT_ESCAPE_EXTRA_INFO
Definition: shlwapi.h:1217
#define URL_ESCAPE_SPACES_ONLY
Definition: shlwapi.h:1216

Referenced by HTMLWindow2_open(), and navigate_href_new_window().

◆ create_uri()

HRESULT create_uri ( const WCHAR uri_str,
DWORD  flags,
IUri **  uri 
)

Definition at line 158 of file persist.c.

159{
160 return CreateUri(uri_str, flags | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri);
161}
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5700
GLbitfield flags
Definition: glext.h:7161

Referenced by create_redirect_nschannel(), create_relative_uri(), HTMLFormElement_submit(), HTMLPrivateWindow_SuperNavigate(), navigate_url(), nsIOService_NewURI(), nsURI_SetSpec(), parse_extern_script(), PersistHistory_LoadHistory(), set_current_mon(), set_moniker(), and translate_uri().

◆ get_doc_string()

static HRESULT get_doc_string ( HTMLDocumentNode This,
char **  str 
)
static

Definition at line 479 of file persist.c.

480{
481 nsIDOMNode *nsnode;
483 nsAString nsstr;
484 nsresult nsres;
486
487 if(!This->nsdoc) {
488 WARN("NULL nsdoc\n");
489 return E_UNEXPECTED;
490 }
491
492 nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
493 if(NS_FAILED(nsres)) {
494 ERR("Could not get nsIDOMNode failed: %08x\n", nsres);
495 return E_FAIL;
496 }
497
498 nsAString_Init(&nsstr, NULL);
499 hres = nsnode_to_nsstring(nsnode, &nsstr);
500 nsIDOMNode_Release(nsnode);
501 if(FAILED(hres)) {
502 nsAString_Finish(&nsstr);
503 return hres;
504 }
505
506 nsAString_GetData(&nsstr, &strw);
507 TRACE("%s\n", debugstr_w(strw));
508
510
511 nsAString_Finish(&nsstr);
512
513 if(!*str)
514 return E_OUTOFMEMORY;
515 return S_OK;
516}
static char * heap_strdupWtoA(const WCHAR *str)
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
HRESULT hres
Definition: protocol.c:465
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
HRESULT nsnode_to_nsstring(nsIDOMNode *, nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:1000
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
#define NS_FAILED(res)
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
#define E_UNEXPECTED
Definition: winerror.h:2456
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by PersistFile_Save(), and PersistStreamInit_Save().

◆ HTMLDocument_Persist_Init()

void HTMLDocument_Persist_Init ( HTMLDocument This)

Definition at line 1089 of file persist.c.

1090{
1091 This->IPersistMoniker_iface.lpVtbl = &PersistMonikerVtbl;
1092 This->IPersistFile_iface.lpVtbl = &PersistFileVtbl;
1093 This->IMonikerProp_iface.lpVtbl = &MonikerPropVtbl;
1094 This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
1095 This->IPersistHistory_iface.lpVtbl = &PersistHistoryVtbl;
1096}
static const IPersistStreamInitVtbl PersistStreamInitVtbl
Definition: persist.c:266
static const IPersistFileVtbl PersistFileVtbl
Definition: persist.c:800
static const IPersistMonikerVtbl PersistMonikerVtbl
Definition: persist.c:636
static const IMonikerPropVtbl MonikerPropVtbl
Definition: persist.c:698
static const IPersistHistoryVtbl PersistHistoryVtbl
Definition: persist.c:1078

Referenced by init_doc().

◆ impl_from_IMonikerProp()

static HTMLDocument * impl_from_IMonikerProp ( IMonikerProp iface)
inlinestatic

Definition at line 652 of file persist.c.

653{
654 return CONTAINING_RECORD(iface, HTMLDocument, IMonikerProp_iface);
655}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by MonikerProp_AddRef(), MonikerProp_PutProperty(), MonikerProp_QueryInterface(), and MonikerProp_Release().

◆ impl_from_IPersistFile()

static HTMLDocument * impl_from_IPersistFile ( IPersistFile iface)
inlinestatic

◆ impl_from_IPersistHistory()

◆ impl_from_IPersistMoniker()

◆ impl_from_IPersistStreamInit()

static HTMLDocument * impl_from_IPersistStreamInit ( IPersistStreamInit iface)
inlinestatic

Definition at line 812 of file persist.c.

813{
814 return CONTAINING_RECORD(iface, HTMLDocument, IPersistStreamInit_iface);
815}

◆ MonikerProp_AddRef()

static ULONG WINAPI MonikerProp_AddRef ( IMonikerProp iface)
static

Definition at line 663 of file persist.c.

664{
666 return htmldoc_addref(This);
667}
static HTMLDocument * impl_from_IMonikerProp(IMonikerProp *iface)
Definition: persist.c:652
static ULONG htmldoc_addref(HTMLDocument *This)

◆ MonikerProp_PutProperty()

static HRESULT WINAPI MonikerProp_PutProperty ( IMonikerProp iface,
MONIKERPROPERTY  mkp,
LPCWSTR  val 
)
static

Definition at line 675 of file persist.c.

676{
678
679 TRACE("(%p)->(%d %s)\n", This, mkp, debugstr_w(val));
680
681 switch(mkp) {
682 case MIMETYPEPROP:
683 heap_free(This->doc_obj->mime);
684 This->doc_obj->mime = heap_strdupW(val);
685 break;
686
687 case CLASSIDPROP:
688 break;
689
690 default:
691 FIXME("mkp %d\n", mkp);
692 return E_NOTIMPL;
693 }
694
695 return S_OK;
696}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
GLuint GLfloat * val
Definition: glext.h:7180

◆ MonikerProp_QueryInterface()

static HRESULT WINAPI MonikerProp_QueryInterface ( IMonikerProp iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 657 of file persist.c.

658{
661}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv)

◆ MonikerProp_Release()

static ULONG WINAPI MonikerProp_Release ( IMonikerProp iface)
static

Definition at line 669 of file persist.c.

670{
672 return htmldoc_release(This);
673}
static ULONG htmldoc_release(HTMLDocument *This)

◆ notif_readystate()

static void notif_readystate ( HTMLOuterWindow window)
static

Definition at line 418 of file persist.c.

419{
420 window->readystate_pending = FALSE;
421
422 if(window->doc_obj && window->doc_obj->basedoc.window == window)
423 call_property_onchanged(&window->doc_obj->basedoc.cp_container, DISPID_READYSTATE);
424
425 fire_event(window->base.inner_window->doc, EVENTID_READYSTATECHANGE, FALSE,
426 window->base.inner_window->doc->node.nsnode, NULL, NULL);
427
428 if(window->frame_element)
429 fire_event(window->frame_element->element.node.doc, EVENTID_READYSTATECHANGE,
430 TRUE, window->frame_element->element.node.nsnode, NULL, NULL);
431}
void call_property_onchanged(ConnectionPointContainer *container, DISPID dispid)
Definition: conpoint.c:342
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode *target, nsIDOMEvent *nsevent, IDispatch *script_this)
Definition: htmlevent.c:1195
@ EVENTID_READYSTATECHANGE
Definition: htmlevent.h:47
#define DISPID_READYSTATE
Definition: idispids.h:22

Referenced by notif_readystate_proc(), and set_ready_state().

◆ notif_readystate_destr()

static void notif_readystate_destr ( task_t _task)
static

Definition at line 444 of file persist.c.

445{
446 readystate_task_t *task = (readystate_task_t*)_task;
447 IHTMLWindow2_Release(&task->window->base.IHTMLWindow2_iface);
448}
IHTMLWindow2 IHTMLWindow2_iface
HTMLOuterWindow * window
Definition: persist.c:435

Referenced by set_ready_state().

◆ notif_readystate_proc()

static void notif_readystate_proc ( task_t _task)
static

Definition at line 438 of file persist.c.

439{
440 readystate_task_t *task = (readystate_task_t*)_task;
442}
static void notif_readystate(HTMLOuterWindow *window)
Definition: persist.c:418

Referenced by set_ready_state().

◆ notify_travellog_update()

static void notify_travellog_update ( HTMLDocumentObj doc)
static

Definition at line 48 of file persist.c.

49{
50 IOleCommandTarget *cmdtrg;
52
53 if(!doc->webbrowser)
54 return;
55
56 hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
57 if(SUCCEEDED(hres)) {
58 VARIANT vin;
59
60 V_VT(&vin) = VT_I4;
61 V_I4(&vin) = 0;
62
63 IOleCommandTarget_Exec(cmdtrg, &CGID_Explorer, CMDID_EXPLORER_UPDATEHISTORY, 0, &vin, NULL);
64 IOleCommandTarget_Release(cmdtrg);
65 }
66}
@ VT_I4
Definition: compat.h:2298
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define CMDID_EXPLORER_UPDATEHISTORY
Definition: persist.c:22
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
IOleClientSite * client
IUnknown * webbrowser

Referenced by set_current_mon().

◆ PersistFile_AddRef()

static ULONG WINAPI PersistFile_AddRef ( IPersistFile iface)
static

Definition at line 720 of file persist.c.

721{
723 return htmldoc_addref(This);
724}
static HTMLDocument * impl_from_IPersistFile(IPersistFile *iface)
Definition: persist.c:709

◆ PersistFile_GetClassID()

static HRESULT WINAPI PersistFile_GetClassID ( IPersistFile iface,
CLSID pClassID 
)
static

Definition at line 732 of file persist.c.

733{
735
736 TRACE("(%p)->(%p)\n", This, pClassID);
737
738 if(!pClassID)
739 return E_INVALIDARG;
740
741 *pClassID = CLSID_HTMLDocument;
742 return S_OK;
743}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ PersistFile_GetCurFile()

static HRESULT WINAPI PersistFile_GetCurFile ( IPersistFile iface,
LPOLESTR pszFileName 
)
static

Definition at line 793 of file persist.c.

794{
796 FIXME("(%p)->(%p)\n", This, pszFileName);
797 return E_NOTIMPL;
798}
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44

◆ PersistFile_IsDirty()

static HRESULT WINAPI PersistFile_IsDirty ( IPersistFile iface)
static

Definition at line 745 of file persist.c.

746{
748
749 TRACE("(%p)\n", This);
750
751 return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
752}

◆ PersistFile_Load()

static HRESULT WINAPI PersistFile_Load ( IPersistFile iface,
LPCOLESTR  pszFileName,
DWORD  dwMode 
)
static

Definition at line 754 of file persist.c.

755{
757 FIXME("(%p)->(%s %08x)\n", This, debugstr_w(pszFileName), dwMode);
758 return E_NOTIMPL;
759}

◆ PersistFile_QueryInterface()

static HRESULT WINAPI PersistFile_QueryInterface ( IPersistFile iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 714 of file persist.c.

715{
718}

◆ PersistFile_Release()

static ULONG WINAPI PersistFile_Release ( IPersistFile iface)
static

Definition at line 726 of file persist.c.

727{
729 return htmldoc_release(This);
730}

◆ PersistFile_Save()

static HRESULT WINAPI PersistFile_Save ( IPersistFile iface,
LPCOLESTR  pszFileName,
BOOL  fRemember 
)
static

Definition at line 761 of file persist.c.

762{
764 char *str;
765 DWORD written=0;
766 HANDLE file;
768
769 TRACE("(%p)->(%s %x)\n", This, debugstr_w(pszFileName), fRemember);
770
774 WARN("Could not create file: %u\n", GetLastError());
775 return E_FAIL;
776 }
777
778 hres = get_doc_string(This->doc_node, &str);
779 if(SUCCEEDED(hres))
780 WriteFile(file, str, strlen(str), &written, NULL);
781
783 return hres;
784}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CREATE_ALWAYS
Definition: disk.h:72
static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
Definition: persist.c:479
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ PersistFile_SaveCompleted()

static HRESULT WINAPI PersistFile_SaveCompleted ( IPersistFile iface,
LPCOLESTR  pszFileName 
)
static

Definition at line 786 of file persist.c.

787{
789 FIXME("(%p)->(%s)\n", This, debugstr_w(pszFileName));
790 return E_NOTIMPL;
791}

◆ PersistHistory_AddRef()

static ULONG WINAPI PersistHistory_AddRef ( IPersistHistory iface)
static

Definition at line 963 of file persist.c.

964{
966 return htmldoc_addref(This);
967}
static HTMLDocument * impl_from_IPersistHistory(IPersistHistory *iface)
Definition: persist.c:952

◆ PersistHistory_GetClassID()

static HRESULT WINAPI PersistHistory_GetClassID ( IPersistHistory iface,
CLSID pClassID 
)
static

Definition at line 975 of file persist.c.

976{
978 return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID);
979}

◆ PersistHistory_GetPositionCookie()

static HRESULT WINAPI PersistHistory_GetPositionCookie ( IPersistHistory iface,
DWORD pdwPositioncookie 
)
static

Definition at line 1071 of file persist.c.

1072{
1074 FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
1075 return E_NOTIMPL;
1076}

◆ PersistHistory_LoadHistory()

static HRESULT WINAPI PersistHistory_LoadHistory ( IPersistHistory iface,
IStream pStream,
IBindCtx pbc 
)
static

Definition at line 981 of file persist.c.

982{
985 WCHAR *uri_str;
986 IUri *uri;
988
989 TRACE("(%p)->(%p %p)\n", This, pStream, pbc);
990
991 if(!This->window) {
992 FIXME("No current window\n");
993 return E_UNEXPECTED;
994 }
995
996 if(pbc)
997 FIXME("pbc not supported\n");
998
999 if(This->doc_obj->client) {
1000 IOleCommandTarget *cmdtrg = NULL;
1001
1002 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
1003 (void**)&cmdtrg);
1004 if(SUCCEEDED(hres)) {
1005 IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 138, 0, NULL, NULL);
1006 IOleCommandTarget_Release(cmdtrg);
1007 }
1008 }
1009
1010 hres = IStream_Read(pStream, &str_len, sizeof(str_len), &read);
1011 if(FAILED(hres))
1012 return hres;
1013 if(read != sizeof(str_len))
1014 return E_FAIL;
1015
1016 uri_str = heap_alloc((str_len+1)*sizeof(WCHAR));
1017 if(!uri_str)
1018 return E_OUTOFMEMORY;
1019
1020 hres = IStream_Read(pStream, uri_str, str_len*sizeof(WCHAR), &read);
1021 if(SUCCEEDED(hres) && read != str_len*sizeof(WCHAR))
1022 hres = E_FAIL;
1023 if(SUCCEEDED(hres)) {
1024 uri_str[str_len] = 0;
1025 hres = create_uri(uri_str, 0, &uri);
1026 }
1027 heap_free(uri_str);
1028 if(FAILED(hres))
1029 return hres;
1030
1031 hres = load_uri(This->window, uri, BINDING_FROMHIST);
1032 IUri_Release(uri);
1033 return hres;
1034}
#define read
Definition: acwin.h:96
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define BINDING_FROMHIST
Definition: binding.h:129
HRESULT load_uri(HTMLOuterWindow *, IUri *, DWORD) DECLSPEC_HIDDEN
Definition: navigate.c:2306
#define str_len
Definition: treelist.c:89
uint32_t ULONG
Definition: typedefs.h:59
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ PersistHistory_QueryInterface()

static HRESULT WINAPI PersistHistory_QueryInterface ( IPersistHistory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 957 of file persist.c.

◆ PersistHistory_Release()

static ULONG WINAPI PersistHistory_Release ( IPersistHistory iface)
static

Definition at line 969 of file persist.c.

970{
972 return htmldoc_release(This);
973}

◆ PersistHistory_SaveHistory()

static HRESULT WINAPI PersistHistory_SaveHistory ( IPersistHistory iface,
IStream pStream 
)
static

Definition at line 1036 of file persist.c.

1037{
1039 ULONG len, written;
1040 BSTR display_uri;
1041 HRESULT hres;
1042
1043 TRACE("(%p)->(%p)\n", This, pStream);
1044
1045 if(!This->window || !This->window->uri) {
1046 FIXME("No current URI\n");
1047 return E_FAIL;
1048 }
1049
1050 /* NOTE: The format we store is *not* compatible with native MSHTML. We currently
1051 * store only URI of the page (as a length followed by a string) */
1052 hres = IUri_GetDisplayUri(This->window->uri, &display_uri);
1053 if(FAILED(hres))
1054 return hres;
1055
1056 len = SysStringLen(display_uri);
1057 hres = IStream_Write(pStream, &len, sizeof(len), &written);
1058 if(SUCCEEDED(hres))
1059 hres = IStream_Write(pStream, display_uri, len*sizeof(WCHAR), &written);
1060 SysFreeString(display_uri);
1061 return hres;
1062}
OLECHAR * BSTR
Definition: compat.h:2293
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

◆ PersistHistory_SetPositionCookie()

static HRESULT WINAPI PersistHistory_SetPositionCookie ( IPersistHistory iface,
DWORD  dwPositioncookie 
)
static

Definition at line 1064 of file persist.c.

1065{
1067 FIXME("(%p)->(%x)\n", This, dwPositioncookie);
1068 return E_NOTIMPL;
1069}

◆ PersistMoniker_AddRef()

static ULONG WINAPI PersistMoniker_AddRef ( IPersistMoniker iface)
static

Definition at line 534 of file persist.c.

535{
537 return htmldoc_addref(This);
538}
static HTMLDocument * impl_from_IPersistMoniker(IPersistMoniker *iface)
Definition: persist.c:523

◆ PersistMoniker_GetClassID()

static HRESULT WINAPI PersistMoniker_GetClassID ( IPersistMoniker iface,
CLSID pClassID 
)
static

Definition at line 546 of file persist.c.

547{
549 return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID);
550}

◆ PersistMoniker_GetCurMoniker()

static HRESULT WINAPI PersistMoniker_GetCurMoniker ( IPersistMoniker iface,
IMoniker **  ppimkName 
)
static

Definition at line 622 of file persist.c.

623{
625
626 TRACE("(%p)->(%p)\n", This, ppimkName);
627
628 if(!This->window || !This->window->mon)
629 return E_UNEXPECTED;
630
631 IMoniker_AddRef(This->window->mon);
632 *ppimkName = This->window->mon;
633 return S_OK;
634}

◆ PersistMoniker_IsDirty()

static HRESULT WINAPI PersistMoniker_IsDirty ( IPersistMoniker iface)
static

Definition at line 552 of file persist.c.

553{
555
556 TRACE("(%p)\n", This);
557
558 return IPersistStreamInit_IsDirty(&This->IPersistStreamInit_iface);
559}

◆ PersistMoniker_Load()

static HRESULT WINAPI PersistMoniker_Load ( IPersistMoniker iface,
BOOL  fFullyAvailable,
IMoniker pimkName,
LPBC  pibc,
DWORD  grfMode 
)
static

Definition at line 561 of file persist.c.

563{
566
567 TRACE("(%p)->(%x %p %p %08x)\n", This, fFullyAvailable, pimkName, pibc, grfMode);
568
569 if(pibc) {
570 IUnknown *unk = NULL;
571
572 /* FIXME:
573 * Use params:
574 * "__PrecreatedObject"
575 * "BIND_CONTEXT_PARAM"
576 * "__HTMLLOADOPTIONS"
577 * "__DWNBINDINFO"
578 * "URL Context"
579 * "_ITransData_Object_"
580 * "_EnumFORMATETC_"
581 */
582
583 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
584 if(SUCCEEDED(hres) && unk) {
586
587 hres = IUnknown_QueryInterface(unk, &IID_IOleClientSite, (void**)&client);
588 if(SUCCEEDED(hres)) {
589 TRACE("Got client site %p\n", client);
590 IOleObject_SetClientSite(&This->IOleObject_iface, client);
591 IOleClientSite_Release(client);
592 }
593
594 IUnknown_Release(unk);
595 }
596 }
597
598 prepare_for_binding(This, pimkName, FALSE);
599 call_docview_84(This->doc_obj);
600 hres = set_moniker(This->window, pimkName, NULL, pibc, NULL, TRUE);
601 if(FAILED(hres))
602 return hres;
603
604 return start_binding(This->window->pending_window, (BSCallback*)This->window->pending_window->bscallback, pibc);
605}
static LPOLESTR
Definition: stg_prop.c:27
static const WCHAR SZ_HTML_CLIENTSITE_OBJECTPARAM[]
Definition: mshtmhst.idl:59
HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBindCtx *pibc, nsChannelBSC *async_bsc, BOOL set_download)
Definition: persist.c:329
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
Definition: persist.c:271
HRESULT start_binding(HTMLInnerWindow *, BSCallback *, IBindCtx *) DECLSPEC_HIDDEN
Definition: navigate.c:762
void call_docview_84(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: oleobj.c:173
const GUID IID_IOleClientSite
static FILE * client
Definition: client.c:41

◆ PersistMoniker_QueryInterface()

static HRESULT WINAPI PersistMoniker_QueryInterface ( IPersistMoniker iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 528 of file persist.c.

◆ PersistMoniker_Release()

static ULONG WINAPI PersistMoniker_Release ( IPersistMoniker iface)
static

Definition at line 540 of file persist.c.

541{
543 return htmldoc_release(This);
544}

◆ PersistMoniker_Save()

static HRESULT WINAPI PersistMoniker_Save ( IPersistMoniker iface,
IMoniker pimkName,
LPBC  pbc,
BOOL  fRemember 
)
static

Definition at line 607 of file persist.c.

609{
611 FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
612 return E_NOTIMPL;
613}

◆ PersistMoniker_SaveCompleted()

static HRESULT WINAPI PersistMoniker_SaveCompleted ( IPersistMoniker iface,
IMoniker pimkName,
LPBC  pibc 
)
static

Definition at line 615 of file persist.c.

616{
618 FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
619 return E_NOTIMPL;
620}

◆ PersistStreamInit_AddRef()

static ULONG WINAPI PersistStreamInit_AddRef ( IPersistStreamInit iface)
static

Definition at line 824 of file persist.c.

825{
827 return htmldoc_addref(This);
828}
static WebBrowser * impl_from_IPersistStreamInit(IPersistStreamInit *iface)
Definition: persist.c:200

◆ PersistStreamInit_GetClassID()

static HRESULT WINAPI PersistStreamInit_GetClassID ( IPersistStreamInit iface,
CLSID pClassID 
)
static

Definition at line 836 of file persist.c.

837{
839 return IPersistFile_GetClassID(&This->IPersistFile_iface, pClassID);
840}

◆ PersistStreamInit_GetSizeMax()

static HRESULT WINAPI PersistStreamInit_GetSizeMax ( IPersistStreamInit iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 904 of file persist.c.

906{
908 FIXME("(%p)->(%p)\n", This, pcbSize);
909 return E_NOTIMPL;
910}

◆ PersistStreamInit_InitNew()

static HRESULT WINAPI PersistStreamInit_InitNew ( IPersistStreamInit iface)
static

Definition at line 912 of file persist.c.

913{
915 IMoniker *mon;
917
918 TRACE("(%p)\n", This);
919
921 if(FAILED(hres)) {
922 WARN("CreateURLMoniker failed: %08x\n", hres);
923 return hres;
924 }
925
927 hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE);
928 if(FAILED(hres))
929 return hres;
930
931 hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
932 IMoniker_Release(mon);
933 return hres;
934}
HRESULT channelbsc_load_stream(HTMLInnerWindow *, IMoniker *, IStream *) DECLSPEC_HIDDEN
Definition: navigate.c:1811
static const WCHAR about_blankW[]
Definition: persist.c:24
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732

◆ PersistStreamInit_IsDirty()

static HRESULT WINAPI PersistStreamInit_IsDirty ( IPersistStreamInit iface)
static

Definition at line 842 of file persist.c.

843{
845
846 TRACE("(%p)\n", This);
847
848 if(This->doc_obj->usermode == EDITMODE)
849 return editor_is_dirty(This);
850
851 return S_FALSE;
852}
HRESULT editor_is_dirty(HTMLDocument *This)
Definition: editor.c:1209
@ EDITMODE
#define S_FALSE
Definition: winerror.h:2357

◆ PersistStreamInit_Load()

static HRESULT WINAPI PersistStreamInit_Load ( IPersistStreamInit iface,
LPSTREAM  pStm 
)
static

Definition at line 854 of file persist.c.

855{
857 IMoniker *mon;
859
860 TRACE("(%p)->(%p)\n", This, pStm);
861
863 if(FAILED(hres)) {
864 WARN("CreateURLMoniker failed: %08x\n", hres);
865 return hres;
866 }
867
869 hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE);
870 if(FAILED(hres))
871 return hres;
872
873 hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
874 IMoniker_Release(mon);
875 return hres;
876}

◆ PersistStreamInit_QueryInterface()

static HRESULT WINAPI PersistStreamInit_QueryInterface ( IPersistStreamInit iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 817 of file persist.c.

◆ PersistStreamInit_Release()

static ULONG WINAPI PersistStreamInit_Release ( IPersistStreamInit iface)
static

Definition at line 830 of file persist.c.

831{
833 return htmldoc_release(This);
834}

◆ PersistStreamInit_Save()

static HRESULT WINAPI PersistStreamInit_Save ( IPersistStreamInit iface,
LPSTREAM  pStm,
BOOL  fClearDirty 
)
static

Definition at line 878 of file persist.c.

880{
882 char *str;
883 DWORD written=0;
885
886 TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
887
888 hres = get_doc_string(This->doc_node, &str);
889 if(FAILED(hres))
890 return hres;
891
892 hres = IStream_Write(pStm, str, strlen(str), &written);
893 if(FAILED(hres))
894 FIXME("Write failed: %08x\n", hres);
895
896 heap_free(str);
897
898 if(fClearDirty)
899 set_dirty(This, VARIANT_FALSE);
900
901 return S_OK;
902}
static void set_dirty(struct d3dx_parameter *param)
Definition: effect.c:1318

◆ prepare_for_binding()

void prepare_for_binding ( HTMLDocument This,
IMoniker mon,
DWORD  flags 
)

Definition at line 271 of file persist.c.

272{
274
275 if(This->doc_obj->client) {
276 VARIANT silent, offline;
277
278 hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
279 if(SUCCEEDED(hres)) {
280 if(V_VT(&silent) != VT_BOOL)
281 WARN("silent = %s\n", debugstr_variant(&silent));
282 else if(V_BOOL(&silent))
283 FIXME("silent == true\n");
284 }
285
286 hres = get_client_disp_property(This->doc_obj->client,
288 if(SUCCEEDED(hres)) {
289 if(V_VT(&offline) != VT_BOOL)
290 WARN("offline = %s\n", debugstr_variant(&offline));
291 else if(V_BOOL(&offline))
292 FIXME("offline == true\n");
293 }
294 }
295
296 if(This->window->mon) {
298 }else {
300 set_current_mon(This->window, mon, flags);
301 }
302
303 if(This->doc_obj->client) {
304 IOleCommandTarget *cmdtrg = NULL;
305
306 hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
307 (void**)&cmdtrg);
308 if(SUCCEEDED(hres)) {
309 VARIANT var, out;
310
312 V_VT(&var) = VT_UNKNOWN;
313 V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
314 V_VT(&out) = VT_EMPTY;
315 hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
316 if(SUCCEEDED(hres))
318 }else if(!(flags & BINDING_FROMHIST)) {
319 V_VT(&var) = VT_I4;
320 V_I4(&var) = 0;
321 IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
322 }
323
324 IOleCommandTarget_Release(cmdtrg);
325 }
326 }
327}
#define UPDATE_TITLE
#define BINDING_NAVIGATED
Definition: binding.h:127
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_BOOL
Definition: compat.h:2306
@ VT_EMPTY
Definition: compat.h:2295
#define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
Definition: idispids.h:25
#define DISPID_AMBIENT_SILENT
Definition: idispids.h:26
const char * var
Definition: shader.c:5666
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
Definition: persist.c:99
#define UPDATE_UI
void update_doc(HTMLDocument *, DWORD) DECLSPEC_HIDDEN
Definition: view.c:62
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_UNKNOWN(A)
Definition: oleauto.h:281
static HRESULT get_client_disp_property(IOleClientSite *client, DISPID dispid, VARIANT *res)
Definition: oleobject.c:233
static FILE * out
Definition: regtests2xml.c:44
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by PersistMoniker_Load(), PersistStreamInit_InitNew(), PersistStreamInit_Load(), and super_navigate().

◆ set_current_mon()

void set_current_mon ( HTMLOuterWindow This,
IMoniker mon,
DWORD  flags 
)

Definition at line 99 of file persist.c.

100{
101 IUriContainer *uri_container;
102 IUri *uri = NULL;
104
105 if(This->mon) {
106 if(This->doc_obj && !(flags & (BINDING_REPLACE|BINDING_REFRESH))) {
107 if(This == This->doc_obj->basedoc.window)
109 else
110 TRACE("Skipping travellog update for frame navigation.\n");
111 }
112 IMoniker_Release(This->mon);
113 This->mon = NULL;
114 }
115
116 This->load_flags = flags;
117 if(!mon)
118 return;
119
120 IMoniker_AddRef(mon);
121 This->mon = mon;
122
123 hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
124 if(SUCCEEDED(hres)) {
125 hres = IUriContainer_GetIUri(uri_container, &uri);
126 IUriContainer_Release(uri_container);
127 if(hres != S_OK) {
128 WARN("GetIUri failed: %08x\n", hres);
129 uri = NULL;
130 }
131 }
132
133 if(!uri) {
134 WCHAR *url;
135
136 hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url);
137 if(SUCCEEDED(hres)) {
138 hres = create_uri(url, 0, &uri);
139 if(FAILED(hres)) {
140 WARN("CrateUri failed: %08x\n", hres);
142 This->url = SysAllocString(url);
144 return;
145 }
147 }else {
148 WARN("GetDisplayName failed: %08x\n", hres);
149 }
150 }
151
153 if(uri)
154 IUri_Release(uri);
156}
#define BINDING_REPLACE
Definition: binding.h:128
#define BINDING_REFRESH
Definition: binding.h:130
void set_script_mode(HTMLOuterWindow *, SCRIPTMODE) DECLSPEC_HIDDEN
Definition: script.c:1551
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static const WCHAR url[]
Definition: encode.c:1432
void set_current_uri(HTMLOuterWindow *window, IUri *uri)
Definition: persist.c:68
static BOOL use_gecko_script(HTMLOuterWindow *window)
Definition: persist.c:33
static void notify_travellog_update(HTMLDocumentObj *doc)
Definition: persist.c:48
@ SCRIPTMODE_ACTIVESCRIPT
@ SCRIPTMODE_GECKO
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238

Referenced by async_open(), channelbsc_load_stream(), navigate_proc(), prepare_for_binding(), release_outer_window(), and start_doc_binding_proc().

◆ set_current_uri()

void set_current_uri ( HTMLOuterWindow window,
IUri uri 
)

Definition at line 68 of file persist.c.

69{
70 if(window->uri) {
71 IUri_Release(window->uri);
72 window->uri = NULL;
73 }
74
75 if(window->uri_nofrag) {
76 IUri_Release(window->uri_nofrag);
77 window->uri_nofrag = NULL;
78 }
79
81 window->url = NULL;
82
83 if(!uri)
84 return;
85
86 IUri_AddRef(uri);
87 window->uri = uri;
88
89 window->uri_nofrag = get_uri_nofrag(uri);
90 if(!window->uri_nofrag) {
91 FIXME("get_uri_nofrag failed\n");
92 IUri_AddRef(uri);
93 window->uri_nofrag = uri;
94 }
95
96 IUri_GetDisplayUri(uri, &window->url);
97}
IUri * get_uri_nofrag(IUri *) DECLSPEC_HIDDEN
Definition: nsio.c:77

Referenced by navigate_fragment(), navigate_proc(), nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback(), and set_current_mon().

◆ set_download_state()

void set_download_state ( HTMLDocumentObj doc,
int  state 
)

Definition at line 170 of file persist.c.

171{
172 if(doc->client) {
173 IOleCommandTarget *olecmd;
175
176 hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
177 if(SUCCEEDED(hres)) {
178 VARIANT var;
179
180 V_VT(&var) = VT_I4;
181 V_I4(&var) = state;
182
183 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETDOWNLOADSTATE,
184 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
185 IOleCommandTarget_Release(olecmd);
186 }
187 }
188
189 doc->download_state = state;
190}
static int state
Definition: maze.c:121

Referenced by handle_docobj_load(), navigate_javascript_proc(), and set_downloading_proc().

◆ set_downloading_proc()

static void set_downloading_proc ( task_t _task)
static

Definition at line 233 of file persist.c.

234{
236 HTMLDocumentObj *doc = task->doc;
238
239 TRACE("(%p)\n", doc);
240
242
243 if(task->set_download)
244 set_download_state(doc, 1);
245
246 if(!doc->client)
247 return;
248
249 if(doc->view_sink)
250 IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1);
251
252 if(doc->hostui) {
253 IDropTarget *drop_target = NULL;
254
255 hres = IDocHostUIHandler_GetDropTarget(doc->hostui, NULL /* FIXME */, &drop_target);
256 if(SUCCEEDED(hres) && drop_target) {
257 FIXME("Use IDropTarget\n");
258 IDropTarget_Release(drop_target);
259 }
260 }
261}
void set_statustext(HTMLDocumentObj *doc, INT id, LPCWSTR arg)
Definition: main.c:111
#define IDS_STATUS_DOWNLOADINGFROM
Definition: resource.h:24
void set_download_state(HTMLDocumentObj *doc, int state)
Definition: persist.c:170
IAdviseSink * view_sink
IDocHostUIHandler * hostui
HTMLDocumentObj * doc
Definition: persist.c:28

Referenced by set_moniker().

◆ set_downloading_task_destr()

static void set_downloading_task_destr ( task_t _task)
static

Definition at line 263 of file persist.c.

264{
266
267 CoTaskMemFree(task->url);
268 heap_free(task);
269}

Referenced by set_moniker().

◆ set_moniker()

HRESULT set_moniker ( HTMLOuterWindow window,
IMoniker mon,
IUri nav_uri,
IBindCtx pibc,
nsChannelBSC async_bsc,
BOOL  set_download 
)

Definition at line 329 of file persist.c.

331{
332 download_proc_task_t *download_task;
333 HTMLDocumentObj *doc_obj = NULL;
334 nsChannelBSC *bscallback;
335 nsWineURI *nsuri;
337 IUri *uri;
339
340 if(window->doc_obj && window->doc_obj->basedoc.window == window)
341 doc_obj = window->doc_obj;
342
343 hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
344 if(FAILED(hres)) {
345 WARN("GetDiaplayName failed: %08x\n", hres);
346 return hres;
347 }
348
349 if(nav_uri) {
350 uri = nav_uri;
351 }else {
352 hres = create_uri(url, 0, &uri);
353 if(FAILED(hres)) {
355 return hres;
356 }
357 }
358
359 TRACE("got url: %s\n", debugstr_w(url));
360
361 set_ready_state(window, READYSTATE_LOADING);
362
363 hres = create_doc_uri(window, uri, &nsuri);
364 if(!nav_uri)
365 IUri_Release(uri);
366 if(SUCCEEDED(hres)) {
367 if(async_bsc)
368 bscallback = async_bsc;
369 else
370 hres = create_channelbsc(mon, NULL, NULL, 0, TRUE, &bscallback);
371 }
372
373 if(SUCCEEDED(hres)) {
374 if(window->base.inner_window->doc)
375 remove_target_tasks(window->base.inner_window->task_magic);
376 abort_window_bindings(window->base.inner_window);
377
378 hres = load_nsuri(window, nsuri, NULL, bscallback, LOAD_FLAGS_BYPASS_CACHE);
379 nsISupports_Release((nsISupports*)nsuri); /* FIXME */
380 if(SUCCEEDED(hres)) {
381 hres = create_pending_window(window, bscallback);
382 TRACE("pending window for %p %p %p\n", window, bscallback, window->pending_window);
383 }
384 if(bscallback != async_bsc)
385 IBindStatusCallback_Release(&bscallback->bsc.IBindStatusCallback_iface);
386 }
387
388 if(FAILED(hres)) {
390 return hres;
391 }
392
393 if(doc_obj) {
395
396 if(doc_obj->frame) {
397 docobj_task_t *task;
398
399 task = heap_alloc(sizeof(docobj_task_t));
400 task->doc = doc_obj;
402 if(FAILED(hres)) {
404 return hres;
405 }
406 }
407
408 download_task = heap_alloc(sizeof(download_proc_task_t));
409 download_task->doc = doc_obj;
410 download_task->set_download = set_download;
411 download_task->url = url;
413 }
414
415 return S_OK;
416}
HRESULT load_nsuri(HTMLOuterWindow *, nsWineURI *, nsIInputStream *, nsChannelBSC *, DWORD) DECLSPEC_HIDDEN
Definition: nsio.c:250
HRESULT create_channelbsc(IMoniker *, const WCHAR *, BYTE *, DWORD, BOOL, nsChannelBSC **) DECLSPEC_HIDDEN
Definition: navigate.c:1693
HRESULT create_doc_uri(HTMLOuterWindow *, IUri *, nsWineURI **) DECLSPEC_HIDDEN
Definition: nsio.c:3210
HRESULT create_pending_window(HTMLOuterWindow *outer_window, nsChannelBSC *channelbsc)
Definition: htmlwindow.c:3009
static void set_progress_proc(task_t *_task)
Definition: persist.c:192
static void set_downloading_proc(task_t *_task)
Definition: persist.c:233
static void set_downloading_task_destr(task_t *_task)
Definition: persist.c:263
void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
Definition: persist.c:450
void abort_window_bindings(HTMLInnerWindow *) DECLSPEC_HIDDEN
Definition: navigate.c:1775
void HTMLDocument_LockContainer(HTMLDocumentObj *, BOOL) DECLSPEC_HIDDEN
Definition: oleobj.c:1183
HRESULT push_task(task_t *, task_proc_t, task_proc_t, LONG) DECLSPEC_HIDDEN
Definition: task.c:39
void remove_target_tasks(LONG) DECLSPEC_HIDDEN
Definition: task.c:107
IBindStatusCallback IBindStatusCallback_iface
Definition: binding.h:72
IOleInPlaceFrame * frame
HTMLDocument basedoc
HTMLDocumentObj * doc
BSCallback bsc
Definition: binding.h:98
Definition: nsio.c:34

Referenced by navigate_proc(), PersistMoniker_Load(), PersistStreamInit_InitNew(), PersistStreamInit_Load(), and super_navigate().

◆ set_progress_proc()

static void set_progress_proc ( task_t _task)
static

Definition at line 192 of file persist.c.

193{
194 docobj_task_t *task = (docobj_task_t*)_task;
195 IOleCommandTarget *olecmd = NULL;
196 HTMLDocumentObj *doc = task->doc;
198
199 TRACE("(%p)\n", doc);
200
201 if(doc->client)
202 IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
203
204 if(olecmd) {
205 VARIANT progress_max, progress;
206
207 V_VT(&progress_max) = VT_I4;
208 V_I4(&progress_max) = 0; /* FIXME */
209 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSMAX, OLECMDEXECOPT_DONTPROMPTUSER,
210 &progress_max, NULL);
211
212 V_VT(&progress) = VT_I4;
213 V_I4(&progress) = 0; /* FIXME */
214 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS, OLECMDEXECOPT_DONTPROMPTUSER,
215 &progress, NULL);
216 IOleCommandTarget_Release(olecmd);
217 }
218
219 if(doc->usermode == EDITMODE && doc->hostui) {
220 DOCHOSTUIINFO hostinfo;
221
222 memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
223 hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
224 hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
225 if(SUCCEEDED(hres))
226 /* FIXME: use hostinfo */
227 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
228 hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
229 debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
230 }
231}
cd_progress_ptr progress
Definition: cdjpeg.h:152
#define memset(x, y, z)
Definition: compat.h:39

Referenced by set_moniker().

◆ set_ready_state()

void set_ready_state ( HTMLOuterWindow window,
READYSTATE  readystate 
)

Definition at line 450 of file persist.c.

451{
452 READYSTATE prev_state = window->readystate;
453
454 window->readystate = readystate;
455
456 if(window->readystate_locked) {
457 readystate_task_t *task;
459
460 if(window->readystate_pending || prev_state == readystate)
461 return;
462
463 task = heap_alloc(sizeof(*task));
464 if(!task)
465 return;
466
467 IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
468 task->window = window;
469
471 if(SUCCEEDED(hres))
472 window->readystate_pending = TRUE;
473 return;
474 }
475
477}
static void notif_readystate_destr(task_t *_task)
Definition: persist.c:444
static void notif_readystate_proc(task_t *_task)
Definition: persist.c:438

Referenced by handle_load(), on_start_nsrequest(), run_end_load(), and set_moniker().

◆ use_gecko_script()

static BOOL use_gecko_script ( HTMLOuterWindow window)
static

Definition at line 33 of file persist.c.

34{
35 DWORD zone;
37
38 hres = IInternetSecurityManager_MapUrlToZone(window->secmgr, window->url, &zone, 0);
39 if(FAILED(hres)) {
40 WARN("Could not map %s to zone: %08x\n", debugstr_w(window->url), hres);
41 return TRUE;
42 }
43
44 TRACE("zone %d\n", zone);
45 return zone == URLZONE_UNTRUSTED;
46}
DWORD zone
Definition: sec_mgr.c:1754

Referenced by set_current_mon().

Variable Documentation

◆ about_blankW

const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0}
static

◆ MonikerPropVtbl

const IMonikerPropVtbl MonikerPropVtbl
static
Initial value:
= {
}
static HRESULT WINAPI MonikerProp_PutProperty(IMonikerProp *iface, MONIKERPROPERTY mkp, LPCWSTR val)
Definition: persist.c:675
static ULONG WINAPI MonikerProp_AddRef(IMonikerProp *iface)
Definition: persist.c:663
static HRESULT WINAPI MonikerProp_QueryInterface(IMonikerProp *iface, REFIID riid, void **ppv)
Definition: persist.c:657
static ULONG WINAPI MonikerProp_Release(IMonikerProp *iface)
Definition: persist.c:669

Definition at line 698 of file persist.c.

Referenced by HTMLDocument_Persist_Init().

◆ PersistFileVtbl

const IPersistFileVtbl PersistFileVtbl
static
Initial value:
= {
}
static HRESULT WINAPI PersistFile_Load(IPersistFile *iface, LPCOLESTR pszFileName, DWORD dwMode)
Definition: persist.c:754
static ULONG WINAPI PersistFile_Release(IPersistFile *iface)
Definition: persist.c:726
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *iface, REFIID riid, void **ppv)
Definition: persist.c:714
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
Definition: persist.c:786
static ULONG WINAPI PersistFile_AddRef(IPersistFile *iface)
Definition: persist.c:720
static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *iface)
Definition: persist.c:745
static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileName, BOOL fRemember)
Definition: persist.c:761
static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *iface, LPOLESTR *pszFileName)
Definition: persist.c:793
static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *iface, CLSID *pClassID)
Definition: persist.c:732

Definition at line 800 of file persist.c.

Referenced by HTMLDocument_Persist_Init().

◆ PersistHistoryVtbl

const IPersistHistoryVtbl PersistHistoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI PersistHistory_QueryInterface(IPersistHistory *iface, REFIID riid, void **ppv)
Definition: persist.c:957
static HRESULT WINAPI PersistHistory_SetPositionCookie(IPersistHistory *iface, DWORD dwPositioncookie)
Definition: persist.c:1064
static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
Definition: persist.c:981
static HRESULT WINAPI PersistHistory_SaveHistory(IPersistHistory *iface, IStream *pStream)
Definition: persist.c:1036
static HRESULT WINAPI PersistHistory_GetClassID(IPersistHistory *iface, CLSID *pClassID)
Definition: persist.c:975
static ULONG WINAPI PersistHistory_Release(IPersistHistory *iface)
Definition: persist.c:969
static HRESULT WINAPI PersistHistory_GetPositionCookie(IPersistHistory *iface, DWORD *pdwPositioncookie)
Definition: persist.c:1071
static ULONG WINAPI PersistHistory_AddRef(IPersistHistory *iface)
Definition: persist.c:963

Definition at line 1078 of file persist.c.

Referenced by HTMLDocument_Persist_Init().

◆ PersistMonikerVtbl

const IPersistMonikerVtbl PersistMonikerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI PersistMoniker_GetClassID(IPersistMoniker *iface, CLSID *pClassID)
Definition: persist.c:546
static HRESULT WINAPI PersistMoniker_Save(IPersistMoniker *iface, IMoniker *pimkName, LPBC pbc, BOOL fRemember)
Definition: persist.c:607
static ULONG WINAPI PersistMoniker_Release(IPersistMoniker *iface)
Definition: persist.c:540
static HRESULT WINAPI PersistMoniker_IsDirty(IPersistMoniker *iface)
Definition: persist.c:552
static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode)
Definition: persist.c:561
static HRESULT WINAPI PersistMoniker_SaveCompleted(IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
Definition: persist.c:615
static HRESULT WINAPI PersistMoniker_GetCurMoniker(IPersistMoniker *iface, IMoniker **ppimkName)
Definition: persist.c:622
static ULONG WINAPI PersistMoniker_AddRef(IPersistMoniker *iface)
Definition: persist.c:534
static HRESULT WINAPI PersistMoniker_QueryInterface(IPersistMoniker *iface, REFIID riid, void **ppv)
Definition: persist.c:528

Definition at line 636 of file persist.c.

Referenced by HTMLDocument_Persist_Init().

◆ PersistStreamInitVtbl

const IPersistStreamInitVtbl PersistStreamInitVtbl
static
Initial value:
= {
}
static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize)
Definition: persist.c:251
static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
Definition: persist.c:259
static ULONG WINAPI PersistStreamInit_AddRef(IPersistStreamInit *iface)
Definition: persist.c:212
static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
Definition: persist.c:230
static ULONG WINAPI PersistStreamInit_Release(IPersistStreamInit *iface)
Definition: persist.c:218
static HRESULT WINAPI PersistStreamInit_GetClassID(IPersistStreamInit *iface, CLSID *pClassID)
Definition: persist.c:224
static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM pStg)
Definition: persist.c:236
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStg, BOOL fSameAsLoad)
Definition: persist.c:243
static HRESULT WINAPI PersistStreamInit_QueryInterface(IPersistStreamInit *iface, REFIID riid, LPVOID *ppobj)
Definition: persist.c:205

Definition at line 936 of file persist.c.