mshtml: Add DispatchEx support to HTMLImageElementFactory.
This commit is contained in:
parent
9c53e8d935
commit
90029d3429
|
@ -128,6 +128,7 @@ static REFIID tid_ids[] = {
|
|||
&IID_IHTMLFrameBase,
|
||||
&IID_IHTMLFrameBase2,
|
||||
&IID_IHTMLGenericElement,
|
||||
&IID_IHTMLImageElementFactory,
|
||||
&IID_IHTMLImgElement,
|
||||
&IID_IHTMLInputElement,
|
||||
&IID_IHTMLLocation,
|
||||
|
|
|
@ -624,13 +624,11 @@ static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFa
|
|||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_Unknown %p)\n", This, ppv);
|
||||
*ppv = HTMLIMGFACTORY(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = HTMLIMGFACTORY(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLImageElementFactory %p)\n", This, ppv);
|
||||
*ppv = HTMLIMGFACTORY(This);
|
||||
}
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv))
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
|
||||
if(*ppv) {
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
|
@ -758,6 +756,18 @@ static const IHTMLImageElementFactoryVtbl HTMLImageElementFactoryVtbl = {
|
|||
HTMLImageElementFactory_create
|
||||
};
|
||||
|
||||
static const tid_t HTMLImageElementFactory_iface_tids[] = {
|
||||
IHTMLImageElementFactory_tid,
|
||||
0
|
||||
};
|
||||
|
||||
static dispex_static_data_t HTMLImageElementFactory_dispex = {
|
||||
NULL,
|
||||
IHTMLImageElementFactory_tid,
|
||||
NULL,
|
||||
HTMLImageElementFactory_iface_tids
|
||||
};
|
||||
|
||||
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
|
||||
{
|
||||
HTMLImageElementFactory *ret;
|
||||
|
@ -768,5 +778,7 @@ HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
|
|||
ret->ref = 1;
|
||||
ret->window = window;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLIMGFACTORY(ret), &HTMLImageElementFactory_dispex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -104,6 +104,7 @@ typedef enum {
|
|||
IHTMLFrameBase_tid,
|
||||
IHTMLFrameBase2_tid,
|
||||
IHTMLGenericElement_tid,
|
||||
IHTMLImageElementFactory_tid,
|
||||
IHTMLImgElement_tid,
|
||||
IHTMLInputElement_tid,
|
||||
IHTMLLocation_tid,
|
||||
|
@ -182,6 +183,7 @@ typedef struct {
|
|||
} HTMLOptionElementFactory;
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
const IHTMLImageElementFactoryVtbl *lpHTMLImageElementFactoryVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
|
|
@ -342,6 +342,14 @@ static const IID * const cstyle_iids[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static const IID * const img_factory_iids[] = {
|
||||
&IID_IUnknown,
|
||||
&IID_IDispatch,
|
||||
&IID_IDispatchEx,
|
||||
&IID_IHTMLImageElementFactory,
|
||||
NULL
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char *tag;
|
||||
REFIID *iids;
|
||||
|
@ -1118,6 +1126,9 @@ static IHTMLImgElement *_create_img_elem(unsigned line, IHTMLDocument2 *doc,
|
|||
IHTMLWindow2_Release(window);
|
||||
ok_(__FILE__,line) (hres == S_OK, "get_Image failed: %08x\n", hres);
|
||||
|
||||
test_ifaces((IUnknown*)factory, img_factory_iids);
|
||||
test_disp((IUnknown*)factory, &IID_IHTMLImageElementFactory, "[object]");
|
||||
|
||||
if(wdth >= 0){
|
||||
snprintf(buf, 16, "%d", wdth);
|
||||
V_VT(&width) = VT_BSTR;
|
||||
|
|
Loading…
Reference in New Issue