windows.applicationmodel/tests: Use PathRemoveFileSpecW() instead of PathCchRemoveFil...
[wine.git] / dlls / ieframe / classinfo.c
blob254cba3ce39e71e50ad4fc3c3b528e7a0324a27a
1 /*
2 * Implementation of IProvideClassInfo interfaces for WebBrowser control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "ieframe.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
27 /**********************************************************************
28 * Implement the IProvideClassInfo2 interface
31 static inline WebBrowser *impl_from_IProvideClassInfo2(IProvideClassInfo2 *iface)
33 return CONTAINING_RECORD(iface, WebBrowser, IProvideClassInfo2_iface);
36 static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo2 *iface,
37 REFIID riid, LPVOID *ppobj)
39 WebBrowser *This = impl_from_IProvideClassInfo2(iface);
40 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppobj);
43 static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo2 *iface)
45 WebBrowser *This = impl_from_IProvideClassInfo2(iface);
46 return IUnknown_AddRef(This->hlink_frame.outer);
49 static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo2 *iface)
51 WebBrowser *This = impl_from_IProvideClassInfo2(iface);
52 return IUnknown_Release(This->hlink_frame.outer);
55 static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
57 WebBrowser *This = impl_from_IProvideClassInfo2(iface);
58 HRESULT hres;
60 TRACE("(%p)->(%p)\n", This, ppTI);
62 hres = get_typeinfo(This->version > 1 ? WebBrowser_tid : WebBrowser_V1_tid, ppTI);
63 if(FAILED(hres))
64 return hres;
66 ITypeInfo_AddRef(*ppTI);
67 return S_OK;
70 static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface,
71 DWORD dwGuidKind, GUID *pGUID)
73 WebBrowser *This = impl_from_IProvideClassInfo2(iface);
75 TRACE("(%p)->(%ld %p)\n", This, dwGuidKind, pGUID);
77 if(!pGUID)
78 return E_POINTER;
80 if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
81 WARN("Wrong GUID type: %ld\n", dwGuidKind);
82 *pGUID = IID_NULL;
83 return E_FAIL;
86 memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2,
87 sizeof(GUID));
88 return S_OK;
91 static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl =
93 ProvideClassInfo_QueryInterface,
94 ProvideClassInfo_AddRef,
95 ProvideClassInfo_Release,
96 ProvideClassInfo_GetClassInfo,
97 ProvideClassInfo_GetGUID
100 void WebBrowser_ClassInfo_Init(WebBrowser *This)
102 This->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfoVtbl;