diff --git a/dlls/mshtml/binding.h b/dlls/mshtml/binding.h index 1366d98e6d1..4e86b76555c 100644 --- a/dlls/mshtml/binding.h +++ b/dlls/mshtml/binding.h @@ -121,8 +121,9 @@ HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC** HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN; void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) 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; void set_current_mon(HTMLOuterWindow*,IMoniker*,DWORD) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 2a2b5caed38..6cfa76b846a 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2083,7 +2083,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, 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); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index f0edca067cd..012d7ac705e 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -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, &uri, 0); else - hres = CreateUri(new_url, 0, 0, &uri); + hres = create_uri(new_url, 0, &uri); if(FAILED(hres)) return hres; @@ -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)); SysFreeString(display_uri); IUri_Release(uri); - hres = CreateUri(translated_url, 0, 0, &uri); + hres = create_uri(translated_url, 0, &uri); CoTaskMemFree(translated_url); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 1e8f1bbd78e..d31367673fc 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1904,10 +1904,10 @@ static nsresult NSAPI nsURI_SetSpec(nsIFileURL *iface, const nsACString *aSpec) if(!spec) return NS_ERROR_OUT_OF_MEMORY; - hres = CreateUri(spec, 0, 0, &uri); + hres = create_uri(spec, 0, &uri); heap_free(spec); if(FAILED(hres)) { - WARN("CreateUri failed: %08x\n", hres); + WARN("create_uri failed: %08x\n", hres); return NS_ERROR_FAILURE; } @@ -2924,7 +2924,7 @@ HRESULT create_doc_uri(HTMLOuterWindow *window, const WCHAR *url, nsWineURI **re nsresult nsres; HRESULT hres; - hres = CreateUri(url, 0, 0, &iuri); + hres = create_uri(url, 0, &iuri); if(FAILED(hres)) return hres; @@ -2974,7 +2974,7 @@ HRESULT create_redirect_nschannel(const WCHAR *url, nsChannel *orig_channel, nsC nsresult nsres; HRESULT hres; - hres = CreateUri(url, 0, 0, &iuri); + hres = create_uri(url, 0, &iuri); if(FAILED(hres)) return hres; @@ -3287,9 +3287,9 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * if(FAILED(hres)) WARN("CoInternetCombineUrlEx failed: %08x\n", hres); }else { - hres = CreateUri(new_spec, 0, 0, &urlmon_uri); + hres = create_uri(new_spec, 0, &urlmon_uri); if(FAILED(hres)) - WARN("CreateUri failed: %08x\n", hres); + WARN("create_uri failed: %08x\n", hres); } if(FAILED(hres)) diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index df9bafdf5c3..a0bb2087c65 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -158,7 +158,7 @@ void set_current_mon(HTMLOuterWindow *This, IMoniker *mon, DWORD flags) hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url); if(SUCCEEDED(hres)) { - hres = CreateUri(url, 0, 0, &uri); + hres = create_uri(url, 0, &uri); if(FAILED(hres)) { WARN("CrateUri failed: %08x\n", hres); set_current_uri(This, NULL); @@ -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); } +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) { return window->uri ? 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) @@ -967,7 +972,7 @@ static HRESULT WINAPI PersistHistory_LoadHistory(IPersistHistory *iface, IStream hres = E_FAIL; if(SUCCEEDED(hres)) { uri_str[str_len] = 0; - hres = CreateUri(uri_str, 0, 0, &uri); + hres = create_uri(uri_str, 0, &uri); } heap_free(uri_str); if(FAILED(hres))