From 7fac512c579e9f671b279d8301d8c40b3b5afcf8 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 8 Dec 2019 16:53:08 +0300 Subject: [PATCH] msxml3: Handle escaped document file paths. Signed-off-by: Nikolay Sivov --- dlls/msxml3/bsc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/msxml3/bsc.c b/dlls/msxml3/bsc.c index df4cf37346..0b9e679bda 100644 --- a/dlls/msxml3/bsc.c +++ b/dlls/msxml3/bsc.c @@ -253,15 +253,19 @@ HRESULT create_uri(const WCHAR *url, IUri **uri) WCHAR fullpath[MAX_PATH]; DWORD needed = ARRAY_SIZE(fileUrl); - if (!PathSearchAndQualifyW(url, fullpath, ARRAY_SIZE(fullpath))) + lstrcpynW(fileUrl, url, ARRAY_SIZE(fileUrl)); + UrlUnescapeW(fileUrl, NULL, NULL, URL_UNESCAPE_INPLACE); + + if (!PathSearchAndQualifyW(fileUrl, fullpath, ARRAY_SIZE(fullpath))) { WARN("can't find path\n"); return E_FAIL; } - if (FAILED(UrlCreateFromPathW(fullpath, fileUrl, &needed, 0))) + if (FAILED(UrlApplySchemeW(fullpath, fileUrl, &needed, URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE | + URL_APPLY_DEFAULT))) { - ERR("can't create url from path\n"); + ERR("Failed to apply url scheme.\n"); return E_FAIL; } url = fileUrl; -- 2.24.0