winex11.drv: Map coordinates before calling send_mouse_input.
[wine/zf.git] / dlls / hnetcfg / policy.c
blob1f5b0daa568abbfe4399f9f95b6673dc4a34f6a9
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 <stdarg.h>
20 #include <stdio.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "ole2.h"
28 #include "netfw.h"
30 #include "wine/debug.h"
31 #include "hnetcfg_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
35 typedef struct fw_policy
37 INetFwPolicy INetFwPolicy_iface;
38 LONG refs;
39 } fw_policy;
41 static inline fw_policy *impl_from_INetFwPolicy( INetFwPolicy *iface )
43 return CONTAINING_RECORD(iface, fw_policy, INetFwPolicy_iface);
46 typedef struct fw_policy2
48 INetFwPolicy2 INetFwPolicy2_iface;
49 INetFwRules *fw_policy2_rules;
50 LONG refs;
51 } fw_policy2;
53 static inline fw_policy2 *impl_from_INetFwPolicy2( INetFwPolicy2 *iface )
55 return CONTAINING_RECORD(iface, fw_policy2, INetFwPolicy2_iface);
58 typedef struct fw_rules
60 INetFwRules INetFwRules_iface;
61 LONG refs;
62 } fw_rules;
64 static inline fw_rules *impl_from_INetFwRules( INetFwRules *iface )
66 return CONTAINING_RECORD(iface, fw_rules, INetFwRules_iface);
69 static HRESULT WINAPI netfw_rules_QueryInterface(
70 INetFwRules *iface,
71 REFIID riid,
72 void **object)
74 fw_rules *This = impl_from_INetFwRules( iface );
76 TRACE("%p %s %p\n", This, debugstr_guid( riid ), object );
78 if ( IsEqualGUID( riid, &IID_INetFwRules ) ||
79 IsEqualGUID( riid, &IID_IDispatch ) ||
80 IsEqualGUID( riid, &IID_IUnknown ) )
82 *object = iface;
84 else
86 FIXME("interface %s not implemented\n", debugstr_guid(riid));
87 return E_NOINTERFACE;
89 INetFwRules_AddRef( iface );
90 return S_OK;
93 static ULONG WINAPI netfw_rules_AddRef(
94 INetFwRules *iface )
96 fw_rules *This = impl_from_INetFwRules( iface );
97 return InterlockedIncrement( &This->refs );
100 static ULONG WINAPI netfw_rules_Release(
101 INetFwRules *iface )
103 fw_rules *This = impl_from_INetFwRules( iface );
104 LONG refs = InterlockedDecrement( &This->refs );
105 if (!refs)
107 TRACE("destroying %p\n", This);
108 HeapFree( GetProcessHeap(), 0, This );
110 return refs;
113 static HRESULT WINAPI netfw_rules_GetTypeInfoCount(
114 INetFwRules *iface,
115 UINT *pctinfo )
117 fw_rules *This = impl_from_INetFwRules( iface );
119 TRACE("%p %p\n", This, pctinfo);
120 *pctinfo = 1;
121 return S_OK;
124 static HRESULT WINAPI netfw_rules_GetTypeInfo(
125 INetFwRules *iface,
126 UINT iTInfo,
127 LCID lcid,
128 ITypeInfo **ppTInfo)
130 fw_rules *This = impl_from_INetFwRules( iface );
132 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
133 return get_typeinfo( INetFwRules_tid, ppTInfo );
136 static HRESULT WINAPI netfw_rules_GetIDsOfNames(
137 INetFwRules *iface,
138 REFIID riid,
139 LPOLESTR *rgszNames,
140 UINT cNames,
141 LCID lcid,
142 DISPID *rgDispId)
144 fw_rules *This = impl_from_INetFwRules( iface );
145 ITypeInfo *typeinfo;
146 HRESULT hr;
148 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
150 hr = get_typeinfo( INetFwRules_tid, &typeinfo );
151 if (SUCCEEDED(hr))
153 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
154 ITypeInfo_Release( typeinfo );
156 return hr;
159 static HRESULT WINAPI netfw_rules_Invoke(
160 INetFwRules *iface,
161 DISPID dispIdMember,
162 REFIID riid,
163 LCID lcid,
164 WORD wFlags,
165 DISPPARAMS *pDispParams,
166 VARIANT *pVarResult,
167 EXCEPINFO *pExcepInfo,
168 UINT *puArgErr)
170 fw_rules *This = impl_from_INetFwRules( iface );
171 ITypeInfo *typeinfo;
172 HRESULT hr;
174 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
175 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
177 hr = get_typeinfo( INetFwRules_tid, &typeinfo );
178 if (SUCCEEDED(hr))
180 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwRules_iface, dispIdMember,
181 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
182 ITypeInfo_Release( typeinfo );
184 return hr;
187 static HRESULT WINAPI netfw_rules_get_Count(
188 INetFwRules *iface,
189 LONG *count)
191 fw_rules *This = impl_from_INetFwRules( iface );
193 FIXME("%p, %p\n", This, count);
195 if (count)
196 *count = 0;
198 return S_OK;
201 static HRESULT WINAPI netfw_rules_Add(
202 INetFwRules *iface,
203 INetFwRule *rule)
205 fw_rules *This = impl_from_INetFwRules( iface );
207 FIXME("%p, %p\n", This, rule);
208 return E_NOTIMPL;
211 static HRESULT WINAPI netfw_rules_Remove(
212 INetFwRules *iface,
213 BSTR name)
215 fw_rules *This = impl_from_INetFwRules( iface );
217 FIXME("%p, %s\n", This, debugstr_w(name));
218 return E_NOTIMPL;
221 static HRESULT WINAPI netfw_rules_Item(
222 INetFwRules *iface,
223 BSTR name,
224 INetFwRule **rule)
226 fw_rules *This = impl_from_INetFwRules( iface );
228 FIXME("%p, %s, %p\n", This, debugstr_w(name), rule);
229 return E_NOTIMPL;
232 static HRESULT WINAPI netfw_rules_get__NewEnum(
233 INetFwRules *iface,
234 IUnknown **newEnum)
236 fw_rules *This = impl_from_INetFwRules( iface );
238 FIXME("%p, %p\n", This, newEnum);
240 if (!newEnum) return E_POINTER;
241 *newEnum = NULL;
243 return E_NOTIMPL;
246 static const struct INetFwRulesVtbl fw_rules_vtbl =
248 netfw_rules_QueryInterface,
249 netfw_rules_AddRef,
250 netfw_rules_Release,
251 netfw_rules_GetTypeInfoCount,
252 netfw_rules_GetTypeInfo,
253 netfw_rules_GetIDsOfNames,
254 netfw_rules_Invoke,
255 netfw_rules_get_Count,
256 netfw_rules_Add,
257 netfw_rules_Remove,
258 netfw_rules_Item,
259 netfw_rules_get__NewEnum
262 static HRESULT create_INetFwRules(INetFwRules **object)
264 fw_rules *rules;
266 TRACE("(%p)\n", object);
268 rules = HeapAlloc( GetProcessHeap(), 0, sizeof(*rules) );
269 if (!rules) return E_OUTOFMEMORY;
271 rules->INetFwRules_iface.lpVtbl = &fw_rules_vtbl;
272 rules->refs = 1;
274 *object = &rules->INetFwRules_iface;
276 TRACE("returning iface %p\n", *object);
277 return S_OK;
280 static ULONG WINAPI fw_policy_AddRef(
281 INetFwPolicy *iface )
283 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
284 return InterlockedIncrement( &fw_policy->refs );
287 static ULONG WINAPI fw_policy_Release(
288 INetFwPolicy *iface )
290 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
291 LONG refs = InterlockedDecrement( &fw_policy->refs );
292 if (!refs)
294 TRACE("destroying %p\n", fw_policy);
295 HeapFree( GetProcessHeap(), 0, fw_policy );
297 return refs;
300 static HRESULT WINAPI fw_policy_QueryInterface(
301 INetFwPolicy *iface,
302 REFIID riid,
303 void **ppvObject )
305 fw_policy *This = impl_from_INetFwPolicy( iface );
307 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
309 if ( IsEqualGUID( riid, &IID_INetFwPolicy ) ||
310 IsEqualGUID( riid, &IID_IDispatch ) ||
311 IsEqualGUID( riid, &IID_IUnknown ) )
313 *ppvObject = iface;
315 else
317 FIXME("interface %s not implemented\n", debugstr_guid(riid));
318 return E_NOINTERFACE;
320 INetFwPolicy_AddRef( iface );
321 return S_OK;
324 static HRESULT WINAPI fw_policy_GetTypeInfoCount(
325 INetFwPolicy *iface,
326 UINT *pctinfo )
328 fw_policy *This = impl_from_INetFwPolicy( iface );
330 TRACE("%p %p\n", This, pctinfo);
331 *pctinfo = 1;
332 return S_OK;
335 static HRESULT WINAPI fw_policy_GetTypeInfo(
336 INetFwPolicy *iface,
337 UINT iTInfo,
338 LCID lcid,
339 ITypeInfo **ppTInfo )
341 fw_policy *This = impl_from_INetFwPolicy( iface );
343 TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
344 return get_typeinfo( INetFwPolicy_tid, ppTInfo );
347 static HRESULT WINAPI fw_policy_GetIDsOfNames(
348 INetFwPolicy *iface,
349 REFIID riid,
350 LPOLESTR *rgszNames,
351 UINT cNames,
352 LCID lcid,
353 DISPID *rgDispId )
355 fw_policy *This = impl_from_INetFwPolicy( iface );
356 ITypeInfo *typeinfo;
357 HRESULT hr;
359 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
361 hr = get_typeinfo( INetFwPolicy_tid, &typeinfo );
362 if (SUCCEEDED(hr))
364 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
365 ITypeInfo_Release( typeinfo );
367 return hr;
370 static HRESULT WINAPI fw_policy_Invoke(
371 INetFwPolicy *iface,
372 DISPID dispIdMember,
373 REFIID riid,
374 LCID lcid,
375 WORD wFlags,
376 DISPPARAMS *pDispParams,
377 VARIANT *pVarResult,
378 EXCEPINFO *pExcepInfo,
379 UINT *puArgErr )
381 fw_policy *This = impl_from_INetFwPolicy( iface );
382 ITypeInfo *typeinfo;
383 HRESULT hr;
385 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
386 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
388 hr = get_typeinfo( INetFwPolicy_tid, &typeinfo );
389 if (SUCCEEDED(hr))
391 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwPolicy_iface, dispIdMember,
392 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
393 ITypeInfo_Release( typeinfo );
395 return hr;
398 static HRESULT WINAPI fw_policy_get_CurrentProfile(
399 INetFwPolicy *iface,
400 INetFwProfile **profile )
402 fw_policy *This = impl_from_INetFwPolicy( iface );
404 TRACE("%p, %p\n", This, profile);
405 return NetFwProfile_create( NULL, (void **)profile );
408 static HRESULT WINAPI fw_policy_GetProfileByType(
409 INetFwPolicy *iface,
410 NET_FW_PROFILE_TYPE profileType,
411 INetFwProfile **profile )
413 fw_policy *This = impl_from_INetFwPolicy( iface );
415 FIXME("%p, %u, %p\n", This, profileType, profile);
416 return E_NOTIMPL;
419 static const struct INetFwPolicyVtbl fw_policy_vtbl =
421 fw_policy_QueryInterface,
422 fw_policy_AddRef,
423 fw_policy_Release,
424 fw_policy_GetTypeInfoCount,
425 fw_policy_GetTypeInfo,
426 fw_policy_GetIDsOfNames,
427 fw_policy_Invoke,
428 fw_policy_get_CurrentProfile,
429 fw_policy_GetProfileByType
432 HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
434 fw_policy *fp;
436 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
438 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
439 if (!fp) return E_OUTOFMEMORY;
441 fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
442 fp->refs = 1;
444 *ppObj = &fp->INetFwPolicy_iface;
446 TRACE("returning iface %p\n", *ppObj);
447 return S_OK;
450 static HRESULT WINAPI fwpolicy2_QueryInterface(INetFwPolicy2 *iface, REFIID riid, void **out)
452 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
454 TRACE("%p %s %p\n", This, debugstr_guid( riid ), out );
456 if ( IsEqualGUID( riid, &IID_INetFwPolicy2 ) ||
457 IsEqualGUID( riid, &IID_IDispatch ) ||
458 IsEqualGUID( riid, &IID_IUnknown ) )
460 *out = iface;
462 else if( IsEqualGUID( riid, &IID_INetFwRules ) )
464 TRACE("INetFwRules not supported\n");
465 return E_NOINTERFACE;
467 else
469 FIXME("interface %s not implemented\n", debugstr_guid(riid));
470 return E_NOINTERFACE;
472 INetFwPolicy2_AddRef( iface );
473 return S_OK;
476 static ULONG WINAPI fwpolicy2_AddRef(INetFwPolicy2 *iface)
478 fw_policy2 *fw_policy = impl_from_INetFwPolicy2( iface );
479 return InterlockedIncrement( &fw_policy->refs );
482 static ULONG WINAPI fwpolicy2_Release(INetFwPolicy2 *iface)
484 fw_policy2 *fw_policy = impl_from_INetFwPolicy2( iface );
485 LONG refs = InterlockedDecrement( &fw_policy->refs );
486 if (!refs)
488 INetFwRules_Release(fw_policy->fw_policy2_rules);
489 TRACE("destroying %p\n", fw_policy);
490 HeapFree( GetProcessHeap(), 0, fw_policy );
492 return refs;
495 static HRESULT WINAPI fwpolicy2_GetTypeInfoCount(INetFwPolicy2 *iface, UINT *pctinfo)
497 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
499 TRACE("%p %p\n", This, pctinfo);
500 *pctinfo = 1;
501 return S_OK;
504 static HRESULT WINAPI fwpolicy2_GetTypeInfo(INetFwPolicy2 *iface, UINT iTInfo, LCID lcid, ITypeInfo **info)
506 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
508 TRACE("%p %u %u %p\n", This, iTInfo, lcid, info);
509 return get_typeinfo( INetFwPolicy2_tid, info );
512 static HRESULT WINAPI fwpolicy2_GetIDsOfNames(INetFwPolicy2 *iface, REFIID riid, LPOLESTR *rgszNames,
513 UINT cNames, LCID lcid, DISPID *rgDispId)
515 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
516 ITypeInfo *typeinfo;
517 HRESULT hr;
519 TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
521 hr = get_typeinfo( INetFwPolicy2_tid, &typeinfo );
522 if (SUCCEEDED(hr))
524 hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
525 ITypeInfo_Release( typeinfo );
527 return hr;
530 static HRESULT WINAPI fwpolicy2_Invoke(INetFwPolicy2 *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
531 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
533 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
534 ITypeInfo *typeinfo;
535 HRESULT hr;
537 TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
538 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
540 hr = get_typeinfo( INetFwPolicy2_tid, &typeinfo );
541 if (SUCCEEDED(hr))
543 hr = ITypeInfo_Invoke( typeinfo, &This->INetFwPolicy2_iface, dispIdMember,
544 wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
545 ITypeInfo_Release( typeinfo );
547 return hr;
550 static HRESULT WINAPI fwpolicy2_get_CurrentProfileTypes(INetFwPolicy2 *iface, LONG *profile)
552 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
554 FIXME("%p %p\n", This, profile);
555 return E_NOTIMPL;
558 static HRESULT WINAPI fwpolicy2_get_FirewallEnabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *enabled)
560 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
562 FIXME("%p %d %p\n", This, profileType, enabled);
563 return E_NOTIMPL;
566 static HRESULT WINAPI fwpolicy2_put_FirewallEnabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL enabled)
568 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
570 FIXME("%p %d %d\n", This, profileType, enabled);
571 return E_NOTIMPL;
574 static HRESULT WINAPI fwpolicy2_get_ExcludedInterfaces(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT *interfaces)
576 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
578 FIXME("%p %d %p\n", This, profileType, interfaces);
579 return E_NOTIMPL;
582 static HRESULT WINAPI fwpolicy2_put_ExcludedInterfaces(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT interfaces)
584 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
585 FIXME("%p %d\n", This, profileType);
586 return E_NOTIMPL;
589 static HRESULT WINAPI fwpolicy2_get_BlockAllInboundTraffic(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *block)
591 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
593 FIXME("%p %d %p\n", This, profileType, block);
594 return E_NOTIMPL;
597 static HRESULT WINAPI fwpolicy2_put_BlockAllInboundTraffic(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL block)
599 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
601 FIXME("%p %d %d\n", This, profileType, block);
602 return E_NOTIMPL;
605 static HRESULT WINAPI fwpolicy2_get_NotificationsDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *disabled)
607 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
609 FIXME("%p %d %p\n", This, profileType, disabled);
610 return E_NOTIMPL;
613 static HRESULT WINAPI fwpolicy2_put_NotificationsDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL disabled)
615 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
617 FIXME("%p %d %d\n", This, profileType, disabled);
618 return E_NOTIMPL;
621 static HRESULT WINAPI fwpolicy2_get_UnicastResponsesToMulticastBroadcastDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL *disabled)
623 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
625 FIXME("%p %d %p\n", This, profileType, disabled);
626 return E_NOTIMPL;
629 static HRESULT WINAPI fwpolicy2_put_UnicastResponsesToMulticastBroadcastDisabled(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, VARIANT_BOOL disabled)
631 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
633 FIXME("%p %d %d\n", This, profileType, disabled);
634 return E_NOTIMPL;
637 static HRESULT WINAPI fwpolicy2_get_Rules(INetFwPolicy2 *iface, INetFwRules **rules)
639 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
641 TRACE("%p %p\n", This, rules);
643 if(!rules)
644 return E_POINTER;
646 *rules = This->fw_policy2_rules;
647 INetFwRules_AddRef(This->fw_policy2_rules);
649 return S_OK;
652 static HRESULT WINAPI fwpolicy2_get_ServiceRestriction(INetFwPolicy2 *iface, INetFwServiceRestriction **ServiceRestriction)
654 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
656 FIXME("%p %p\n", This, ServiceRestriction);
657 return E_NOTIMPL;
660 static HRESULT WINAPI fwpolicy2_EnableRuleGroup(INetFwPolicy2 *iface, LONG bitmask, BSTR group, VARIANT_BOOL enable)
662 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
664 FIXME("%p %d %s %d\n", This, bitmask, debugstr_w(group), enable);
665 return E_NOTIMPL;
668 static HRESULT WINAPI fwpolicy2_IsRuleGroupEnabled(INetFwPolicy2 *iface, LONG bitmask, BSTR group, VARIANT_BOOL *enabled)
670 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
672 FIXME("%p %d %s %p\n", This, bitmask, debugstr_w(group), enabled);
673 return E_NOTIMPL;
676 static HRESULT WINAPI fwpolicy2_RestoreLocalFirewallDefaults(INetFwPolicy2 *iface)
678 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
680 FIXME("%p\n", This);
681 return E_NOTIMPL;
684 static HRESULT WINAPI fwpolicy2_get_DefaultInboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION *action)
686 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
688 FIXME("%p %d %p\n", This, profileType, action);
689 return E_NOTIMPL;
692 static HRESULT WINAPI fwpolicy2_put_DefaultInboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION action)
694 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
696 FIXME("%p %d %d\n", This, profileType, action);
697 return E_NOTIMPL;
700 static HRESULT WINAPI fwpolicy2_get_DefaultOutboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION *action)
702 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
704 FIXME("%p %d %p\n", This, profileType, action);
705 return E_NOTIMPL;
708 static HRESULT WINAPI fwpolicy2_put_DefaultOutboundAction(INetFwPolicy2 *iface, NET_FW_PROFILE_TYPE2 profileType, NET_FW_ACTION action)
710 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
712 FIXME("%p %d %d\n", This, profileType, action);
713 return E_NOTIMPL;
716 static HRESULT WINAPI fwpolicy2_get_IsRuleGroupCurrentlyEnabled(INetFwPolicy2 *iface, BSTR group, VARIANT_BOOL *enabled)
718 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
720 FIXME("%p %s %p\n", This, debugstr_w(group), enabled);
721 return E_NOTIMPL;
724 static HRESULT WINAPI fwpolicy2_get_LocalPolicyModifyState(INetFwPolicy2 *iface, NET_FW_MODIFY_STATE *modifyState)
726 fw_policy2 *This = impl_from_INetFwPolicy2( iface );
728 FIXME("%p %p\n", This, modifyState);
729 return E_NOTIMPL;
732 static const struct INetFwPolicy2Vtbl fw_policy2_vtbl =
734 fwpolicy2_QueryInterface,
735 fwpolicy2_AddRef,
736 fwpolicy2_Release,
737 fwpolicy2_GetTypeInfoCount,
738 fwpolicy2_GetTypeInfo,
739 fwpolicy2_GetIDsOfNames,
740 fwpolicy2_Invoke,
741 fwpolicy2_get_CurrentProfileTypes,
742 fwpolicy2_get_FirewallEnabled,
743 fwpolicy2_put_FirewallEnabled,
744 fwpolicy2_get_ExcludedInterfaces,
745 fwpolicy2_put_ExcludedInterfaces,
746 fwpolicy2_get_BlockAllInboundTraffic,
747 fwpolicy2_put_BlockAllInboundTraffic,
748 fwpolicy2_get_NotificationsDisabled,
749 fwpolicy2_put_NotificationsDisabled,
750 fwpolicy2_get_UnicastResponsesToMulticastBroadcastDisabled,
751 fwpolicy2_put_UnicastResponsesToMulticastBroadcastDisabled,
752 fwpolicy2_get_Rules,
753 fwpolicy2_get_ServiceRestriction,
754 fwpolicy2_EnableRuleGroup,
755 fwpolicy2_IsRuleGroupEnabled,
756 fwpolicy2_RestoreLocalFirewallDefaults,
757 fwpolicy2_get_DefaultInboundAction,
758 fwpolicy2_put_DefaultInboundAction,
759 fwpolicy2_get_DefaultOutboundAction,
760 fwpolicy2_put_DefaultOutboundAction,
761 fwpolicy2_get_IsRuleGroupCurrentlyEnabled,
762 fwpolicy2_get_LocalPolicyModifyState
765 HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
767 fw_policy2 *fp;
769 TRACE("(%p,%p)\n", outer, obj);
771 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
772 if (!fp) return E_OUTOFMEMORY;
774 fp->INetFwPolicy2_iface.lpVtbl = &fw_policy2_vtbl;
775 fp->refs = 1;
777 *obj = &fp->INetFwPolicy2_iface;
779 if (FAILED(create_INetFwRules(&fp->fw_policy2_rules)))
781 HeapFree( GetProcessHeap(), 0, fp );
782 return E_OUTOFMEMORY;
785 TRACE("returning iface %p\n", *obj);
786 return S_OK;