2002-05-05 21:40:57 +02:00
|
|
|
/*
|
2005-09-08 20:55:50 +02:00
|
|
|
* Implementation of IProvideClassInfo interfaces for WebBrowser control
|
2002-05-05 21:40:57 +02:00
|
|
|
*
|
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
#include "ieframe.h"
|
2002-12-05 21:33:07 +01:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2011-07-29 12:18:33 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
|
2002-05-05 21:40:57 +02:00
|
|
|
|
|
|
|
/**********************************************************************
|
2005-09-08 20:55:50 +02:00
|
|
|
* Implement the IProvideClassInfo2 interface
|
2002-05-05 21:40:57 +02:00
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IProvideClassInfo2(IProvideClassInfo2 *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IProvideClassInfo2_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo2 *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IProvideClassInfo2(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IProvideClassInfo2(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo2 *iface)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IProvideClassInfo2(iface);
|
2010-11-13 17:47:05 +01:00
|
|
|
return IWebBrowser_Release(&This->IWebBrowser2_iface);
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2012-02-10 12:36:53 +01:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IProvideClassInfo2(iface);
|
2012-02-10 12:36:53 +01:00
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppTI);
|
|
|
|
|
|
|
|
hres = get_typeinfo(This->version > 1 ? WebBrowser_tid : WebBrowser_V1_tid, ppTI);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
ITypeInfo_AddRef(*ppTI);
|
|
|
|
return S_OK;
|
2002-05-05 21:40:57 +02:00
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface,
|
|
|
|
DWORD dwGuidKind, GUID *pGUID)
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IProvideClassInfo2(iface);
|
2005-09-08 20:55:50 +02:00
|
|
|
|
2006-10-05 23:49:39 +02:00
|
|
|
TRACE("(%p)->(%d %p)\n", This, dwGuidKind, pGUID);
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2006-02-21 10:05:00 +01:00
|
|
|
if(!pGUID)
|
|
|
|
return E_POINTER;
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2006-02-21 10:05:00 +01:00
|
|
|
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
|
2006-10-05 23:49:39 +02:00
|
|
|
WARN("Wrong GUID type: %d\n", dwGuidKind);
|
2008-03-17 22:36:56 +01:00
|
|
|
*pGUID = IID_NULL;
|
2006-02-21 10:05:00 +01:00
|
|
|
return E_FAIL;
|
|
|
|
}
|
2002-05-05 21:40:57 +02:00
|
|
|
|
2006-08-09 16:31:31 +02:00
|
|
|
memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2,
|
|
|
|
sizeof(GUID));
|
2002-05-05 21:40:57 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl =
|
2002-05-05 21:40:57 +02:00
|
|
|
{
|
2005-09-08 20:55:50 +02:00
|
|
|
ProvideClassInfo_QueryInterface,
|
|
|
|
ProvideClassInfo_AddRef,
|
|
|
|
ProvideClassInfo_Release,
|
|
|
|
ProvideClassInfo_GetClassInfo,
|
|
|
|
ProvideClassInfo_GetGUID
|
2002-05-05 21:40:57 +02:00
|
|
|
};
|
|
|
|
|
2005-09-08 20:55:50 +02:00
|
|
|
void WebBrowser_ClassInfo_Init(WebBrowser *This)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
This->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfoVtbl;
|
2005-09-08 20:55:50 +02:00
|
|
|
}
|