Commit 6f075693 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Make IOleControl and IOleInPlaceObject interface heap based.

parent 087de7d4
...@@ -260,32 +260,33 @@ static const IOleObjectVtbl OleObjectVtbl = ...@@ -260,32 +260,33 @@ static const IOleObjectVtbl OleObjectVtbl =
* Implement the IOleInPlaceObject interface * Implement the IOleInPlaceObject interface
*/ */
static HRESULT WINAPI WBOIPO_QueryInterface(LPOLEINPLACEOBJECT iface, #define INPLACEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceObject, iface)
REFIID riid, LPVOID *ppobj)
{
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
if (ppobj == NULL) return E_POINTER; static HRESULT WINAPI OleInPlaceObject_QueryInterface(IOleInPlaceObject *iface,
REFIID riid, LPVOID *ppobj)
return E_NOINTERFACE; {
WebBrowser *This = INPLACEOBJ_THIS(iface);
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
} }
static ULONG WINAPI WBOIPO_AddRef(LPOLEINPLACEOBJECT iface) static ULONG WINAPI OleInPlaceObject_AddRef(IOleInPlaceObject *iface)
{ {
SHDOCVW_LockModule(); WebBrowser *This = INPLACEOBJ_THIS(iface);
return IWebBrowser_AddRef(WEBBROWSER(This));
return 2; /* non-heap based object */
} }
static ULONG WINAPI WBOIPO_Release(LPOLEINPLACEOBJECT iface) static ULONG WINAPI OleInPlaceObject_Release(IOleInPlaceObject *iface)
{ {
SHDOCVW_UnlockModule(); WebBrowser *This = INPLACEOBJ_THIS(iface);
return IWebBrowser_Release(WEBBROWSER(This));
return 1; /* non-heap based object */
} }
static HRESULT WINAPI WBOIPO_GetWindow(LPOLEINPLACEOBJECT iface, HWND* phwnd) static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND* phwnd)
{ {
WebBrowser *This = INPLACEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, phwnd);
#if 0 #if 0
/* Create a fake window to fool MFC into believing that we actually /* Create a fake window to fool MFC into believing that we actually
* have an implemented browser control. Avoids the assertion. * have an implemented browser control. Avoids the assertion.
...@@ -300,132 +301,130 @@ static HRESULT WINAPI WBOIPO_GetWindow(LPOLEINPLACEOBJECT iface, HWND* phwnd) ...@@ -300,132 +301,130 @@ static HRESULT WINAPI WBOIPO_GetWindow(LPOLEINPLACEOBJECT iface, HWND* phwnd)
TRACE ("Returning hwnd = %d\n", hwnd); TRACE ("Returning hwnd = %d\n", hwnd);
#endif #endif
FIXME("stub HWND* = %p\n", phwnd);
return S_OK; return S_OK;
} }
static HRESULT WINAPI WBOIPO_ContextSensitiveHelp(LPOLEINPLACEOBJECT iface, static HRESULT WINAPI OleInPlaceObject_ContextSensitiveHelp(IOleInPlaceObject *iface,
BOOL fEnterMode) BOOL fEnterMode)
{ {
FIXME("stub fEnterMode = %d\n", fEnterMode); WebBrowser *This = INPLACEOBJ_THIS(iface);
return S_OK; FIXME("(%p)->(%x)\n", This, fEnterMode);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOIPO_InPlaceDeactivate(LPOLEINPLACEOBJECT iface) static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *iface)
{ {
FIXME("stub \n"); WebBrowser *This = INPLACEOBJ_THIS(iface);
return S_OK; FIXME("(%p)\n", This);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOIPO_UIDeactivate(LPOLEINPLACEOBJECT iface) static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface)
{ {
FIXME("stub \n"); WebBrowser *This = INPLACEOBJ_THIS(iface);
return S_OK; FIXME("(%p)\n", This);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOIPO_SetObjectRects(LPOLEINPLACEOBJECT iface, static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
LPCRECT lprcPosRect, LPCRECT lprcClipRect) LPCRECT lprcPosRect, LPCRECT lprcClipRect)
{ {
FIXME("stub PosRect = %p, ClipRect = %p\n", lprcPosRect, lprcClipRect); WebBrowser *This = INPLACEOBJ_THIS(iface);
return S_OK; FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOIPO_ReactivateAndUndo(LPOLEINPLACEOBJECT iface) static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface)
{ {
FIXME("stub \n"); WebBrowser *This = INPLACEOBJ_THIS(iface);
return S_OK; FIXME("(%p)\n", This);
return E_NOTIMPL;
} }
/********************************************************************** #undef INPLACEOBJ_THIS
* IOleInPlaceObject virtual function table for IE Web Browser component
*/
static const IOleInPlaceObjectVtbl WBOIPO_Vtbl = static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl =
{ {
WBOIPO_QueryInterface, OleInPlaceObject_QueryInterface,
WBOIPO_AddRef, OleInPlaceObject_AddRef,
WBOIPO_Release, OleInPlaceObject_Release,
WBOIPO_GetWindow, OleInPlaceObject_GetWindow,
WBOIPO_ContextSensitiveHelp, OleInPlaceObject_ContextSensitiveHelp,
WBOIPO_InPlaceDeactivate, OleInPlaceObject_InPlaceDeactivate,
WBOIPO_UIDeactivate, OleInPlaceObject_UIDeactivate,
WBOIPO_SetObjectRects, OleInPlaceObject_SetObjectRects,
WBOIPO_ReactivateAndUndo OleInPlaceObject_ReactivateAndUndo
}; };
IOleInPlaceObjectImpl SHDOCVW_OleInPlaceObject = {&WBOIPO_Vtbl};
/********************************************************************** /**********************************************************************
* Implement the IOleControl interface * Implement the IOleControl interface
*/ */
static HRESULT WINAPI WBOC_QueryInterface(LPOLECONTROL iface, #define CONTROL_THIS(iface) DEFINE_THIS(WebBrowser, OleControl, iface)
REFIID riid, LPVOID *ppobj)
{
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
if (ppobj == NULL) return E_POINTER; static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface,
REFIID riid, LPVOID *ppobj)
return E_NOINTERFACE; {
WebBrowser *This = CONTROL_THIS(iface);
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
} }
static ULONG WINAPI WBOC_AddRef(LPOLECONTROL iface) static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
{ {
SHDOCVW_LockModule(); WebBrowser *This = CONTROL_THIS(iface);
return IWebBrowser_AddRef(WEBBROWSER(This));
return 2; /* non-heap based object */
} }
static ULONG WINAPI WBOC_Release(LPOLECONTROL iface) static ULONG WINAPI OleControl_Release(IOleControl *iface)
{ {
SHDOCVW_UnlockModule(); WebBrowser *This = CONTROL_THIS(iface);
return IWebBrowser_Release(WEBBROWSER(This));
return 1; /* non-heap based object */
} }
static HRESULT WINAPI WBOC_GetControlInfo(LPOLECONTROL iface, LPCONTROLINFO pCI) static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINFO pCI)
{ {
FIXME("stub: LPCONTROLINFO = %p\n", pCI); WebBrowser *This = CONTROL_THIS(iface);
return S_OK; FIXME("(%p)->(%p)\n", This, pCI);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOC_OnMnemonic(LPOLECONTROL iface, struct tagMSG *pMsg) static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, struct tagMSG *pMsg)
{ {
FIXME("stub: MSG* = %p\n", pMsg); WebBrowser *This = CONTROL_THIS(iface);
return S_OK; FIXME("(%p)->(%p)\n", This, pMsg);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOC_OnAmbientPropertyChange(LPOLECONTROL iface, DISPID dispID) static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
{ {
FIXME("stub: DISPID = %ld\n", dispID); WebBrowser *This = CONTROL_THIS(iface);
return S_OK; FIXME("(%p)->(%ld)\n", This, dispID);
return E_NOTIMPL;
} }
static HRESULT WINAPI WBOC_FreezeEvents(LPOLECONTROL iface, BOOL bFreeze) static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
{ {
FIXME("stub: bFreeze = %d\n", bFreeze); WebBrowser *This = CONTROL_THIS(iface);
return S_OK; FIXME("(%p)->(%x)\n", This, bFreeze);
return E_NOTIMPL;
} }
/********************************************************************** #undef CONTROL_THIS
* IOleControl virtual function table for IE Web Browser component
*/
static const IOleControlVtbl WBOC_Vtbl = static const IOleControlVtbl OleControlVtbl =
{ {
WBOC_QueryInterface, OleControl_QueryInterface,
WBOC_AddRef, OleControl_AddRef,
WBOC_Release, OleControl_Release,
WBOC_GetControlInfo, OleControl_GetControlInfo,
WBOC_OnMnemonic, OleControl_OnMnemonic,
WBOC_OnAmbientPropertyChange, OleControl_OnAmbientPropertyChange,
WBOC_FreezeEvents OleControl_FreezeEvents
}; };
IOleControlImpl SHDOCVW_OleControl = {&WBOC_Vtbl};
void WebBrowser_OleObject_Init(WebBrowser *This) void WebBrowser_OleObject_Init(WebBrowser *This)
{ {
This->lpOleObjectVtbl = &OleObjectVtbl; This->lpOleObjectVtbl = &OleObjectVtbl;
This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl;
This->lpOleControlVtbl = &OleControlVtbl;
} }
...@@ -53,14 +53,18 @@ extern IClassFactoryImpl SHDOCVW_ClassFactory; ...@@ -53,14 +53,18 @@ extern IClassFactoryImpl SHDOCVW_ClassFactory;
* WebBrowser declaration for SHDOCVW.DLL * WebBrowser declaration for SHDOCVW.DLL
*/ */
typedef struct { typedef struct {
const IWebBrowserVtbl *lpWebBrowserVtbl; const IWebBrowserVtbl *lpWebBrowserVtbl;
const IOleObjectVtbl *lpOleObjectVtbl; const IOleObjectVtbl *lpOleObjectVtbl;
const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
const IOleControlVtbl *lpOleControlVtbl;
LONG ref; LONG ref;
} WebBrowser; } WebBrowser;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowserVtbl) #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowserVtbl)
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl) #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
void WebBrowser_OleObject_Init(WebBrowser*); void WebBrowser_OleObject_Init(WebBrowser*);
...@@ -154,30 +158,6 @@ typedef struct ...@@ -154,30 +158,6 @@ typedef struct
LONG ref; LONG ref;
} IConnectionPointImpl; } IConnectionPointImpl;
/**********************************************************************
* IOleInPlaceObject declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IOleInPlaceObjectVtbl *lpVtbl;
DWORD ref;
} IOleInPlaceObjectImpl;
extern IOleInPlaceObjectImpl SHDOCVW_OleInPlaceObject;
/**********************************************************************
* IOleControl declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IOleControlVtbl *lpVtbl;
DWORD ref;
} IOleControlImpl;
extern IOleControlImpl SHDOCVW_OleControl;
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
/********************************************************************** /**********************************************************************
......
...@@ -42,14 +42,23 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid, ...@@ -42,14 +42,23 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid,
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = WEBBROWSER(This); *ppv = WEBBROWSER(This);
}else if(IsEqualGUID (&IID_IDispatch, riid)) { }else if(IsEqualGUID (&IID_IDispatch, riid)) {
FIXME("(%p)->(IID_IDispatch %p)\n", This, ppv); TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = WEBBROWSER(This); *ppv = WEBBROWSER(This);
}else if(IsEqualGUID(&IID_IWebBrowser, riid)) { }else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv); TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
*ppv = WEBBROWSER(This); *ppv = WEBBROWSER(This);
}else if(IsEqualGUID(&IID_IOleObject, riid)) { }else if(IsEqualGUID(&IID_IOleObject, riid)) {
FIXME("(%p)->(IID_IOleObject %p)\n", This, ppv); TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
*ppv = OLEOBJ(This); *ppv = OLEOBJ(This);
}else if(IsEqualGUID(&IID_IOleWindow, riid)) {
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
*ppv = INPLACEOBJ(This);
}else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
*ppv = INPLACEOBJ(This);
}else if(IsEqualGUID (&IID_IOleControl, riid)) {
FIXME("(%p)->(IID_IOleControl %p)\n", This, ppv);
*ppv = CONTROL(This);
}else if(IsEqualGUID (&IID_IPersistStorage, riid)) { }else if(IsEqualGUID (&IID_IPersistStorage, riid)) {
FIXME("(%p)->(IID_IPersistStorage %p)\n", This, ppv); FIXME("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
*ppv = &SHDOCVW_PersistStorage; *ppv = &SHDOCVW_PersistStorage;
...@@ -68,12 +77,6 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid, ...@@ -68,12 +77,6 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid,
}else if(IsEqualGUID (&IID_IConnectionPointContainer, riid)) { }else if(IsEqualGUID (&IID_IConnectionPointContainer, riid)) {
FIXME("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv); FIXME("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
*ppv = &SHDOCVW_ConnectionPointContainer; *ppv = &SHDOCVW_ConnectionPointContainer;
}else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
FIXME("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
*ppv = &SHDOCVW_OleInPlaceObject;
}else if(IsEqualGUID (&IID_IOleControl, riid)) {
FIXME("(%p)->(IID_IOleControl %p)\n", This, ppv);
*ppv = &SHDOCVW_OleControl;
} }
if(*ppv) { if(*ppv) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment