Commit 41eba1c3 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Return parser result in detach_url.

parent f8112cc5
......@@ -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;
}
......@@ -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;
......
......@@ -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;
......
......@@ -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(
......
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