Commit 87242c5f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Report error on synchronous bindings that don't have a cache file and…

urlmon: Report error on synchronous bindings that don't have a cache file and are not read in callback.
parent a7852b51
...@@ -76,6 +76,7 @@ typedef enum { ...@@ -76,6 +76,7 @@ typedef enum {
#define BINDING_LOCKED 0x0001 #define BINDING_LOCKED 0x0001
#define BINDING_STOPPED 0x0002 #define BINDING_STOPPED 0x0002
#define BINDING_OBJAVAIL 0x0004 #define BINDING_OBJAVAIL 0x0004
#define BINDING_ABORTED 0x0008
struct Binding { struct Binding {
const IBindingVtbl *lpBindingVtbl; const IBindingVtbl *lpBindingVtbl;
...@@ -682,6 +683,10 @@ static HRESULT stgmed_stream_get_result(stgmed_obj_t *obj, DWORD bindf, void **r ...@@ -682,6 +683,10 @@ static HRESULT stgmed_stream_get_result(stgmed_obj_t *obj, DWORD bindf, void **r
{ {
ProtocolStream *stream = (ProtocolStream*)obj; ProtocolStream *stream = (ProtocolStream*)obj;
if(!(bindf & BINDF_ASYNCHRONOUS) && stream->buf->file == INVALID_HANDLE_VALUE
&& (stream->buf->hres != S_FALSE || stream->buf->size))
return INET_E_DATA_NOT_AVAILABLE;
IStream_AddRef(STREAM(stream)); IStream_AddRef(STREAM(stream));
*result = STREAM(stream); *result = STREAM(stream);
return S_OK; return S_OK;
...@@ -1573,8 +1578,10 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv) ...@@ -1573,8 +1578,10 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
IInternetProtocol_UnlockRequest(binding->protocol); IInternetProtocol_UnlockRequest(binding->protocol);
hres = binding->stgmed_obj->vtbl->get_result(binding->stgmed_obj, binding->bindf, ppv); hres = binding->stgmed_obj->vtbl->get_result(binding->stgmed_obj, binding->bindf, ppv);
}else { }else if(binding->bindf & BINDF_ASYNCHRONOUS) {
hres = MK_S_ASYNCHRONOUS; hres = MK_S_ASYNCHRONOUS;
}else {
hres = FAILED(binding->hres) ? binding->hres : S_OK;
} }
IBinding_Release(BINDING(binding)); IBinding_Release(BINDING(binding));
......
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