Commit daca693f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Don't pass query part of URL to CreateUrlCacheEntryW.

parent f00670df
...@@ -49,32 +49,30 @@ HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, ...@@ -49,32 +49,30 @@ HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL,
{ {
IUMCacheStream* ucstr; IUMCacheStream* ucstr;
HANDLE handle; HANDLE handle;
LPWSTR ext; DWORD size;
LPCWSTR c; LPWSTR url, c, ext = NULL;
LPCWSTR eloc = 0;
HRESULT hr; HRESULT hr;
for (c = pszURL; *c && *c != '#' && *c != '?'; ++c) size = (strlenW(pszURL)+1)*sizeof(WCHAR);
url = HeapAlloc(GetProcessHeap(), 0, size);
memcpy(url, pszURL, size);
for (c = url; *c && *c != '#' && *c != '?'; ++c)
{ {
if (*c == '.') if (*c == '.')
eloc = c + 1; ext = c+1;
else if (*c == '/' || *c == '\\') else if(*c == '/')
eloc = 0; ext = NULL;
} }
if (!eloc) *c = 0;
eloc = c;
ext = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (c - eloc + 1));
memcpy(ext, eloc, sizeof(WCHAR) * (c - eloc));
ext[c - eloc] = 0;
if(!CreateUrlCacheEntryW(pszURL, dwSize, ext, pszFileName, 0)) if(!CreateUrlCacheEntryW(url, dwSize, ext, pszFileName, 0))
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
else else
hr = 0; hr = 0;
HeapFree(GetProcessHeap(), 0, ext); HeapFree(GetProcessHeap(), 0, url);
if (hr) if (hr)
return hr; return hr;
......
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