ReactOS  0.4.14-dev-323-g6fe6a88
profile.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 
35 typedef struct fw_profile
36 {
39 } fw_profile;
40 
42 {
43  return CONTAINING_RECORD(iface, fw_profile, INetFwProfile_iface);
44 }
45 
47  INetFwProfile *iface )
48 {
51 }
52 
54  INetFwProfile *iface )
55 {
58  if (!refs)
59  {
60  TRACE("destroying %p\n", fw_profile);
62  }
63  return refs;
64 }
65 
67  INetFwProfile *iface,
68  REFIID riid,
69  void **ppvObject )
70 {
72 
73  TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
74 
75  if ( IsEqualGUID( riid, &IID_INetFwProfile ) ||
78  {
79  *ppvObject = iface;
80  }
81  else
82  {
83  FIXME("interface %s not implemented\n", debugstr_guid(riid));
84  return E_NOINTERFACE;
85  }
86  INetFwProfile_AddRef( iface );
87  return S_OK;
88 }
89 
91  INetFwProfile *iface,
92  UINT *pctinfo )
93 {
95 
96  TRACE("%p %p\n", This, pctinfo);
97  *pctinfo = 1;
98  return S_OK;
99 }
100 
102  INetFwProfile *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( INetFwProfile_tid, ppTInfo );
111 }
112 
114  INetFwProfile *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  INetFwProfile *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->INetFwProfile_iface, dispIdMember,
158  wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
159  ITypeInfo_Release( typeinfo );
160  }
161  return hr;
162 }
163 
165  INetFwProfile *iface,
167 {
169 
170  FIXME("%p, %p\n", This, type);
171  return E_NOTIMPL;
172 }
173 
175  INetFwProfile *iface,
177 {
179 
180  FIXME("%p, %p\n", This, enabled);
181 
182  *enabled = VARIANT_FALSE;
183  return S_OK;
184 }
185 
187  INetFwProfile *iface,
189 {
191 
192  FIXME("%p, %d\n", This, enabled);
193  return E_NOTIMPL;
194 }
195 
197  INetFwProfile *iface,
198  VARIANT_BOOL *notAllowed )
199 {
201 
202  FIXME("%p, %p\n", This, notAllowed);
203  return E_NOTIMPL;
204 }
205 
207  INetFwProfile *iface,
208  VARIANT_BOOL notAllowed )
209 {
211 
212  FIXME("%p, %d\n", This, notAllowed);
213  return E_NOTIMPL;
214 }
215 
217  INetFwProfile *iface,
218  VARIANT_BOOL *disabled )
219 {
221 
222  FIXME("%p, %p\n", This, disabled);
223  return E_NOTIMPL;
224 }
225 
227  INetFwProfile *iface,
228  VARIANT_BOOL disabled )
229 {
231 
232  FIXME("%p, %d\n", This, disabled);
233  return E_NOTIMPL;
234 }
235 
237  INetFwProfile *iface,
238  VARIANT_BOOL *disabled )
239 {
241 
242  FIXME("%p, %p\n", This, disabled);
243  return E_NOTIMPL;
244 }
245 
247  INetFwProfile *iface,
248  VARIANT_BOOL disabled )
249 {
251 
252  FIXME("%p, %d\n", This, disabled);
253  return E_NOTIMPL;
254 }
255 
257  INetFwProfile *iface,
258  INetFwRemoteAdminSettings **remoteAdminSettings )
259 {
261 
262  FIXME("%p, %p\n", This, remoteAdminSettings);
263  return E_NOTIMPL;
264 }
265 
267  INetFwProfile *iface,
268  INetFwIcmpSettings **icmpSettings )
269 {
271 
272  FIXME("%p, %p\n", This, icmpSettings);
273  return E_NOTIMPL;
274 }
275 
277  INetFwProfile *iface,
278  INetFwOpenPorts **openPorts )
279 {
281 
282  TRACE("%p, %p\n", This, openPorts);
283  return NetFwOpenPorts_create( NULL, (void **)openPorts );
284 }
285 
287  INetFwProfile *iface,
289 {
291 
292  TRACE("%p, %p\n", This, Services);
293  return NetFwServices_create( NULL, (void **)Services );
294 }
295 
297  INetFwProfile *iface,
299 {
301 
302  TRACE("%p, %p\n", This, apps);
303  return NetFwAuthorizedApplications_create( NULL, (void **)apps );
304 }
305 
306 static const struct INetFwProfileVtbl fw_profile_vtbl =
307 {
329 };
330 
332 {
333  fw_profile *fp;
334 
335  TRACE("(%p,%p)\n", pUnkOuter, ppObj);
336 
337  fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
338  if (!fp) return E_OUTOFMEMORY;
339 
340  fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl;
341  fp->refs = 1;
342 
343  *ppObj = &fp->INetFwProfile_iface;
344 
345  TRACE("returning iface %p\n", *ppObj);
346  return S_OK;
347 }
static HRESULT WINAPI fw_profile_GetIDsOfNames(INetFwProfile *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: profile.c:113
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI fw_profile_get_Type(INetFwProfile *iface, NET_FW_PROFILE_TYPE *type)
Definition: profile.c:164
static HRESULT WINAPI fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled(INetFwProfile *iface, VARIANT_BOOL disabled)
Definition: profile.c:246
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI fw_profile_QueryInterface(INetFwProfile *iface, REFIID riid, void **ppvObject)
Definition: profile.c:66
static HRESULT WINAPI fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled(INetFwProfile *iface, VARIANT_BOOL *disabled)
Definition: profile.c:236
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
DWORD LCID
Definition: nls.h:13
static HRESULT WINAPI fw_profile_get_NotificationsDisabled(INetFwProfile *iface, VARIANT_BOOL *disabled)
Definition: profile.c:216
static LPOLESTR
Definition: stg_prop.c:27
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
short VARIANT_BOOL
Definition: compat.h:1931
HRESULT NetFwOpenPorts_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN
Definition: port.c:589
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT WINAPI fw_profile_get_AuthorizedApplications(INetFwProfile *iface, INetFwAuthorizedApplications **apps)
Definition: profile.c:296
long LONG
Definition: pedump.c:60
WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg)
#define FIXME(fmt,...)
Definition: debug.h:110
static SERVICES Services[NUM_SERVICES]
Definition: tcpsvcs.c:26
smooth NULL
Definition: ftsmooth.c:416
HRESULT NetFwProfile_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: profile.c:331
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
#define debugstr_guid
Definition: kernel32.h:35
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
static HRESULT WINAPI fw_profile_get_ExceptionsNotAllowed(INetFwProfile *iface, VARIANT_BOOL *notAllowed)
Definition: profile.c:196
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static HRESULT WINAPI fw_profile_GetTypeInfoCount(INetFwProfile *iface, UINT *pctinfo)
Definition: profile.c:90
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
static HRESULT WINAPI fw_profile_get_Services(INetFwProfile *iface, INetFwServices **Services)
Definition: profile.c:286
INetFwProfile INetFwProfile_iface
Definition: profile.c:37
const GUID IID_IDispatch
enum NET_FW_PROFILE_TYPE_ NET_FW_PROFILE_TYPE
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:109
#define InterlockedDecrement
Definition: armddk.h:52
HRESULT NetFwAuthorizedApplications_create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: apps.c:645
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static HRESULT WINAPI fw_profile_put_FirewallEnabled(INetFwProfile *iface, VARIANT_BOOL enabled)
Definition: profile.c:186
static HRESULT WINAPI fw_profile_get_RemoteAdminSettings(INetFwProfile *iface, INetFwRemoteAdminSettings **remoteAdminSettings)
Definition: profile.c:256
static ULONG WINAPI fw_profile_AddRef(INetFwProfile *iface)
Definition: profile.c:46
struct fw_profile fw_profile
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT WINAPI fw_profile_get_GloballyOpenPorts(INetFwProfile *iface, INetFwOpenPorts **openPorts)
Definition: profile.c:276
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static ULONG WINAPI fw_profile_Release(INetFwProfile *iface)
Definition: profile.c:53
static HRESULT WINAPI fw_profile_put_ExceptionsNotAllowed(INetFwProfile *iface, VARIANT_BOOL notAllowed)
Definition: profile.c:206
static HRESULT WINAPI fw_profile_get_FirewallEnabled(INetFwProfile *iface, VARIANT_BOOL *enabled)
Definition: profile.c:174
struct stdole::DISPPARAMS DISPPARAMS
HRESULT NetFwServices_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN
Definition: service.c:461
static fw_profile * impl_from_INetFwProfile(INetFwProfile *iface)
Definition: profile.c:41
unsigned int ULONG
Definition: retypes.h:1
static const struct INetFwProfileVtbl fw_profile_vtbl
Definition: profile.c:306
static HRESULT WINAPI fw_profile_put_NotificationsDisabled(INetFwProfile *iface, VARIANT_BOOL disabled)
Definition: profile.c:226
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LONG refs
Definition: profile.c:38
static HRESULT WINAPI fw_profile_get_IcmpSettings(INetFwProfile *iface, INetFwIcmpSettings **icmpSettings)
Definition: profile.c:266
static HRESULT WINAPI fw_profile_GetTypeInfo(INetFwProfile *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: profile.c:101
static HRESULT WINAPI fw_profile_Invoke(INetFwProfile *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: profile.c:136