2 * Copyright 2009 Hans Leidekker for CodeWeavers
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.
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.
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
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
33 #include "hnetcfg_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
37 typedef struct fw_profile
39 INetFwProfile INetFwProfile_iface;
43 static inline fw_profile *impl_from_INetFwProfile( INetFwProfile *iface )
45 return CONTAINING_RECORD(iface, fw_profile, INetFwProfile_iface);
48 static ULONG WINAPI fw_profile_AddRef(
49 INetFwProfile *iface )
51 fw_profile *fw_profile = impl_from_INetFwProfile( iface );
52 return InterlockedIncrement( &fw_profile->refs );
55 static ULONG WINAPI fw_profile_Release(
56 INetFwProfile *iface )
58 fw_profile *fw_profile = impl_from_INetFwProfile( iface );
59 LONG refs = InterlockedDecrement( &fw_profile->refs );
62 TRACE("destroying %p\n", fw_profile);
63 HeapFree( GetProcessHeap(), 0, fw_profile );
68 static HRESULT WINAPI fw_profile_QueryInterface(
73 fw_profile *This = impl_from_INetFwProfile( iface );
75 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
77 if ( IsEqualGUID( riid, &IID_INetFwProfile ) ||
78 IsEqualGUID( riid, &IID_IDispatch ) ||
79 IsEqualGUID( riid, &IID_IUnknown ) )
85 FIXME("interface %s not implemented\n", debugstr_guid(riid));
88 INetFwProfile_AddRef( iface );
92 static HRESULT WINAPI fw_profile_GetTypeInfoCount(
96 fw_profile *This = impl_from_INetFwProfile( iface );
98 FIXME("%p %p\n", This, pctinfo);
102 static HRESULT WINAPI fw_profile_GetTypeInfo(
103 INetFwProfile *iface,
106 ITypeInfo **ppTInfo )
108 fw_profile *This = impl_from_INetFwProfile( iface );
110 FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
114 static HRESULT WINAPI fw_profile_GetIDsOfNames(
115 INetFwProfile *iface,
122 fw_profile *This = impl_from_INetFwProfile( iface );
124 FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
128 static HRESULT WINAPI fw_profile_Invoke(
129 INetFwProfile *iface,
134 DISPPARAMS *pDispParams,
136 EXCEPINFO *pExcepInfo,
139 fw_profile *This = impl_from_INetFwProfile( iface );
141 FIXME("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
142 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
146 static HRESULT WINAPI fw_profile_get_Type(
147 INetFwProfile *iface,
148 NET_FW_PROFILE_TYPE *type )
150 fw_profile *This = impl_from_INetFwProfile( iface );
152 FIXME("%p, %p\n", This, type);
156 static HRESULT WINAPI fw_profile_get_FirewallEnabled(
157 INetFwProfile *iface,
158 VARIANT_BOOL *enabled )
160 fw_profile *This = impl_from_INetFwProfile( iface );
162 FIXME("%p, %p\n", This, enabled);
164 *enabled = VARIANT_FALSE;
168 static HRESULT WINAPI fw_profile_put_FirewallEnabled(
169 INetFwProfile *iface,
170 VARIANT_BOOL enabled )
172 fw_profile *This = impl_from_INetFwProfile( iface );
174 FIXME("%p, %d\n", This, enabled);
178 static HRESULT WINAPI fw_profile_get_ExceptionsNotAllowed(
179 INetFwProfile *iface,
180 VARIANT_BOOL *notAllowed )
182 fw_profile *This = impl_from_INetFwProfile( iface );
184 FIXME("%p, %p\n", This, notAllowed);
188 static HRESULT WINAPI fw_profile_put_ExceptionsNotAllowed(
189 INetFwProfile *iface,
190 VARIANT_BOOL notAllowed )
192 fw_profile *This = impl_from_INetFwProfile( iface );
194 FIXME("%p, %d\n", This, notAllowed);
198 static HRESULT WINAPI fw_profile_get_NotificationsDisabled(
199 INetFwProfile *iface,
200 VARIANT_BOOL *disabled )
202 fw_profile *This = impl_from_INetFwProfile( iface );
204 FIXME("%p, %p\n", This, disabled);
208 static HRESULT WINAPI fw_profile_put_NotificationsDisabled(
209 INetFwProfile *iface,
210 VARIANT_BOOL disabled )
212 fw_profile *This = impl_from_INetFwProfile( iface );
214 FIXME("%p, %d\n", This, disabled);
218 static HRESULT WINAPI fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled(
219 INetFwProfile *iface,
220 VARIANT_BOOL *disabled )
222 fw_profile *This = impl_from_INetFwProfile( iface );
224 FIXME("%p, %p\n", This, disabled);
228 static HRESULT WINAPI fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled(
229 INetFwProfile *iface,
230 VARIANT_BOOL disabled )
232 fw_profile *This = impl_from_INetFwProfile( iface );
234 FIXME("%p, %d\n", This, disabled);
238 static HRESULT WINAPI fw_profile_get_RemoteAdminSettings(
239 INetFwProfile *iface,
240 INetFwRemoteAdminSettings **remoteAdminSettings )
242 fw_profile *This = impl_from_INetFwProfile( iface );
244 FIXME("%p, %p\n", This, remoteAdminSettings);
248 static HRESULT WINAPI fw_profile_get_IcmpSettings(
249 INetFwProfile *iface,
250 INetFwIcmpSettings **icmpSettings )
252 fw_profile *This = impl_from_INetFwProfile( iface );
254 FIXME("%p, %p\n", This, icmpSettings);
258 static HRESULT WINAPI fw_profile_get_GloballyOpenPorts(
259 INetFwProfile *iface,
260 INetFwOpenPorts **openPorts )
262 fw_profile *This = impl_from_INetFwProfile( iface );
264 TRACE("%p, %p\n", This, openPorts);
265 return NetFwOpenPorts_create( NULL, (void **)openPorts );
268 static HRESULT WINAPI fw_profile_get_Services(
269 INetFwProfile *iface,
270 INetFwServices **Services )
272 fw_profile *This = impl_from_INetFwProfile( iface );
274 TRACE("%p, %p\n", This, Services);
275 return NetFwServices_create( NULL, (void **)Services );
278 static HRESULT WINAPI fw_profile_get_AuthorizedApplications(
279 INetFwProfile *iface,
280 INetFwAuthorizedApplications **apps )
282 fw_profile *This = impl_from_INetFwProfile( iface );
284 TRACE("%p, %p\n", This, apps);
285 return NetFwAuthorizedApplications_create( NULL, (void **)apps );
288 static const struct INetFwProfileVtbl fw_profile_vtbl =
290 fw_profile_QueryInterface,
293 fw_profile_GetTypeInfoCount,
294 fw_profile_GetTypeInfo,
295 fw_profile_GetIDsOfNames,
298 fw_profile_get_FirewallEnabled,
299 fw_profile_put_FirewallEnabled,
300 fw_profile_get_ExceptionsNotAllowed,
301 fw_profile_put_ExceptionsNotAllowed,
302 fw_profile_get_NotificationsDisabled,
303 fw_profile_put_NotificationsDisabled,
304 fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled,
305 fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled,
306 fw_profile_get_RemoteAdminSettings,
307 fw_profile_get_IcmpSettings,
308 fw_profile_get_GloballyOpenPorts,
309 fw_profile_get_Services,
310 fw_profile_get_AuthorizedApplications
313 HRESULT NetFwProfile_create( IUnknown *pUnkOuter, LPVOID *ppObj )
317 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
319 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
320 if (!fp) return E_OUTOFMEMORY;
322 fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl;
325 *ppObj = &fp->INetFwProfile_iface;
327 TRACE("returning iface %p\n", *ppObj);