- Make WebBrowser heap based object.

- Improve stubs.
This commit is contained in:
Jacek Caban 2005-09-06 11:41:14 +00:00 committed by Alexandre Julliard
parent 7a843c668e
commit 755e2bac6c
4 changed files with 454 additions and 531 deletions

View File

@ -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));
TRACE("(%s %p)\n", debugstr_guid(riid), ppobj);
if (ppobj == NULL) return E_POINTER;
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);
}
/************************************************************************

View File

@ -1,11 +1,12 @@
/*
* Implementation of IOleObject interfaces for IE Web Browser
* Implementation of IOleObject interfaces for WebBrowser control
*
* - IOleObject
* - IOleInPlaceObject
* - IOleControl
*
* Copyright 2001 John R. Sheets (for CodeWeavers)
* Copyright 2005 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -25,257 +26,99 @@
#include <string.h>
#include "wine/debug.h"
#include "shdocvw.h"
#include "ole2.h"
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
/**********************************************************************
* IOleControl declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IOleControlVtbl *lpVtbl;
DWORD ref;
} IOleControlImpl;
static IOleControlImpl SHDOCVW_OleControl;
/**********************************************************************
* IOleInPlaceObject declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IOleInPlaceObjectVtbl *lpVtbl;
DWORD ref;
} IOleInPlaceObjectImpl;
static IOleInPlaceObjectImpl SHDOCVW_OleInPlaceObject;
/**********************************************************************
* Implement the IOleObject interface for the web browser component
*
* Based on DefaultHandler code in dlls/ole32/defaulthandler.c.
* Implement the IOleObject interface for the WebBrowser control
*/
static ULONG WINAPI WBOOBJ_AddRef(LPOLEOBJECT iface);
static ULONG WINAPI WBOOBJ_Release(LPOLEOBJECT iface);
#define OLEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface)
/************************************************************************
* WBOOBJ_QueryInterface (IUnknown)
*
* Interfaces we need to (at least pretend to) retrieve:
*
* a6bc3ac0-dbaa-11ce-9de3-00aa004bb851 IID_IProvideClassInfo2
* b196b283-bab4-101a-b69c-00aa00341d07 IID_IProvideClassInfo
* cf51ed10-62fe-11cf-bf86-00a0c9034836 IID_IQuickActivate
* 7fd52380-4e07-101b-ae2d-08002b2ec713 IID_IPersistStreamInit
* 0000010a-0000-0000-c000-000000000046 IID_IPersistStorage
* b196b284-bab4-101a-b69c-00aa00341d07 IID_IConnectionPointContainer
*/
static HRESULT WINAPI WBOOBJ_QueryInterface(LPOLEOBJECT iface,
REFIID riid, void** ppobj)
static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv)
{
IOleObjectImpl *This = (IOleObjectImpl *)iface;
/*
* Perform a sanity check on the parameters.
*/
if ((This == NULL) || (ppobj == NULL) )
return E_INVALIDARG;
if (IsEqualGUID (&IID_IPersistStorage, riid))
{
TRACE("Returning IID_IPersistStorage interface\n");
*ppobj = (LPVOID)&SHDOCVW_PersistStorage;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IPersistStreamInit, riid))
{
TRACE("Returning IID_IPersistStreamInit interface\n");
*ppobj = (LPVOID)&SHDOCVW_PersistStreamInit;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IProvideClassInfo, riid))
{
TRACE("Returning IID_IProvideClassInfo interface\n");
*ppobj = (LPVOID)&SHDOCVW_ProvideClassInfo;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IProvideClassInfo2, riid))
{
TRACE("Returning IID_IProvideClassInfo2 interface %p\n",
&SHDOCVW_ProvideClassInfo2);
*ppobj = (LPVOID)&SHDOCVW_ProvideClassInfo2;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IQuickActivate, riid))
{
TRACE("Returning IID_IQuickActivate interface\n");
*ppobj = (LPVOID)&SHDOCVW_QuickActivate;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IConnectionPointContainer, riid))
{
TRACE("Returning IID_IConnectionPointContainer interface\n");
*ppobj = (LPVOID)&SHDOCVW_ConnectionPointContainer;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IOleInPlaceObject, riid))
{
TRACE("Returning IID_IOleInPlaceObject interface\n");
*ppobj = (LPVOID)&SHDOCVW_OleInPlaceObject;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IOleControl, riid))
{
TRACE("Returning IID_IOleControl interface\n");
*ppobj = (LPVOID)&SHDOCVW_OleControl;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IWebBrowser, riid))
{
TRACE("Returning IID_IWebBrowser interface\n");
*ppobj = (LPVOID)&SHDOCVW_WebBrowser;
WBOOBJ_AddRef (iface);
return S_OK;
}
else if (IsEqualGUID (&IID_IDispatch, riid))
{
TRACE("Returning IID_IDispatch interface\n");
*ppobj = (LPVOID)&SHDOCVW_WebBrowser;
WBOOBJ_AddRef (iface);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppv);
}
TRACE ("Failed to find iid = %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
/************************************************************************
* WBOOBJ_AddRef (IUnknown)
*/
static ULONG WINAPI WBOOBJ_AddRef(LPOLEOBJECT iface)
static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
{
SHDOCVW_LockModule();
return 2; /* non-heap based object */
WebBrowser *This = OLEOBJ_THIS(iface);
return IWebBrowser_AddRef(WEBBROWSER(This));
}
/************************************************************************
* WBOOBJ_Release (IUnknown)
*/
static ULONG WINAPI WBOOBJ_Release(LPOLEOBJECT iface)
static ULONG WINAPI OleObject_Release(IOleObject *iface)
{
SHDOCVW_UnlockModule();
return 1; /* non-heap based object */
WebBrowser *This = OLEOBJ_THIS(iface);
return IWebBrowser_Release(WEBBROWSER(This));
}
/************************************************************************
* WBOOBJ_SetClientSite (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_SetClientSite(LPOLEOBJECT iface,
LPOLECLIENTSITE pClientSite)
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite)
{
FIXME("stub: (%p, %p)\n", iface, pClientSite);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, pClientSite);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_GetClientSite (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_GetClientSite(LPOLEOBJECT iface,
LPOLECLIENTSITE* ppClientSite)
static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE *ppClientSite)
{
FIXME("stub: (%p)\n", *ppClientSite);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppClientSite);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_SetHostNames (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_SetHostNames(LPOLEOBJECT iface, LPCOLESTR szContainerApp,
static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp,
LPCOLESTR szContainerObj)
{
FIXME("stub: (%p, %s, %s)\n", iface, debugstr_w(szContainerApp),
debugstr_w(szContainerObj));
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_Close (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_Close(LPOLEOBJECT iface, DWORD dwSaveOption)
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
{
FIXME("stub: ()\n");
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld)\n", This, dwSaveOption);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_SetMoniker (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_SetMoniker(LPOLEOBJECT iface,
DWORD dwWhichMoniker, IMoniker* pmk)
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker* pmk)
{
FIXME("stub: (%p, %ld, %p)\n", iface, dwWhichMoniker, pmk);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld, %p)\n", This, dwWhichMoniker, pmk);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_GetMoniker (IOleObject)
*
* Delegate this request to the client site if we have one.
*/
static HRESULT WINAPI WBOOBJ_GetMoniker(LPOLEOBJECT iface, DWORD dwAssign,
static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign,
DWORD dwWhichMoniker, LPMONIKER *ppmk)
{
FIXME("stub (%p, %ld, %ld, %p)\n", iface, dwAssign, dwWhichMoniker, ppmk);
return E_FAIL;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld, %ld, %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_InitFromData (IOleObject)
*
* This method is meaningless if the server is not running
*/
static HRESULT WINAPI WBOOBJ_InitFromData(LPOLEOBJECT iface, LPDATAOBJECT pDataObject,
static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDataObject,
BOOL fCreation, DWORD dwReserved)
{
FIXME("stub: (%p, %p, %d, %ld)\n", iface, pDataObject, fCreation, dwReserved);
return OLE_E_NOTRUNNING;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p, %d, %ld)\n", This, pDataObject, fCreation, dwReserved);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_GetClipboardData (IOleObject)
*
* This method is meaningless if the server is not running
*/
static HRESULT WINAPI WBOOBJ_GetClipboardData(LPOLEOBJECT iface, DWORD dwReserved,
static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved,
LPDATAOBJECT *ppDataObject)
{
FIXME("stub: (%p, %ld, %p)\n", iface, dwReserved, ppDataObject);
return OLE_E_NOTRUNNING;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld, %p)\n", This, dwReserved, ppDataObject);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_DoVerb (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_DoVerb(LPOLEOBJECT iface, LONG iVerb, struct tagMSG* lpmsg,
LPOLECLIENTSITE pActiveSite, LONG lindex,
HWND hwndParent, LPCRECT lprcPosRect)
static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG* lpmsg,
LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
{
FIXME(": stub iVerb = %ld\n", iVerb);
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
lprcPosRect);
switch (iVerb)
{
case OLEIVERB_INPLACEACTIVATE:
@ -286,126 +129,87 @@ static HRESULT WINAPI WBOOBJ_DoVerb(LPOLEOBJECT iface, LONG iVerb, struct tagMSG
break;
}
return S_OK;
}
/************************************************************************
* WBOOBJ_EnumVerbs (IOleObject)
*
* Delegate to OleRegEnumVerbs.
*/
static HRESULT WINAPI WBOOBJ_EnumVerbs(LPOLEOBJECT iface,
IEnumOLEVERB** ppEnumOleVerb)
{
TRACE("(%p, %p)\n", iface, ppEnumOleVerb);
return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb);
}
/************************************************************************
* WBOOBJ_EnumVerbs (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_Update(LPOLEOBJECT iface)
{
FIXME(": Stub\n");
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_IsUpToDate (IOleObject)
*
* This method is meaningless if the server is not running
*/
static HRESULT WINAPI WBOOBJ_IsUpToDate(LPOLEOBJECT iface)
static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
{
FIXME("(%p)\n", iface);
return OLE_E_NOTRUNNING;
WebBrowser *This = OLEOBJ_THIS(iface);
TRACE("(%p)->(%p)\n", This, ppEnumOleVerb);
return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb);
}
/************************************************************************
* WBOOBJ_GetUserClassID (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_GetUserClassID(LPOLEOBJECT iface, CLSID* pClsid)
static HRESULT WINAPI OleObject_Update(IOleObject *iface)
{
FIXME("stub: (%p, %p)\n", iface, pClsid);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_GetUserType (IOleObject)
*
* Delegate to OleRegGetUserType.
*/
static HRESULT WINAPI WBOOBJ_GetUserType(LPOLEOBJECT iface, DWORD dwFormOfType,
static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
{
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid)
{
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, pClsid);
return E_NOTIMPL;
}
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType,
LPOLESTR* pszUserType)
{
TRACE("(%p, %ld, %p)\n", iface, dwFormOfType, pszUserType);
WebBrowser *This = OLEOBJ_THIS(iface);
TRACE("(%p, %ld, %p)\n", This, dwFormOfType, pszUserType);
return OleRegGetUserType(&CLSID_WebBrowser, dwFormOfType, pszUserType);
}
/************************************************************************
* WBOOBJ_SetExtent (IOleObject)
*
* This method is meaningless if the server is not running
*/
static HRESULT WINAPI WBOOBJ_SetExtent(LPOLEOBJECT iface, DWORD dwDrawAspect,
SIZEL* psizel)
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
{
FIXME("stub: (%p, %lx, (%ld x %ld))\n", iface, dwDrawAspect,
psizel->cx, psizel->cy);
return OLE_E_NOTRUNNING;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%lx %p)\n", This, dwDrawAspect, psizel);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_GetExtent (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_GetExtent(LPOLEOBJECT iface, DWORD dwDrawAspect,
SIZEL* psizel)
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
{
FIXME("stub: (%p, %lx, %p)\n", iface, dwDrawAspect, psizel);
return S_OK;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%lx, %p)\n", This, dwDrawAspect, psizel);
return E_NOTIMPL;
}
/************************************************************************
* WBOOBJ_Advise (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_Advise(LPOLEOBJECT iface, IAdviseSink* pAdvSink,
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink,
DWORD* pdwConnection)
{
FIXME("stub: (%p, %p, %p)\n", iface, pAdvSink, pdwConnection);
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection);
return E_NOTIMPL;
}
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
{
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%ld)\n", This, dwConnection);
return E_NOTIMPL;
}
static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
{
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppenumAdvise);
return S_OK;
}
/************************************************************************
* WBOOBJ_Unadvise (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_Unadvise(LPOLEOBJECT iface, DWORD dwConnection)
{
FIXME("stub: (%p, %ld)\n", iface, dwConnection);
return S_OK;
}
/************************************************************************
* WBOOBJ_EnumAdvise (IOleObject)
*/
static HRESULT WINAPI WBOOBJ_EnumAdvise(LPOLEOBJECT iface, IEnumSTATDATA** ppenumAdvise)
{
FIXME("stub: (%p, %p)\n", iface, ppenumAdvise);
return S_OK;
}
/************************************************************************
* WBOOBJ_GetMiscStatus (IOleObject)
*
* Delegate to OleRegGetMiscStatus.
*/
static HRESULT WINAPI WBOOBJ_GetMiscStatus(LPOLEOBJECT iface, DWORD dwAspect,
DWORD* pdwStatus)
static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
{
WebBrowser *This = OLEOBJ_THIS(iface);
HRESULT hres;
TRACE("(%p, %lx, %p)\n", iface, dwAspect, pdwStatus);
TRACE("(%p)->(%lx, %p)\n", This, dwAspect, pdwStatus);
hres = OleRegGetMiscStatus(&CLSID_WebBrowser, dwAspect, pdwStatus);
@ -415,53 +219,43 @@ static HRESULT WINAPI WBOOBJ_GetMiscStatus(LPOLEOBJECT iface, DWORD dwAspect,
return S_OK;
}
/************************************************************************
* WBOOBJ_SetColorScheme (IOleObject)
*
* This method is meaningless if the server is not running
*/
static HRESULT WINAPI WBOOBJ_SetColorScheme(LPOLEOBJECT iface,
struct tagLOGPALETTE* pLogpal)
static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE* pLogpal)
{
FIXME("stub: (%p, %p))\n", iface, pLogpal);
return OLE_E_NOTRUNNING;
WebBrowser *This = OLEOBJ_THIS(iface);
FIXME("(%p)->(%p)\n", This, pLogpal);
return E_NOTIMPL;
}
/**********************************************************************
* IOleObject virtual function table for IE Web Browser component
*/
#undef OLEOBJ_THIS
static const IOleObjectVtbl WBOOBJ_Vtbl =
static const IOleObjectVtbl OleObjectVtbl =
{
WBOOBJ_QueryInterface,
WBOOBJ_AddRef,
WBOOBJ_Release,
WBOOBJ_SetClientSite,
WBOOBJ_GetClientSite,
WBOOBJ_SetHostNames,
WBOOBJ_Close,
WBOOBJ_SetMoniker,
WBOOBJ_GetMoniker,
WBOOBJ_InitFromData,
WBOOBJ_GetClipboardData,
WBOOBJ_DoVerb,
WBOOBJ_EnumVerbs,
WBOOBJ_Update,
WBOOBJ_IsUpToDate,
WBOOBJ_GetUserClassID,
WBOOBJ_GetUserType,
WBOOBJ_SetExtent,
WBOOBJ_GetExtent,
WBOOBJ_Advise,
WBOOBJ_Unadvise,
WBOOBJ_EnumAdvise,
WBOOBJ_GetMiscStatus,
WBOOBJ_SetColorScheme
OleObject_QueryInterface,
OleObject_AddRef,
OleObject_Release,
OleObject_SetClientSite,
OleObject_GetClientSite,
OleObject_SetHostNames,
OleObject_Close,
OleObject_SetMoniker,
OleObject_GetMoniker,
OleObject_InitFromData,
OleObject_GetClipboardData,
OleObject_DoVerb,
OleObject_EnumVerbs,
OleObject_Update,
OleObject_IsUpToDate,
OleObject_GetUserClassID,
OleObject_GetUserType,
OleObject_SetExtent,
OleObject_GetExtent,
OleObject_Advise,
OleObject_Unadvise,
OleObject_EnumAdvise,
OleObject_GetMiscStatus,
OleObject_SetColorScheme
};
IOleObjectImpl SHDOCVW_OleObject = {&WBOOBJ_Vtbl};
/**********************************************************************
* Implement the IOleInPlaceObject interface
*/
@ -559,7 +353,7 @@ static const IOleInPlaceObjectVtbl WBOIPO_Vtbl =
WBOIPO_ReactivateAndUndo
};
static IOleInPlaceObjectImpl SHDOCVW_OleInPlaceObject = {&WBOIPO_Vtbl};
IOleInPlaceObjectImpl SHDOCVW_OleInPlaceObject = {&WBOIPO_Vtbl};
/**********************************************************************
@ -629,4 +423,9 @@ static const IOleControlVtbl WBOC_Vtbl =
WBOC_FreezeEvents
};
static IOleControlImpl SHDOCVW_OleControl = {&WBOC_Vtbl};
IOleControlImpl SHDOCVW_OleControl = {&WBOC_Vtbl};
void WebBrowser_OleObject_Init(WebBrowser *This)
{
This->lpOleObjectVtbl = &OleObjectVtbl;
}

View File

@ -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;
typedef struct {
const IWebBrowserVtbl *lpWebBrowserVtbl;
const IOleObjectVtbl *lpOleObjectVtbl;
LONG ref;
} IOleObjectImpl;
} WebBrowser;
extern IOleObjectImpl SHDOCVW_OleObject;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowserVtbl)
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
/**********************************************************************
* IWebBrowser declaration for SHDOCVW.DLL
*/
typedef struct
{
/* IUnknown fields */
const IWebBrowserVtbl *lpVtbl;
LONG ref;
} IWebBrowserImpl;
extern IWebBrowserImpl SHDOCVW_WebBrowser;
void WebBrowser_OleObject_Init(WebBrowser*);
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
/**********************************************************************
* IProvideClassInfo declaration for SHDOCVW.DLL
@ -161,6 +154,32 @@ typedef struct
LONG ref;
} 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
*/

View File

@ -1,7 +1,8 @@
/*
* Implementation of IWebBrowser interface for IE Web Browser control
* Implementation of IWebBrowser interface for WebBrowser control
*
* Copyright 2001 John R. Sheets (for CodeWeavers)
* Copyright 2005 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -27,252 +28,365 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
* Implement the IWebBrowser interface
*/
static HRESULT WINAPI WB_QueryInterface(IWebBrowser *iface, REFIID riid, LPVOID *ppobj)
#define WEBBROWSER_THIS(iface) DEFINE_THIS(WebBrowser, WebBrowser, iface)
static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser *iface, REFIID riid, LPVOID *ppv)
{
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
WebBrowser *This = WEBBROWSER_THIS(iface);
if (ppobj == NULL) return E_POINTER;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = WEBBROWSER(This);
}else if(IsEqualGUID (&IID_IDispatch, riid)) {
FIXME("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = WEBBROWSER(This);
}else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
*ppv = WEBBROWSER(This);
}else if(IsEqualGUID(&IID_IOleObject, riid)) {
FIXME("(%p)->(IID_IOleObject %p)\n", This, ppv);
*ppv = OLEOBJ(This);
}else if(IsEqualGUID (&IID_IPersistStorage, riid)) {
FIXME("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
*ppv = &SHDOCVW_PersistStorage;
}else if(IsEqualGUID (&IID_IPersistStreamInit, riid)) {
FIXME("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
*ppv = &SHDOCVW_PersistStreamInit;
}else if(IsEqualGUID (&IID_IProvideClassInfo, riid)) {
FIXME("(%p)->(IID_IProvideClassInfo %p)\n", This, ppv);
*ppv = &SHDOCVW_ProvideClassInfo;
}else if(IsEqualGUID (&IID_IProvideClassInfo2, riid)) {
FIXME("(%p)->(IID_IProvideClassInfo2 %p)\n", This, ppv);
*ppv = &SHDOCVW_ProvideClassInfo2;
}else if(IsEqualGUID (&IID_IQuickActivate, riid)) {
FIXME("(%p)->(IID_IQuickActivate %p)\n", This, ppv);
*ppv = &SHDOCVW_QuickActivate;
}else if(IsEqualGUID (&IID_IConnectionPointContainer, riid)) {
FIXME("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
*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) {
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI WB_AddRef(IWebBrowser *iface)
static ULONG WINAPI WebBrowser_AddRef(IWebBrowser *iface)
{
SHDOCVW_LockModule();
return 2; /* non-heap based object */
WebBrowser *This = WEBBROWSER_THIS(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref);
return ref;
}
static ULONG WINAPI WB_Release(IWebBrowser *iface)
static ULONG WINAPI WebBrowser_Release(IWebBrowser *iface)
{
SHDOCVW_UnlockModule();
WebBrowser *This = WEBBROWSER_THIS(iface);
LONG ref = InterlockedDecrement(&This->ref);
return 1; /* non-heap based object */
TRACE("(%p) ref=%ld\n", This, ref);
if(!ref) {
HeapFree(GetProcessHeap(), 0, This);
SHDOCVW_UnlockModule();
}
return ref;
}
/* IDispatch methods */
static HRESULT WINAPI WB_GetTypeInfoCount(IWebBrowser *iface, UINT *pctinfo)
static HRESULT WINAPI WebBrowser_GetTypeInfoCount(IWebBrowser *iface, UINT *pctinfo)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_GetTypeInfo(IWebBrowser *iface, UINT iTInfo, LCID lcid,
static HRESULT WINAPI WebBrowser_GetTypeInfo(IWebBrowser *iface, UINT iTInfo, LCID lcid,
LPTYPEINFO *ppTInfo)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%d %ld %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_GetIDsOfNames(IWebBrowser *iface, REFIID riid,
static HRESULT WINAPI WebBrowser_GetIDsOfNames(IWebBrowser *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%s %p %d %ld %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
lcid, rgDispId);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_Invoke(IWebBrowser *iface, DISPID dispIdMember,
static HRESULT WINAPI WebBrowser_Invoke(IWebBrowser *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags,
DISPPARAMS *pDispParams, VARIANT *pVarResult,
EXCEPINFO *pExepInfo, UINT *puArgErr)
{
FIXME("stub dispIdMember = %d, IID = %s\n", (int)dispIdMember, debugstr_guid(riid));
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld %s %ld %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
return E_NOTIMPL;
}
/* IWebBrowser methods */
static HRESULT WINAPI WB_GoBack(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_GoBack(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_GoForward(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_GoForward(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_GoHome(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_GoHome(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_GoSearch(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_GoSearch(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_Navigate(IWebBrowser *iface, BSTR URL,
static HRESULT WINAPI WebBrowser_Navigate(IWebBrowser *iface, BSTR URL,
VARIANT *Flags, VARIANT *TargetFrameName,
VARIANT *PostData, VARIANT *Headers)
{
FIXME("stub: URL = %p (%p, %p, %p, %p)\n", URL, Flags, TargetFrameName,
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(URL), Flags, TargetFrameName,
PostData, Headers);
return S_OK;
return E_NOTIMPL;
}
static HRESULT WINAPI WB_Refresh(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_Refresh2(IWebBrowser *iface, VARIANT *Level)
static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser *iface, VARIANT *Level)
{
FIXME("stub: %p\n", Level);
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, Level);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_Stop(IWebBrowser *iface)
static HRESULT WINAPI WebBrowser_Stop(IWebBrowser *iface)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Application(IWebBrowser *iface, IDispatch **ppDisp)
static HRESULT WINAPI WebBrowser_get_Application(IWebBrowser *iface, IDispatch **ppDisp)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppDisp);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Parent(IWebBrowser *iface, IDispatch **ppDisp)
static HRESULT WINAPI WebBrowser_get_Parent(IWebBrowser *iface, IDispatch **ppDisp)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppDisp);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Container(IWebBrowser *iface, IDispatch **ppDisp)
static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser *iface, IDispatch **ppDisp)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppDisp);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Document(IWebBrowser *iface, IDispatch **ppDisp)
static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser *iface, IDispatch **ppDisp)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, ppDisp);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_TopLevelContainer(IWebBrowser *iface, VARIANT_BOOL *pBool)
static HRESULT WINAPI WebBrowser_get_TopLevelContainer(IWebBrowser *iface, VARIANT_BOOL *pBool)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pBool);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Type(IWebBrowser *iface, BSTR *Type)
static HRESULT WINAPI WebBrowser_get_Type(IWebBrowser *iface, BSTR *Type)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, Type);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Left(IWebBrowser *iface, long *pl)
static HRESULT WINAPI WebBrowser_get_Left(IWebBrowser *iface, long *pl)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pl);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_put_Left(IWebBrowser *iface, long Left)
static HRESULT WINAPI WebBrowser_put_Left(IWebBrowser *iface, long Left)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld)\n", This, Left);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Top(IWebBrowser *iface, long *pl)
static HRESULT WINAPI WebBrowser_get_Top(IWebBrowser *iface, long *pl)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pl);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_put_Top(IWebBrowser *iface, long Top)
static HRESULT WINAPI WebBrowser_put_Top(IWebBrowser *iface, long Top)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld)\n", This, Top);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Width(IWebBrowser *iface, long *pl)
static HRESULT WINAPI WebBrowser_get_Width(IWebBrowser *iface, long *pl)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pl);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_put_Width(IWebBrowser *iface, long Width)
static HRESULT WINAPI WebBrowser_put_Width(IWebBrowser *iface, long Width)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld)\n", This, Width);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Height(IWebBrowser *iface, long *pl)
static HRESULT WINAPI WebBrowser_get_Height(IWebBrowser *iface, long *pl)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pl);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_put_Height(IWebBrowser *iface, long Height)
static HRESULT WINAPI WebBrowser_put_Height(IWebBrowser *iface, long Height)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld)\n", This, Height);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_LocationName(IWebBrowser *iface, BSTR *LocationName)
static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser *iface, BSTR *LocationName)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, LocationName);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_LocationURL(IWebBrowser *iface, BSTR *LocationURL)
static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser *iface, BSTR *LocationURL)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, LocationURL);
return E_NOTIMPL;
}
static HRESULT WINAPI WB_get_Busy(IWebBrowser *iface, VARIANT_BOOL *pBool)
static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser *iface, VARIANT_BOOL *pBool)
{
FIXME("stub \n");
return S_OK;
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, pBool);
return E_NOTIMPL;
}
#undef WEBBROWSER_THIS
/**********************************************************************
* IWebBrowser virtual function table for IE Web Browser component
* IWebBrowser virtual function table for IWebBrowser interface
*/
static const IWebBrowserVtbl WB_Vtbl =
static const IWebBrowserVtbl WebBrowserVtbl =
{
WB_QueryInterface,
WB_AddRef,
WB_Release,
WB_GetTypeInfoCount,
WB_GetTypeInfo,
WB_GetIDsOfNames,
WB_Invoke,
WB_GoBack,
WB_GoForward,
WB_GoHome,
WB_GoSearch,
WB_Navigate,
WB_Refresh,
WB_Refresh2,
WB_Stop,
WB_get_Application,
WB_get_Parent,
WB_get_Container,
WB_get_Document,
WB_get_TopLevelContainer,
WB_get_Type,
WB_get_Left,
WB_put_Left,
WB_get_Top,
WB_put_Top,
WB_get_Width,
WB_put_Width,
WB_get_Height,
WB_put_Height,
WB_get_LocationName,
WB_get_LocationURL,
WB_get_Busy
WebBrowser_QueryInterface,
WebBrowser_AddRef,
WebBrowser_Release,
WebBrowser_GetTypeInfoCount,
WebBrowser_GetTypeInfo,
WebBrowser_GetIDsOfNames,
WebBrowser_Invoke,
WebBrowser_GoBack,
WebBrowser_GoForward,
WebBrowser_GoHome,
WebBrowser_GoSearch,
WebBrowser_Navigate,
WebBrowser_Refresh,
WebBrowser_Refresh2,
WebBrowser_Stop,
WebBrowser_get_Application,
WebBrowser_get_Parent,
WebBrowser_get_Container,
WebBrowser_get_Document,
WebBrowser_get_TopLevelContainer,
WebBrowser_get_Type,
WebBrowser_get_Left,
WebBrowser_put_Left,
WebBrowser_get_Top,
WebBrowser_put_Top,
WebBrowser_get_Width,
WebBrowser_put_Width,
WebBrowser_get_Height,
WebBrowser_put_Height,
WebBrowser_get_LocationName,
WebBrowser_get_LocationURL,
WebBrowser_get_Busy
};
IWebBrowserImpl SHDOCVW_WebBrowser = {&WB_Vtbl};
HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
{
WebBrowser *ret;
HRESULT hres;
TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv);
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WebBrowser));
ret->lpWebBrowserVtbl = &WebBrowserVtbl;
ret->ref = 0;
WebBrowser_OleObject_Init(ret);
hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
if(SUCCEEDED(hres)) {
SHDOCVW_LockModule();
}else {
HeapFree(GetProcessHeap(), 0, ret);
return hres;
}
return hres;
}