From 5fd62154f3be23508234f4284fdefa5524dba0f8 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Mon, 24 Jan 2011 00:08:15 +0100 Subject: [PATCH] msxml3: COM cleanup for the IBindStatusCallback iface. --- dlls/msxml3/bsc.c | 12 ++++++------ dlls/msxml3/xmldoc.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/msxml3/bsc.c b/dlls/msxml3/bsc.c index 020a6e58389..5e83ca088d0 100644 --- a/dlls/msxml3/bsc.c +++ b/dlls/msxml3/bsc.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); struct bsc_t { - const struct IBindStatusCallbackVtbl *lpVtbl; + IBindStatusCallback IBindStatusCallback_iface; LONG ref; @@ -52,7 +52,7 @@ struct bsc_t { 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( @@ -269,14 +269,14 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi bsc = heap_alloc(sizeof(bsc_t)); - bsc->lpVtbl = &bsc_vtbl; + bsc->IBindStatusCallback_iface.lpVtbl = &bsc_vtbl; bsc->ref = 1; bsc->obj = obj; bsc->onDataAvailable = onDataAvailable; bsc->binding = NULL; bsc->memstream = NULL; - hr = RegisterBindStatusCallback(pbc, (IBindStatusCallback*)&bsc->lpVtbl, NULL, 0); + hr = RegisterBindStatusCallback(pbc, &bsc->IBindStatusCallback_iface, NULL, 0); if(SUCCEEDED(hr)) { IMoniker *moniker; @@ -295,7 +295,7 @@ HRESULT bind_url(LPCWSTR url, HRESULT (*onDataAvailable)(void*,char*,DWORD), voi if(FAILED(hr)) { - IBindStatusCallback_Release((IBindStatusCallback*)&bsc->lpVtbl); + IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); bsc = NULL; } @@ -309,5 +309,5 @@ void detach_bsc(bsc_t *bsc) IBinding_Abort(bsc->binding); bsc->obj = NULL; - IBindStatusCallback_Release((IBindStatusCallback*)&bsc->lpVtbl); + IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); } diff --git a/dlls/msxml3/xmldoc.c b/dlls/msxml3/xmldoc.c index b1488b89464..9165346d7f1 100644 --- a/dlls/msxml3/xmldoc.c +++ b/dlls/msxml3/xmldoc.c @@ -237,7 +237,7 @@ static HRESULT WINAPI xmldoc_get_URL(IXMLDocument *iface, BSTR *p) } typedef struct { - const struct IBindStatusCallbackVtbl *lpVtbl; + IBindStatusCallback IBindStatusCallback_iface; } bsc; static HRESULT WINAPI bsc_QueryInterface( @@ -352,7 +352,7 @@ static const struct IBindStatusCallbackVtbl bsc_vtbl = bsc_OnObjectAvailable }; -static bsc xmldoc_bsc = { &bsc_vtbl }; +static bsc xmldoc_bsc = { { &bsc_vtbl } }; 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)) 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); IBindCtx_Release(bctx);