diff --git a/dlls/msxml3/dispex.c b/dlls/msxml3/dispex.c index 1b8afb58d2a..392d8569fa7 100644 --- a/dlls/msxml3/dispex.c +++ b/dlls/msxml3/dispex.c @@ -40,8 +40,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); -#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl) - typedef struct { DISPID id; BSTR name; @@ -306,7 +304,7 @@ static inline BOOL is_dynamic_dispid(DISPID id) static inline DispatchEx *impl_from_IDispatchEx(IDispatchEx *iface) { - return (DispatchEx*)((char*)iface - FIELD_OFFSET(DispatchEx, lpIDispatchExVtbl)); + return CONTAINING_RECORD(iface, DispatchEx, IDispatchEx_iface); } static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -362,7 +360,7 @@ static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, lcid, rgDispId); for(i=0; i < cNames; i++) { - hres = IDispatchEx_GetDispID(DISPATCHEX(This), rgszNames[i], 0, rgDispId+i); + hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[i], 0, rgDispId+i); if(FAILED(hres)) return hres; } @@ -379,7 +377,7 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - return IDispatchEx_InvokeEx(DISPATCHEX(This), dispIdMember, lcid, wFlags, + return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL); } @@ -630,10 +628,10 @@ BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv) if(IsEqualGUID(&IID_IDispatch, riid)) { TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); - *ppv = DISPATCHEX(This); + *ppv = &This->IDispatchEx_iface; }else if(IsEqualGUID(&IID_IDispatchEx, riid)) { TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv); - *ppv = DISPATCHEX(This); + *ppv = &This->IDispatchEx_iface; }else if(IsEqualGUID(&IID_UndocumentedScriptIface, riid)) { TRACE("(%p)->(IID_UndocumentedScriptIface %p) returning NULL\n", This, ppv); *ppv = NULL; @@ -651,7 +649,7 @@ BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv) void init_dispex(DispatchEx *dispex, IUnknown *outer, dispex_static_data_t *data) { - dispex->lpIDispatchExVtbl = &DispatchExVtbl; + dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; dispex->outer = outer; dispex->data = data; } diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 65e10bfc486..2687324720f 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -144,7 +144,7 @@ typedef struct { } dispex_static_data_t; typedef struct { - const IDispatchExVtbl *lpIDispatchExVtbl; + IDispatchEx IDispatchEx_iface; IUnknown *outer;