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_policy
39 const INetFwPolicyVtbl *vtbl;
43 static inline fw_policy *impl_from_INetFwPolicy( INetFwPolicy *iface )
45 return (fw_policy *)((char *)iface - FIELD_OFFSET( fw_policy, vtbl ));
48 static ULONG WINAPI fw_policy_AddRef(
51 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
52 return InterlockedIncrement( &fw_policy->refs );
55 static ULONG WINAPI fw_policy_Release(
58 fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
59 LONG refs = InterlockedDecrement( &fw_policy->refs );
62 TRACE("destroying %p\n", fw_policy);
63 HeapFree( GetProcessHeap(), 0, fw_policy );
68 static HRESULT WINAPI fw_policy_QueryInterface(
73 fw_policy *This = impl_from_INetFwPolicy( iface );
75 TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
77 if ( IsEqualGUID( riid, &IID_INetFwPolicy ) ||
78 IsEqualGUID( riid, &IID_IDispatch ) ||
79 IsEqualGUID( riid, &IID_IUnknown ) )
85 FIXME("interface %s not implemented\n", debugstr_guid(riid));
88 INetFwPolicy_AddRef( iface );
92 static HRESULT WINAPI fw_policy_GetTypeInfoCount(
96 fw_policy *This = impl_from_INetFwPolicy( iface );
98 FIXME("%p %p\n", This, pctinfo);
102 static HRESULT WINAPI fw_policy_GetTypeInfo(
106 ITypeInfo **ppTInfo )
108 fw_policy *This = impl_from_INetFwPolicy( iface );
110 FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
114 static HRESULT WINAPI fw_policy_GetIDsOfNames(
122 fw_policy *This = impl_from_INetFwPolicy( iface );
124 FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
128 static HRESULT WINAPI fw_policy_Invoke(
134 DISPPARAMS *pDispParams,
136 EXCEPINFO *pExcepInfo,
139 fw_policy *This = impl_from_INetFwPolicy( 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_policy_get_CurrentProfile(
148 INetFwProfile **profile )
150 fw_policy *This = impl_from_INetFwPolicy( iface );
152 TRACE("%p, %p\n", This, profile);
153 return NetFwProfile_create( NULL, (void **)profile );
156 static HRESULT WINAPI fw_policy_GetProfileByType(
158 NET_FW_PROFILE_TYPE profileType,
159 INetFwProfile **profile )
161 fw_policy *This = impl_from_INetFwPolicy( iface );
163 FIXME("%p, %u, %p\n", This, profileType, profile);
167 static const struct INetFwPolicyVtbl fw_policy_vtbl =
169 fw_policy_QueryInterface,
172 fw_policy_GetTypeInfoCount,
173 fw_policy_GetTypeInfo,
174 fw_policy_GetIDsOfNames,
176 fw_policy_get_CurrentProfile,
177 fw_policy_GetProfileByType
180 HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
184 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
186 fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
187 if (!fp) return E_OUTOFMEMORY;
189 fp->vtbl = &fw_policy_vtbl;
194 TRACE("returning iface %p\n", *ppObj);