diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 6bc28ac2591..4ec9490760c 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -1608,6 +1608,51 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, return S_OK; } +/*********************************************************************** + * URLDownloadToCacheFileA (URLMON.@) + */ +HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN lpUnkCaller, LPCSTR szURL, LPSTR szFileName, + DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC) +{ + LPWSTR url = NULL, file_name = NULL; + int len; + HRESULT hres; + + TRACE("(%p %s %p %ld %ld %p)\n", lpUnkCaller, debugstr_a(szURL), szFileName, + dwBufLength, dwReserved, pBSC); + + if(szURL) { + len = MultiByteToWideChar(CP_ACP, 0, szURL, -1, NULL, 0); + url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, szURL, -1, url, -1); + } + + if(szFileName) + file_name = HeapAlloc(GetProcessHeap(), 0, dwBufLength*sizeof(WCHAR)); + + hres = URLDownloadToCacheFileW(lpUnkCaller, url, file_name, dwBufLength*sizeof(WCHAR), + dwReserved, pBSC); + + if(SUCCEEDED(hres) && file_name) + WideCharToMultiByte(CP_ACP, 0, file_name, -1, szFileName, dwBufLength, NULL, NULL); + + HeapFree(GetProcessHeap(), 0, url); + HeapFree(GetProcessHeap(), 0, file_name); + + return hres; +} + +/*********************************************************************** + * URLDownloadToCacheFileW (URLMON.@) + */ +HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, + DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC) +{ + FIXME("(%p %s %p %ld %ld %p)\n", lpUnkCaller, debugstr_w(szURL), szFileName, + dwBufLength, dwReserved, pBSC); + return E_NOTIMPL; +} + /*********************************************************************** * HlinkSimpleNavigateToString (URLMON.@) */ diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec index 143c180114b..3399edbbd2f 100644 --- a/dlls/urlmon/urlmon.spec +++ b/dlls/urlmon/urlmon.spec @@ -64,8 +64,8 @@ @ stdcall RevokeFormatEnumerator(ptr ptr) @ stub SetSoftwareUpdateAdvertisementState @ stub URLDownloadA -@ stub URLDownloadToCacheFileA -@ stub URLDownloadToCacheFileW +@ stdcall URLDownloadToCacheFileA(ptr str str long ptr) +@ stdcall URLDownloadToCacheFileW(ptr wstr wstr long ptr) @ stdcall URLDownloadToFileA(ptr str str long ptr) @ stdcall URLDownloadToFileW(ptr wstr wstr long ptr) @ stub URLDownloadW diff --git a/include/urlmon.idl b/include/urlmon.idl index a2d4ead4399..1fa8b4fa3d8 100644 --- a/include/urlmon.idl +++ b/include/urlmon.idl @@ -1166,8 +1166,10 @@ cpp_quote("HRESULT WINAPI CoGetClassObjectFromURL(REFCLSID, LPCWSTR, DWORD, DWOR cpp_quote("HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk);") cpp_quote("HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbsc, DWORD dwReserved);") cpp_quote("HRESULT WINAPI CompareSecurityIds(BYTE*,DWORD,BYTE*,DWORD,DWORD);") -cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN pCaller, LPCSTR szURL, LPCSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);") -cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);") +cpp_quote("HRESULT WINAPI URLDownloadToFileA(LPUNKNOWN,LPCSTR,LPCSTR,DWORD,LPBINDSTATUSCALLBACK);") +cpp_quote("HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN,LPCWSTR,LPCWSTR,DWORD,LPBINDSTATUSCALLBACK);") +cpp_quote("HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN,LPCSTR,LPSTR,DWORD,DWORD,LPBINDSTATUSCALLBACK);") +cpp_quote("HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN,LPCWSTR,LPWSTR,DWORD,DWORD,LPBINDSTATUSCALLBACK);") cpp_quote("HRESULT WINAPI CoInternetGetSession(DWORD,IInternetSession**,DWORD);") cpp_quote("HRESULT WINAPI MkParseDisplayNameEx(IBindCtx*,LPCWSTR,ULONG*,IMoniker**);") cpp_quote("HRESULT WINAPI IsAsyncMoniker(IMoniker* pmk);")