mirror of
https://github.com/reactos/wine.git
synced 2025-02-17 19:39:00 +00:00
urlmon: Correctly handle file URLs with '|' instead of ':' after drive letter.
This commit is contained in:
parent
ad0e82e136
commit
3efe4e6837
@ -154,6 +154,9 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
|
||||
}
|
||||
}
|
||||
|
||||
if(file_name[1] == '|')
|
||||
file_name[1] = ':';
|
||||
|
||||
This->file = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "winbase.h"
|
||||
#include "ole2.h"
|
||||
#include "urlmon.h"
|
||||
#include "wininet.h"
|
||||
|
||||
#include "initguid.h"
|
||||
|
||||
@ -1387,7 +1388,7 @@ static void test_file_protocol_fail(void)
|
||||
}
|
||||
|
||||
static void test_file_protocol(void) {
|
||||
WCHAR buf[MAX_PATH];
|
||||
WCHAR buf[INTERNET_MAX_URL_LENGTH], file_name_buf[MAX_PATH];
|
||||
DWORD size;
|
||||
ULONG len;
|
||||
HANDLE file;
|
||||
@ -1429,17 +1430,19 @@ static void test_file_protocol(void) {
|
||||
test_file_protocol_url(buf);
|
||||
|
||||
memcpy(buf, wszFile2, sizeof(wszFile2));
|
||||
len = sizeof(wszFile2)/sizeof(WCHAR)-1;
|
||||
len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len);
|
||||
buf[len++] = '\\';
|
||||
memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml));
|
||||
|
||||
file_name = buf + sizeof(wszFile2)/sizeof(WCHAR)-1;
|
||||
len = GetCurrentDirectoryW(sizeof(file_name_buf)/sizeof(WCHAR), file_name_buf);
|
||||
file_name_buf[len++] = '\\';
|
||||
memcpy(file_name_buf+len, wszIndexHtml, sizeof(wszIndexHtml));
|
||||
lstrcpyW(buf+sizeof(wszFile2)/sizeof(WCHAR)-1, file_name_buf);
|
||||
file_name = file_name_buf;
|
||||
bindf = 0;
|
||||
test_file_protocol_url(buf);
|
||||
bindf = BINDF_FROMURLMON;
|
||||
test_file_protocol_url(buf);
|
||||
|
||||
buf[sizeof(wszFile2)/sizeof(WCHAR)] = '|';
|
||||
test_file_protocol_url(buf);
|
||||
|
||||
memcpy(buf, wszFile3, sizeof(wszFile3));
|
||||
len = sizeof(wszFile3)/sizeof(WCHAR)-1;
|
||||
len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user