msxml3: COM cleanup for the IDispatchEx iface.

This commit is contained in:
Michael Stefaniuc 2011-02-23 23:15:47 +01:00 committed by Alexandre Julliard
parent b92d834d36
commit 16c543a089
2 changed files with 7 additions and 9 deletions

View File

@ -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;
}

View File

@ -144,7 +144,7 @@ typedef struct {
} dispex_static_data_t;
typedef struct {
const IDispatchExVtbl *lpIDispatchExVtbl;
IDispatchEx IDispatchEx_iface;
IUnknown *outer;