urlmon: Added BINDSTATUS_CACHEFILENAMEAVAILABLE support.

This commit is contained in:
Jacek Caban 2008-01-31 18:17:18 +01:00 committed by Alexandre Julliard
parent e9189df9a6
commit 458d27fa46
1 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,8 @@ typedef struct {
DWORD size;
BOOL init;
HRESULT hres;
LPWSTR cache_file;
} stgmed_buf_t;
typedef struct _stgmed_obj_t stgmed_obj_t;
@ -513,6 +515,7 @@ static ULONG WINAPI StgMedUnk_Release(IUnknown *iface)
if(!ref) {
IInternetProtocol_Release(This->protocol);
heap_free(This->cache_file);
heap_free(This);
URLMON_UnlockModule();
@ -538,6 +541,7 @@ static stgmed_buf_t *create_stgmed_buf(IInternetProtocol *protocol)
ret->size = 0;
ret->init = FALSE;
ret->hres = S_OK;
ret->cache_file = NULL;
IInternetProtocol_AddRef(protocol);
ret->protocol = protocol;
@ -1099,6 +1103,8 @@ static HRESULT WINAPI InternetProtocolSink_ReportProgress(IInternetProtocolSink
mime_available(This, szStatusText, FALSE);
break;
case BINDSTATUS_CACHEFILENAMEAVAILABLE:
heap_free(This->stgmed_buf->cache_file);
This->stgmed_buf->cache_file = heap_strdupW(szStatusText);
break;
case BINDSTATUS_DIRECTBIND:
This->report_mime = FALSE;
@ -1134,6 +1140,10 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
sent_begindownloaddata = TRUE;
IBindStatusCallback_OnProgress(This->callback, progress, progress_max,
BINDSTATUS_BEGINDOWNLOADDATA, This->url);
if(This->stgmed_buf->cache_file)
IBindStatusCallback_OnProgress(This->callback, progress, progress_max,
BINDSTATUS_CACHEFILENAMEAVAILABLE, This->stgmed_buf->cache_file);
}
if(This->stgmed_buf->hres == S_FALSE || (bscf & BSCF_LASTDATANOTIFICATION)) {