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 TRACE("%p %p\n", This, pctinfo);
103 static HRESULT WINAPI fw_profile_GetTypeInfo(
104 INetFwProfile *iface,
107 ITypeInfo **ppTInfo )
109 fw_profile *This = impl_from_INetFwProfile( iface );
111 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
112 return get_typeinfo( INetFwProfile_tid, ppTInfo );
115 static HRESULT WINAPI fw_profile_GetIDsOfNames(
116 INetFwProfile *iface,
123 fw_profile *This = impl_from_INetFwProfile( iface );
127 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
129 hr = get_typeinfo( INetFwProfile_tid, &typeinfo );
132 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
133 ITypeInfo_Release( typeinfo );
138 static HRESULT WINAPI fw_profile_Invoke(
139 INetFwProfile *iface,
144 DISPPARAMS *pDispParams,
146 EXCEPINFO *pExcepInfo,
149 fw_profile *This = impl_from_INetFwProfile( iface );
153 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
154 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
156 hr = get_typeinfo( INetFwProfile_tid, &typeinfo );
159 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwProfile_iface, dispIdMember,
160 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
161 ITypeInfo_Release( typeinfo );
166 static HRESULT WINAPI fw_profile_get_Type(
167 INetFwProfile *iface,
168 NET_FW_PROFILE_TYPE *type )
170 fw_profile *This = impl_from_INetFwProfile( iface );
172 FIXME("%p, %p\n", This, type);
176 static HRESULT WINAPI fw_profile_get_FirewallEnabled(
177 INetFwProfile *iface,
178 VARIANT_BOOL *enabled )
180 fw_profile *This = impl_from_INetFwProfile( iface );
182 FIXME("%p, %p\n", This, enabled);
184 *enabled = VARIANT_FALSE;
188 static HRESULT WINAPI fw_profile_put_FirewallEnabled(
189 INetFwProfile *iface,
190 VARIANT_BOOL enabled )
192 fw_profile *This = impl_from_INetFwProfile( iface );
194 FIXME("%p, %d\n", This, enabled);
198 static HRESULT WINAPI fw_profile_get_ExceptionsNotAllowed(
199 INetFwProfile *iface,
200 VARIANT_BOOL *notAllowed )
202 fw_profile *This = impl_from_INetFwProfile( iface );
204 FIXME("%p, %p\n", This, notAllowed);
208 static HRESULT WINAPI fw_profile_put_ExceptionsNotAllowed(
209 INetFwProfile *iface,
210 VARIANT_BOOL notAllowed )
212 fw_profile *This = impl_from_INetFwProfile( iface );
214 FIXME("%p, %d\n", This, notAllowed);
218 static HRESULT WINAPI fw_profile_get_NotificationsDisabled(
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_NotificationsDisabled(
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_UnicastResponsesToMulticastBroadcastDisabled(
239 INetFwProfile *iface,
240 VARIANT_BOOL *disabled )
242 fw_profile *This = impl_from_INetFwProfile( iface );
244 FIXME("%p, %p\n", This, disabled);
248 static HRESULT WINAPI fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled(
249 INetFwProfile *iface,
250 VARIANT_BOOL disabled )
252 fw_profile *This = impl_from_INetFwProfile( iface );
254 FIXME("%p, %d\n", This, disabled);
258 static HRESULT WINAPI fw_profile_get_RemoteAdminSettings(
259 INetFwProfile *iface,
260 INetFwRemoteAdminSettings **remoteAdminSettings )
262 fw_profile *This = impl_from_INetFwProfile( iface );
264 FIXME("%p, %p\n", This, remoteAdminSettings);
268 static HRESULT WINAPI fw_profile_get_IcmpSettings(
269 INetFwProfile *iface,
270 INetFwIcmpSettings **icmpSettings )
272 fw_profile *This = impl_from_INetFwProfile( iface );
274 FIXME("%p, %p\n", This, icmpSettings);
278 static HRESULT WINAPI fw_profile_get_GloballyOpenPorts(
279 INetFwProfile *iface,
280 INetFwOpenPorts **openPorts )
282 fw_profile *This = impl_from_INetFwProfile( iface );
284 TRACE("%p, %p\n", This, openPorts);
285 return NetFwOpenPorts_create( NULL, (void **)openPorts );
288 static HRESULT WINAPI fw_profile_get_Services(
289 INetFwProfile *iface,
290 INetFwServices **Services )
292 fw_profile *This = impl_from_INetFwProfile( iface );
294 TRACE("%p, %p\n", This, Services);
295 return NetFwServices_create( NULL, (void **)Services );
298 static HRESULT WINAPI fw_profile_get_AuthorizedApplications(
299 INetFwProfile *iface,
300 INetFwAuthorizedApplications **apps )
302 fw_profile *This = impl_from_INetFwProfile( iface );
304 TRACE("%p, %p\n", This, apps);
305 return NetFwAuthorizedApplications_create( NULL, (void **)apps );
308 static const struct INetFwProfileVtbl fw_profile_vtbl =
310 fw_profile_QueryInterface,
313 fw_profile_GetTypeInfoCount,
314 fw_profile_GetTypeInfo,
315 fw_profile_GetIDsOfNames,
318 fw_profile_get_FirewallEnabled,
319 fw_profile_put_FirewallEnabled,
320 fw_profile_get_ExceptionsNotAllowed,
321 fw_profile_put_ExceptionsNotAllowed,
322 fw_profile_get_NotificationsDisabled,
323 fw_profile_put_NotificationsDisabled,
324 fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled,
325 fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled,
326 fw_profile_get_RemoteAdminSettings,
327 fw_profile_get_IcmpSettings,
328 fw_profile_get_GloballyOpenPorts,
329 fw_profile_get_Services,
330 fw_profile_get_AuthorizedApplications
333 HRESULT NetFwProfile_create( IUnknown *pUnkOuter, LPVOID *ppObj )
337 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
339 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
340 if (!fp) return E_OUTOFMEMORY;
342 fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl;
345 *ppObj = &fp->INetFwProfile_iface;
347 TRACE("returning iface %p\n", *ppObj);