urlmon: Pass unescaped URLs to InternetOpenUrl in ftp protocol handler.
Based on a patch by André Hentschel. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26445 Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b51064a3d5
commit
d99605d714
|
@ -66,6 +66,7 @@ static HRESULT FtpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request
|
|||
HINTERNET internet_session, IInternetBindInfo *bind_info)
|
||||
{
|
||||
FtpProtocol *This = impl_from_Protocol(prot);
|
||||
DWORD path_size = 0;
|
||||
BSTR url;
|
||||
HRESULT hres;
|
||||
|
||||
|
@ -73,16 +74,18 @@ static HRESULT FtpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request
|
|||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = UrlUnescapeW(url, NULL, &path_size, URL_UNESCAPE_INPLACE);
|
||||
if(SUCCEEDED(hres)) {
|
||||
This->base.request = InternetOpenUrlW(internet_session, url, NULL, 0,
|
||||
request_flags|INTERNET_FLAG_EXISTING_CONNECT|INTERNET_FLAG_PASSIVE,
|
||||
(DWORD_PTR)&This->base);
|
||||
SysFreeString(url);
|
||||
if (!This->base.request && GetLastError() != ERROR_IO_PENDING) {
|
||||
WARN("InternetOpenUrl failed: %d\n", GetLastError());
|
||||
return INET_E_RESOURCE_NOT_FOUND;
|
||||
hres = INET_E_RESOURCE_NOT_FOUND;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
SysFreeString(url);
|
||||
return hres;
|
||||
}
|
||||
|
||||
static HRESULT FtpProtocol_end_request(Protocol *prot)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
TESTDLL = urlmon.dll
|
||||
IMPORTS = urlmon wininet ole32 oleaut32 user32 advapi32
|
||||
IMPORTS = urlmon wininet ole32 oleaut32 shlwapi user32 advapi32
|
||||
|
||||
C_SRCS = \
|
||||
generated.c \
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "urlmon.h"
|
||||
#include "wininet.h"
|
||||
#include "mshtml.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "wine/test.h"
|
||||
|
||||
|
@ -2905,7 +2906,7 @@ static void init_bind_test(int protocol, DWORD flags, DWORD t)
|
|||
url_a = (flags & BINDTEST_INVALID_CN) ? "https://4.15.184.77/favicon.ico" : "https://test.winehq.org/tests/hello.html";
|
||||
break;
|
||||
case FTP_TEST:
|
||||
url_a = "ftp://ftp.winehq.org/welcome.msg";
|
||||
url_a = "ftp://ftp.winehq.org/welcome%2emsg";
|
||||
break;
|
||||
default:
|
||||
url_a = "winetest:test";
|
||||
|
@ -2969,6 +2970,13 @@ static void test_BindToStorage(int protocol, DWORD flags, DWORD t)
|
|||
if(FAILED(hres))
|
||||
return;
|
||||
|
||||
if(protocol == FTP_TEST)
|
||||
{
|
||||
/* FTP url dont have any escape characters, so convert the url to what is expected */
|
||||
DWORD size = 0;
|
||||
UrlUnescapeW(current_url, NULL, &size, URL_UNESCAPE_INPLACE);
|
||||
}
|
||||
|
||||
hres = IMoniker_QueryInterface(mon, &IID_IBinding, (void**)&bind);
|
||||
ok(hres == E_NOINTERFACE, "IMoniker should not have IBinding interface\n");
|
||||
if(SUCCEEDED(hres))
|
||||
|
|
Loading…
Reference in New Issue