ReactOS 0.4.15-dev-8191-gbc6c731
binding.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nsChannel
 
struct  request_data_t
 
struct  BSCallback
 
struct  nsChannelBSC
 
struct  BSCallbackVtbl
 
struct  http_header_t
 

Macros

#define BINDING_NAVIGATED   0x0001
 
#define BINDING_REPLACE   0x0002
 
#define BINDING_FROMHIST   0x0004
 
#define BINDING_REFRESH   0x0008
 
#define BINDING_SUBMIT   0x0010
 
#define BINDING_NOFRAG   0x0020
 

Typedefs

typedef struct nsWineURI nsWineURI
 
typedef struct BSCallbackVtbl BSCallbackVtbl
 
typedef struct nsProtocolStream nsProtocolStream
 

Enumerations

enum  REQUEST_METHOD { METHOD_GET , METHOD_PUT , METHOD_POST }
 
enum  binding_bom_t { BOM_NONE , BOM_UTF8 , BOM_UTF16 }
 

Functions

HRESULT set_http_header (struct list *, const WCHAR *, int, const WCHAR *, int) DECLSPEC_HIDDEN
 
HRESULT create_redirect_nschannel (const WCHAR *, nsChannel *, nsChannel **) DECLSPEC_HIDDEN
 
nsresult on_start_uri_open (NSContainer *, nsIURI *, cpp_bool *) DECLSPEC_HIDDEN
 
HRESULT hlink_frame_navigate (HTMLDocument *, LPCWSTR, nsChannel *, DWORD, BOOL *) DECLSPEC_HIDDEN
 
HRESULT create_doc_uri (HTMLOuterWindow *, IUri *, nsWineURI **) DECLSPEC_HIDDEN
 
HRESULT load_nsuri (HTMLOuterWindow *, nsWineURI *, nsIInputStream *, nsChannelBSC *, DWORD) DECLSPEC_HIDDEN
 
HRESULT set_moniker (HTMLOuterWindow *, IMoniker *, IUri *, IBindCtx *, nsChannelBSC *, BOOL) DECLSPEC_HIDDEN
 
void prepare_for_binding (HTMLDocument *, IMoniker *, DWORD) DECLSPEC_HIDDEN
 
HRESULT super_navigate (HTMLOuterWindow *, IUri *, DWORD, const WCHAR *, BYTE *, DWORD) DECLSPEC_HIDDEN
 
HRESULT load_uri (HTMLOuterWindow *, IUri *, DWORD) DECLSPEC_HIDDEN
 
HRESULT navigate_new_window (HTMLOuterWindow *, IUri *, const WCHAR *, request_data_t *, IHTMLWindow2 **) DECLSPEC_HIDDEN
 
HRESULT navigate_url (HTMLOuterWindow *, const WCHAR *, IUri *, DWORD) DECLSPEC_HIDDEN
 
HRESULT submit_form (HTMLOuterWindow *, const WCHAR *, IUri *, nsIInputStream *) DECLSPEC_HIDDEN
 
void init_bscallback (BSCallback *, const BSCallbackVtbl *, IMoniker *, DWORD) DECLSPEC_HIDDEN
 
HRESULT create_channelbsc (IMoniker *, const WCHAR *, BYTE *, DWORD, BOOL, nsChannelBSC **) DECLSPEC_HIDDEN
 
HRESULT channelbsc_load_stream (HTMLInnerWindow *, IMoniker *, IStream *) DECLSPEC_HIDDEN
 
void channelbsc_set_channel (nsChannelBSC *, nsChannel *, nsIStreamListener *, nsISupports *) DECLSPEC_HIDDEN
 
IUrinsuri_get_uri (nsWineURI *) DECLSPEC_HIDDEN
 
HRESULT read_stream (BSCallback *, IStream *, void *, DWORD, DWORD *) DECLSPEC_HIDDEN
 
HRESULT create_relative_uri (HTMLOuterWindow *, const WCHAR *, IUri **) DECLSPEC_HIDDEN
 
HRESULT create_uri (const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
 
IUriget_uri_nofrag (IUri *) DECLSPEC_HIDDEN
 
void set_current_mon (HTMLOuterWindow *, IMoniker *, DWORD) DECLSPEC_HIDDEN
 
void set_current_uri (HTMLOuterWindow *, IUri *) DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ BINDING_FROMHIST

#define BINDING_FROMHIST   0x0004

Definition at line 129 of file binding.h.

◆ BINDING_NAVIGATED

#define BINDING_NAVIGATED   0x0001

Definition at line 127 of file binding.h.

◆ BINDING_NOFRAG

#define BINDING_NOFRAG   0x0020

Definition at line 132 of file binding.h.

◆ BINDING_REFRESH

#define BINDING_REFRESH   0x0008

Definition at line 130 of file binding.h.

◆ BINDING_REPLACE

#define BINDING_REPLACE   0x0002

Definition at line 128 of file binding.h.

◆ BINDING_SUBMIT

#define BINDING_SUBMIT   0x0010

Definition at line 131 of file binding.h.

Typedef Documentation

◆ BSCallbackVtbl

Definition at line 69 of file binding.h.

◆ nsProtocolStream

Definition at line 95 of file binding.h.

◆ nsWineURI

Definition at line 21 of file binding.h.

Enumeration Type Documentation

◆ binding_bom_t

Enumerator
BOM_NONE 
BOM_UTF8 
BOM_UTF16 

Definition at line 30 of file binding.h.

30 {
binding_bom_t
Definition: binding.h:30
@ BOM_UTF8
Definition: binding.h:32
@ BOM_UTF16
Definition: binding.h:33
@ BOM_NONE
Definition: binding.h:31

◆ REQUEST_METHOD

Enumerator
METHOD_GET 
METHOD_PUT 
METHOD_POST 

Definition at line 24 of file binding.h.

24 {
REQUEST_METHOD
Definition: binding.h:24
@ METHOD_PUT
Definition: binding.h:26
@ METHOD_POST
Definition: binding.h:27
@ METHOD_GET
Definition: binding.h:25

Function Documentation

◆ channelbsc_load_stream()

HRESULT channelbsc_load_stream ( HTMLInnerWindow pending_window,
IMoniker mon,
IStream stream 
)

Definition at line 1811 of file navigate.c.

1812{
1813 nsChannelBSC *bscallback = pending_window->bscallback;
1814 HRESULT hres = S_OK;
1815
1816 if(!bscallback->nschannel) {
1817 ERR("NULL nschannel\n");
1818 return E_FAIL;
1819 }
1820
1821 bscallback->nschannel->content_type = heap_strdupA("text/html");
1822 if(!bscallback->nschannel->content_type)
1823 return E_OUTOFMEMORY;
1824
1825 set_current_mon(pending_window->base.outer_window, mon, 0);
1826
1827 bscallback->bsc.window = pending_window;
1828 if(stream)
1829 hres = read_stream_data(bscallback, stream);
1830 if(SUCCEEDED(hres))
1831 hres = async_stop_request(bscallback);
1832 if(FAILED(hres))
1833 IBindStatusCallback_OnStopBinding(&bscallback->bsc.IBindStatusCallback_iface, hres,
1835
1836 return hres;
1837}
void set_current_mon(HTMLOuterWindow *, IMoniker *, DWORD) DECLSPEC_HIDDEN
Definition: persist.c:99
#define ERR(fmt,...)
Definition: debug.h:113
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
static HRESULT async_stop_request(nsChannelBSC *This)
Definition: navigate.c:1258
static char * heap_strdupA(const char *str)
IBindStatusCallback IBindStatusCallback_iface
Definition: binding.h:72
HTMLInnerWindow * window
Definition: binding.h:90
nsChannelBSC * bscallback
HTMLOuterWindow * outer_window
nsChannel * nschannel
Definition: binding.h:100
BSCallback bsc
Definition: binding.h:98
char * content_type
Definition: binding.h:53
Definition: parse.h:23

Referenced by PersistStreamInit_InitNew(), and PersistStreamInit_Load().

◆ channelbsc_set_channel()

void channelbsc_set_channel ( nsChannelBSC This,
nsChannel channel,
nsIStreamListener listener,
nsISupports context 
)

Definition at line 1839 of file navigate.c.

1840{
1841 nsIHttpChannel_AddRef(&channel->nsIHttpChannel_iface);
1842 This->nschannel = channel;
1843
1844 nsIStreamListener_AddRef(listener);
1845 This->nslistener = listener;
1846
1847 if(context) {
1848 nsISupports_AddRef(context);
1849 This->nscontext = context;
1850 }
1851
1852 if(This->bsc.request_data.headers) {
1853 HRESULT hres;
1854
1855 hres = parse_headers(This->bsc.request_data.headers, &channel->request_headers);
1856 heap_free(This->bsc.request_data.headers);
1857 This->bsc.request_data.headers = NULL;
1858 if(FAILED(hres))
1859 WARN("parse_headers failed: %08x\n", hres);
1860 }
1861}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define WARN(fmt,...)
Definition: debug.h:115
#define NULL
Definition: types.h:112
static HRESULT parse_headers(const WCHAR *headers, struct list *headers_list)
Definition: navigate.c:681
Definition: http.c:7252
struct list request_headers
Definition: binding.h:59
nsIHttpChannel nsIHttpChannel_iface
Definition: binding.h:37

Referenced by async_open(), and nsChannel_AsyncOpen().

◆ create_channelbsc()

HRESULT create_channelbsc ( IMoniker mon,
const WCHAR headers,
BYTE post_data,
DWORD  post_data_size,
BOOL  is_doc_binding,
nsChannelBSC **  retval 
)

Definition at line 1693 of file navigate.c.

1695{
1697 DWORD bindf;
1698
1699 ret = heap_alloc_zero(sizeof(*ret));
1700 if(!ret)
1701 return E_OUTOFMEMORY;
1702
1703 bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
1704 if(post_data_size)
1705 bindf |= BINDF_FORMS_SUBMIT | BINDF_PRAGMA_NO_CACHE | BINDF_HYPERLINK | BINDF_GETNEWESTVERSION;
1706
1708 ret->is_doc_channel = is_doc_binding;
1709
1710 if(headers) {
1711 ret->bsc.request_data.headers = heap_strdupW(headers);
1712 if(!ret->bsc.request_data.headers) {
1713 IBindStatusCallback_Release(&ret->bsc.IBindStatusCallback_iface);
1714 return E_OUTOFMEMORY;
1715 }
1716 }
1717
1718 if(post_data) {
1719 ret->bsc.request_data.post_data = GlobalAlloc(0, post_data_size+1);
1720 if(!ret->bsc.request_data.post_data) {
1721 release_request_data(&ret->bsc.request_data);
1722 IBindStatusCallback_Release(&ret->bsc.IBindStatusCallback_iface);
1723 return E_OUTOFMEMORY;
1724 }
1725
1726 memcpy(ret->bsc.request_data.post_data, post_data, post_data_size);
1727 ((BYTE*)ret->bsc.request_data.post_data)[post_data_size] = 0;
1728 ret->bsc.request_data.post_data_len = post_data_size;
1729 }
1730
1731 TRACE("created %p\n", ret);
1732 *retval = ret;
1733 return S_OK;
1734}
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
unsigned long DWORD
Definition: ntddk_ex.h:95
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static DWORD bindf
Definition: protocol.c:70
static const CHAR post_data[]
Definition: protocol.c:217
static const BSCallbackVtbl nsChannelBSCVtbl
Definition: navigate.c:1682
static void release_request_data(request_data_t *request_data)
Definition: navigate.c:190
void init_bscallback(BSCallback *This, const BSCallbackVtbl *vtbl, IMoniker *mon, DWORD bindf)
Definition: navigate.c:584
vector< Header * > headers
Definition: sdkparse.cpp:39
#define TRACE(s)
Definition: solgame.cpp:4
int ret
unsigned char BYTE
Definition: xxhash.c:193

Referenced by async_open(), hlink_frame_navigate(), navigate_new_window(), set_moniker(), and super_navigate().

◆ create_doc_uri()

HRESULT create_doc_uri ( HTMLOuterWindow window,
IUri iuri,
nsWineURI **  ret 
)

Definition at line 3210 of file nsio.c.

3211{
3212 nsWineURI *uri;
3213 nsresult nsres;
3214
3215 nsres = create_nsuri(iuri, window, window->doc_obj->nscontainer, NULL, &uri);
3216 if(NS_FAILED(nsres))
3217 return E_FAIL;
3218
3219 uri->is_doc_uri = TRUE;
3220
3221 *ret = uri;
3222 return S_OK;
3223}
#define TRUE
Definition: types.h:120
static IHTMLWindow2 * window
Definition: events.c:77
const char * uri
Definition: sec_mgr.c:1588
#define NS_FAILED(res)
static nsresult create_nsuri(IUri *, HTMLOuterWindow *, NSContainer *, const char *, nsWineURI **)
Definition: nsio.c:3172
Definition: nsio.c:34

Referenced by navigate_uri(), and set_moniker().

◆ create_redirect_nschannel()

HRESULT create_redirect_nschannel ( const WCHAR url,
nsChannel orig_channel,
nsChannel **  ret 
)

Definition at line 3251 of file nsio.c.

3252{
3254 nsChannel *channel;
3255 nsWineURI *uri;
3256 IUri *iuri;
3257 nsresult nsres;
3258 HRESULT hres;
3259
3260 hres = create_uri(url, 0, &iuri);
3261 if(FAILED(hres))
3262 return hres;
3263
3264 if(orig_channel->uri->window_ref)
3265 window = orig_channel->uri->window_ref->window;
3266 nsres = create_nsuri(iuri, window, NULL, NULL, &uri);
3267 IUri_Release(iuri);
3268 if(NS_FAILED(nsres))
3269 return E_FAIL;
3270
3271 nsres = create_nschannel(uri, &channel);
3272 nsIFileURL_Release(&uri->nsIFileURL_iface);
3273 if(NS_FAILED(nsres))
3274 return E_FAIL;
3275
3276 if(orig_channel->load_group) {
3277 nsILoadGroup_AddRef(orig_channel->load_group);
3278 channel->load_group = orig_channel->load_group;
3279 }
3280
3281 if(orig_channel->notif_callback) {
3282 nsIInterfaceRequestor_AddRef(orig_channel->notif_callback);
3283 channel->notif_callback = orig_channel->notif_callback;
3284 }
3285
3286 channel->load_flags = orig_channel->load_flags | LOAD_REPLACE;
3287
3288 if(orig_channel->request_method == METHOD_POST)
3289 FIXME("unsupported POST method\n");
3290
3291 if(orig_channel->original_uri) {
3292 nsIURI_AddRef(orig_channel->original_uri);
3293 channel->original_uri = orig_channel->original_uri;
3294 }
3295
3296 if(orig_channel->referrer) {
3297 nsIURI_AddRef(orig_channel->referrer);
3298 channel->referrer = orig_channel->referrer;
3299 }
3300
3301 *ret = channel;
3302 return S_OK;
3303}
HRESULT create_uri(const WCHAR *, DWORD, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:158
#define FIXME(fmt,...)
Definition: debug.h:114
static const WCHAR url[]
Definition: encode.c:1432
static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret)
Definition: nsio.c:3225
nsIInterfaceRequestor * notif_callback
Definition: binding.h:47
nsILoadGroup * load_group
Definition: binding.h:46
nsIURI * original_uri
Definition: binding.h:51
nsWineURI * uri
Definition: binding.h:43
nsLoadFlags load_flags
Definition: binding.h:50
REQUEST_METHOD request_method
Definition: binding.h:57
nsIURI * referrer
Definition: binding.h:52
windowref_t * window_ref
Definition: nsio.c:41
HTMLOuterWindow * window

Referenced by handle_redirect().

◆ 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
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_uri_nofrag()

IUri * get_uri_nofrag ( IUri uri)

Definition at line 77 of file nsio.c.

78{
79 IUriBuilder *uri_builder;
80 IUri *ret;
81 BOOL b;
83
84 hres = IUri_HasProperty(uri, Uri_PROPERTY_FRAGMENT, &b);
85 if(SUCCEEDED(hres) && !b) {
86 IUri_AddRef(uri);
87 return uri;
88 }
89
90 hres = CreateIUriBuilder(uri, 0, 0, &uri_builder);
91 if(FAILED(hres))
92 return NULL;
93
94 hres = IUriBuilder_RemoveProperties(uri_builder, Uri_HAS_FRAGMENT);
95 if(SUCCEEDED(hres))
96 hres = IUriBuilder_CreateUriSimple(uri_builder, 0, 0, &ret);
97 IUriBuilder_Release(uri_builder);
98 if(FAILED(hres))
99 return NULL;
100
101 return ret;
102}
HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserved, IUriBuilder **ppIUriBuilder)
Definition: uri.c:6353
unsigned int BOOL
Definition: ntddk_ex.h:94
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79

Referenced by combine_url(), compare_ignoring_frag(), nsURI_CloneIgnoreRef(), set_current_uri(), and super_navigate().

◆ hlink_frame_navigate()

HRESULT hlink_frame_navigate ( HTMLDocument doc,
LPCWSTR  url,
nsChannel nschannel,
DWORD  hlnf,
BOOL cancel 
)

Definition at line 2193 of file navigate.c.

2194{
2195 IHlinkFrame *hlink_frame;
2197 IBindCtx *bindctx;
2198 IMoniker *mon;
2199 IHlink *hlink;
2200 HRESULT hres;
2201
2202 *cancel = FALSE;
2203
2204 hres = do_query_service((IUnknown*)doc->doc_obj->client, &IID_IHlinkFrame, &IID_IHlinkFrame,
2205 (void**)&hlink_frame);
2206 if(FAILED(hres))
2207 return S_OK;
2208
2210 if(FAILED(hres)) {
2211 IHlinkFrame_Release(hlink_frame);
2212 return hres;
2213 }
2214
2215 if(nschannel)
2217 &nschannel->request_headers, &callback->bsc.request_data);
2218
2219 hres = CreateAsyncBindCtx(0, &callback->bsc.IBindStatusCallback_iface, NULL, &bindctx);
2220 if(SUCCEEDED(hres))
2221 hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER,
2222 &IID_IHlink, (LPVOID*)&hlink);
2223
2224 if(SUCCEEDED(hres))
2225 hres = CreateURLMoniker(NULL, url, &mon);
2226
2227 if(SUCCEEDED(hres)) {
2228 IHlink_SetMonikerReference(hlink, HLINKSETF_TARGET, mon, NULL);
2229
2230 if(hlnf & HLNF_OPENINNEWWINDOW) {
2231 static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0};
2232 IHlink_SetTargetFrameName(hlink, wszBlank); /* FIXME */
2233 }
2234
2235 hres = IHlinkFrame_Navigate(hlink_frame, hlnf, bindctx,
2236 &callback->bsc.IBindStatusCallback_iface, hlink);
2237 IMoniker_Release(mon);
2238 *cancel = hres == S_OK;
2239 hres = S_OK;
2240 }
2241
2242 IHlinkFrame_Release(hlink_frame);
2243 IBindCtx_Release(bindctx);
2244 IBindStatusCallback_Release(&callback->bsc.IBindStatusCallback_iface);
2245 return hres;
2246}
#define FALSE
Definition: types.h:117
HRESULT do_query_service(IUnknown *unk, REFGUID guid_service, REFIID riid, void **ppv)
Definition: main.c:148
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HRESULT read_post_data_stream(nsIInputStream *stream, BOOL contains_headers, struct list *headers_list, request_data_t *request_data)
Definition: navigate.c:800
HRESULT create_channelbsc(IMoniker *mon, const WCHAR *headers, BYTE *post_data, DWORD post_data_size, BOOL is_doc_binding, nsChannelBSC **retval)
Definition: navigate.c:1693
IOleClientSite * client
HTMLDocumentObj * doc_obj
nsIInputStream * post_data_stream
Definition: binding.h:44
BOOL post_data_contains_headers
Definition: binding.h:45
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind)
Definition: bindctx.c:899
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by before_async_open(), and navigate_uri().

◆ init_bscallback()

void init_bscallback ( BSCallback This,
const BSCallbackVtbl vtbl,
IMoniker mon,
DWORD  bindf 
)

Definition at line 584 of file navigate.c.

585{
586 This->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl;
587 This->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
588 This->IHttpNegotiate2_iface.lpVtbl = &HttpNegotiate2Vtbl;
589 This->IInternetBindInfo_iface.lpVtbl = &InternetBindInfoVtbl;
590 This->vtbl = vtbl;
591 This->ref = 1;
592 This->bindf = bindf;
593 This->bom = BOM_NONE;
594
595 list_init(&This->entry);
596
597 if(mon)
598 IMoniker_AddRef(mon);
599 This->mon = mon;
600}
static void list_init(struct list_entry *head)
Definition: list.h:51
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
Definition: navigate.c:426
static const IInternetBindInfoVtbl InternetBindInfoVtbl
Definition: navigate.c:533
static const IHttpNegotiate2Vtbl HttpNegotiate2Vtbl
Definition: navigate.c:484
static const IServiceProviderVtbl ServiceProviderVtbl
Definition: navigate.c:577

Referenced by bind_script_to_text(), and create_channelbsc().

◆ load_nsuri()

HRESULT load_nsuri ( HTMLOuterWindow window,
nsWineURI uri,
nsIInputStream post_stream,
nsChannelBSC channelbsc,
DWORD  flags 
)

Definition at line 250 of file nsio.c.

252{
253 nsIDocShellLoadInfo *load_info = NULL;
254 nsIWebNavigation *web_navigation;
255 nsIDocShell *doc_shell;
256 HTMLDocumentNode *doc;
257 nsresult nsres;
258
259 nsres = get_nsinterface((nsISupports*)window->nswindow, &IID_nsIWebNavigation, (void**)&web_navigation);
260 if(NS_FAILED(nsres)) {
261 ERR("Could not get nsIWebNavigation interface: %08x\n", nsres);
262 return E_FAIL;
263 }
264
265 nsres = nsIWebNavigation_QueryInterface(web_navigation, &IID_nsIDocShell, (void**)&doc_shell);
266 nsIWebNavigation_Release(web_navigation);
267 if(NS_FAILED(nsres)) {
268 ERR("Could not get nsIDocShell: %08x\n", nsres);
269 return E_FAIL;
270 }
271
272 if(post_stream) {
273 nsres = nsIDocShell_CreateLoadInfo(doc_shell, &load_info);
274 if(NS_FAILED(nsres)) {
275 nsIDocShell_Release(doc_shell);
276 return E_FAIL;
277 }
278
279 nsres = nsIDocShellLoadInfo_SetPostDataStream(load_info, post_stream);
280 assert(nsres == NS_OK);
281 }
282
283 uri->channel_bsc = channelbsc;
284 doc = window->base.inner_window->doc;
286 nsres = nsIDocShell_LoadURI(doc_shell, (nsIURI*)&uri->nsIFileURL_iface, load_info, flags, FALSE);
287 if(doc == window->base.inner_window->doc)
289 uri->channel_bsc = NULL;
290 nsIDocShell_Release(doc_shell);
291 if(load_info)
292 nsIDocShellLoadInfo_Release(load_info);
293 if(NS_FAILED(nsres)) {
294 WARN("LoadURI failed: %08x\n", nsres);
295 return E_FAIL;
296 }
297
298 return S_OK;
299}
#define assert(x)
Definition: debug.h:53
#define NS_OK
nsresult get_nsinterface(nsISupports *, REFIID, void **) DECLSPEC_HIDDEN
Definition: nsembed.c:907

Referenced by navigate_uri(), and set_moniker().

◆ load_uri()

HRESULT load_uri ( HTMLOuterWindow window,
IUri uri,
DWORD  flags 
)

Definition at line 2306 of file navigate.c.

2307{
2308 BSTR display_uri;
2309 HRESULT hres;
2310
2311 hres = IUri_GetDisplayUri(uri, &display_uri);
2312 if(FAILED(hres))
2313 return hres;
2314
2315 hres = navigate_uri(window, uri, display_uri, NULL, flags);
2316 SysFreeString(display_uri);
2317 return hres;
2318}
OLECHAR * BSTR
Definition: compat.h:2293
static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *display_uri, const request_data_t *request_data, DWORD flags)
Definition: navigate.c:2248
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by PersistHistory_LoadHistory(), and refresh_proc().

◆ navigate_new_window()

HRESULT navigate_new_window ( HTMLOuterWindow window,
IUri uri,
const WCHAR name,
request_data_t request_data,
IHTMLWindow2 **  ret 
)

Definition at line 2132 of file navigate.c.

2133{
2134 IWebBrowser2 *web_browser;
2136 IBindCtx *bind_ctx;
2138 HRESULT hres;
2139
2140 if(request_data)
2141 hres = create_channelbsc(NULL, request_data->headers,
2142 request_data->post_data, request_data->post_data_len, FALSE,
2143 &bsc);
2144 else
2146 if(FAILED(hres))
2147 return hres;
2148
2149 hres = CreateAsyncBindCtx(0, &bsc->bsc.IBindStatusCallback_iface, NULL, &bind_ctx);
2150 if(FAILED(hres)) {
2151 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
2152 return hres;
2153 }
2154
2155 hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
2156 &IID_IWebBrowser2, (void**)&web_browser);
2157 if(SUCCEEDED(hres)) {
2158 ITargetFramePriv2 *target_frame_priv;
2159
2160 hres = IWebBrowser2_QueryInterface(web_browser, &IID_ITargetFramePriv2, (void**)&target_frame_priv);
2161 if(SUCCEEDED(hres)) {
2162 hres = ITargetFramePriv2_AggregatedNavigation2(target_frame_priv,
2163 HLNF_DISABLEWINDOWRESTRICTIONS|HLNF_OPENINNEWWINDOW, bind_ctx, &bsc->bsc.IBindStatusCallback_iface,
2164 name, uri, emptyW);
2165 ITargetFramePriv2_Release(target_frame_priv);
2166
2167 if(SUCCEEDED(hres))
2168 hres = do_query_service((IUnknown*)web_browser, &SID_SHTMLWindow, &IID_IHTMLWindow2, (void**)&new_window);
2169 }
2170 if(FAILED(hres)) {
2171 IWebBrowser2_Quit(web_browser);
2172 IWebBrowser2_Release(web_browser);
2173 }
2174 }else {
2175 WARN("Could not create InternetExplorer instance: %08x\n", hres);
2176 }
2177
2178 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
2179 IBindCtx_Release(bind_ctx);
2180 if(FAILED(hres))
2181 return hres;
2182
2183 IWebBrowser2_put_Visible(web_browser, VARIANT_TRUE);
2184 IWebBrowser2_Release(web_browser);
2185
2186 if(ret)
2187 *ret = new_window;
2188 else
2189 IHTMLWindow2_Release(new_window);
2190 return S_OK;
2191}
static const WCHAR emptyW[]
Definition: navigate.c:40
static HWND new_window(LPCSTR lpClassName, DWORD dwStyle, HWND parent)
Definition: editor.c:54
static IBindStatusCallbackEx bsc
Definition: url.c:2150
interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
Definition: name.c:39
WCHAR * headers
Definition: binding.h:64
ULONG post_data_len
Definition: binding.h:66
HGLOBAL post_data
Definition: binding.h:65

Referenced by HlinkTarget_Navigate(), HTMLWindow2_open(), navigate_href_new_window(), and submit_form().

◆ navigate_url()

HRESULT navigate_url ( HTMLOuterWindow window,
const WCHAR new_url,
IUri base_uri,
DWORD  flags 
)

Definition at line 2391 of file navigate.c.

2392{
2393 IUri *uri, *nav_uri;
2394 BSTR display_uri;
2395 HRESULT hres;
2396
2397 if(new_url && base_uri)
2399 &nav_uri, 0);
2400 else
2401 hres = create_uri(new_url, 0, &nav_uri);
2402 if(FAILED(hres))
2403 return hres;
2404
2405 hres = translate_uri(window, nav_uri, &display_uri, &uri);
2406 IUri_Release(nav_uri);
2407 if(FAILED(hres))
2408 return hres;
2409
2410 hres = navigate_uri(window, uri, display_uri, NULL, flags);
2411 IUri_Release(uri);
2412 SysFreeString(display_uri);
2413 return hres;
2414}
static HRESULT translate_uri(HTMLOuterWindow *window, IUri *orig_uri, BSTR *ret_display_uri, IUri **ret_uri)
Definition: navigate.c:2320

◆ nsuri_get_uri()

IUri * nsuri_get_uri ( nsWineURI nsuri)

Definition at line 68 of file nsio.c.

69{
70 if(!ensure_uri(nsuri))
71 return NULL;
72
73 IUri_AddRef(nsuri->uri);
74 return nsuri->uri;
75}
static BOOL ensure_uri(nsWineURI *This)
Definition: nsio.c:51
IUri * uri
Definition: nsio.c:43

Referenced by nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback().

◆ on_start_uri_open()

nsresult on_start_uri_open ( NSContainer nscontainer,
nsIURI uri,
cpp_bool _retval 
)

Definition at line 4019 of file nsio.c.

4020{
4021 nsWineURI *wine_uri;
4022 nsresult nsres;
4023
4024 *_retval = FALSE;
4025
4026 nsres = nsIURI_QueryInterface(uri, &IID_nsWineURI, (void**)&wine_uri);
4027 if(NS_FAILED(nsres)) {
4028 WARN("Could not get nsWineURI: %08x\n", nsres);
4030 }
4031
4032 if(!wine_uri->is_doc_uri) {
4033 wine_uri->is_doc_uri = TRUE;
4034
4035 if(!wine_uri->container) {
4036 nsIWebBrowserChrome_AddRef(&nscontainer->nsIWebBrowserChrome_iface);
4037 wine_uri->container = nscontainer;
4038 }
4039
4040 if(nscontainer->doc)
4041 *_retval = translate_url(nscontainer->doc, wine_uri);
4042 }
4043
4044 nsIFileURL_Release(&wine_uri->nsIFileURL_iface);
4045 return NS_OK;
4046}
#define NS_ERROR_NOT_IMPLEMENTED
static BOOL translate_url(HTMLDocumentObj *doc, nsWineURI *uri)
Definition: nsio.c:3992
static const IID IID_nsWineURI
Definition: nsio.c:26
nsIWebBrowserChrome nsIWebBrowserChrome_iface
HTMLDocumentObj * doc
nsIFileURL nsIFileURL_iface
Definition: nsio.c:35
BOOL is_doc_uri
Definition: nsio.c:46
NSContainer * container
Definition: nsio.c:40

Referenced by nsURIContentListener_OnStartURIOpen().

◆ 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
#define BINDING_FROMHIST
Definition: binding.h:129
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_I4
Definition: compat.h:2298
@ 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
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
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().

◆ read_stream()

HRESULT read_stream ( BSCallback This,
IStream stream,
void buf,
DWORD  size,
DWORD ret_size 
)

Definition at line 602 of file navigate.c.

603{
604 DWORD read_size = 0, skip=0;
605 BYTE *data = buf;
607
608 hres = IStream_Read(stream, buf, size, &read_size);
609
610 if(!This->readed && This->bom == BOM_NONE) {
611 if(read_size >= 2 && data[0] == 0xff && data[1] == 0xfe) {
612 This->bom = BOM_UTF16;
613 skip = 2;
614 }else if(read_size >= 3 && data[0] == 0xef && data[1] == 0xbb && data[2] == 0xbf) {
615 This->bom = BOM_UTF8;
616 skip = 3;
617 }
618 if(skip) {
619 read_size -= skip;
620 if(read_size)
621 memmove(data, data+skip, read_size);
622 }
623 }
624
625 This->readed += read_size;
626 *ret_size = read_size;
627 return hres;
628}
#define skip(...)
Definition: atltest.h:64
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by do_read(), duplicate_extents(), read_stream_data(), and ScriptBSC_read_data().

◆ 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
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_http_header()

HRESULT set_http_header ( struct list headers,
const WCHAR name,
int  name_len,
const WCHAR value,
int  value_len 
)

Definition at line 380 of file nsio.c.

382{
384
385 TRACE("%s: %s\n", debugstr_wn(name, name_len), debugstr_wn(value, value_len));
386
387 header = find_http_header(headers, name, name_len);
388 if(header) {
389 WCHAR *new_data;
390
391 new_data = heap_strndupW(value, value_len);
392 if(!new_data)
393 return E_OUTOFMEMORY;
394
395 heap_free(header->data);
396 header->data = new_data;
397 }else {
399 if(!header)
400 return E_OUTOFMEMORY;
401
402 header->header = heap_strndupW(name, name_len);
403 header->data = heap_strndupW(value, value_len);
404 if(!header->header || !header->data) {
405 heap_free(header->header);
406 heap_free(header->data);
408 return E_OUTOFMEMORY;
409 }
410
411 list_add_tail(headers, &header->entry);
412 }
413
414 return S_OK;
415}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define debugstr_wn
Definition: kernel32.h:33
static LPWSTR heap_strndupW(LPCWSTR str, unsigned len)
static http_header_t * find_http_header(struct list *headers, const WCHAR *name, int len)
Definition: nsio.c:340
Definition: pdh_main.c:94

Referenced by nsUploadChannel_SetUploadStream(), parse_headers(), and set_channel_http_header().

◆ 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
#define debugstr_w
Definition: kernel32.h:32
static LPOLESTR
Definition: stg_prop.c:27
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
IOleInPlaceFrame * frame
HTMLDocument basedoc
HTMLDocumentObj * doc
HTMLDocumentObj * doc
Definition: persist.c:28

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

◆ submit_form()

HRESULT submit_form ( HTMLOuterWindow window,
const WCHAR target,
IUri submit_uri,
nsIInputStream post_stream 
)

Definition at line 2361 of file navigate.c.

2362{
2363 request_data_t request_data = {NULL};
2364 HRESULT hres;
2365
2366 hres = read_post_data_stream(post_stream, TRUE, NULL, &request_data);
2367 if(FAILED(hres))
2368 return hres;
2369
2370 if(window) {
2371 IUri *uri;
2372 BSTR display_uri;
2373
2374 window->readystate_locked++;
2375
2376 hres = translate_uri(window, submit_uri, &display_uri, &uri);
2377 if(SUCCEEDED(hres)) {
2378 hres = navigate_uri(window, uri, display_uri, &request_data, BINDING_NAVIGATED|BINDING_SUBMIT);
2379 IUri_Release(uri);
2380 SysFreeString(display_uri);
2381 }
2382
2383 window->readystate_locked--;
2384 }else
2385 hres = navigate_new_window(window, submit_uri, target, &request_data, NULL);
2386
2387 release_request_data(&request_data);
2388 return hres;
2389}
#define BINDING_SUBMIT
Definition: binding.h:131
GLenum target
Definition: glext.h:7315
HRESULT navigate_new_window(HTMLOuterWindow *window, IUri *uri, const WCHAR *name, request_data_t *request_data, IHTMLWindow2 **ret)
Definition: navigate.c:2132

Referenced by HTMLFormElement_submit().

◆ super_navigate()

HRESULT super_navigate ( HTMLOuterWindow window,
IUri uri,
DWORD  flags,
const WCHAR headers,
BYTE post_data,
DWORD  post_data_size 
)

Definition at line 2016 of file navigate.c.

2017{
2019 IUri *uri_nofrag;
2020 IMoniker *mon;
2021 DWORD scheme;
2022 HRESULT hres;
2023
2024 uri_nofrag = get_uri_nofrag(uri);
2025 if(!uri_nofrag)
2026 return E_FAIL;
2027
2028 if(window->doc_obj->client && !(flags & BINDING_REFRESH)) {
2029 IOleCommandTarget *cmdtrg;
2030
2031 hres = IOleClientSite_QueryInterface(window->doc_obj->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
2032 if(SUCCEEDED(hres)) {
2033 VARIANT in, out;
2034 BSTR url_str;
2035
2036 hres = IUri_GetDisplayUri(uri_nofrag, &url_str);
2037 if(SUCCEEDED(hres)) {
2038 V_VT(&in) = VT_BSTR;
2039 V_BSTR(&in) = url_str;
2040 V_VT(&out) = VT_BOOL;
2041 V_BOOL(&out) = VARIANT_TRUE;
2042 hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 67, 0, &in, &out);
2043 IOleCommandTarget_Release(cmdtrg);
2044 if(SUCCEEDED(hres))
2045 VariantClear(&out);
2046 SysFreeString(url_str);
2047 }
2048 }
2049 }
2050
2051 if(!(flags & BINDING_NOFRAG) && window->uri_nofrag && !post_data_size) {
2052 BOOL eq;
2053
2054 hres = IUri_IsEqual(uri_nofrag, window->uri_nofrag, &eq);
2055 if(SUCCEEDED(hres) && eq) {
2056 IUri_Release(uri_nofrag);
2057 TRACE("fragment navigate\n");
2058 return navigate_fragment(window, uri);
2059 }
2060 }
2061
2062 hres = CreateURLMonikerEx2(NULL, uri_nofrag, &mon, URL_MK_UNIFORM);
2063 IUri_Release(uri_nofrag);
2064 if(FAILED(hres))
2065 return hres;
2066
2067 /* FIXME: Why not set_ready_state? */
2068 window->readystate = READYSTATE_UNINITIALIZED;
2069
2070 hres = create_channelbsc(mon, headers, post_data, post_data_size, TRUE, &bsc);
2071 if(FAILED(hres)) {
2072 IMoniker_Release(mon);
2073 return hres;
2074 }
2075
2076 prepare_for_binding(&window->doc_obj->basedoc, mon, flags);
2077
2078 hres = IUri_GetScheme(uri, &scheme);
2081
2082 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
2083 IMoniker_Release(mon);
2084
2085 task = heap_alloc(sizeof(*task));
2086 if(!task)
2087 return E_OUTOFMEMORY;
2088
2089 /* Why silently? */
2090 window->readystate = READYSTATE_COMPLETE;
2091 if(!(flags & BINDING_FROMHIST))
2092 call_docview_84(window->doc_obj);
2093
2094 IUri_AddRef(uri);
2095 task->window = window;
2096 task->uri = uri;
2098 }else if(flags & BINDING_SUBMIT) {
2099 hres = set_moniker(window, mon, uri, NULL, bsc, TRUE);
2100 if(SUCCEEDED(hres))
2101 hres = start_binding(window->pending_window, &bsc->bsc, NULL);
2102 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
2103 IMoniker_Release(mon);
2104 }else {
2105 navigate_task_t *task;
2106
2107 task = heap_alloc(sizeof(*task));
2108 if(!task) {
2109 IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
2110 IMoniker_Release(mon);
2111 return E_OUTOFMEMORY;
2112 }
2113
2114 /* Silently and repeated when real loading starts? */
2115 window->readystate = READYSTATE_LOADING;
2117 call_docview_84(window->doc_obj);
2118
2119 task->window = window;
2120 task->bscallback = bsc;
2121 task->flags = flags;
2122 task->mon = mon;
2123
2124 IUri_AddRef(uri);
2125 task->uri = uri;
2127 }
2128
2129 return hres;
2130}
#define BINDING_NOFRAG
Definition: binding.h:132
void prepare_for_binding(HTMLDocument *, IMoniker *, DWORD) DECLSPEC_HIDDEN
Definition: persist.c:271
HRESULT set_moniker(HTMLOuterWindow *, IMoniker *, IUri *, IBindCtx *, nsChannelBSC *, BOOL) DECLSPEC_HIDDEN
Definition: persist.c:329
@ VT_BSTR
Definition: compat.h:2303
GLuint in
Definition: glext.h:9616
#define eq(received, expected, label, type)
Definition: locale.c:144
static void navigate_task_destr(task_t *_task)
Definition: navigate.c:1937
static void navigate_javascript_task_destr(task_t *_task)
Definition: navigate.c:1907
static void navigate_proc(task_t *_task)
Definition: navigate.c:1924
static void navigate_javascript_proc(task_t *_task)
Definition: navigate.c:1869
static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri)
Definition: navigate.c:1947
HRESULT start_binding(HTMLInnerWindow *inner_window, BSCallback *bscallback, IBindCtx *bctx)
Definition: navigate.c:762
void call_docview_84(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: oleobj.c:173
#define V_BSTR(A)
Definition: oleauto.h:226
DWORD scheme
@ URL_SCHEME_JAVASCRIPT
Definition: shlwapi.h:1161
HTMLOuterWindow * window
Definition: navigate.c:1865
nsChannelBSC * bscallback
Definition: navigate.c:1918
HTMLOuterWindow * window
Definition: navigate.c:1917
IMoniker * mon
Definition: navigate.c:1920
HRESULT WINAPI CreateURLMonikerEx2(IMoniker *pmkContext, IUri *pUri, IMoniker **ppmk, DWORD dwFlags)
Definition: umon.c:668

Referenced by HTMLPrivateWindow_SuperNavigate(), and navigate_uri().