shdocvw: Get rid of more *_THIS macros.

This commit is contained in:
Jacek Caban 2010-11-13 17:47:31 +01:00 committed by Alexandre Julliard
parent 8767356d12
commit 7149f04b4e
3 changed files with 118 additions and 116 deletions

View File

@ -190,9 +190,9 @@ static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site)
IOleInPlaceSite_OnUIActivate(This->inplace); IOleInPlaceSite_OnUIActivate(This->inplace);
if(This->doc_host.frame) if(This->doc_host.frame)
IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, ACTIVEOBJ(This), wszitem); IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, &This->IOleInPlaceActiveObject_iface, wszitem);
if(This->uiwindow) if(This->uiwindow)
IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, ACTIVEOBJ(This), wszitem); IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, &This->IOleInPlaceActiveObject_iface, wszitem);
if(This->doc_host.frame) if(This->doc_host.frame)
IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL, This->shell_embedding_hwnd); IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL, This->shell_embedding_hwnd);
@ -289,29 +289,32 @@ static void release_client_site(WebBrowser *This)
* Implement the IOleObject interface for the WebBrowser control * Implement the IOleObject interface for the WebBrowser control
*/ */
#define OLEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface) static inline WebBrowser *impl_from_IOleObject(IOleObject *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IOleObject_iface));
}
static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv); return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
} }
static ULONG WINAPI OleObject_AddRef(IOleObject *iface) static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
return IWebBrowser_AddRef(&This->IWebBrowser2_iface); return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI OleObject_Release(IOleObject *iface) static ULONG WINAPI OleObject_Release(IOleObject *iface)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
return IWebBrowser_Release(&This->IWebBrowser2_iface); return IWebBrowser_Release(&This->IWebBrowser2_iface);
} }
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite) static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
IDocHostUIHandler *hostui; IDocHostUIHandler *hostui;
IOleContainer *container; IOleContainer *container;
IDispatch *disp; IDispatch *disp;
@ -367,7 +370,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE *ppClientSite) static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE *ppClientSite)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%p)\n", This, ppClientSite); TRACE("(%p)->(%p)\n", This, ppClientSite);
@ -384,7 +387,7 @@ static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE
static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp,
LPCOLESTR szContainerObj) LPCOLESTR szContainerObj)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj)); TRACE("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
@ -394,14 +397,14 @@ static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szCont
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption) static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%d)\n", This, dwSaveOption); FIXME("(%p)->(%d)\n", This, dwSaveOption);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker* pmk) static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker* pmk)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%d, %p)\n", This, dwWhichMoniker, pmk); FIXME("(%p)->(%d, %p)\n", This, dwWhichMoniker, pmk);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -409,7 +412,7 @@ static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMonik
static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign,
DWORD dwWhichMoniker, LPMONIKER *ppmk) DWORD dwWhichMoniker, LPMONIKER *ppmk)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%d, %d, %p)\n", This, dwAssign, dwWhichMoniker, ppmk); FIXME("(%p)->(%d, %d, %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -417,7 +420,7 @@ static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign,
static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDataObject, static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDataObject,
BOOL fCreation, DWORD dwReserved) BOOL fCreation, DWORD dwReserved)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%p, %d, %d)\n", This, pDataObject, fCreation, dwReserved); FIXME("(%p)->(%p, %d, %d)\n", This, pDataObject, fCreation, dwReserved);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -425,7 +428,7 @@ static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDa
static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved,
LPDATAOBJECT *ppDataObject) LPDATAOBJECT *ppDataObject)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%d, %p)\n", This, dwReserved, ppDataObject); FIXME("(%p)->(%d, %p)\n", This, dwReserved, ppDataObject);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -433,7 +436,7 @@ static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwRese
static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG* lpmsg, static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG* lpmsg,
LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent, TRACE("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
lprcPosRect); lprcPosRect);
@ -464,28 +467,28 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb) static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%p)\n", This, ppEnumOleVerb); TRACE("(%p)->(%p)\n", This, ppEnumOleVerb);
return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb); return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb);
} }
static HRESULT WINAPI OleObject_Update(IOleObject *iface) static HRESULT WINAPI OleObject_Update(IOleObject *iface)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface) static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid) static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%p)\n", This, pClsid); FIXME("(%p)->(%p)\n", This, pClsid);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -493,14 +496,14 @@ static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid)
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType,
LPOLESTR* pszUserType) LPOLESTR* pszUserType)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p, %d, %p)\n", This, dwFormOfType, pszUserType); TRACE("(%p, %d, %p)\n", This, dwFormOfType, pszUserType);
return OleRegGetUserType(&CLSID_WebBrowser, dwFormOfType, pszUserType); return OleRegGetUserType(&CLSID_WebBrowser, dwFormOfType, pszUserType);
} }
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%x %p)\n", This, dwDrawAspect, psizel); TRACE("(%p)->(%x %p)\n", This, dwDrawAspect, psizel);
@ -511,7 +514,7 @@ static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect,
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel) static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%x, %p)\n", This, dwDrawAspect, psizel); TRACE("(%p)->(%x, %p)\n", This, dwDrawAspect, psizel);
@ -523,28 +526,28 @@ static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect,
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink,
DWORD* pdwConnection) DWORD* pdwConnection)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection); FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection) static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%d)\n", This, dwConnection); FIXME("(%p)->(%d)\n", This, dwConnection);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise) static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%p)\n", This, ppenumAdvise); FIXME("(%p)->(%p)\n", This, ppenumAdvise);
return S_OK; return S_OK;
} }
static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus) static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
TRACE("(%p)->(%x, %p)\n", This, dwAspect, pdwStatus); TRACE("(%p)->(%x, %p)\n", This, dwAspect, pdwStatus);
@ -556,13 +559,11 @@ static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect,
static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE* pLogpal) static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE* pLogpal)
{ {
WebBrowser *This = OLEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%p)\n", This, pLogpal); FIXME("(%p)->(%p)\n", This, pLogpal);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef OLEOBJ_THIS
static const IOleObjectVtbl OleObjectVtbl = static const IOleObjectVtbl OleObjectVtbl =
{ {
OleObject_QueryInterface, OleObject_QueryInterface,
@ -595,30 +596,33 @@ static const IOleObjectVtbl OleObjectVtbl =
* Implement the IOleInPlaceObject interface * Implement the IOleInPlaceObject interface
*/ */
#define INPLACEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceObject, iface) static inline WebBrowser *impl_from_IOleInPlaceObject(IOleInPlaceObject *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IOleInPlaceObject_iface));
}
static HRESULT WINAPI OleInPlaceObject_QueryInterface(IOleInPlaceObject *iface, static HRESULT WINAPI OleInPlaceObject_QueryInterface(IOleInPlaceObject *iface,
REFIID riid, LPVOID *ppobj) REFIID riid, LPVOID *ppobj)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj); return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
} }
static ULONG WINAPI OleInPlaceObject_AddRef(IOleInPlaceObject *iface) static ULONG WINAPI OleInPlaceObject_AddRef(IOleInPlaceObject *iface)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
return IWebBrowser_AddRef(&This->IWebBrowser2_iface); return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI OleInPlaceObject_Release(IOleInPlaceObject *iface) static ULONG WINAPI OleInPlaceObject_Release(IOleInPlaceObject *iface)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
return IWebBrowser_Release(&This->IWebBrowser2_iface); return IWebBrowser_Release(&This->IWebBrowser2_iface);
} }
static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND* phwnd) static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND* phwnd)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
TRACE("(%p)->(%p)\n", This, phwnd); TRACE("(%p)->(%p)\n", This, phwnd);
@ -629,14 +633,14 @@ static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND*
static HRESULT WINAPI OleInPlaceObject_ContextSensitiveHelp(IOleInPlaceObject *iface, static HRESULT WINAPI OleInPlaceObject_ContextSensitiveHelp(IOleInPlaceObject *iface,
BOOL fEnterMode) BOOL fEnterMode)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
FIXME("(%p)->(%x)\n", This, fEnterMode); FIXME("(%p)->(%x)\n", This, fEnterMode);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *iface) static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *iface)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
if(This->inplace) { if(This->inplace) {
@ -649,7 +653,7 @@ static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *ifac
static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface) static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -657,7 +661,7 @@ static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface)
static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface, static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
LPCRECT lprcPosRect, LPCRECT lprcClipRect) LPCRECT lprcPosRect, LPCRECT lprcClipRect)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect); TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
@ -679,13 +683,11 @@ static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface) static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceObject(iface);
FIXME("(%p)\n", This); FIXME("(%p)\n", This);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef INPLACEOBJ_THIS
static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl = static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl =
{ {
OleInPlaceObject_QueryInterface, OleInPlaceObject_QueryInterface,
@ -703,30 +705,33 @@ static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl =
* Implement the IOleControl interface * Implement the IOleControl interface
*/ */
#define CONTROL_THIS(iface) DEFINE_THIS(WebBrowser, OleControl, iface) static inline WebBrowser *impl_from_IOleControl(IOleControl *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IOleControl_iface));
}
static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface,
REFIID riid, LPVOID *ppobj) REFIID riid, LPVOID *ppobj)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj); return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
} }
static ULONG WINAPI OleControl_AddRef(IOleControl *iface) static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
return IWebBrowser_AddRef(&This->IWebBrowser2_iface); return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI OleControl_Release(IOleControl *iface) static ULONG WINAPI OleControl_Release(IOleControl *iface)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
return IWebBrowser_Release(&This->IWebBrowser2_iface); return IWebBrowser_Release(&This->IWebBrowser2_iface);
} }
static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINFO pCI) static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINFO pCI)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
TRACE("(%p)->(%p)\n", This, pCI); TRACE("(%p)->(%p)\n", This, pCI);
@ -736,14 +741,14 @@ static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINF
static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, struct tagMSG *pMsg) static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, struct tagMSG *pMsg)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
FIXME("(%p)->(%p)\n", This, pMsg); FIXME("(%p)->(%p)\n", This, pMsg);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID) static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
TRACE("(%p)->(%d)\n", This, dispID); TRACE("(%p)->(%d)\n", This, dispID);
@ -767,13 +772,11 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze) static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
{ {
WebBrowser *This = CONTROL_THIS(iface); WebBrowser *This = impl_from_IOleControl(iface);
FIXME("(%p)->(%x)\n", This, bFreeze); FIXME("(%p)->(%x)\n", This, bFreeze);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef CONTROL_THIS
static const IOleControlVtbl OleControlVtbl = static const IOleControlVtbl OleControlVtbl =
{ {
OleControl_QueryInterface, OleControl_QueryInterface,
@ -785,45 +788,48 @@ static const IOleControlVtbl OleControlVtbl =
OleControl_FreezeEvents OleControl_FreezeEvents
}; };
#define ACTIVEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceActiveObject, iface) static inline WebBrowser *impl_from_IOleInPlaceActiveObject(IOleInPlaceActiveObject *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IOleInPlaceActiveObject_iface));
}
static HRESULT WINAPI InPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv); return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
} }
static ULONG WINAPI InPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface) static ULONG WINAPI InPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
return IWebBrowser2_AddRef(&This->IWebBrowser2_iface); return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI InPlaceActiveObject_Release(IOleInPlaceActiveObject *iface) static ULONG WINAPI InPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
return IWebBrowser2_Release(&This->IWebBrowser2_iface); return IWebBrowser2_Release(&This->IWebBrowser2_iface);
} }
static HRESULT WINAPI InPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface,
HWND *phwnd) HWND *phwnd)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
return IOleInPlaceObject_GetWindow(INPLACEOBJ(This), phwnd); return IOleInPlaceObject_GetWindow(&This->IOleInPlaceObject_iface, phwnd);
} }
static HRESULT WINAPI InPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface,
BOOL fEnterMode) BOOL fEnterMode)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
return IOleInPlaceObject_ContextSensitiveHelp(INPLACEOBJ(This), fEnterMode); return IOleInPlaceObject_ContextSensitiveHelp(&This->IOleInPlaceObject_iface, fEnterMode);
} }
static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface,
LPMSG lpmsg) LPMSG lpmsg)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
FIXME("(%p)->(%p)\n", This, lpmsg); FIXME("(%p)->(%p)\n", This, lpmsg);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -831,7 +837,7 @@ static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActive
static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface,
BOOL fActivate) BOOL fActivate)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
FIXME("(%p)->(%x)\n", This, fActivate); FIXME("(%p)->(%x)\n", This, fActivate);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -839,7 +845,7 @@ static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiv
static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface,
BOOL fActivate) BOOL fActivate)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
FIXME("(%p)->(%x)\n", This, fActivate); FIXME("(%p)->(%x)\n", This, fActivate);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -847,7 +853,7 @@ static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveO
static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface,
LPCRECT lprcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) LPCRECT lprcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
FIXME("(%p)->(%p %p %x)\n", This, lprcBorder, pUIWindow, fFrameWindow); FIXME("(%p)->(%p %p %x)\n", This, lprcBorder, pUIWindow, fFrameWindow);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -855,13 +861,11 @@ static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *
static HRESULT WINAPI InPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface, static HRESULT WINAPI InPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface,
BOOL fEnable) BOOL fEnable)
{ {
WebBrowser *This = ACTIVEOBJ_THIS(iface); WebBrowser *This = impl_from_IOleInPlaceActiveObject(iface);
FIXME("(%p)->(%x)\n", This, fEnable); FIXME("(%p)->(%x)\n", This, fEnable);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef ACTIVEOBJ_THIS
static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = { static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
InPlaceActiveObject_QueryInterface, InPlaceActiveObject_QueryInterface,
InPlaceActiveObject_AddRef, InPlaceActiveObject_AddRef,
@ -875,31 +879,34 @@ static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
InPlaceActiveObject_EnableModeless InPlaceActiveObject_EnableModeless
}; };
#define OLECMD_THIS(iface) DEFINE_THIS(WebBrowser, OleCommandTarget, iface) static inline WebBrowser *impl_from_IOleCommandTarget(IOleCommandTarget *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IOleCommandTarget_iface));
}
static HRESULT WINAPI WBOleCommandTarget_QueryInterface(IOleCommandTarget *iface, static HRESULT WINAPI WBOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
WebBrowser *This = OLECMD_THIS(iface); WebBrowser *This = impl_from_IOleCommandTarget(iface);
return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv); return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
} }
static ULONG WINAPI WBOleCommandTarget_AddRef(IOleCommandTarget *iface) static ULONG WINAPI WBOleCommandTarget_AddRef(IOleCommandTarget *iface)
{ {
WebBrowser *This = OLECMD_THIS(iface); WebBrowser *This = impl_from_IOleCommandTarget(iface);
return IWebBrowser2_AddRef(&This->IWebBrowser2_iface); return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI WBOleCommandTarget_Release(IOleCommandTarget *iface) static ULONG WINAPI WBOleCommandTarget_Release(IOleCommandTarget *iface)
{ {
WebBrowser *This = OLECMD_THIS(iface); WebBrowser *This = impl_from_IOleCommandTarget(iface);
return IWebBrowser2_Release(&This->IWebBrowser2_iface); return IWebBrowser2_Release(&This->IWebBrowser2_iface);
} }
static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface, static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{ {
WebBrowser *This = OLECMD_THIS(iface); WebBrowser *This = impl_from_IOleCommandTarget(iface);
IOleCommandTarget *cmdtrg; IOleCommandTarget *cmdtrg;
HRESULT hres; HRESULT hres;
@ -926,14 +933,12 @@ static HRESULT WINAPI WBOleCommandTarget_Exec(IOleCommandTarget *iface,
const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn,
VARIANT *pvaOut) VARIANT *pvaOut)
{ {
WebBrowser *This = OLECMD_THIS(iface); WebBrowser *This = impl_from_IOleCommandTarget(iface);
FIXME("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, FIXME("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
nCmdexecopt, pvaIn, pvaOut); nCmdexecopt, pvaIn, pvaOut);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef OLECMD_THIS
static const IOleCommandTargetVtbl OleCommandTargetVtbl = { static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
WBOleCommandTarget_QueryInterface, WBOleCommandTarget_QueryInterface,
WBOleCommandTarget_AddRef, WBOleCommandTarget_AddRef,
@ -954,11 +959,11 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
This->lpOleObjectVtbl = &OleObjectVtbl; This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl; This->IOleInPlaceObject_iface.lpVtbl = &OleInPlaceObjectVtbl;
This->lpOleControlVtbl = &OleControlVtbl; This->IOleControl_iface.lpVtbl = &OleControlVtbl;
This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl; This->IOleInPlaceActiveObject_iface.lpVtbl = &OleInPlaceActiveObjectVtbl;
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl; This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
/* Default size is 50x20 pixels, in himetric units */ /* Default size is 50x20 pixels, in himetric units */
This->extent.cx = MulDiv( 50, 2540, dpi_x ); This->extent.cx = MulDiv( 50, 2540, dpi_x );

View File

@ -135,18 +135,18 @@ struct DocHost {
}; };
struct WebBrowser { struct WebBrowser {
IWebBrowser2 IWebBrowser2_iface; IWebBrowser2 IWebBrowser2_iface;
const IOleObjectVtbl *lpOleObjectVtbl; IOleObject IOleObject_iface;
const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl; IOleInPlaceObject IOleInPlaceObject_iface;
const IOleControlVtbl *lpOleControlVtbl; IOleControl IOleControl_iface;
const IPersistStorageVtbl *lpPersistStorageVtbl; const IPersistStorageVtbl *lpPersistStorageVtbl;
const IPersistMemoryVtbl *lpPersistMemoryVtbl; const IPersistMemoryVtbl *lpPersistMemoryVtbl;
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl; const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl; const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
const IViewObject2Vtbl *lpViewObjectVtbl; const IViewObject2Vtbl *lpViewObjectVtbl;
const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl; IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl; IOleCommandTarget IOleCommandTarget_iface;
const IServiceProviderVtbl *lpServiceProviderVtbl; IServiceProvider IServiceProvider_iface;
const IDataObjectVtbl *lpDataObjectVtbl; const IDataObjectVtbl *lpDataObjectVtbl;
HlinkFrame hlink_frame; HlinkFrame hlink_frame;
@ -194,9 +194,6 @@ struct InternetExplorer {
DocHost doc_host; DocHost doc_host;
}; };
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl) #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
#define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl) #define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl) #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
@ -204,7 +201,6 @@ struct InternetExplorer {
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl) #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl); #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
#define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl); #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
#define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
#define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl) #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define DATAOBJECT(x) ((IDataObject*) &(x)->lpDataObjectVtbl) #define DATAOBJECT(x) ((IDataObject*) &(x)->lpDataObjectVtbl)

View File

@ -56,16 +56,16 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
*ppv = &This->IWebBrowser2_iface; *ppv = &This->IWebBrowser2_iface;
}else if(IsEqualGUID(&IID_IOleObject, riid)) { }else if(IsEqualGUID(&IID_IOleObject, riid)) {
TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv); TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
*ppv = OLEOBJ(This); *ppv = &This->IOleObject_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 = INPLACEOBJ(This); *ppv = &This->IOleInPlaceObject_iface;
}else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) { }else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv); TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
*ppv = INPLACEOBJ(This); *ppv = &This->IOleInPlaceObject_iface;
}else if(IsEqualGUID(&IID_IOleControl, riid)) { }else if(IsEqualGUID(&IID_IOleControl, riid)) {
TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv); TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
*ppv = CONTROL(This); *ppv = &This->IOleControl_iface;
}else if(IsEqualGUID(&IID_IPersist, riid)) { }else if(IsEqualGUID(&IID_IPersist, riid)) {
TRACE("(%p)->(IID_IPersist %p)\n", This, ppv); TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
*ppv = PERSTORAGE(This); *ppv = PERSTORAGE(This);
@ -95,12 +95,12 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
*ppv = VIEWOBJ2(This); *ppv = VIEWOBJ2(This);
}else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv); TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
*ppv = ACTIVEOBJ(This); *ppv = &This->IOleInPlaceActiveObject_iface;
}else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv); TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
*ppv = OLECMD(This); *ppv = &This->IOleCommandTarget_iface;
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) { }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
*ppv = SERVPROV(This); *ppv = &This->IServiceProvider_iface;
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv); TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
}else if(IsEqualGUID(&IID_IDataObject, riid)) { }else if(IsEqualGUID(&IID_IDataObject, riid)) {
*ppv = DATAOBJECT(This); *ppv = DATAOBJECT(This);
@ -1060,33 +1060,34 @@ static const IWebBrowser2Vtbl WebBrowser2Vtbl =
WebBrowser_put_Resizable WebBrowser_put_Resizable
}; };
#define SERVPROV_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface) static inline WebBrowser *impl_from_IServiceProvider(IServiceProvider *iface)
/* {
* IServiceProvider interface. return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IServiceProvider_iface));
*/ }
static HRESULT WINAPI WebBrowser_IServiceProvider_QueryInterface(IServiceProvider *iface,
static HRESULT WINAPI WBServiceProvider_QueryInterface(IServiceProvider *iface,
REFIID riid, LPVOID *ppv) REFIID riid, LPVOID *ppv)
{ {
WebBrowser *This = SERVPROV_THIS(iface); WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv); return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
} }
static ULONG WINAPI WebBrowser_IServiceProvider_AddRef(IServiceProvider *iface) static ULONG WINAPI WBServiceProvider_AddRef(IServiceProvider *iface)
{ {
WebBrowser *This = SERVPROV_THIS(iface); WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_AddRef(&This->IWebBrowser2_iface); return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
} }
static ULONG WINAPI WebBrowser_IServiceProvider_Release(IServiceProvider *iface) static ULONG WINAPI WBServiceProvider_Release(IServiceProvider *iface)
{ {
WebBrowser *This = SERVPROV_THIS(iface); WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_Release(&This->IWebBrowser2_iface); return IWebBrowser_Release(&This->IWebBrowser2_iface);
} }
static HRESULT STDMETHODCALLTYPE WebBrowser_IServiceProvider_QueryService(IServiceProvider *iface, static HRESULT STDMETHODCALLTYPE WBServiceProvider_QueryService(IServiceProvider *iface,
REFGUID guidService, REFIID riid, void **ppv) REFGUID guidService, REFIID riid, void **ppv)
{ {
WebBrowser *This = SERVPROV_THIS(iface); WebBrowser *This = impl_from_IServiceProvider(iface);
static const IID IID_IBrowserService2 = static const IID IID_IBrowserService2 =
{0x68BD21CC,0x438B,0x11d2,{0xA5,0x60,0x00,0xA0,0xC,0x2D,0xBF,0xE8}}; {0x68BD21CC,0x438B,0x11d2,{0xA5,0x60,0x00,0xA0,0xC,0x2D,0xBF,0xE8}};
@ -1103,14 +1104,14 @@ static HRESULT STDMETHODCALLTYPE WebBrowser_IServiceProvider_QueryService(IServi
return E_NOINTERFACE; return E_NOINTERFACE;
} }
#undef SERVPROV_THIS #undef impl_from_IServiceProvider
static const IServiceProviderVtbl ServiceProviderVtbl = static const IServiceProviderVtbl ServiceProviderVtbl =
{ {
WebBrowser_IServiceProvider_QueryInterface, WBServiceProvider_QueryInterface,
WebBrowser_IServiceProvider_AddRef, WBServiceProvider_AddRef,
WebBrowser_IServiceProvider_Release, WBServiceProvider_Release,
WebBrowser_IServiceProvider_QueryService WBServiceProvider_QueryService
}; };
#define DOCHOST_THIS(iface) DEFINE_THIS2(WebBrowser,doc_host,iface) #define DOCHOST_THIS(iface) DEFINE_THIS2(WebBrowser,doc_host,iface)
@ -1179,7 +1180,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
ret = heap_alloc_zero(sizeof(WebBrowser)); ret = heap_alloc_zero(sizeof(WebBrowser));
ret->IWebBrowser2_iface.lpVtbl = &WebBrowser2Vtbl; ret->IWebBrowser2_iface.lpVtbl = &WebBrowser2Vtbl;
ret->lpServiceProviderVtbl = &ServiceProviderVtbl; ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
ret->ref = 1; ret->ref = 1;
ret->version = version; ret->version = version;