Piotr Caban : msxml3: Return parser result in detach_url.
Alexandre Julliard
julliard at winehq.org
Mon Oct 24 13:43:55 CDT 2011
Module: wine
Branch: master
Commit: 41eba1c30ddd4050fa8064a205c84418a3d31859
URL: http://source.winehq.org/git/wine.git/?a=commit;h=41eba1c30ddd4050fa8064a205c84418a3d31859
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Oct 24 12:55:00 2011 +0200
msxml3: Return parser result in detach_url.
---
dlls/msxml3/bsc.c | 11 +++++++++--
dlls/msxml3/domdoc.c | 7 +++++--
dlls/msxml3/msxml_private.h | 2 +-
dlls/msxml3/saxreader.c | 4 +---
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/dlls/msxml3/bsc.c b/dlls/msxml3/bsc.c
index 9a8be97..a0b9022 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 144648e..24df895 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 b9ec423..3e057bb 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 b2c3f25..fe78375 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(
More information about the wine-cvs
mailing list