Commit 755e2bac authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

- Make WebBrowser heap based object.

- Improve stubs.
parent 7a843c66
......@@ -25,7 +25,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
/**********************************************************************
* Implement the IWebBrowser class factory
* Implement the WebBrowser class factory
*
* (Based on implementation in ddraw/main.c)
*/
......@@ -36,10 +36,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
static HRESULT WINAPI WBCF_QueryInterface(LPCLASSFACTORY iface,
REFIID riid, LPVOID *ppobj)
{
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
if (ppobj == NULL) return E_POINTER;
TRACE("(%s %p)\n", debugstr_guid(riid), ppobj);
if (!ppobj)
return E_POINTER;
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
*ppobj = iface;
return S_OK;
}
WARN("Not supported interface %s\n", debugstr_guid(riid));
*ppobj = NULL;
return E_NOINTERFACE;
}
......@@ -69,25 +78,7 @@ static ULONG WINAPI WBCF_Release(LPCLASSFACTORY iface)
static HRESULT WINAPI WBCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter,
REFIID riid, LPVOID *ppobj)
{
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* Don't support aggregation (yet?) */
if (pOuter)
{
TRACE ("Failed attempt to aggregate IWebBrowser\n");
return CLASS_E_NOAGGREGATION;
}
TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if ((IsEqualGUID (&IID_IOleObject, riid)))
{
TRACE ("Instantiating IOleObject component\n");
*ppobj = (LPVOID)&SHDOCVW_OleObject;
return S_OK;
}
return CLASS_E_CLASSNOTAVAILABLE;
return WebBrowser_Create(pOuter, riid, ppobj);
}
/************************************************************************
......@@ -98,9 +89,9 @@ static HRESULT WINAPI WBCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
TRACE("(%d)\n", dolock);
if (dolock)
SHDOCVW_LockModule();
SHDOCVW_LockModule();
else
SHDOCVW_UnlockModule();
SHDOCVW_UnlockModule();
return S_OK;
}
......
......@@ -22,7 +22,8 @@
#define __WINE_SHDOCVW_H
#define COM_NO_WINDOWS_H
/* FIXME: Is there a better way to deal with all these includes? */
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
......@@ -49,29 +50,21 @@ extern IClassFactoryImpl SHDOCVW_ClassFactory;
/**********************************************************************
* IOleObject declaration for SHDOCVW.DLL
* WebBrowser declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IOleObjectVtbl *lpVtbl;
LONG ref;
} IOleObjectImpl;
extern IOleObjectImpl SHDOCVW_OleObject;
typedef struct {
const IWebBrowserVtbl *lpWebBrowserVtbl;
const IOleObjectVtbl *lpOleObjectVtbl;
/**********************************************************************
* IWebBrowser declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IWebBrowserVtbl *lpVtbl;
LONG ref;
} IWebBrowserImpl;
} WebBrowser;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowserVtbl)
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
extern IWebBrowserImpl SHDOCVW_WebBrowser;
void WebBrowser_OleObject_Init(WebBrowser*);
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
/**********************************************************************
* IProvideClassInfo declaration for SHDOCVW.DLL
......@@ -162,6 +155,32 @@ typedef struct
} 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)))
/**********************************************************************
* Dll lifetime tracking declaration for shdocvw.dll
*/
extern LONG SHDOCVW_refCount;
......
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