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
30 #include "wine/debug.h"
31 #include "hnetcfg_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg
);
35 typedef struct fw_profile
37 INetFwProfile INetFwProfile_iface
;
41 static inline fw_profile
*impl_from_INetFwProfile( INetFwProfile
*iface
)
43 return CONTAINING_RECORD(iface
, fw_profile
, INetFwProfile_iface
);
46 static ULONG WINAPI
fw_profile_AddRef(
47 INetFwProfile
*iface
)
49 fw_profile
*fw_profile
= impl_from_INetFwProfile( iface
);
50 return InterlockedIncrement( &fw_profile
->refs
);
53 static ULONG WINAPI
fw_profile_Release(
54 INetFwProfile
*iface
)
56 fw_profile
*fw_profile
= impl_from_INetFwProfile( iface
);
57 LONG refs
= InterlockedDecrement( &fw_profile
->refs
);
60 TRACE("destroying %p\n", fw_profile
);
61 HeapFree( GetProcessHeap(), 0, fw_profile
);
66 static HRESULT WINAPI
fw_profile_QueryInterface(
71 fw_profile
*This
= impl_from_INetFwProfile( iface
);
73 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
75 if ( IsEqualGUID( riid
, &IID_INetFwProfile
) ||
76 IsEqualGUID( riid
, &IID_IDispatch
) ||
77 IsEqualGUID( riid
, &IID_IUnknown
) )
83 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
86 INetFwProfile_AddRef( iface
);
90 static HRESULT WINAPI
fw_profile_GetTypeInfoCount(
94 fw_profile
*This
= impl_from_INetFwProfile( iface
);
96 TRACE("%p %p\n", This
, pctinfo
);
101 static HRESULT WINAPI
fw_profile_GetTypeInfo(
102 INetFwProfile
*iface
,
105 ITypeInfo
**ppTInfo
)
107 fw_profile
*This
= impl_from_INetFwProfile( iface
);
109 TRACE("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
110 return get_typeinfo( INetFwProfile_tid
, ppTInfo
);
113 static HRESULT WINAPI
fw_profile_GetIDsOfNames(
114 INetFwProfile
*iface
,
121 fw_profile
*This
= impl_from_INetFwProfile( iface
);
125 TRACE("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
127 hr
= get_typeinfo( INetFwProfile_tid
, &typeinfo
);
130 hr
= ITypeInfo_GetIDsOfNames( typeinfo
, rgszNames
, cNames
, rgDispId
);
131 ITypeInfo_Release( typeinfo
);
136 static HRESULT WINAPI
fw_profile_Invoke(
137 INetFwProfile
*iface
,
142 DISPPARAMS
*pDispParams
,
144 EXCEPINFO
*pExcepInfo
,
147 fw_profile
*This
= impl_from_INetFwProfile( iface
);
151 TRACE("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
152 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
154 hr
= get_typeinfo( INetFwProfile_tid
, &typeinfo
);
157 hr
= ITypeInfo_Invoke( typeinfo
, &This
->INetFwProfile_iface
, dispIdMember
,
158 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
159 ITypeInfo_Release( typeinfo
);
164 static HRESULT WINAPI
fw_profile_get_Type(
165 INetFwProfile
*iface
,
166 NET_FW_PROFILE_TYPE
*type
)
168 fw_profile
*This
= impl_from_INetFwProfile( iface
);
170 FIXME("%p, %p\n", This
, type
);
174 static HRESULT WINAPI
fw_profile_get_FirewallEnabled(
175 INetFwProfile
*iface
,
176 VARIANT_BOOL
*enabled
)
178 fw_profile
*This
= impl_from_INetFwProfile( iface
);
180 FIXME("%p, %p\n", This
, enabled
);
182 *enabled
= VARIANT_FALSE
;
186 static HRESULT WINAPI
fw_profile_put_FirewallEnabled(
187 INetFwProfile
*iface
,
188 VARIANT_BOOL enabled
)
190 fw_profile
*This
= impl_from_INetFwProfile( iface
);
192 FIXME("%p, %d\n", This
, enabled
);
196 static HRESULT WINAPI
fw_profile_get_ExceptionsNotAllowed(
197 INetFwProfile
*iface
,
198 VARIANT_BOOL
*notAllowed
)
200 fw_profile
*This
= impl_from_INetFwProfile( iface
);
202 FIXME("%p, %p\n", This
, notAllowed
);
206 static HRESULT WINAPI
fw_profile_put_ExceptionsNotAllowed(
207 INetFwProfile
*iface
,
208 VARIANT_BOOL notAllowed
)
210 fw_profile
*This
= impl_from_INetFwProfile( iface
);
212 FIXME("%p, %d\n", This
, notAllowed
);
216 static HRESULT WINAPI
fw_profile_get_NotificationsDisabled(
217 INetFwProfile
*iface
,
218 VARIANT_BOOL
*disabled
)
220 fw_profile
*This
= impl_from_INetFwProfile( iface
);
222 FIXME("%p, %p\n", This
, disabled
);
226 static HRESULT WINAPI
fw_profile_put_NotificationsDisabled(
227 INetFwProfile
*iface
,
228 VARIANT_BOOL disabled
)
230 fw_profile
*This
= impl_from_INetFwProfile( iface
);
232 FIXME("%p, %d\n", This
, disabled
);
236 static HRESULT WINAPI
fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled(
237 INetFwProfile
*iface
,
238 VARIANT_BOOL
*disabled
)
240 fw_profile
*This
= impl_from_INetFwProfile( iface
);
242 FIXME("%p, %p\n", This
, disabled
);
246 static HRESULT WINAPI
fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled(
247 INetFwProfile
*iface
,
248 VARIANT_BOOL disabled
)
250 fw_profile
*This
= impl_from_INetFwProfile( iface
);
252 FIXME("%p, %d\n", This
, disabled
);
256 static HRESULT WINAPI
fw_profile_get_RemoteAdminSettings(
257 INetFwProfile
*iface
,
258 INetFwRemoteAdminSettings
**remoteAdminSettings
)
260 fw_profile
*This
= impl_from_INetFwProfile( iface
);
262 FIXME("%p, %p\n", This
, remoteAdminSettings
);
266 static HRESULT WINAPI
fw_profile_get_IcmpSettings(
267 INetFwProfile
*iface
,
268 INetFwIcmpSettings
**icmpSettings
)
270 fw_profile
*This
= impl_from_INetFwProfile( iface
);
272 FIXME("%p, %p\n", This
, icmpSettings
);
276 static HRESULT WINAPI
fw_profile_get_GloballyOpenPorts(
277 INetFwProfile
*iface
,
278 INetFwOpenPorts
**openPorts
)
280 fw_profile
*This
= impl_from_INetFwProfile( iface
);
282 TRACE("%p, %p\n", This
, openPorts
);
283 return NetFwOpenPorts_create( NULL
, (void **)openPorts
);
286 static HRESULT WINAPI
fw_profile_get_Services(
287 INetFwProfile
*iface
,
288 INetFwServices
**Services
)
290 fw_profile
*This
= impl_from_INetFwProfile( iface
);
292 TRACE("%p, %p\n", This
, Services
);
293 return NetFwServices_create( NULL
, (void **)Services
);
296 static HRESULT WINAPI
fw_profile_get_AuthorizedApplications(
297 INetFwProfile
*iface
,
298 INetFwAuthorizedApplications
**apps
)
300 fw_profile
*This
= impl_from_INetFwProfile( iface
);
302 TRACE("%p, %p\n", This
, apps
);
303 return NetFwAuthorizedApplications_create( NULL
, (void **)apps
);
306 static const struct INetFwProfileVtbl fw_profile_vtbl
=
308 fw_profile_QueryInterface
,
311 fw_profile_GetTypeInfoCount
,
312 fw_profile_GetTypeInfo
,
313 fw_profile_GetIDsOfNames
,
316 fw_profile_get_FirewallEnabled
,
317 fw_profile_put_FirewallEnabled
,
318 fw_profile_get_ExceptionsNotAllowed
,
319 fw_profile_put_ExceptionsNotAllowed
,
320 fw_profile_get_NotificationsDisabled
,
321 fw_profile_put_NotificationsDisabled
,
322 fw_profile_get_UnicastResponsesToMulticastBroadcastDisabled
,
323 fw_profile_put_UnicastResponsesToMulticastBroadcastDisabled
,
324 fw_profile_get_RemoteAdminSettings
,
325 fw_profile_get_IcmpSettings
,
326 fw_profile_get_GloballyOpenPorts
,
327 fw_profile_get_Services
,
328 fw_profile_get_AuthorizedApplications
331 HRESULT
NetFwProfile_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
335 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
337 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
338 if (!fp
) return E_OUTOFMEMORY
;
340 fp
->INetFwProfile_iface
.lpVtbl
= &fw_profile_vtbl
;
343 *ppObj
= &fp
->INetFwProfile_iface
;
345 TRACE("returning iface %p\n", *ppObj
);