return S_OK;
}
-#define HTMLIMGFACTORY_THIS(iface) DEFINE_THIS(HTMLImageElementFactory, HTMLImageElementFactory, iface)
+static inline HTMLImageElementFactory *impl_from_IHTMLImageElementFactory(IHTMLImageElementFactory *iface)
+{
+ return CONTAINING_RECORD(iface, HTMLImageElementFactory, IHTMLImageElementFactory_iface);
+}
static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFactory *iface,
REFIID riid, void **ppv)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_Unknown %p)\n", This, ppv);
- *ppv = HTMLIMGFACTORY(This);
+ *ppv = &This->IHTMLImageElementFactory_iface;
}else if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid)) {
TRACE("(%p)->(IID_IHTMLImageElementFactory %p)\n", This, ppv);
- *ppv = HTMLIMGFACTORY(This);
+ *ppv = &This->IHTMLImageElementFactory_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE;
static ULONG WINAPI HTMLImageElementFactory_AddRef(IHTMLImageElementFactory *iface)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *iface)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
static HRESULT WINAPI HTMLImageElementFactory_GetTypeInfoCount(IHTMLImageElementFactory *iface,
UINT *pctinfo)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLImageElementFactory_GetTypeInfo(IHTMLImageElementFactory *iface,
UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL;
}
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
DISPID *rgDispId)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames,
cNames, lcid, rgDispId);
return E_NOTIMPL;
DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return E_NOTIMPL;
static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *iface,
VARIANT width, VARIANT height, IHTMLImgElement **img_elem)
{
- HTMLImageElementFactory *This = HTMLIMGFACTORY_THIS(iface);
+ HTMLImageElementFactory *This = impl_from_IHTMLImageElementFactory(iface);
IHTMLImgElement *img;
HTMLElement *elem;
nsIDOMHTMLElement *nselem;
return S_OK;
}
-#undef HTMLIMGFACTORY_THIS
-
static const IHTMLImageElementFactoryVtbl HTMLImageElementFactoryVtbl = {
HTMLImageElementFactory_QueryInterface,
HTMLImageElementFactory_AddRef,
width = argc >= 1 ? params->rgvarg + (params->cArgs - 1) : ∅
height = argc >= 2 ? params->rgvarg + (params->cArgs - 2) : ∅
- hres = IHTMLImageElementFactory_create(HTMLIMGFACTORY(This), *width, *height, &img);
+ hres = IHTMLImageElementFactory_create(&This->IHTMLImageElementFactory_iface, *width, *height,
+ &img);
if(FAILED(hres))
return hres;
ret = heap_alloc(sizeof(HTMLImageElementFactory));
- ret->lpHTMLImageElementFactoryVtbl = &HTMLImageElementFactoryVtbl;
+ ret->IHTMLImageElementFactory_iface.lpVtbl = &HTMLImageElementFactoryVtbl;
ret->ref = 1;
ret->window = window;
- init_dispex(&ret->dispex, (IUnknown*)HTMLIMGFACTORY(ret), &HTMLImageElementFactory_dispex);
+ init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLImageElementFactory_iface,
+ &HTMLImageElementFactory_dispex);
return ret;
}