mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
mshtml: COM cleanup for the IDispatchEx iface in HTMLWindow.
This commit is contained in:
parent
00eb02711d
commit
2e2f88af90
5 changed files with 47 additions and 41 deletions
|
@ -1636,8 +1636,8 @@ static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID
|
|||
HTMLDocument *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT))
|
||||
return IDispatchEx_InvokeEx(DISPATCHEX(This->window), DISPID_IHTMLWINDOW2_LOCATION, lcid, wFlags,
|
||||
pdp, pvarRes, pei, pspCaller);
|
||||
return IDispatchEx_InvokeEx(&This->window->IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION,
|
||||
lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
||||
|
||||
|
||||
return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
||||
|
|
|
@ -241,7 +241,8 @@ static HRESULT HTMLFrameElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
return IDispatchEx_InvokeEx(DISPATCHEX(This->framebase.content_window), id, lcid, flags, params, res, ei, caller);
|
||||
return IDispatchEx_InvokeEx(&This->framebase.content_window->IDispatchEx_iface, id, lcid,
|
||||
flags, params, res, ei, caller);
|
||||
}
|
||||
|
||||
static HRESULT HTMLFrameElement_bind_to_tree(HTMLDOMNode *iface)
|
||||
|
|
|
@ -212,7 +212,8 @@ static HRESULT HTMLIFrame_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
return IDispatchEx_InvokeEx(DISPATCHEX(This->framebase.content_window), id, lcid, flags, params, res, ei, caller);
|
||||
return IDispatchEx_InvokeEx(&This->framebase.content_window->IDispatchEx_iface, id, lcid,
|
||||
flags, params, res, ei, caller);
|
||||
}
|
||||
|
||||
static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
|
||||
|
|
|
@ -176,7 +176,7 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii
|
|||
*ppv = &This->IHTMLWindow2_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_IHTMLFramesCollection2, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLFramesCollection2 %p)\n", This, ppv);
|
||||
*ppv = &This->IHTMLWindow2_iface;
|
||||
|
@ -279,7 +279,7 @@ static HRESULT WINAPI HTMLWindow2_GetTypeInfoCount(IHTMLWindow2 *iface, UINT *pc
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
|
||||
|
@ -287,7 +287,7 @@ static HRESULT WINAPI HTMLWindow2_GetTypeInfo(IHTMLWindow2 *iface, UINT iTInfo,
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid,
|
||||
|
@ -296,7 +296,8 @@ static HRESULT WINAPI HTMLWindow2_GetIDsOfNames(IHTMLWindow2 *iface, REFIID riid
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
||||
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
||||
rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMember,
|
||||
|
@ -305,8 +306,8 @@ static HRESULT WINAPI HTMLWindow2_Invoke(IHTMLWindow2 *iface, DISPID dispIdMembe
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow2(iface);
|
||||
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
||||
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT get_frame_by_index(nsIDOMWindowCollection *nsFrames, PRUint32 index, HTMLWindow **ret)
|
||||
|
@ -1346,7 +1347,7 @@ static HRESULT WINAPI HTMLWindow3_GetTypeInfoCount(IHTMLWindow3 *iface, UINT *pc
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
|
||||
|
@ -1354,7 +1355,7 @@ static HRESULT WINAPI HTMLWindow3_GetTypeInfo(IHTMLWindow3 *iface, UINT iTInfo,
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid,
|
||||
|
@ -1363,7 +1364,8 @@ static HRESULT WINAPI HTMLWindow3_GetIDsOfNames(IHTMLWindow3 *iface, REFIID riid
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
||||
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
||||
rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMember,
|
||||
|
@ -1372,8 +1374,8 @@ static HRESULT WINAPI HTMLWindow3_Invoke(IHTMLWindow3 *iface, DISPID dispIdMembe
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow3(iface);
|
||||
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
||||
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow3_get_screenLeft(IHTMLWindow3 *iface, LONG *p)
|
||||
|
@ -1563,7 +1565,7 @@ static HRESULT WINAPI HTMLWindow4_GetTypeInfoCount(IHTMLWindow4 *iface, UINT *pc
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow4_GetTypeInfo(IHTMLWindow4 *iface, UINT iTInfo,
|
||||
|
@ -1571,7 +1573,7 @@ static HRESULT WINAPI HTMLWindow4_GetTypeInfo(IHTMLWindow4 *iface, UINT iTInfo,
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
||||
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow4_GetIDsOfNames(IHTMLWindow4 *iface, REFIID riid,
|
||||
|
@ -1580,7 +1582,8 @@ static HRESULT WINAPI HTMLWindow4_GetIDsOfNames(IHTMLWindow4 *iface, REFIID riid
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
||||
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
|
||||
rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow4_Invoke(IHTMLWindow4 *iface, DISPID dispIdMember,
|
||||
|
@ -1589,8 +1592,8 @@ static HRESULT WINAPI HTMLWindow4_Invoke(IHTMLWindow4 *iface, DISPID dispIdMembe
|
|||
{
|
||||
HTMLWindow *This = impl_from_IHTMLWindow4(iface);
|
||||
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
|
||||
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow4_createPopup(IHTMLWindow4 *iface, VARIANT *varArgIn,
|
||||
|
@ -1784,32 +1787,35 @@ static const IHTMLPrivateWindowVtbl HTMLPrivateWindowVtbl = {
|
|||
HTMLPrivateWindow_GetAddressBar
|
||||
};
|
||||
|
||||
#define DISPEX_THIS(iface) DEFINE_THIS(HTMLWindow, IDispatchEx, iface)
|
||||
static inline HTMLWindow *impl_from_IDispatchEx(IDispatchEx *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, HTMLWindow, IDispatchEx_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
return IHTMLWindow2_QueryInterface(&This->IHTMLWindow2_iface, riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI WindowDispEx_AddRef(IDispatchEx *iface)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
return IHTMLWindow2_AddRef(&This->IHTMLWindow2_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI WindowDispEx_Release(IDispatchEx *iface)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
return IHTMLWindow2_Release(&This->IHTMLWindow2_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, pctinfo);
|
||||
|
||||
|
@ -1819,7 +1825,7 @@ static HRESULT WINAPI WindowDispEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pc
|
|||
static HRESULT WINAPI WindowDispEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
|
||||
|
@ -1830,7 +1836,7 @@ static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid
|
|||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
UINT i;
|
||||
HRESULT hres;
|
||||
|
||||
|
@ -1839,7 +1845,7 @@ static HRESULT WINAPI WindowDispEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid
|
|||
|
||||
for(i=0; i < cNames; i++) {
|
||||
/* We shouldn't use script's IDispatchEx here, so we shouldn't use GetDispID */
|
||||
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;
|
||||
}
|
||||
|
@ -1851,7 +1857,7 @@ static HRESULT WINAPI WindowDispEx_Invoke(IDispatchEx *iface, DISPID dispIdMembe
|
|||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
|
@ -1927,7 +1933,7 @@ HRESULT search_window_props(HTMLWindow *This, BSTR bstrName, DWORD grfdex, DISPI
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
|
||||
|
@ -1964,7 +1970,7 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
|
|||
static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
||||
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
||||
|
||||
|
@ -1988,7 +1994,7 @@ static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
|
||||
|
||||
|
@ -1997,7 +2003,7 @@ static HRESULT WINAPI WindowDispEx_DeleteMemberByName(IDispatchEx *iface, BSTR b
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, id);
|
||||
|
||||
|
@ -2006,7 +2012,7 @@ static HRESULT WINAPI WindowDispEx_DeleteMemberByDispID(IDispatchEx *iface, DISP
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
|
||||
|
||||
|
@ -2015,7 +2021,7 @@ static HRESULT WINAPI WindowDispEx_GetMemberProperties(IDispatchEx *iface, DISPI
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%x %p)\n", This, id, pbstrName);
|
||||
|
||||
|
@ -2024,7 +2030,7 @@ static HRESULT WINAPI WindowDispEx_GetMemberName(IDispatchEx *iface, DISPID id,
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
|
||||
|
||||
|
@ -2033,7 +2039,7 @@ static HRESULT WINAPI WindowDispEx_GetNextDispID(IDispatchEx *iface, DWORD grfde
|
|||
|
||||
static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
|
||||
{
|
||||
HTMLWindow *This = DISPEX_THIS(iface);
|
||||
HTMLWindow *This = impl_from_IDispatchEx(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, ppunk);
|
||||
|
||||
|
@ -2041,8 +2047,6 @@ static HRESULT WINAPI WindowDispEx_GetNameSpaceParent(IDispatchEx *iface, IUnkno
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
#undef DISPEX_THIS
|
||||
|
||||
static const IDispatchExVtbl WindowDispExVtbl = {
|
||||
WindowDispEx_QueryInterface,
|
||||
WindowDispEx_AddRef,
|
||||
|
@ -2214,7 +2218,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
|
|||
window->IHTMLWindow3_iface.lpVtbl = &HTMLWindow3Vtbl;
|
||||
window->IHTMLWindow4_iface.lpVtbl = &HTMLWindow4Vtbl;
|
||||
window->IHTMLPrivateWindow_iface.lpVtbl = &HTMLPrivateWindowVtbl;
|
||||
window->lpIDispatchExVtbl = &WindowDispExVtbl;
|
||||
window->IDispatchEx_iface.lpVtbl = &WindowDispExVtbl;
|
||||
window->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
|
||||
window->ref = 1;
|
||||
window->doc_obj = doc_obj;
|
||||
|
|
|
@ -266,7 +266,7 @@ struct HTMLWindow {
|
|||
IHTMLWindow3 IHTMLWindow3_iface;
|
||||
IHTMLWindow4 IHTMLWindow4_iface;
|
||||
IHTMLPrivateWindow IHTMLPrivateWindow_iface;
|
||||
const IDispatchExVtbl *lpIDispatchExVtbl;
|
||||
IDispatchEx IDispatchEx_iface;
|
||||
IServiceProvider IServiceProvider_iface;
|
||||
|
||||
LONG ref;
|
||||
|
|
Loading…
Reference in a new issue