diff --git a/dlls/msxml3/bsc.c b/dlls/msxml3/bsc.c index 9a8be97c9ca..a0b902220c4 100644 --- a/dlls/msxml3/bsc.c +++ b/dlls/msxml3/bsc.c @@ -53,6 +53,7 @@ struct bsc_t { IBinding *binding; IStream *memstream; + HRESULT hres; }; static inline bsc_t *impl_from_IBindStatusCallback( IBindStatusCallback *iface ) @@ -173,7 +174,7 @@ static HRESULT WINAPI bsc_OnStopBinding( DWORD len = GlobalSize(hglobal); char *ptr = GlobalLock(hglobal); - hr = This->onDataAvailable(This->obj, ptr, len); + This->hres = hr = This->onDataAvailable(This->obj, ptr, len); GlobalUnlock(hglobal); } @@ -281,6 +282,7 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi bsc->onDataAvailable = onDataAvailable; bsc->binding = NULL; bsc->memstream = NULL; + bsc->hres = S_OK; hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0); if(SUCCEEDED(hr)) @@ -309,11 +311,16 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi return hr; } -void detach_bsc(bsc_t *bsc) +HRESULT detach_bsc(bsc_t *bsc) { + HRESULT hres; + if(bsc->binding) IBinding_Abort(bsc->binding); bsc->obj = NULL; + hres = bsc->hres; IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); + + return hres; } diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 144648eb0fb..24df8958a71 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2075,8 +2075,11 @@ static HRESULT doread( domdoc *This, LPWSTR filename ) if(FAILED(hr)) return hr; - if(This->bsc) - detach_bsc(This->bsc); + if(This->bsc) { + hr = detach_bsc(This->bsc); + if(FAILED(hr)) + return hr; + } This->bsc = bsc; return S_OK; diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index b9ec42357cf..3e057bb1f4f 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -467,7 +467,7 @@ static inline const CLSID* SchemaCache_version(MSXML_VERSION v) typedef struct bsc_t bsc_t; HRESULT bind_url(LPCWSTR, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN; -void detach_bsc(bsc_t*) DECLSPEC_HIDDEN; +HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN; const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index b2c3f25d5a0..fe78375139e 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -2298,9 +2298,7 @@ static HRESULT internal_parseURL( if(FAILED(hr)) return hr; - detach_bsc(bsc); - - return S_OK; + return detach_bsc(bsc); } static HRESULT internal_putProperty(