Jacek Caban : urlmon: Fixed handling URIs with implicit file scheme in CoInternetCombineUrlEx.
Alexandre Julliard
julliard at winehq.org
Tue Mar 26 15:11:13 CDT 2013
Module: wine
Branch: master
Commit: 79b7c1108e3a0c8626799a20492e6c1daecfd928
URL: http://source.winehq.org/git/wine.git/?a=commit;h=79b7c1108e3a0c8626799a20492e6c1daecfd928
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Mar 26 11:34:12 2013 +0100
urlmon: Fixed handling URIs with implicit file scheme in CoInternetCombineUrlEx.
---
dlls/urlmon/tests/uri.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/urlmon/uri.c | 4 +-
2 files changed, 82 insertions(+), 2 deletions(-)
diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c
index bc6d1be..e5faa81 100644
--- a/dlls/urlmon/tests/uri.c
+++ b/dlls/urlmon/tests/uri.c
@@ -360,6 +360,31 @@ static const uri_properties uri_tests[] = {
{URLZONE_INVALID,E_NOTIMPL,FALSE}
}
},
+ { "file:///z:/test dir/README.txt", 0, S_OK, FALSE,
+ {
+ {"file:///z:/test%20dir/README.txt",S_OK},
+ {"",S_FALSE},
+ {"file:///z:/test%20dir/README.txt",S_OK},
+ {"",S_FALSE},
+ {".txt",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"/z:/test%20dir/README.txt",S_OK},
+ {"/z:/test%20dir/README.txt",S_OK},
+ {"",S_FALSE},
+ {"file:///z:/test dir/README.txt",S_OK},
+ {"file",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE}
+ },
+ {
+ {Uri_HOST_UNKNOWN,S_OK,FALSE},
+ {0,S_FALSE,FALSE},
+ {URL_SCHEME_FILE,S_OK,FALSE},
+ {URLZONE_INVALID,E_NOTIMPL,FALSE}
+ }
+ },
{ "urn:nothing:should:happen here", 0, S_OK, FALSE,
{
{"urn:nothing:should:happen here",S_OK,FALSE},
@@ -6926,7 +6951,62 @@ static const uri_combine_test uri_combine_tests[] = {
{URL_SCHEME_HTTP,S_OK},
{URLZONE_INVALID,E_NOTIMPL}
}
+ },
+ { "http://google.com/test",0,
+ "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
+ 0,S_OK,FALSE,
+ {
+ {"file:///c:/test/",S_OK},
+ {"",S_FALSE},
+ {"file:///c:/test/",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"/c:/test/",S_OK},
+ {"/c:/test/",S_OK},
+ {"",S_FALSE},
+ {"c:\\test\\",S_OK,FALSE,"file:///c:/test/"},
+ {"file",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE}
+ },
+ {
+ {Uri_HOST_UNKNOWN,S_OK},
+ {0,S_FALSE},
+ {URL_SCHEME_FILE,S_OK},
+ {URLZONE_INVALID,E_NOTIMPL}
+ }
+ },
+ { "http://google.com/test",0,
+ "c:\\test\\", Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME,
+ 0,S_OK,FALSE,
+ {
+ {"file:///c:/test/",S_OK},
+ {"",S_FALSE},
+ {"file:///c:/test/",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"/c:/test/",S_OK},
+ {"/c:/test/",S_OK},
+ {"",S_FALSE},
+ {"c:\\test\\",S_OK,FALSE,"file:///c:/test/"},
+ {"file",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE}
+ },
+ {
+ {Uri_HOST_UNKNOWN,S_OK},
+ {0,S_FALSE},
+ {URL_SCHEME_FILE,S_OK},
+ {URLZONE_INVALID,E_NOTIMPL}
+ }
}
+
};
typedef struct _uri_parse_test {
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index 42cfe71..0f6ee31 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -6461,7 +6461,7 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
return E_OUTOFMEMORY;
}
- parse_uri(&data, 0);
+ parse_uri(&data, Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME);
hr = Uri_Construct(NULL, (void**)&ret);
if(FAILED(hr)) {
@@ -6800,7 +6800,7 @@ HRESULT WINAPI CoInternetCombineUrlEx(IUri *pBaseUri, LPCWSTR pwzRelativeUrl, DW
}
}
- hr = CreateUri(pwzRelativeUrl, Uri_CREATE_ALLOW_RELATIVE, 0, &relative);
+ hr = CreateUri(pwzRelativeUrl, Uri_CREATE_ALLOW_RELATIVE|Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME, 0, &relative);
if(FAILED(hr)) {
*ppCombinedUri = NULL;
return hr;
More information about the wine-cvs
mailing list