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_service
37 INetFwService INetFwService_iface
;
41 static inline fw_service
*impl_from_INetFwService( INetFwService
*iface
)
43 return CONTAINING_RECORD(iface
, fw_service
, INetFwService_iface
);
46 static ULONG WINAPI
fw_service_AddRef(
47 INetFwService
*iface
)
49 fw_service
*fw_service
= impl_from_INetFwService( iface
);
50 return InterlockedIncrement( &fw_service
->refs
);
53 static ULONG WINAPI
fw_service_Release(
54 INetFwService
*iface
)
56 fw_service
*fw_service
= impl_from_INetFwService( iface
);
57 LONG refs
= InterlockedDecrement( &fw_service
->refs
);
60 TRACE("destroying %p\n", fw_service
);
61 HeapFree( GetProcessHeap(), 0, fw_service
);
66 static HRESULT WINAPI
fw_service_QueryInterface(
71 fw_service
*This
= impl_from_INetFwService( iface
);
73 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
75 if ( IsEqualGUID( riid
, &IID_INetFwService
) ||
76 IsEqualGUID( riid
, &IID_IDispatch
) ||
77 IsEqualGUID( riid
, &IID_IUnknown
) )
83 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
86 INetFwService_AddRef( iface
);
90 static HRESULT WINAPI
fw_service_GetTypeInfoCount(
94 fw_service
*This
= impl_from_INetFwService( iface
);
96 FIXME("%p %p\n", This
, pctinfo
);
100 static HRESULT WINAPI
fw_service_GetTypeInfo(
101 INetFwService
*iface
,
104 ITypeInfo
**ppTInfo
)
106 fw_service
*This
= impl_from_INetFwService( iface
);
108 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
112 static HRESULT WINAPI
fw_service_GetIDsOfNames(
113 INetFwService
*iface
,
120 fw_service
*This
= impl_from_INetFwService( iface
);
122 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
126 static HRESULT WINAPI
fw_service_Invoke(
127 INetFwService
*iface
,
132 DISPPARAMS
*pDispParams
,
134 EXCEPINFO
*pExcepInfo
,
137 fw_service
*This
= impl_from_INetFwService( iface
);
139 FIXME("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
140 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
144 static HRESULT WINAPI
fw_service_get_Name(
145 INetFwService
*iface
,
148 fw_service
*This
= impl_from_INetFwService( iface
);
150 FIXME("%p %p\n", This
, name
);
154 static HRESULT WINAPI
fw_service_get_Type(
155 INetFwService
*iface
,
156 NET_FW_SERVICE_TYPE
*type
)
158 fw_service
*This
= impl_from_INetFwService( iface
);
160 FIXME("%p %p\n", This
, type
);
164 static HRESULT WINAPI
fw_service_get_Customized(
165 INetFwService
*iface
,
166 VARIANT_BOOL
*customized
)
168 fw_service
*This
= impl_from_INetFwService( iface
);
170 FIXME("%p %p\n", This
, customized
);
174 static HRESULT WINAPI
fw_service_get_IpVersion(
175 INetFwService
*iface
,
176 NET_FW_IP_VERSION
*ipVersion
)
178 fw_service
*This
= impl_from_INetFwService( iface
);
180 FIXME("%p %p\n", This
, ipVersion
);
184 static HRESULT WINAPI
fw_service_put_IpVersion(
185 INetFwService
*iface
,
186 NET_FW_IP_VERSION ipVersion
)
188 fw_service
*This
= impl_from_INetFwService( iface
);
190 FIXME("%p %u\n", This
, ipVersion
);
194 static HRESULT WINAPI
fw_service_get_Scope(
195 INetFwService
*iface
,
196 NET_FW_SCOPE
*scope
)
198 fw_service
*This
= impl_from_INetFwService( iface
);
200 FIXME("%p %p\n", This
, scope
);
204 static HRESULT WINAPI
fw_service_put_Scope(
205 INetFwService
*iface
,
208 fw_service
*This
= impl_from_INetFwService( iface
);
210 FIXME("%p %u\n", This
, scope
);
214 static HRESULT WINAPI
fw_service_get_RemoteAddresses(
215 INetFwService
*iface
,
218 fw_service
*This
= impl_from_INetFwService( iface
);
220 FIXME("%p %p\n", This
, remoteAddrs
);
224 static HRESULT WINAPI
fw_service_put_RemoteAddresses(
225 INetFwService
*iface
,
228 fw_service
*This
= impl_from_INetFwService( iface
);
230 FIXME("%p %s\n", This
, debugstr_w(remoteAddrs
));
234 static HRESULT WINAPI
fw_service_get_Enabled(
235 INetFwService
*iface
,
236 VARIANT_BOOL
*enabled
)
238 fw_service
*This
= impl_from_INetFwService( iface
);
240 FIXME("%p %p\n", This
, enabled
);
244 static HRESULT WINAPI
fw_service_put_Enabled(
245 INetFwService
*iface
,
246 VARIANT_BOOL enabled
)
248 fw_service
*This
= impl_from_INetFwService( iface
);
250 FIXME("%p %d\n", This
, enabled
);
254 static HRESULT WINAPI
fw_service_get_GloballyOpenPorts(
255 INetFwService
*iface
,
256 INetFwOpenPorts
**openPorts
)
258 fw_service
*This
= impl_from_INetFwService( iface
);
260 TRACE("%p %p\n", This
, openPorts
);
261 return NetFwOpenPorts_create( NULL
, (void **)openPorts
);
264 static const struct INetFwServiceVtbl fw_service_vtbl
=
266 fw_service_QueryInterface
,
269 fw_service_GetTypeInfoCount
,
270 fw_service_GetTypeInfo
,
271 fw_service_GetIDsOfNames
,
275 fw_service_get_Customized
,
276 fw_service_get_IpVersion
,
277 fw_service_put_IpVersion
,
278 fw_service_get_Scope
,
279 fw_service_put_Scope
,
280 fw_service_get_RemoteAddresses
,
281 fw_service_put_RemoteAddresses
,
282 fw_service_get_Enabled
,
283 fw_service_put_Enabled
,
284 fw_service_get_GloballyOpenPorts
287 static HRESULT
NetFwService_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
291 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
293 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
294 if (!fp
) return E_OUTOFMEMORY
;
296 fp
->INetFwService_iface
.lpVtbl
= &fw_service_vtbl
;
299 *ppObj
= &fp
->INetFwService_iface
;
301 TRACE("returning iface %p\n", *ppObj
);
305 typedef struct fw_services
307 INetFwServices INetFwServices_iface
;
311 static inline fw_services
*impl_from_INetFwServices( INetFwServices
*iface
)
313 return CONTAINING_RECORD(iface
, fw_services
, INetFwServices_iface
);
316 static ULONG WINAPI
fw_services_AddRef(
317 INetFwServices
*iface
)
319 fw_services
*fw_services
= impl_from_INetFwServices( iface
);
320 return InterlockedIncrement( &fw_services
->refs
);
323 static ULONG WINAPI
fw_services_Release(
324 INetFwServices
*iface
)
326 fw_services
*fw_services
= impl_from_INetFwServices( iface
);
327 LONG refs
= InterlockedDecrement( &fw_services
->refs
);
330 TRACE("destroying %p\n", fw_services
);
331 HeapFree( GetProcessHeap(), 0, fw_services
);
336 static HRESULT WINAPI
fw_services_QueryInterface(
337 INetFwServices
*iface
,
341 fw_services
*This
= impl_from_INetFwServices( iface
);
343 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
345 if ( IsEqualGUID( riid
, &IID_INetFwServices
) ||
346 IsEqualGUID( riid
, &IID_IDispatch
) ||
347 IsEqualGUID( riid
, &IID_IUnknown
) )
353 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
354 return E_NOINTERFACE
;
356 INetFwServices_AddRef( iface
);
360 static HRESULT WINAPI
fw_services_GetTypeInfoCount(
361 INetFwServices
*iface
,
364 fw_services
*This
= impl_from_INetFwServices( iface
);
366 FIXME("%p %p\n", This
, pctinfo
);
370 static HRESULT WINAPI
fw_services_GetTypeInfo(
371 INetFwServices
*iface
,
374 ITypeInfo
**ppTInfo
)
376 fw_services
*This
= impl_from_INetFwServices( iface
);
378 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
382 static HRESULT WINAPI
fw_services_GetIDsOfNames(
383 INetFwServices
*iface
,
390 fw_services
*This
= impl_from_INetFwServices( iface
);
392 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
396 static HRESULT WINAPI
fw_services_Invoke(
397 INetFwServices
*iface
,
402 DISPPARAMS
*pDispParams
,
404 EXCEPINFO
*pExcepInfo
,
407 fw_services
*This
= impl_from_INetFwServices( iface
);
409 FIXME("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
410 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
414 static HRESULT WINAPI
fw_services_get_Count(
415 INetFwServices
*iface
,
418 fw_services
*This
= impl_from_INetFwServices( iface
);
420 FIXME("%p, %p\n", This
, count
);
426 static HRESULT WINAPI
fw_services_Item(
427 INetFwServices
*iface
,
428 NET_FW_SERVICE_TYPE svcType
,
429 INetFwService
**service
)
431 fw_services
*This
= impl_from_INetFwServices( iface
);
433 FIXME("%p, %u, %p\n", This
, svcType
, service
);
434 return NetFwService_create( NULL
, (void **)service
);
437 static HRESULT WINAPI
fw_services_get__NewEnum(
438 INetFwServices
*iface
,
441 fw_services
*This
= impl_from_INetFwServices( iface
);
443 FIXME("%p, %p\n", This
, newEnum
);
447 static const struct INetFwServicesVtbl fw_services_vtbl
=
449 fw_services_QueryInterface
,
452 fw_services_GetTypeInfoCount
,
453 fw_services_GetTypeInfo
,
454 fw_services_GetIDsOfNames
,
456 fw_services_get_Count
,
458 fw_services_get__NewEnum
461 HRESULT
NetFwServices_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
465 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
467 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
468 if (!fp
) return E_OUTOFMEMORY
;
470 fp
->INetFwServices_iface
.lpVtbl
= &fw_services_vtbl
;
473 *ppObj
= &fp
->INetFwServices_iface
;
475 TRACE("returning iface %p\n", *ppObj
);