Commit 7b9fc3bb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME in CreateUri calls.

parent 79b7c110
...@@ -121,8 +121,9 @@ HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC** ...@@ -121,8 +121,9 @@ HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**
HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN; HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN;
void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN; void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN; IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
HRESULT create_relative_uri(HTMLOuterWindow*,const WCHAR*,IUri**) DECLSPEC_HIDDEN;
HRESULT create_uri(const WCHAR*,DWORD,IUri**) DECLSPEC_HIDDEN;
IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN; IUri *get_uri_nofrag(IUri*) DECLSPEC_HIDDEN;
void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN; void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
......
...@@ -2083,7 +2083,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, ...@@ -2083,7 +2083,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
translated_url = NULL; translated_url = NULL;
} }
hres = CreateUri(translated_url ? translated_url : url, 0, 0, &uri); hres = create_uri(translated_url ? translated_url : url, 0, &uri);
CoTaskMemFree(translated_url); CoTaskMemFree(translated_url);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -2327,7 +2327,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u ...@@ -2327,7 +2327,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
hres = CoInternetCombineUrlEx(base_uri, new_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, hres = CoInternetCombineUrlEx(base_uri, new_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
&uri, 0); &uri, 0);
else else
hres = CreateUri(new_url, 0, 0, &uri); hres = create_uri(new_url, 0, &uri);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -2346,7 +2346,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u ...@@ -2346,7 +2346,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
TRACE("%08x %s -> %s\n", hres, debugstr_w(display_uri), debugstr_w(translated_url)); TRACE("%08x %s -> %s\n", hres, debugstr_w(display_uri), debugstr_w(translated_url));
SysFreeString(display_uri); SysFreeString(display_uri);
IUri_Release(uri); IUri_Release(uri);
hres = CreateUri(translated_url, 0, 0, &uri); hres = create_uri(translated_url, 0, &uri);
CoTaskMemFree(translated_url); CoTaskMemFree(translated_url);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -1904,10 +1904,10 @@ static nsresult NSAPI nsURI_SetSpec(nsIFileURL *iface, const nsACString *aSpec) ...@@ -1904,10 +1904,10 @@ static nsresult NSAPI nsURI_SetSpec(nsIFileURL *iface, const nsACString *aSpec)
if(!spec) if(!spec)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
hres = CreateUri(spec, 0, 0, &uri); hres = create_uri(spec, 0, &uri);
heap_free(spec); heap_free(spec);
if(FAILED(hres)) { if(FAILED(hres)) {
WARN("CreateUri failed: %08x\n", hres); WARN("create_uri failed: %08x\n", hres);
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
...@@ -2924,7 +2924,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, const WCHAR *url, nsWineURI **re ...@@ -2924,7 +2924,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, const WCHAR *url, nsWineURI **re
nsresult nsres; nsresult nsres;
HRESULT hres; HRESULT hres;
hres = CreateUri(url, 0, 0, &iuri); hres = create_uri(url, 0, &iuri);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -2974,7 +2974,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC ...@@ -2974,7 +2974,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC
nsresult nsres; nsresult nsres;
HRESULT hres; HRESULT hres;
hres = CreateUri(url, 0, 0, &iuri); hres = create_uri(url, 0, &iuri);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -3287,9 +3287,9 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * ...@@ -3287,9 +3287,9 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
if(FAILED(hres)) if(FAILED(hres))
WARN("CoInternetCombineUrlEx failed: %08x\n", hres); WARN("CoInternetCombineUrlEx failed: %08x\n", hres);
}else { }else {
hres = CreateUri(new_spec, 0, 0, &urlmon_uri); hres = create_uri(new_spec, 0, &urlmon_uri);
if(FAILED(hres)) if(FAILED(hres))
WARN("CreateUri failed: %08x\n", hres); WARN("create_uri failed: %08x\n", hres);
} }
if(FAILED(hres)) if(FAILED(hres))
......
...@@ -158,7 +158,7 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags) ...@@ -158,7 +158,7 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url); hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = CreateUri(url, 0, 0, &uri); hres = create_uri(url, 0, &uri);
if(FAILED(hres)) { if(FAILED(hres)) {
WARN("CrateUri failed: %08x\n", hres); WARN("CrateUri failed: %08x\n", hres);
set_current_uri(This, NULL); set_current_uri(This, NULL);
...@@ -178,11 +178,16 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags) ...@@ -178,11 +178,16 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags)
set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT); set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
} }
HRESULT create_uri(const WCHAR *uri_str, DWORD flags, IUri **uri)
{
return CreateUri(uri_str, flags | Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, uri);
}
HRESULT create_relative_uri(HTMLOuterWindow *window, const WCHAR *rel_uri, IUri **uri) HRESULT create_relative_uri(HTMLOuterWindow *window, const WCHAR *rel_uri, IUri **uri)
{ {
return window->uri return window->uri
? CoInternetCombineUrlEx(window->uri, rel_uri, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, uri, 0) ? CoInternetCombineUrlEx(window->uri, rel_uri, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, uri, 0)
: CreateUri(rel_uri, 0, 0, uri); : create_uri(rel_uri, 0, uri);
} }
void set_download_state(HTMLDocumentObj *doc, int state) void set_download_state(HTMLDocumentObj *doc, int state)
...@@ -967,7 +972,7 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream ...@@ -967,7 +972,7 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream
hres = E_FAIL; hres = E_FAIL;
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
uri_str[str_len] = 0; uri_str[str_len] = 0;
hres = CreateUri(uri_str, 0, 0, &uri); hres = create_uri(uri_str, 0, &uri);
} }
heap_free(uri_str); heap_free(uri_str);
if(FAILED(hres)) if(FAILED(hres))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment