Commit 5fd62154 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msxml3: COM cleanup for the IBindStatusCallback iface.

parent 81c91c43
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msxml); WINE_DEFAULT_DEBUG_CHANNEL(msxml);
struct bsc_t { struct bsc_t {
const struct IBindStatusCallbackVtbl *lpVtbl; IBindStatusCallback IBindStatusCallback_iface;
LONG ref; LONG ref;
...@@ -52,7 +52,7 @@ struct bsc_t { ...@@ -52,7 +52,7 @@ struct bsc_t {
static inline bsc_t *impl_from_IBindStatusCallback( IBindStatusCallback *iface ) static inline bsc_t *impl_from_IBindStatusCallback( IBindStatusCallback *iface )
{ {
return (bsc_t *)((char*)iface - FIELD_OFFSET(bsc_t, lpVtbl)); return CONTAINING_RECORD(iface, bsc_t, IBindStatusCallback_iface);
} }
static HRESULT WINAPI bsc_QueryInterface( static HRESULT WINAPI bsc_QueryInterface(
...@@ -269,14 +269,14 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi ...@@ -269,14 +269,14 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi
bsc = heap_alloc(sizeof(bsc_t)); bsc = heap_alloc(sizeof(bsc_t));
bsc->lpVtbl = &bsc_vtbl; bsc->IBindStatusCallback_iface.lpVtbl = &bsc_vtbl;
bsc->ref = 1; bsc->ref = 1;
bsc->obj = obj; bsc->obj = obj;
bsc->onDataAvailable = onDataAvailable; bsc->onDataAvailable = onDataAvailable;
bsc->binding = NULL; bsc->binding = NULL;
bsc->memstream = NULL; bsc->memstream = NULL;
hr = RegisterBindStatusCallback(pbc, (IBindStatusCallback*)&bsc->lpVtbl, NULL, 0); hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
IMoniker *moniker; IMoniker *moniker;
...@@ -295,7 +295,7 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi ...@@ -295,7 +295,7 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi
if(FAILED(hr)) if(FAILED(hr))
{ {
IBindStatusCallback_Release((IBindStatusCallback*)&bsc->lpVtbl); IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface);
bsc = NULL; bsc = NULL;
} }
...@@ -309,5 +309,5 @@ void detach_bsc(bsc_t *bsc) ...@@ -309,5 +309,5 @@ void detach_bsc(bsc_t *bsc)
IBinding_Abort(bsc->binding); IBinding_Abort(bsc->binding);
bsc->obj = NULL; bsc->obj = NULL;
IBindStatusCallback_Release((IBindStatusCallback*)&bsc->lpVtbl); IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface);
} }
...@@ -237,7 +237,7 @@ static HRESULT WINAPI xmldoc_get_URL(IXMLDocument *iface, BSTR *p) ...@@ -237,7 +237,7 @@ static HRESULT WINAPI xmldoc_get_URL(IXMLDocument *iface, BSTR *p)
} }
typedef struct { typedef struct {
const struct IBindStatusCallbackVtbl *lpVtbl; IBindStatusCallback IBindStatusCallback_iface;
} bsc; } bsc;
static HRESULT WINAPI bsc_QueryInterface( static HRESULT WINAPI bsc_QueryInterface(
...@@ -352,7 +352,7 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl = ...@@ -352,7 +352,7 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl =
bsc_OnObjectAvailable bsc_OnObjectAvailable
}; };
static bsc xmldoc_bsc = { &bsc_vtbl }; static bsc xmldoc_bsc = { { &bsc_vtbl } };
static HRESULT WINAPI xmldoc_put_URL(IXMLDocument *iface, BSTR p) static HRESULT WINAPI xmldoc_put_URL(IXMLDocument *iface, BSTR p)
{ {
...@@ -392,7 +392,7 @@ static HRESULT WINAPI xmldoc_put_URL(IXMLDocument *iface, BSTR p) ...@@ -392,7 +392,7 @@ static HRESULT WINAPI xmldoc_put_URL(IXMLDocument *iface, BSTR p)
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
CreateAsyncBindCtx(0, (IBindStatusCallback *)&xmldoc_bsc, 0, &bctx); CreateAsyncBindCtx(0, &xmldoc_bsc.IBindStatusCallback_iface, 0, &bctx);
hr = IMoniker_BindToStorage(moniker, bctx, NULL, &IID_IStream, (LPVOID *)&stream); hr = IMoniker_BindToStorage(moniker, bctx, NULL, &IID_IStream, (LPVOID *)&stream);
IBindCtx_Release(bctx); IBindCtx_Release(bctx);
......
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