ReactOS 0.4.16-dev-306-g647d351
manager.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Hans Leidekker for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include <stdarg.h>
20#include <stdio.h>
21
22#define COBJMACROS
23
24#include "windef.h"
25#include "winbase.h"
26#include "winuser.h"
27#include "ole2.h"
28#include "netfw.h"
29
30#include "wine/debug.h"
31#include "hnetcfg_private.h"
32
34
35typedef struct fw_manager
36{
40
42{
43 return CONTAINING_RECORD(iface, fw_manager, INetFwMgr_iface);
44}
45
47 INetFwMgr *iface )
48{
51}
52
54 INetFwMgr *iface )
55{
58 if (!refs)
59 {
60 TRACE("destroying %p\n", fw_manager);
62 }
63 return refs;
64}
65
67 INetFwMgr *iface,
69 void **ppvObject )
70{
72
73 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
74
75 if ( IsEqualGUID( riid, &IID_INetFwMgr ) ||
78 {
79 *ppvObject = iface;
80 }
81 else
82 {
83 FIXME("interface %s not implemented\n", debugstr_guid(riid));
84 return E_NOINTERFACE;
85 }
86 INetFwMgr_AddRef( iface );
87 return S_OK;
88}
89
91 INetFwMgr *iface,
92 UINT *pctinfo )
93{
95
96 TRACE("%p %p\n", This, pctinfo);
97 *pctinfo = 1;
98 return S_OK;
99}
100
102 INetFwMgr *iface,
103 UINT iTInfo,
104 LCID lcid,
105 ITypeInfo **ppTInfo )
106{
108
109 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
110 return get_typeinfo( INetFwMgr_tid, ppTInfo );
111}
112
114 INetFwMgr *iface,
115 REFIID riid,
116 LPOLESTR *rgszNames,
117 UINT cNames,
118 LCID lcid,
119 DISPID *rgDispId )
120{
123 HRESULT hr;
124
125 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
126
128 if (SUCCEEDED(hr))
129 {
130 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
131 ITypeInfo_Release( typeinfo );
132 }
133 return hr;
134}
135
137 INetFwMgr *iface,
138 DISPID dispIdMember,
139 REFIID riid,
140 LCID lcid,
141 WORD wFlags,
142 DISPPARAMS *pDispParams,
143 VARIANT *pVarResult,
144 EXCEPINFO *pExcepInfo,
145 UINT *puArgErr )
146{
149 HRESULT hr;
150
151 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
152 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
153
155 if (SUCCEEDED(hr))
156 {
157 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwMgr_iface, dispIdMember,
158 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
159 ITypeInfo_Release( typeinfo );
160 }
161 return hr;
162}
163
165 INetFwMgr *iface,
166 INetFwPolicy **localPolicy )
167{
169
170 TRACE("%p, %p\n", This, localPolicy);
171 return NetFwPolicy_create( NULL, (void **)localPolicy );
172}
173
175 INetFwMgr *iface,
176 NET_FW_PROFILE_TYPE *profileType )
177{
179
180 FIXME("%p, %p\n", This, profileType);
181 return E_NOTIMPL;
182}
183
185 INetFwMgr *iface )
186{
188
189 FIXME("%p\n", This);
190 return E_NOTIMPL;
191}
192
194 INetFwMgr *iface,
195 BSTR imageFileName,
196 NET_FW_IP_VERSION ipVersion,
197 LONG portNumber,
198 BSTR localAddress,
199 NET_FW_IP_PROTOCOL ipProtocol,
200 VARIANT *allowed,
201 VARIANT *restricted )
202{
204
205 FIXME("%p, %s, %u, %d, %s, %u, %p, %p\n", This, debugstr_w(imageFileName),
206 ipVersion, portNumber, debugstr_w(localAddress), ipProtocol, allowed, restricted);
207 return E_NOTIMPL;
208}
209
211 INetFwMgr *iface,
212 NET_FW_IP_VERSION ipVersion,
213 BSTR localAddress,
214 BYTE type,
215 VARIANT *allowed,
216 VARIANT *restricted )
217{
219
220 FIXME("%p, %u, %s, %u, %p, %p\n", This, ipVersion, debugstr_w(localAddress),
221 type, allowed, restricted);
222 return E_NOTIMPL;
223}
224
225static const struct INetFwMgrVtbl fw_manager_vtbl =
226{
239};
240
242{
243 fw_manager *fm;
244
245 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
246
247 fm = HeapAlloc( GetProcessHeap(), 0, sizeof(*fm) );
248 if (!fm) return E_OUTOFMEMORY;
249
250 fm->INetFwMgr_iface.lpVtbl = &fw_manager_vtbl;
251 fm->refs = 1;
252
253 *ppObj = &fm->INetFwMgr_iface;
254
255 TRACE("returning iface %p\n", *ppObj);
256 return S_OK;
257}
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
OLECHAR * BSTR
Definition: compat.h:2293
#define HeapFree(x, y, z)
Definition: compat.h:735
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HRESULT NetFwPolicy_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN
Definition: policy.c:436
@ INetFwMgr_tid
enum NET_FW_PROFILE_TYPE_ NET_FW_PROFILE_TYPE
enum NET_FW_IP_PROTOCOL_ NET_FW_IP_PROTOCOL
enum NET_FW_IP_VERSION_ NET_FW_IP_VERSION
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
HRESULT NetFwMgr_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: manager.c:241
static HRESULT WINAPI fw_manager_QueryInterface(INetFwMgr *iface, REFIID riid, void **ppvObject)
Definition: manager.c:66
static fw_manager * impl_from_INetFwMgr(INetFwMgr *iface)
Definition: manager.c:41
static HRESULT WINAPI fw_manager_Invoke(INetFwMgr *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: manager.c:136
static HRESULT WINAPI fw_manager_RestoreDefaults(INetFwMgr *iface)
Definition: manager.c:184
static HRESULT WINAPI fw_manager_GetIDsOfNames(INetFwMgr *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: manager.c:113
static ULONG WINAPI fw_manager_AddRef(INetFwMgr *iface)
Definition: manager.c:46
static HRESULT WINAPI fw_manager_GetTypeInfoCount(INetFwMgr *iface, UINT *pctinfo)
Definition: manager.c:90
static HRESULT WINAPI fw_manager_get_CurrentProfileType(INetFwMgr *iface, NET_FW_PROFILE_TYPE *profileType)
Definition: manager.c:174
static const struct INetFwMgrVtbl fw_manager_vtbl
Definition: manager.c:225
static HRESULT WINAPI fw_manager_GetTypeInfo(INetFwMgr *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: manager.c:101
static HRESULT WINAPI fw_manager_IsIcmpTypeAllowed(INetFwMgr *iface, NET_FW_IP_VERSION ipVersion, BSTR localAddress, BYTE type, VARIANT *allowed, VARIANT *restricted)
Definition: manager.c:210
static HRESULT WINAPI fw_manager_IsPortAllowed(INetFwMgr *iface, BSTR imageFileName, NET_FW_IP_VERSION ipVersion, LONG portNumber, BSTR localAddress, NET_FW_IP_PROTOCOL ipProtocol, VARIANT *allowed, VARIANT *restricted)
Definition: manager.c:193
static ULONG WINAPI fw_manager_Release(INetFwMgr *iface)
Definition: manager.c:53
static HRESULT WINAPI fw_manager_get_LocalPolicy(INetFwMgr *iface, INetFwPolicy **localPolicy)
Definition: manager.c:164
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
unsigned int UINT
Definition: ndis.h:50
const GUID IID_IDispatch
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
DWORD LCID
Definition: nls.h:13
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
LONG refs
Definition: manager.c:38
INetFwMgr INetFwMgr_iface
Definition: manager.c:37
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
unsigned char BYTE
Definition: xxhash.c:193