Jacek Caban : urlmon: Report error on synchronous bindings that don' t have a cache file and are not read in callback.

Alexandre Julliard julliard at winehq.org
Wed Oct 6 14:04:16 CDT 2010


Module: wine
Branch: master
Commit: 87242c5fb6fcf3996d00d38f009b0bee5404527a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=87242c5fb6fcf3996d00d38f009b0bee5404527a

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct  6 14:10:25 2010 +0200

urlmon: Report error on synchronous bindings that don't have a cache file and are not read in callback.

---

 dlls/urlmon/binding.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c
index 02053b0..49e9ac1 100644
--- a/dlls/urlmon/binding.c
+++ b/dlls/urlmon/binding.c
@@ -76,6 +76,7 @@ typedef enum {
 #define BINDING_LOCKED    0x0001
 #define BINDING_STOPPED   0x0002
 #define BINDING_OBJAVAIL  0x0004
+#define BINDING_ABORTED   0x0008
 
 struct Binding {
     const IBindingVtbl               *lpBindingVtbl;
@@ -682,6 +683,10 @@ static HRESULT stgmed_stream_get_result(stgmed_obj_t *obj, DWORD bindf, void **r
 {
     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));
     *result = STREAM(stream);
     return S_OK;
@@ -1573,8 +1578,10 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
             IInternetProtocol_UnlockRequest(binding->protocol);
 
         hres = binding->stgmed_obj->vtbl->get_result(binding->stgmed_obj, binding->bindf, ppv);
-    }else {
+    }else if(binding->bindf & BINDF_ASYNCHRONOUS) {
         hres = MK_S_ASYNCHRONOUS;
+    }else {
+        hres = FAILED(binding->hres) ? binding->hres : S_OK;
     }
 
     IBinding_Release(BINDING(binding));




More information about the wine-cvs mailing list