[PATCH] shdocvw: Fallback to the default scheme, when needed [fixes 22697]
Detlef Riekenberg
wine.dev at web.de
Fri May 14 16:24:50 CDT 2010
This patch allow "wine iexplore.exe browserchoice.eu" to succeed
urlmon is correct to return S_FALSE, when the url does not include a
scheme (dlls/urlmon/tests/url.c#80)
--
By by ... Detlef
---
dlls/shdocvw/navigate.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c
index db6a3c4..78493b9 100644
--- a/dlls/shdocvw/navigate.c
+++ b/dlls/shdocvw/navigate.c
@@ -488,9 +488,16 @@ static HRESULT create_moniker(LPCWSTR url, IMoniker **mon)
}else {
size = sizeof(new_url);
hres = UrlApplySchemeW(url, new_url, &size, URL_APPLY_GUESSSCHEME);
- TRACE("got %s\n", debugstr_w(new_url));
+ if(hres == S_FALSE) {
+ /* no scheme found in url. new_url and size are untouched
+ Use the default scheme as fallback */
+ hres = UrlApplySchemeW(url, new_url, &size, URL_APPLY_DEFAULT);
+ }
+ TRACE("got 0x%x and %s\n", hres, debugstr_w(new_url));
+
if(FAILED(hres)) {
- WARN("UrlApplyScheme failed: %08x\n", hres);
+ WARN("UrlApplyScheme failed with 0x%08x for %s\n", hres, debugstr_w(url));
+ *new_url = 0; /* do not return garbage */
return hres;
}
}
--
1.7.0.4
More information about the wine-patches
mailing list