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 "hnetcfg_private.h"
21 typedef struct fw_profile
23 INetFwProfile INetFwProfile_iface
;
27 static inline fw_profile
*impl_from_INetFwProfile( INetFwProfile
*iface
)
29 return CONTAINING_RECORD(iface
, fw_profile
, INetFwProfile_iface
);
32 static ULONG WINAPI
fw_profile_AddRef(
33 INetFwProfile
*iface
)
35 fw_profile
*fw_profile
= impl_from_INetFwProfile( iface
);
36 return InterlockedIncrement( &fw_profile
->refs
);
39 static ULONG WINAPI
fw_profile_Release(
40 INetFwProfile
*iface
)
42 fw_profile
*fw_profile
= impl_from_INetFwProfile( iface
);
43 LONG refs
= InterlockedDecrement( &fw_profile
->refs
);
46 TRACE("destroying %p\n", fw_profile
);
47 HeapFree( GetProcessHeap(), 0, fw_profile
);
52 static HRESULT WINAPI
fw_profile_QueryInterface(
57 fw_profile
*This
= impl_from_INetFwProfile( iface
);
59 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
61 if ( IsEqualGUID( riid
, &IID_INetFwProfile
) ||
62 IsEqualGUID( riid
, &IID_IDispatch
) ||
63 IsEqualGUID( riid
, &IID_IUnknown
) )
69 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
72 INetFwProfile_AddRef( iface
);
76 static HRESULT WINAPI
fw_profile_GetTypeInfoCount(
80 fw_profile
*This
= impl_from_INetFwProfile( iface
);
82 TRACE("%p %p\n", This
, pctinfo
);
87 static HRESULT WINAPI
fw_profile_GetTypeInfo(
93 fw_profile
*This
= impl_from_INetFwProfile( iface
);
95 TRACE("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
96 return get_typeinfo( INetFwProfile_tid
, ppTInfo
);
99 static HRESULT WINAPI
fw_profile_GetIDsOfNames(
100 INetFwProfile
*iface
,
107 fw_profile
*This
= impl_from_INetFwProfile( iface
);
111 TRACE("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
113 hr
= get_typeinfo( INetFwProfile_tid
, &typeinfo
);
116 hr
= ITypeInfo_GetIDsOfNames( typeinfo
, rgszNames
, cNames
, rgDispId
);
117 ITypeInfo_Release( typeinfo
);
122 static HRESULT WINAPI
fw_profile_Invoke(
123 INetFwProfile
*iface
,
128 DISPPARAMS
*pDispParams
,
130 EXCEPINFO
*pExcepInfo
,
133 fw_profile
*This
= impl_from_INetFwProfile( iface
);
137 TRACE("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
138 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
140 hr
= get_typeinfo( INetFwProfile_tid
, &typeinfo
);
143 hr
= ITypeInfo_Invoke( typeinfo
, &This
->INetFwProfile_iface
, dispIdMember
,
144 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
145 ITypeInfo_Release( typeinfo
);
150 static HRESULT WINAPI
fw_profile_get_Type(
151 INetFwProfile
*iface
,
152 NET_FW_PROFILE_TYPE
*type
)
154 fw_profile
*This
= impl_from_INetFwProfile( iface
);
156 FIXME("%p, %p\n", This
, type
);
160 static HRESULT WINAPI
fw_profile_get_FirewallEnabled(
161 INetFwProfile
*iface
,
162 VARIANT_BOOL
*enabled
)
164 fw_profile
*This
= impl_from_INetFwProfile( iface
);
166 FIXME("%p, %p\n", This
, enabled
);
168 *enabled
= VARIANT_FALSE
;
172 static HRESULT WINAPI
fw_profile_put_FirewallEnabled(
173 INetFwProfile
*iface
,
174 VARIANT_BOOL enabled
)
176 fw_profile
*This
= impl_from_INetFwProfile( iface
);
178 FIXME("%p, %d\n", This
, enabled
);
182 static HRESULT WINAPI
fw_profile_get_ExceptionsNotAllowed(
183 INetFwProfile
*iface
,
184 VARIANT_BOOL
*notAllowed
)
186 fw_profile
*This
= impl_from_INetFwProfile( iface
);
188 FIXME("%p, %p\n", This
, notAllowed
);
192 static HRESULT WINAPI
fw_profile_put_ExceptionsNotAllowed(
193 INetFwProfile
*iface
,
194 VARIANT_BOOL notAllowed
)
196 fw_profile
*This
= impl_from_INetFwProfile( iface
);
198 FIXME("%p, %d\n", This
, notAllowed
);
202 static HRESULT WINAPI
fw_profile_get_NotificationsDisabled(
203 INetFwProfile
*iface
,
204 VARIANT_BOOL
*disabled
)
206 fw_profile
*This
= impl_from_INetFwProfile( iface
);
208 FIXME("%p, %p\n", This
, disabled
);
212 static HRESULT WINAPI
fw_profile_put_NotificationsDisabled(
213 INetFwProfile
*iface
,
214 VARIANT_BOOL disabled
)
216 fw_profile
*This
= impl_from_INetFwProfile( iface
);
218 FIXME("%p, %d\n", This
, disabled
);
222 static HRESULT WINAPI
fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled(
223 INetFwProfile
*iface
,
224 VARIANT_BOOL
*disabled
)
226 fw_profile
*This
= impl_from_INetFwProfile( iface
);
228 FIXME("%p, %p\n", This
, disabled
);
232 static HRESULT WINAPI
fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled(
233 INetFwProfile
*iface
,
234 VARIANT_BOOL disabled
)
236 fw_profile
*This
= impl_from_INetFwProfile( iface
);
238 FIXME("%p, %d\n", This
, disabled
);
242 static HRESULT WINAPI
fw_profile_get_RemoteAdminSettings(
243 INetFwProfile
*iface
,
244 INetFwRemoteAdminSettings
**remoteAdminSettings
)
246 fw_profile
*This
= impl_from_INetFwProfile( iface
);
248 FIXME("%p, %p\n", This
, remoteAdminSettings
);
252 static HRESULT WINAPI
fw_profile_get_IcmpSettings(
253 INetFwProfile
*iface
,
254 INetFwIcmpSettings
**icmpSettings
)
256 fw_profile
*This
= impl_from_INetFwProfile( iface
);
258 FIXME("%p, %p\n", This
, icmpSettings
);
262 static HRESULT WINAPI
fw_profile_get_GloballyOpenPorts(
263 INetFwProfile
*iface
,
264 INetFwOpenPorts
**openPorts
)
266 fw_profile
*This
= impl_from_INetFwProfile( iface
);
268 TRACE("%p, %p\n", This
, openPorts
);
269 return NetFwOpenPorts_create( NULL
, (void **)openPorts
);
272 static HRESULT WINAPI
fw_profile_get_Services(
273 INetFwProfile
*iface
,
274 INetFwServices
**Services
)
276 fw_profile
*This
= impl_from_INetFwProfile( iface
);
278 TRACE("%p, %p\n", This
, Services
);
279 return NetFwServices_create( NULL
, (void **)Services
);
282 static HRESULT WINAPI
fw_profile_get_AuthorizedApplications(
283 INetFwProfile
*iface
,
284 INetFwAuthorizedApplications
**apps
)
286 fw_profile
*This
= impl_from_INetFwProfile( iface
);
288 TRACE("%p, %p\n", This
, apps
);
289 return NetFwAuthorizedApplications_create( NULL
, (void **)apps
);
292 static const struct INetFwProfileVtbl fw_profile_vtbl
=
294 fw_profile_QueryInterface
,
297 fw_profile_GetTypeInfoCount
,
298 fw_profile_GetTypeInfo
,
299 fw_profile_GetIDsOfNames
,
302 fw_profile_get_FirewallEnabled
,
303 fw_profile_put_FirewallEnabled
,
304 fw_profile_get_ExceptionsNotAllowed
,
305 fw_profile_put_ExceptionsNotAllowed
,
306 fw_profile_get_NotificationsDisabled
,
307 fw_profile_put_NotificationsDisabled
,
308 fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled
,
309 fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled
,
310 fw_profile_get_RemoteAdminSettings
,
311 fw_profile_get_IcmpSettings
,
312 fw_profile_get_GloballyOpenPorts
,
313 fw_profile_get_Services
,
314 fw_profile_get_AuthorizedApplications
317 HRESULT
NetFwProfile_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
321 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
323 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
324 if (!fp
) return E_OUTOFMEMORY
;
326 fp
->INetFwProfile_iface
.lpVtbl
= &fw_profile_vtbl
;
329 *ppObj
= &fp
->INetFwProfile_iface
;
331 TRACE("returning iface %p\n", *ppObj
);