Commit 3efe4e68 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Correctly handle file URLs with '|' instead of ':' after drive letter.

parent ad0e82e1
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment