Add support for file:/// urls in PathCreateFromUrl.

This commit is contained in:
Diego Pettenò 2004-09-10 21:12:11 +00:00 committed by Alexandre Julliard
parent 66af8b5f60
commit a33ff00133
1 changed files with 7 additions and 2 deletions

View File

@ -3244,7 +3244,7 @@ HRESULT WINAPI PathCreateFromUrlA(LPCSTR lpszUrl, LPSTR lpszPath,
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR lpszUrl, LPWSTR lpszPath, HRESULT WINAPI PathCreateFromUrlW(LPCWSTR lpszUrl, LPWSTR lpszPath,
LPDWORD pcchPath, DWORD dwFlags) LPDWORD pcchPath, DWORD dwFlags)
{ {
static const WCHAR stemp[] = { 'f','i','l','e',':','/','/',0 }; static const WCHAR stemp[] = { 'f','i','l','e',':','/','/','/',0 };
LPWSTR pwszPathPart; LPWSTR pwszPathPart;
HRESULT hr; HRESULT hr;
@ -3253,8 +3253,13 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR lpszUrl, LPWSTR lpszPath,
if (!lpszUrl || !lpszPath || !pcchPath || !*pcchPath) if (!lpszUrl || !lpszPath || !pcchPath || !*pcchPath)
return E_INVALIDARG; return E_INVALIDARG;
/* Path of the form file:///... */
if (!strncmpW(lpszUrl, stemp, 8))
{
lpszUrl += 8;
}
/* Path of the form file://... */ /* Path of the form file://... */
if (!strncmpW(lpszUrl, stemp, 7)) else if (!strncmpW(lpszUrl, stemp, 7))
{ {
lpszUrl += 7; lpszUrl += 7;
} }