shdocvw: Get rid of remaining *_THIS macros.

This commit is contained in:
Jacek Caban 2010-11-13 17:48:34 +01:00 committed by Alexandre Julliard
parent 2450a2d834
commit 7aa159275f
7 changed files with 81 additions and 80 deletions

View File

@ -220,8 +220,8 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
lprcClipRect, lpFrameInfo); lprcClipRect, lpFrameInfo);
IOleInPlaceFrame_AddRef(INPLACEFRAME(This)); IOleInPlaceFrame_AddRef(&This->IOleInPlaceFrame_iface);
*ppFrame = INPLACEFRAME(This); *ppFrame = &This->IOleInPlaceFrame_iface;
*ppDoc = NULL; *ppDoc = NULL;
GetClientRect(This->hwnd, lprcPosRect); GetClientRect(This->hwnd, lprcPosRect);

View File

@ -29,7 +29,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
struct ConnectionPoint { struct ConnectionPoint {
const IConnectionPointVtbl *lpConnectionPointVtbl; IConnectionPoint IConnectionPoint_iface;
IConnectionPointContainer *container; IConnectionPointContainer *container;
@ -39,37 +39,38 @@ struct ConnectionPoint {
IID iid; IID iid;
}; };
#define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
/********************************************************************** /**********************************************************************
* Implement the IConnectionPointContainer interface * Implement the IConnectionPointContainer interface
*/ */
#define CONPTCONT_THIS(iface) DEFINE_THIS(ConnectionPointContainer, ConnectionPointContainer, iface) static inline ConnectionPointContainer *impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
{
return (ConnectionPointContainer*)((char*)iface - FIELD_OFFSET(ConnectionPointContainer, IConnectionPointContainer_iface));
}
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface,
REFIID riid, LPVOID *ppv) REFIID riid, LPVOID *ppv)
{ {
ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPointContainer *This = impl_from_IConnectionPointContainer(iface);
return IUnknown_QueryInterface(This->impl, riid, ppv); return IUnknown_QueryInterface(This->impl, riid, ppv);
} }
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface) static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
{ {
ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPointContainer *This = impl_from_IConnectionPointContainer(iface);
return IUnknown_AddRef(This->impl); return IUnknown_AddRef(This->impl);
} }
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface) static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
{ {
ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPointContainer *This = impl_from_IConnectionPointContainer(iface);
return IUnknown_Release(This->impl); return IUnknown_Release(This->impl);
} }
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface,
LPENUMCONNECTIONPOINTS *ppEnum) LPENUMCONNECTIONPOINTS *ppEnum)
{ {
ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPointContainer *This = impl_from_IConnectionPointContainer(iface);
FIXME("(%p)->(%p)\n", This, ppEnum); FIXME("(%p)->(%p)\n", This, ppEnum);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -77,7 +78,7 @@ static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionP
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface,
REFIID riid, LPCONNECTIONPOINT *ppCP) REFIID riid, LPCONNECTIONPOINT *ppCP)
{ {
ConnectionPointContainer *This = CONPTCONT_THIS(iface); ConnectionPointContainer *This = impl_from_IConnectionPointContainer(iface);
if(!ppCP) { if(!ppCP) {
WARN("ppCP == NULL\n"); WARN("ppCP == NULL\n");
@ -88,13 +89,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) { if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) {
TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP); TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP);
*ppCP = CONPOINT(This->wbe2); *ppCP = &This->wbe2->IConnectionPoint_iface;
}else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) { }else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) {
TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP); TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP);
*ppCP = CONPOINT(This->wbe); *ppCP = &This->wbe->IConnectionPoint_iface;
}else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) { }else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP); TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP);
*ppCP = CONPOINT(This->pns); *ppCP = &This->pns->IConnectionPoint_iface;
} }
if(*ppCP) { if(*ppCP) {
@ -106,7 +107,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
return CONNECT_E_NOCONNECTION; return CONNECT_E_NOCONNECTION;
} }
#undef CONPTCONT_THIS #undef impl_from_IConnectionPointContainer
static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl =
{ {
@ -122,21 +123,24 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl =
* Implement the IConnectionPoint interface * Implement the IConnectionPoint interface
*/ */
#define CONPOINT_THIS(iface) DEFINE_THIS(ConnectionPoint, ConnectionPoint, iface) static inline ConnectionPoint *impl_from_IConnectionPoint(IConnectionPoint *iface)
{
return (ConnectionPoint*)((char*)iface - FIELD_OFFSET(ConnectionPoint, IConnectionPoint_iface));
}
static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
REFIID riid, LPVOID *ppv) REFIID riid, LPVOID *ppv)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
*ppv = NULL; *ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = CONPOINT(This); *ppv = &This->IConnectionPoint_iface;
}else if(IsEqualGUID(&IID_IConnectionPoint, riid)) { }else if(IsEqualGUID(&IID_IConnectionPoint, riid)) {
TRACE("(%p)->(IID_IConnectionPoint %p)\n", This, ppv); TRACE("(%p)->(IID_IConnectionPoint %p)\n", This, ppv);
*ppv = CONPOINT(This); *ppv = &This->IConnectionPoint_iface;
} }
if(*ppv) { if(*ppv) {
@ -150,19 +154,19 @@ static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface) static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
return IConnectionPointContainer_AddRef(This->container); return IConnectionPointContainer_AddRef(This->container);
} }
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface) static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
return IConnectionPointContainer_Release(This->container); return IConnectionPointContainer_Release(This->container);
} }
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID) static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
TRACE("(%p)->(%p)\n", This, pIID); TRACE("(%p)->(%p)\n", This, pIID);
@ -173,7 +177,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *i
static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface,
IConnectionPointContainer **ppCPC) IConnectionPointContainer **ppCPC)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
TRACE("(%p)->(%p)\n", This, ppCPC); TRACE("(%p)->(%p)\n", This, ppCPC);
@ -185,7 +189,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoi
static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink,
DWORD *pdwCookie) DWORD *pdwCookie)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
IDispatch *disp; IDispatch *disp;
DWORD i; DWORD i;
HRESULT hres; HRESULT hres;
@ -222,7 +226,7 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie) static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
TRACE("(%p)->(%d)\n", This, dwCookie); TRACE("(%p)->(%d)\n", This, dwCookie);
@ -238,13 +242,11 @@ static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dw
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface,
IEnumConnections **ppEnum) IEnumConnections **ppEnum)
{ {
ConnectionPoint *This = CONPOINT_THIS(iface); ConnectionPoint *This = impl_from_IConnectionPoint(iface);
FIXME("(%p)->(%p)\n", This, ppEnum); FIXME("(%p)->(%p)\n", This, ppEnum);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef CONPOINT_THIS
static const IConnectionPointVtbl ConnectionPointVtbl = static const IConnectionPointVtbl ConnectionPointVtbl =
{ {
ConnectionPoint_QueryInterface, ConnectionPoint_QueryInterface,
@ -273,7 +275,7 @@ static void ConnectionPoint_Create(REFIID riid, ConnectionPoint **cp,
{ {
ConnectionPoint *ret = heap_alloc(sizeof(ConnectionPoint)); ConnectionPoint *ret = heap_alloc(sizeof(ConnectionPoint));
ret->lpConnectionPointVtbl = &ConnectionPointVtbl; ret->IConnectionPoint_iface.lpVtbl = &ConnectionPointVtbl;
ret->sinks = NULL; ret->sinks = NULL;
ret->sinks_size = 0; ret->sinks_size = 0;
@ -299,11 +301,11 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This)
void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *impl) void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *impl)
{ {
This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl; This->IConnectionPointContainer_iface.lpVtbl = &ConnectionPointContainerVtbl;
ConnectionPoint_Create(&DIID_DWebBrowserEvents2, &This->wbe2, CONPTCONT(This)); ConnectionPoint_Create(&DIID_DWebBrowserEvents2, &This->wbe2, &This->IConnectionPointContainer_iface);
ConnectionPoint_Create(&DIID_DWebBrowserEvents, &This->wbe, CONPTCONT(This)); ConnectionPoint_Create(&DIID_DWebBrowserEvents, &This->wbe, &This->IConnectionPointContainer_iface);
ConnectionPoint_Create(&IID_IPropertyNotifySink, &This->pns, CONPTCONT(This)); ConnectionPoint_Create(&IID_IPropertyNotifySink, &This->pns, &This->IConnectionPointContainer_iface);
This->impl = impl; This->impl = impl;
} }

View File

@ -21,53 +21,54 @@
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
#define INPLACEFRAME_THIS(iface) DEFINE_THIS(DocHost, OleInPlaceFrame, iface) static inline DocHost *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IOleInPlaceFrame_iface));
}
static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = INPLACEFRAME(This); *ppv = &This->IOleInPlaceFrame_iface;
}else if(IsEqualGUID(&IID_IOleWindow, riid)) { }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv); TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
*ppv = INPLACEFRAME(This); *ppv = &This->IOleInPlaceFrame_iface;
}else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) { }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv); TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
*ppv = INPLACEFRAME(This); *ppv = &This->IOleInPlaceFrame_iface;
}else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) { }else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) {
TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv); TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv);
*ppv = INPLACEFRAME(This); *ppv = &This->IOleInPlaceFrame_iface;
} }else {
*ppv = NULL;
if(*ppv) {
IOleInPlaceFrame_AddRef(INPLACEFRAME(This));
return S_OK;
}
WARN("Unsopported interface %s\n", debugstr_guid(riid)); WARN("Unsopported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface) static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface);
} }
static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface) static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface); return IOleClientSite_Release(&This->IOleClientSite_iface);
} }
static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd) static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p)\n", This, phwnd); FIXME("(%p)->(%p)\n", This, phwnd);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -75,14 +76,14 @@ static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwn
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
BOOL fEnterMode) BOOL fEnterMode)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%x)\n", This, fEnterMode); FIXME("(%p)->(%x)\n", This, fEnterMode);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder) static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p)\n", This, lprectBorder); FIXME("(%p)->(%p)\n", This, lprectBorder);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -90,7 +91,7 @@ static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lpr
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
LPCBORDERWIDTHS pborderwidths) LPCBORDERWIDTHS pborderwidths)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p)\n", This, pborderwidths); FIXME("(%p)->(%p)\n", This, pborderwidths);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -98,7 +99,7 @@ static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
LPCBORDERWIDTHS pborderwidths) LPCBORDERWIDTHS pborderwidths)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p)\n", This, pborderwidths); FIXME("(%p)->(%p)\n", This, pborderwidths);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -106,7 +107,7 @@ static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName) IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName)); FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -114,7 +115,7 @@ static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared, static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths) LPOLEMENUGROUPWIDTHS lpMenuWidths)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths); FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -122,14 +123,14 @@ static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hm
static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared, static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
HOLEMENU holemenu, HWND hwndActiveObject) HOLEMENU holemenu, HWND hwndActiveObject)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject); FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared) static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p)\n", This, hmenuShared); FIXME("(%p)->(%p)\n", This, hmenuShared);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -137,14 +138,14 @@ static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hm
static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface, static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
LPCOLESTR pszStatusText) LPCOLESTR pszStatusText)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText)); TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
return This->container_vtbl->SetStatusText(This, pszStatusText); return This->container_vtbl->SetStatusText(This, pszStatusText);
} }
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable) static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%x)\n", This, fEnable); FIXME("(%p)->(%x)\n", This, fEnable);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -152,12 +153,12 @@ static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg, static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
WORD wID) WORD wID)
{ {
DocHost *This = INPLACEFRAME_THIS(iface); DocHost *This = impl_from_IOleInPlaceFrame(iface);
FIXME("(%p)->(%p %d)\n", This, lpmsg, wID); FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef INPLACEFRAME_THIS #undef impl_from_IOleInPlaceFrame
static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = { static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
InPlaceFrame_QueryInterface, InPlaceFrame_QueryInterface,
@ -179,5 +180,5 @@ static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
void DocHost_Frame_Init(DocHost *This) void DocHost_Frame_Init(DocHost *This)
{ {
This->lpOleInPlaceFrameVtbl = &OleInPlaceFrameVtbl; This->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;
} }

View File

@ -49,7 +49,7 @@ static HRESULT WINAPI InternetExplorer_QueryInterface(IWebBrowser2 *iface, REFII
*ppv = &This->IWebBrowser2_iface; *ppv = &This->IWebBrowser2_iface;
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv); TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
*ppv = CONPTCONT(&This->doc_host.cps); *ppv = &This->doc_host.cps.IConnectionPointContainer_iface;
}else if(HlinkFrame_QI(&This->hlink_frame, riid, ppv)) { }else if(HlinkFrame_QI(&This->hlink_frame, riid, ppv)) {
return S_OK; return S_OK;
} }

View File

@ -722,6 +722,11 @@ static IWebBrowser2 *create_ie_window(LPCSTR cmdline)
return wb; return wb;
} }
static inline InternetExplorer *impl_from_DocHost(DocHost *iface)
{
return (InternetExplorer*)((char*)iface - FIELD_OFFSET(InternetExplorer, doc_host));
}
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc) static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
{ {
GetClientRect(This->frame_hwnd, rc); GetClientRect(This->frame_hwnd, rc);
@ -730,7 +735,7 @@ static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text) static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text)
{ {
InternetExplorer* ie = DOCHOST_THIS(This); InternetExplorer* ie = impl_from_DocHost(This);
return update_ie_statustext(ie, text); return update_ie_statustext(ie, text);
} }

View File

@ -59,7 +59,7 @@ typedef struct ConnectionPoint ConnectionPoint;
typedef struct DocHost DocHost; typedef struct DocHost DocHost;
typedef struct { typedef struct {
const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; IConnectionPointContainer IConnectionPointContainer_iface;
ConnectionPoint *wbe2; ConnectionPoint *wbe2;
ConnectionPoint *wbe; ConnectionPoint *wbe;
@ -103,7 +103,7 @@ struct DocHost {
IServiceProvider IServiceProvider_iface; IServiceProvider IServiceProvider_iface;
/* Interfaces of InPlaceFrame object */ /* Interfaces of InPlaceFrame object */
const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl; IOleInPlaceFrame IOleInPlaceFrame_iface;
IDispatch *disp; IDispatch *disp;
@ -194,9 +194,6 @@ struct InternetExplorer {
DocHost doc_host; DocHost doc_host;
}; };
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
void WebBrowser_OleObject_Init(WebBrowser*); void WebBrowser_OleObject_Init(WebBrowser*);
void WebBrowser_ViewObject_Init(WebBrowser*); void WebBrowser_ViewObject_Init(WebBrowser*);
void WebBrowser_Persist_Init(WebBrowser*); void WebBrowser_Persist_Init(WebBrowser*);
@ -242,9 +239,6 @@ HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**);
HRESULT TaskbarList_Create(IUnknown*,REFIID,void**); HRESULT TaskbarList_Create(IUnknown*,REFIID,void**);
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
/********************************************************************** /**********************************************************************
* Dll lifetime tracking declaration for shdocvw.dll * Dll lifetime tracking declaration for shdocvw.dll
*/ */

View File

@ -86,7 +86,7 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
*ppv = &This->IProvideClassInfo2_iface; *ppv = &This->IProvideClassInfo2_iface;
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv); TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
*ppv = CONPTCONT(&This->doc_host.cps); *ppv = &This->doc_host.cps.IConnectionPointContainer_iface;
}else if(IsEqualGUID(&IID_IViewObject, riid)) { }else if(IsEqualGUID(&IID_IViewObject, riid)) {
TRACE("(%p)->(IID_IViewObject %p)\n", This, ppv); TRACE("(%p)->(IID_IViewObject %p)\n", This, ppv);
*ppv = &This->IViewObject2_iface; *ppv = &This->IViewObject2_iface;
@ -1104,8 +1104,6 @@ static HRESULT STDMETHODCALLTYPE WBServiceProvider_QueryService(IServiceProvider
return E_NOINTERFACE; return E_NOINTERFACE;
} }
#undef impl_from_IServiceProvider
static const IServiceProviderVtbl ServiceProviderVtbl = static const IServiceProviderVtbl ServiceProviderVtbl =
{ {
WBServiceProvider_QueryInterface, WBServiceProvider_QueryInterface,
@ -1114,7 +1112,10 @@ static const IServiceProviderVtbl ServiceProviderVtbl =
WBServiceProvider_QueryService WBServiceProvider_QueryService
}; };
#define DOCHOST_THIS(iface) DEFINE_THIS2(WebBrowser,doc_host,iface) static inline WebBrowser *impl_from_DocHost(DocHost *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, doc_host));
}
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc) static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
{ {
@ -1134,7 +1135,7 @@ static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in, static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
VARIANT *out) VARIANT *out)
{ {
WebBrowser *This = DOCHOST_THIS(doc_host); WebBrowser *This = impl_from_DocHost(doc_host);
IOleCommandTarget *cmdtrg = NULL; IOleCommandTarget *cmdtrg = NULL;
HRESULT hres; HRESULT hres;
@ -1161,8 +1162,6 @@ static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, D
return hres; return hres;
} }
#undef DOCHOST_THIS
static const IDocHostContainerVtbl DocHostContainerVtbl = { static const IDocHostContainerVtbl DocHostContainerVtbl = {
DocHostContainer_GetDocObjRect, DocHostContainer_GetDocObjRect,
DocHostContainer_SetStatusText, DocHostContainer_SetStatusText,