quartz/tests: Make testpin_{AddRef,Release}() static.
[wine.git] / dlls / hnetcfg / policy.c
blobc2f32520bd486b85b05c0bc4305dc95c18351622
1 /*
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
19 #include "config.h"
20 #include <stdarg.h>
21 #include <stdio.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "netfw.h"
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_policy
39 INetFwPolicy INetFwPolicy_iface;
40 LONG refs;
41 } fw_policy;
43 static inline fw_policy *impl_from_INetFwPolicy( INetFwPolicy *iface )
45 return CONTAINING_RECORD(iface, fw_policy, INetFwPolicy_iface);
48 typedef struct fw_policy2
50 INetFwPolicy2 INetFwPolicy2_iface;
51 INetFwRules *fw_policy2_rules;
52 LONG refs;
53 } fw_policy2;
55 static inline fw_policy2 *impl_from_INetFwPolicy2( INetFwPolicy2 *iface )
57 return CONTAINING_RECORD(iface, fw_policy2, INetFwPolicy2_iface);
60 typedef struct fw_rules
62 INetFwRules INetFwRules_iface;
63 LONG refs;
64 } fw_rules;
66 static inline fw_rules *impl_from_INetFwRules( INetFwRules *iface )
68 return CONTAINING_RECORD(iface, fw_rules, INetFwRules_iface);
71 static HRESULT WINAPI netfw_rules_QueryInterface(
72 INetFwRules *iface,
73 REFIID riid,
74 void **object)
76 fw_rules *This = impl_from_INetFwRules( iface );
78 TRACE("%p %s %p\n", This, debugstr_guid( riid ), object );
80 if ( IsEqualGUID( riid, &IID_INetFwRules ) ||
81 IsEqualGUID( riid, &IID_IDispatch ) ||
82 IsEqualGUID( riid, &IID_IUnknown ) )
84 *object = iface;
86 else
88 FIXME("interface %s not implemented\n", debugstr_guid(riid));
89 return E_NOINTERFACE;
91 INetFwRules_AddRef( iface );
92 return S_OK;
95 static ULONG WINAPI netfw_rules_AddRef(
96 INetFwRules *iface )
98 fw_rules *This = impl_from_INetFwRules( iface );
99 return InterlockedIncrement( &This->refs );
102 static ULONG WINAPI netfw_rules_Release(
103 INetFwRules *iface )
105 fw_rules *This = impl_from_INetFwRules( iface );
106 LONG refs = InterlockedDecrement( &This->refs );
107 if (!refs)
109 TRACE("destroying %p\n", This);
110 HeapFree( GetProcessHeap(), 0, This );
112 return refs;
115 static HRESULT WINAPI netfw_rules_GetTypeInfoCount(
116 INetFwRules *iface,
117 UINT *pctinfo )
119 fw_rules *This = impl_from_INetFwRules( iface );
121 TRACE("%p %p\n", This, pctinfo);
122 *pctinfo = 1;
123 return S_OK;
126 static HRESULT WINAPI netfw_rules_GetTypeInfo(
127 INetFwRules *iface,
128 UINT iTInfo,
129 LCID lcid,
130 ITypeInfo **ppTInfo)
132 fw_rules *This = impl_from_INetFwRules( iface );
134 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
135 return get_typeinfo( INetFwRules_tid, ppTInfo );
138 static HRESULT WINAPI netfw_rules_GetIDsOfNames(
139 INetFwRules *iface,
140 REFIID riid,
141 LPOLESTR *rgszNames,
142 UINT cNames,
143 LCID lcid,
144 DISPID *rgDispId)
146 fw_rules *This = impl_from_INetFwRules( iface );
147 ITypeInfo *typeinfo;
148 HRESULT hr;
150 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
152 hr = get_typeinfo( INetFwRules_tid, &typeinfo );
153 if (SUCCEEDED(hr))
155 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
156 ITypeInfo_Release( typeinfo );
158 return hr;
161 static HRESULT WINAPI netfw_rules_Invoke(
162 INetFwRules *iface,
163 DISPID dispIdMember,
164 REFIID riid,
165 LCID lcid,
166 WORD wFlags,
167 DISPPARAMS *pDispParams,
168 VARIANT *pVarResult,
169 EXCEPINFO *pExcepInfo,
170 UINT *puArgErr)
172 fw_rules *This = impl_from_INetFwRules( iface );
173 ITypeInfo *typeinfo;
174 HRESULT hr;
176 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
177 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
179 hr = get_typeinfo( INetFwRules_tid, &typeinfo );
180 if (SUCCEEDED(hr))
182 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwRules_iface, dispIdMember,
183 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
184 ITypeInfo_Release( typeinfo );
186 return hr;
189 static HRESULT WINAPI netfw_rules_get_Count(
190 INetFwRules *iface,
191 LONG *count)
193 fw_rules *This = impl_from_INetFwRules( iface );
195 FIXME("%p, %p\n", This, count);
197 if (count)
198 *count = 0;
200 return S_OK;
203 static HRESULT WINAPI netfw_rules_Add(
204 INetFwRules *iface,
205 INetFwRule *rule)
207 fw_rules *This = impl_from_INetFwRules( iface );
209 FIXME("%p, %p\n", This, rule);
210 return E_NOTIMPL;
213 static HRESULT WINAPI netfw_rules_Remove(
214 INetFwRules *iface,
215 BSTR name)
217 fw_rules *This = impl_from_INetFwRules( iface );
219 FIXME("%p, %s\n", This, debugstr_w(name));
220 return E_NOTIMPL;
223 static HRESULT WINAPI netfw_rules_Item(
224 INetFwRules *iface,
225 BSTR name,
226 INetFwRule **rule)
228 fw_rules *This = impl_from_INetFwRules( iface );
230 FIXME("%p, %s, %p\n", This, debugstr_w(name), rule);
231 return E_NOTIMPL;
234 static HRESULT WINAPI netfw_rules_get__NewEnum(
235 INetFwRules *iface,
236 IUnknown **newEnum)
238 fw_rules *This = impl_from_INetFwRules( iface );
240 FIXME("%p, %p\n", This, newEnum);
241 return E_NOTIMPL;
244 static const struct INetFwRulesVtbl fw_rules_vtbl =
246 netfw_rules_QueryInterface,
247 netfw_rules_AddRef,
248 netfw_rules_Release,
249 netfw_rules_GetTypeInfoCount,
250 netfw_rules_GetTypeInfo,
251 netfw_rules_GetIDsOfNames,
252 netfw_rules_Invoke,
253 netfw_rules_get_Count,
254 netfw_rules_Add,
255 netfw_rules_Remove,
256 netfw_rules_Item,
257 netfw_rules_get__NewEnum
260 static HRESULT create_INetFwRules(INetFwRules **object)
262 fw_rules *rules;
264 TRACE("(%p)\n", object);
266 rules = HeapAlloc( GetProcessHeap(), 0, sizeof(*rules) );
267 if (!rules) return E_OUTOFMEMORY;
269 rules->INetFwRules_iface.lpVtbl = &fw_rules_vtbl;
270 rules->refs = 1;
272 *object = &rules->INetFwRules_iface;
274 TRACE("returning iface %p\n", *object);
275 return S_OK;
278 static ULONG WINAPI fw_policy_AddRef(
279 INetFwPolicy *iface )
281 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
282 return InterlockedIncrement( &fw_policy->refs );
285 static ULONG WINAPI fw_policy_Release(
286 INetFwPolicy *iface )
288 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
289 LONG refs = InterlockedDecrement( &fw_policy->refs );
290 if (!refs)
292 TRACE("destroying %p\n", fw_policy);
293 HeapFree( GetProcessHeap(), 0, fw_policy );
295 return refs;
298 static HRESULT WINAPI fw_policy_QueryInterface(
299 INetFwPolicy *iface,
300 REFIID riid,
301 void **ppvObject )
303 fw_policy *This = impl_from_INetFwPolicy( iface );
305 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
307 if ( IsEqualGUID( riid, &IID_INetFwPolicy ) ||
308 IsEqualGUID( riid, &IID_IDispatch ) ||
309 IsEqualGUID( riid, &IID_IUnknown ) )
311 *ppvObject = iface;
313 else
315 FIXME("interface %s not implemented\n", debugstr_guid(riid));
316 return E_NOINTERFACE;
318 INetFwPolicy_AddRef( iface );
319 return S_OK;
322 static HRESULT WINAPI fw_policy_GetTypeInfoCount(
323 INetFwPolicy *iface,
324 UINT *pctinfo )
326 fw_policy *This = impl_from_INetFwPolicy( iface );
328 TRACE("%p %p\n", This, pctinfo);
329 *pctinfo = 1;
330 return S_OK;
333 static HRESULT WINAPI fw_policy_GetTypeInfo(
334 INetFwPolicy *iface,
335 UINT iTInfo,
336 LCID lcid,
337 ITypeInfo **ppTInfo )
339 fw_policy *This = impl_from_INetFwPolicy( iface );
341 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
342 return get_typeinfo( INetFwPolicy_tid, ppTInfo );
345 static HRESULT WINAPI fw_policy_GetIDsOfNames(
346 INetFwPolicy *iface,
347 REFIID riid,
348 LPOLESTR *rgszNames,
349 UINT cNames,
350 LCID lcid,
351 DISPID *rgDispId )
353 fw_policy *This = impl_from_INetFwPolicy( iface );
354 ITypeInfo *typeinfo;
355 HRESULT hr;
357 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
359 hr = get_typeinfo( INetFwPolicy_tid, &typeinfo );
360 if (SUCCEEDED(hr))
362 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
363 ITypeInfo_Release( typeinfo );
365 return hr;
368 static HRESULT WINAPI fw_policy_Invoke(
369 INetFwPolicy *iface,
370 DISPID dispIdMember,
371 REFIID riid,
372 LCID lcid,
373 WORD wFlags,
374 DISPPARAMS *pDispParams,
375 VARIANT *pVarResult,
376 EXCEPINFO *pExcepInfo,
377 UINT *puArgErr )
379 fw_policy *This = impl_from_INetFwPolicy( iface );
380 ITypeInfo *typeinfo;
381 HRESULT hr;
383 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
384 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
386 hr = get_typeinfo( INetFwPolicy_tid, &typeinfo );
387 if (SUCCEEDED(hr))
389 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwPolicy_iface, dispIdMember,
390 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
391 ITypeInfo_Release( typeinfo );
393 return hr;
396 static HRESULT WINAPI fw_policy_get_CurrentProfile(
397 INetFwPolicy *iface,
398 INetFwProfile **profile )
400 fw_policy *This = impl_from_INetFwPolicy( iface );
402 TRACE("%p, %p\n", This, profile);
403 return NetFwProfile_create( NULL, (void **)profile );
406 static HRESULT WINAPI fw_policy_GetProfileByType(
407 INetFwPolicy *iface,
408 NET_FW_PROFILE_TYPE profileType,
409 INetFwProfile **profile )
411 fw_policy *This = impl_from_INetFwPolicy( iface );
413 FIXME("%p, %u, %p\n", This, profileType, profile);
414 return E_NOTIMPL;
417 static const struct INetFwPolicyVtbl fw_policy_vtbl =
419 fw_policy_QueryInterface,
420 fw_policy_AddRef,
421 fw_policy_Release,
422 fw_policy_GetTypeInfoCount,
423 fw_policy_GetTypeInfo,
424 fw_policy_GetIDsOfNames,
425 fw_policy_Invoke,
426 fw_policy_get_CurrentProfile,
427 fw_policy_GetProfileByType
430 HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
432 fw_policy *fp;
434 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
436 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
437 if (!fp) return E_OUTOFMEMORY;
439 fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
440 fp->refs = 1;
442 *ppObj = &fp->INetFwPolicy_iface;
444 TRACE("returning iface %p\n", *ppObj);
445 return S_OK;
448 static HRESULT WINAPI fwpolicy2_QueryInterface(INetFwPolicy2 *iface, REFIID riid, void **out)
450 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
452 TRACE("%p %s %p\n", This, debugstr_guid( riid ), out );
454 if ( IsEqualGUID( riid, &IID_INetFwPolicy2 ) ||
455 IsEqualGUID( riid, &IID_IDispatch ) ||
456 IsEqualGUID( riid, &IID_IUnknown ) )
458 *out = iface;
460 else if( IsEqualGUID( riid, &IID_INetFwRules ) )
462 TRACE("INetFwRules not supported\n");
463 return E_NOINTERFACE;
465 else
467 FIXME("interface %s not implemented\n", debugstr_guid(riid));
468 return E_NOINTERFACE;
470 INetFwPolicy2_AddRef( iface );
471 return S_OK;
474 static ULONG WINAPI fwpolicy2_AddRef(INetFwPolicy2 *iface)
476 fw_policy2 *fw_policy = impl_from_INetFwPolicy2( iface );
477 return InterlockedIncrement( &fw_policy->refs );
480 static ULONG WINAPI fwpolicy2_Release(INetFwPolicy2 *iface)
482 fw_policy2 *fw_policy = impl_from_INetFwPolicy2( iface );
483 LONG refs = InterlockedDecrement( &fw_policy->refs );
484 if (!refs)
486 INetFwRules_Release(fw_policy->fw_policy2_rules);
487 TRACE("destroying %p\n", fw_policy);
488 HeapFree( GetProcessHeap(), 0, fw_policy );
490 return refs;
493 static HRESULT WINAPI fwpolicy2_GetTypeInfoCount(INetFwPolicy2 *iface, UINT *pctinfo)
495 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
497 TRACE("%p %p\n", This, pctinfo);
498 *pctinfo = 1;
499 return S_OK;
502 static HRESULT WINAPI fwpolicy2_GetTypeInfo(INetFwPolicy2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **info)
504 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
506 TRACE("%p %u %u %p\n", This, iTInfo, lcid, info);
507 return get_typeinfo( INetFwPolicy2_tid, info );
510 static HRESULT WINAPI fwpolicy2_GetIDsOfNames(INetFwPolicy2 *iface, REFIID riid, LPOLESTR *rgszNames,
511 UINT cNames, LCID lcid, DISPID *rgDispId)
513 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
514 ITypeInfo *typeinfo;
515 HRESULT hr;
517 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
519 hr = get_typeinfo( INetFwPolicy2_tid, &typeinfo );
520 if (SUCCEEDED(hr))
522 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
523 ITypeInfo_Release( typeinfo );
525 return hr;
528 static HRESULT WINAPI fwpolicy2_Invoke(INetFwPolicy2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
529 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
531 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
532 ITypeInfo *typeinfo;
533 HRESULT hr;
535 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
536 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
538 hr = get_typeinfo( INetFwPolicy2_tid, &typeinfo );
539 if (SUCCEEDED(hr))
541 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwPolicy2_iface, dispIdMember,
542 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
543 ITypeInfo_Release( typeinfo );
545 return hr;
548 static HRESULT WINAPI fwpolicy2_get_CurrentProfileTypes(INetFwPolicy2 *iface, LONG *profile)
550 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
552 FIXME("%p %p\n", This, profile);
553 return E_NOTIMPL;
556 static HRESULT WINAPI fwpolicy2_get_FirewallEnabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *enabled)
558 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
560 FIXME("%p %d %p\n", This, profileType, enabled);
561 return E_NOTIMPL;
564 static HRESULT WINAPI fwpolicy2_put_FirewallEnabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL enabled)
566 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
568 FIXME("%p %d %d\n", This, profileType, enabled);
569 return E_NOTIMPL;
572 static HRESULT WINAPI fwpolicy2_get_ExcludedInterfaces(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT *interfaces)
574 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
576 FIXME("%p %d %p\n", This, profileType, interfaces);
577 return E_NOTIMPL;
580 static HRESULT WINAPI fwpolicy2_put_ExcludedInterfaces(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT interfaces)
582 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
583 FIXME("%p %d\n", This, profileType);
584 return E_NOTIMPL;
587 static HRESULT WINAPI fwpolicy2_get_BlockAllInboundTraffic(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *block)
589 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
591 FIXME("%p %d %p\n", This, profileType, block);
592 return E_NOTIMPL;
595 static HRESULT WINAPI fwpolicy2_put_BlockAllInboundTraffic(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL block)
597 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
599 FIXME("%p %d %d\n", This, profileType, block);
600 return E_NOTIMPL;
603 static HRESULT WINAPI fwpolicy2_get_NotificationsDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *disabled)
605 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
607 FIXME("%p %d %p\n", This, profileType, disabled);
608 return E_NOTIMPL;
611 static HRESULT WINAPI fwpolicy2_put_NotificationsDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL disabled)
613 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
615 FIXME("%p %d %d\n", This, profileType, disabled);
616 return E_NOTIMPL;
619 static HRESULT WINAPI fwpolicy2_get_UnicastResponsesToMulticastBroadcastDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *disabled)
621 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
623 FIXME("%p %d %p\n", This, profileType, disabled);
624 return E_NOTIMPL;
627 static HRESULT WINAPI fwpolicy2_put_UnicastResponsesToMulticastBroadcastDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL disabled)
629 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
631 FIXME("%p %d %d\n", This, profileType, disabled);
632 return E_NOTIMPL;
635 static HRESULT WINAPI fwpolicy2_get_Rules(INetFwPolicy2 *iface, INetFwRules **rules)
637 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
639 TRACE("%p %p\n", This, rules);
641 if(!rules)
642 return E_POINTER;
644 if(rules)
646 *rules = This->fw_policy2_rules;
647 INetFwRules_AddRef(This->fw_policy2_rules);
650 return S_OK;
653 static HRESULT WINAPI fwpolicy2_get_ServiceRestriction(INetFwPolicy2 *iface, INetFwServiceRestriction **ServiceRestriction)
655 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
657 FIXME("%p %p\n", This, ServiceRestriction);
658 return E_NOTIMPL;
661 static HRESULT WINAPI fwpolicy2_EnableRuleGroup(INetFwPolicy2 *iface, LONG bitmask, BSTR group, VARIANT_BOOL enable)
663 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
665 FIXME("%p %d %s %d\n", This, bitmask, debugstr_w(group), enable);
666 return E_NOTIMPL;
669 static HRESULT WINAPI fwpolicy2_IsRuleGroupEnabled(INetFwPolicy2 *iface, LONG bitmask, BSTR group, VARIANT_BOOL *enabled)
671 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
673 FIXME("%p %d %s %p\n", This, bitmask, debugstr_w(group), enabled);
674 return E_NOTIMPL;
677 static HRESULT WINAPI fwpolicy2_RestoreLocalFirewallDefaults(INetFwPolicy2 *iface)
679 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
681 FIXME("%p\n", This);
682 return E_NOTIMPL;
685 static HRESULT WINAPI fwpolicy2_get_DefaultInboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION *action)
687 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
689 FIXME("%p %d %p\n", This, profileType, action);
690 return E_NOTIMPL;
693 static HRESULT WINAPI fwpolicy2_put_DefaultInboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION action)
695 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
697 FIXME("%p %d %d\n", This, profileType, action);
698 return E_NOTIMPL;
701 static HRESULT WINAPI fwpolicy2_get_DefaultOutboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION *action)
703 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
705 FIXME("%p %d %p\n", This, profileType, action);
706 return E_NOTIMPL;
709 static HRESULT WINAPI fwpolicy2_put_DefaultOutboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION action)
711 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
713 FIXME("%p %d %d\n", This, profileType, action);
714 return E_NOTIMPL;
717 static HRESULT WINAPI fwpolicy2_get_IsRuleGroupCurrentlyEnabled(INetFwPolicy2 *iface, BSTR group, VARIANT_BOOL *enabled)
719 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
721 FIXME("%p %s %p\n", This, debugstr_w(group), enabled);
722 return E_NOTIMPL;
725 static HRESULT WINAPI fwpolicy2_get_LocalPolicyModifyState(INetFwPolicy2 *iface, NET_FW_MODIFY_STATE *modifyState)
727 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
729 FIXME("%p %p\n", This, modifyState);
730 return E_NOTIMPL;
733 static const struct INetFwPolicy2Vtbl fw_policy2_vtbl =
735 fwpolicy2_QueryInterface,
736 fwpolicy2_AddRef,
737 fwpolicy2_Release,
738 fwpolicy2_GetTypeInfoCount,
739 fwpolicy2_GetTypeInfo,
740 fwpolicy2_GetIDsOfNames,
741 fwpolicy2_Invoke,
742 fwpolicy2_get_CurrentProfileTypes,
743 fwpolicy2_get_FirewallEnabled,
744 fwpolicy2_put_FirewallEnabled,
745 fwpolicy2_get_ExcludedInterfaces,
746 fwpolicy2_put_ExcludedInterfaces,
747 fwpolicy2_get_BlockAllInboundTraffic,
748 fwpolicy2_put_BlockAllInboundTraffic,
749 fwpolicy2_get_NotificationsDisabled,
750 fwpolicy2_put_NotificationsDisabled,
751 fwpolicy2_get_UnicastResponsesToMulticastBroadcastDisabled,
752 fwpolicy2_put_UnicastResponsesToMulticastBroadcastDisabled,
753 fwpolicy2_get_Rules,
754 fwpolicy2_get_ServiceRestriction,
755 fwpolicy2_EnableRuleGroup,
756 fwpolicy2_IsRuleGroupEnabled,
757 fwpolicy2_RestoreLocalFirewallDefaults,
758 fwpolicy2_get_DefaultInboundAction,
759 fwpolicy2_put_DefaultInboundAction,
760 fwpolicy2_get_DefaultOutboundAction,
761 fwpolicy2_put_DefaultOutboundAction,
762 fwpolicy2_get_IsRuleGroupCurrentlyEnabled,
763 fwpolicy2_get_LocalPolicyModifyState
766 HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
768 fw_policy2 *fp;
770 TRACE("(%p,%p)\n", outer, obj);
772 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
773 if (!fp) return E_OUTOFMEMORY;
775 fp->INetFwPolicy2_iface.lpVtbl = &fw_policy2_vtbl;
776 fp->refs = 1;
778 *obj = &fp->INetFwPolicy2_iface;
780 if (FAILED(create_INetFwRules(&fp->fw_policy2_rules)))
782 HeapFree( GetProcessHeap(), 0, fp );
783 return E_OUTOFMEMORY;
786 TRACE("returning iface %p\n", *obj);
787 return S_OK;