Commit e2bf4ff1 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

urlmon: Implement URLDownloadToCacheFileW.

parent 54afeb02
...@@ -1611,9 +1611,46 @@ HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN lpUnkCaller, LPCSTR szURL, LPST ...@@ -1611,9 +1611,46 @@ HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN lpUnkCaller, LPCSTR szURL, LPST
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName,
DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC) DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
{ {
FIXME("(%p %s %p %ld %ld %p)\n", lpUnkCaller, debugstr_w(szURL), szFileName, WCHAR cache_path[MAX_PATH + 1];
dwBufLength, dwReserved, pBSC); FILETIME expire, modified;
return E_NOTIMPL; HRESULT hr;
LPWSTR ext;
static const WCHAR header[] = {
'H','T','T','P','/','1','.','0',' ','2','0','0',' ',
'O','K','\\','r','\\','n','\\','r','\\','n',0
};
TRACE("(%p, %s, %p, %ld, %ld, %p)\n", lpUnkCaller, debugstr_w(szURL),
szFileName, dwBufLength, dwReserved, pBSC);
if (!szURL || !szFileName)
return E_INVALIDARG;
ext = PathFindExtensionW(szURL);
if (!CreateUrlCacheEntryW(szURL, 0, ext, cache_path, 0))
return E_FAIL;
hr = URLDownloadToFileW(lpUnkCaller, szURL, cache_path, 0, pBSC);
if (FAILED(hr))
return hr;
expire.dwHighDateTime = 0;
expire.dwLowDateTime = 0;
modified.dwHighDateTime = 0;
modified.dwLowDateTime = 0;
if (!CommitUrlCacheEntryW(szURL, cache_path, expire, modified, NORMAL_CACHE_ENTRY,
(LPWSTR)header, sizeof(header), NULL, NULL))
return E_FAIL;
if (lstrlenW(cache_path) > dwBufLength)
return E_OUTOFMEMORY;
lstrcpyW(szFileName, cache_path);
return S_OK;
} }
/*********************************************************************** /***********************************************************************
......
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