mshtml: Use an iface instead of a vtbl pointer in HTMLGenericElement.

This commit is contained in:
Michael Stefaniuc 2010-12-06 23:31:29 +01:00 committed by Alexandre Julliard
parent 407a02d7eb
commit 5a506d707a
1 changed files with 16 additions and 15 deletions

View File

@ -35,51 +35,52 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct { typedef struct {
HTMLElement element; HTMLElement element;
const IHTMLGenericElementVtbl *lpHTMLGenericElementVtbl; IHTMLGenericElement IHTMLGenericElement_iface;
} HTMLGenericElement; } HTMLGenericElement;
#define HTMLGENERIC(x) (&(x)->lpHTMLGenericElementVtbl) static inline HTMLGenericElement *impl_from_IHTMLGenericElement(IHTMLGenericElement *iface)
{
#define HTMLGENERIC_THIS(iface) DEFINE_THIS(HTMLGenericElement, HTMLGenericElement, iface) return CONTAINING_RECORD(iface, HTMLGenericElement, IHTMLGenericElement_iface);
}
static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv) static HRESULT WINAPI HTMLGenericElement_QueryInterface(IHTMLGenericElement *iface, REFIID riid, void **ppv)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv); return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
} }
static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface) static ULONG WINAPI HTMLGenericElement_AddRef(IHTMLGenericElement *iface)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
} }
static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface) static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
} }
static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo) static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo); return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
} }
static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo, static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ppTInfo)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo); return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
} }
static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid, static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId); return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
} }
@ -87,14 +88,14 @@ static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISP
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams, return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr); pVarResult, pExcepInfo, puArgErr);
} }
static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p) static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -102,7 +103,7 @@ static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *ifac
static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface, static HRESULT WINAPI HTMLGenericElement_namedRecordset(IHTMLGenericElement *iface,
BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset) BSTR dataMember, VARIANT *hierarchy, IDispatch **ppRecordset)
{ {
HTMLGenericElement *This = HTMLGENERIC_THIS(iface); HTMLGenericElement *This = impl_from_IHTMLGenericElement(iface);
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset); FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -129,7 +130,7 @@ static HRESULT HTMLGenericElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv
if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) { if(IsEqualGUID(&IID_IHTMLGenericElement, riid)) {
TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLGenericElement %p)\n", This, ppv);
*ppv = HTMLGENERIC(This); *ppv = &This->IHTMLGenericElement_iface;
}else { }else {
return HTMLElement_QI(&This->element.node, riid, ppv); return HTMLElement_QI(&This->element.node, riid, ppv);
} }
@ -174,7 +175,7 @@ HRESULT HTMLGenericElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsel
if(!ret) if(!ret)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl; ret->IHTMLGenericElement_iface.lpVtbl = &HTMLGenericElementVtbl;
ret->element.node.vtbl = &HTMLGenericElementImplVtbl; ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex); HTMLElement_Init(&ret->element, doc, nselem, &HTMLGenericElement_dispex);