mshtml: Added support for custom DISPIDs.
This commit is contained in:
parent
96fdb0e742
commit
ef4200fcf7
|
@ -277,6 +277,11 @@ void call_disp_func(HTMLDocument *doc, IDispatch *disp)
|
|||
VariantClear(&res);
|
||||
}
|
||||
|
||||
static inline BOOL is_custom_dispid(DISPID id)
|
||||
{
|
||||
return MSHTML_DISPID_CUSTOM_MIN <= id && id <= MSHTML_DISPID_CUSTOM_MAX;
|
||||
}
|
||||
|
||||
#define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
|
||||
|
||||
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
|
@ -395,6 +400,14 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
|
|||
min = n+1;
|
||||
}
|
||||
|
||||
if(This->data->vtbl && This->data->vtbl->get_dispid) {
|
||||
HRESULT hres;
|
||||
|
||||
hres = This->data->vtbl->get_dispid(This->outer, bstrName, grfdex, pid);
|
||||
if(hres != DISP_E_UNKNOWNNAME)
|
||||
return hres;
|
||||
}
|
||||
|
||||
TRACE("not found %s\n", debugstr_w(bstrName));
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
}
|
||||
|
@ -412,6 +425,9 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
|
|||
|
||||
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
||||
|
||||
if(is_custom_dispid(id) && This->data->vtbl && This->data->vtbl->invoke)
|
||||
return This->data->vtbl->invoke(This->outer, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
||||
|
||||
if(wFlags == DISPATCH_CONSTRUCT) {
|
||||
FIXME("DISPATCH_CONSTRUCT not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
|
|
|
@ -1491,6 +1491,7 @@ static const IDispatchExVtbl DocDispatchExVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t HTMLDocument_dispex = {
|
||||
NULL,
|
||||
DispHTMLDocument_tid,
|
||||
NULL,
|
||||
{
|
||||
|
|
|
@ -1283,6 +1283,7 @@ static const NodeImplVtbl HTMLElementImplVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t HTMLElement_dispex = {
|
||||
NULL,
|
||||
DispHTMLUnknownElement_tid,
|
||||
NULL,
|
||||
{
|
||||
|
@ -1669,6 +1670,7 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t HTMLElementCollection_dispex = {
|
||||
NULL,
|
||||
DispHTMLElementCollection_tid,
|
||||
NULL,
|
||||
{
|
||||
|
|
|
@ -186,6 +186,7 @@ static const NodeImplVtbl HTMLDOMTextNodeImplVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t HTMLDOMTextNode_dispex = {
|
||||
NULL,
|
||||
DispHTMLDOMTextNode_tid,
|
||||
0,
|
||||
{
|
||||
|
|
|
@ -1108,6 +1108,7 @@ static const IDispatchExVtbl WindowDispExVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t HTMLWindow_dispex = {
|
||||
NULL,
|
||||
DispHTMLWindow2_tid,
|
||||
NULL,
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2005-2006 Jacek Caban for CodeWeavers
|
||||
* Copyright 2005-2008 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -84,7 +84,16 @@ typedef enum {
|
|||
|
||||
typedef struct dispex_data_t dispex_data_t;
|
||||
|
||||
#define MSHTML_DISPID_CUSTOM_MIN 0x60000000
|
||||
#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
|
||||
|
||||
typedef struct {
|
||||
HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*);
|
||||
HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
|
||||
} dispex_static_data_vtbl_t;
|
||||
|
||||
typedef struct {
|
||||
const dispex_static_data_vtbl_t *vtbl;
|
||||
const tid_t disp_tid;
|
||||
dispex_data_t *data;
|
||||
const tid_t iface_tids[];
|
||||
|
|
|
@ -301,6 +301,7 @@ static const IOmNavigatorVtbl OmNavigatorVtbl = {
|
|||
};
|
||||
|
||||
static dispex_static_data_t OmNavigator_dispex = {
|
||||
NULL,
|
||||
IOmNavigator_tid,
|
||||
NULL,
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue