ReactOS  0.4.13-dev-961-g238ea69
classinfo.c
Go to the documentation of this file.
1 /*
2  * Implementation of IProvideClassInfo interfaces for WebBrowser control
3  *
4  * Copyright 2001 John R. Sheets (for CodeWeavers)
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include "ieframe.h"
22 
23 #include "wine/debug.h"
24 
26 
27 /**********************************************************************
28  * Implement the IProvideClassInfo2 interface
29  */
30 
32 {
33  return CONTAINING_RECORD(iface, WebBrowser, IProvideClassInfo2_iface);
34 }
35 
37  REFIID riid, LPVOID *ppobj)
38 {
40  return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppobj);
41 }
42 
44 {
46  return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
47 }
48 
50 {
52  return IWebBrowser2_Release(&This->IWebBrowser2_iface);
53 }
54 
56 {
58  HRESULT hres;
59 
60  TRACE("(%p)->(%p)\n", This, ppTI);
61 
62  hres = get_typeinfo(This->version > 1 ? WebBrowser_tid : WebBrowser_V1_tid, ppTI);
63  if(FAILED(hres))
64  return hres;
65 
66  ITypeInfo_AddRef(*ppTI);
67  return S_OK;
68 }
69 
71  DWORD dwGuidKind, GUID *pGUID)
72 {
74 
75  TRACE("(%p)->(%d %p)\n", This, dwGuidKind, pGUID);
76 
77  if(!pGUID)
78  return E_POINTER;
79 
80  if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
81  WARN("Wrong GUID type: %d\n", dwGuidKind);
82  *pGUID = IID_NULL;
83  return E_FAIL;
84  }
85 
86  memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2,
87  sizeof(GUID));
88  return S_OK;
89 }
90 
91 static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl =
92 {
98 };
99 
101 {
102  This->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfoVtbl;
103 }
static HRESULT WINAPI ProvideClassInfo_QueryInterface(IProvideClassInfo2 *iface, REFIID riid, LPVOID *ppobj)
Definition: classinfo.c:36
#define REFIID
Definition: guiddef.h:118
static ULONG WINAPI ProvideClassInfo_AddRef(IProvideClassInfo2 *iface)
Definition: classinfo.c:43
REFIID riid
Definition: precomp.h:44
static const IProvideClassInfo2Vtbl ProvideClassInfoVtbl
Definition: classinfo.c:91
#define WARN(fmt,...)
Definition: debug.h:111
static WebBrowser * impl_from_IProvideClassInfo2(IProvideClassInfo2 *iface)
Definition: classinfo.c:31
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI)
Definition: classinfo.c:55
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:120
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID)
Definition: classinfo.c:70
#define IID_NULL
Definition: guiddef.h:98
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
WINE_DEFAULT_DEBUG_CHANNEL(ieframe)
static ULONG WINAPI ProvideClassInfo_Release(IProvideClassInfo2 *iface)
Definition: classinfo.c:49
void WebBrowser_ClassInfo_Init(WebBrowser *This)
Definition: classinfo.c:100
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365