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 #define WIN32_NO_STATUS
21 #define COM_NO_WINDOWS_H
31 //#include "winuser.h"
35 #include <wine/debug.h>
36 //#include "wine/unicode.h"
37 #include "hnetcfg_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg
);
41 typedef struct fw_service
43 INetFwService INetFwService_iface
;
47 static inline fw_service
*impl_from_INetFwService( INetFwService
*iface
)
49 return CONTAINING_RECORD(iface
, fw_service
, INetFwService_iface
);
52 static ULONG WINAPI
fw_service_AddRef(
53 INetFwService
*iface
)
55 fw_service
*fw_service
= impl_from_INetFwService( iface
);
56 return InterlockedIncrement( &fw_service
->refs
);
59 static ULONG WINAPI
fw_service_Release(
60 INetFwService
*iface
)
62 fw_service
*fw_service
= impl_from_INetFwService( iface
);
63 LONG refs
= InterlockedDecrement( &fw_service
->refs
);
66 TRACE("destroying %p\n", fw_service
);
67 HeapFree( GetProcessHeap(), 0, fw_service
);
72 static HRESULT WINAPI
fw_service_QueryInterface(
77 fw_service
*This
= impl_from_INetFwService( iface
);
79 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
81 if ( IsEqualGUID( riid
, &IID_INetFwService
) ||
82 IsEqualGUID( riid
, &IID_IDispatch
) ||
83 IsEqualGUID( riid
, &IID_IUnknown
) )
89 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
92 INetFwService_AddRef( iface
);
96 static HRESULT WINAPI
fw_service_GetTypeInfoCount(
100 fw_service
*This
= impl_from_INetFwService( iface
);
102 FIXME("%p %p\n", This
, pctinfo
);
106 static HRESULT WINAPI
fw_service_GetTypeInfo(
107 INetFwService
*iface
,
110 ITypeInfo
**ppTInfo
)
112 fw_service
*This
= impl_from_INetFwService( iface
);
114 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
118 static HRESULT WINAPI
fw_service_GetIDsOfNames(
119 INetFwService
*iface
,
126 fw_service
*This
= impl_from_INetFwService( iface
);
128 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
132 static HRESULT WINAPI
fw_service_Invoke(
133 INetFwService
*iface
,
138 DISPPARAMS
*pDispParams
,
140 EXCEPINFO
*pExcepInfo
,
143 fw_service
*This
= impl_from_INetFwService( iface
);
145 FIXME("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
146 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
150 static HRESULT WINAPI
fw_service_get_Name(
151 INetFwService
*iface
,
154 fw_service
*This
= impl_from_INetFwService( iface
);
156 FIXME("%p %p\n", This
, name
);
160 static HRESULT WINAPI
fw_service_get_Type(
161 INetFwService
*iface
,
162 NET_FW_SERVICE_TYPE
*type
)
164 fw_service
*This
= impl_from_INetFwService( iface
);
166 FIXME("%p %p\n", This
, type
);
170 static HRESULT WINAPI
fw_service_get_Customized(
171 INetFwService
*iface
,
172 VARIANT_BOOL
*customized
)
174 fw_service
*This
= impl_from_INetFwService( iface
);
176 FIXME("%p %p\n", This
, customized
);
180 static HRESULT WINAPI
fw_service_get_IpVersion(
181 INetFwService
*iface
,
182 NET_FW_IP_VERSION
*ipVersion
)
184 fw_service
*This
= impl_from_INetFwService( iface
);
186 FIXME("%p %p\n", This
, ipVersion
);
190 static HRESULT WINAPI
fw_service_put_IpVersion(
191 INetFwService
*iface
,
192 NET_FW_IP_VERSION ipVersion
)
194 fw_service
*This
= impl_from_INetFwService( iface
);
196 FIXME("%p %u\n", This
, ipVersion
);
200 static HRESULT WINAPI
fw_service_get_Scope(
201 INetFwService
*iface
,
202 NET_FW_SCOPE
*scope
)
204 fw_service
*This
= impl_from_INetFwService( iface
);
206 FIXME("%p %p\n", This
, scope
);
210 static HRESULT WINAPI
fw_service_put_Scope(
211 INetFwService
*iface
,
214 fw_service
*This
= impl_from_INetFwService( iface
);
216 FIXME("%p %u\n", This
, scope
);
220 static HRESULT WINAPI
fw_service_get_RemoteAddresses(
221 INetFwService
*iface
,
224 fw_service
*This
= impl_from_INetFwService( iface
);
226 FIXME("%p %p\n", This
, remoteAddrs
);
230 static HRESULT WINAPI
fw_service_put_RemoteAddresses(
231 INetFwService
*iface
,
234 fw_service
*This
= impl_from_INetFwService( iface
);
236 FIXME("%p %s\n", This
, debugstr_w(remoteAddrs
));
240 static HRESULT WINAPI
fw_service_get_Enabled(
241 INetFwService
*iface
,
242 VARIANT_BOOL
*enabled
)
244 fw_service
*This
= impl_from_INetFwService( iface
);
246 FIXME("%p %p\n", This
, enabled
);
250 static HRESULT WINAPI
fw_service_put_Enabled(
251 INetFwService
*iface
,
252 VARIANT_BOOL enabled
)
254 fw_service
*This
= impl_from_INetFwService( iface
);
256 FIXME("%p %d\n", This
, enabled
);
260 static HRESULT WINAPI
fw_service_get_GloballyOpenPorts(
261 INetFwService
*iface
,
262 INetFwOpenPorts
**openPorts
)
264 fw_service
*This
= impl_from_INetFwService( iface
);
266 TRACE("%p %p\n", This
, openPorts
);
267 return NetFwOpenPorts_create( NULL
, (void **)openPorts
);
270 static const struct INetFwServiceVtbl fw_service_vtbl
=
272 fw_service_QueryInterface
,
275 fw_service_GetTypeInfoCount
,
276 fw_service_GetTypeInfo
,
277 fw_service_GetIDsOfNames
,
281 fw_service_get_Customized
,
282 fw_service_get_IpVersion
,
283 fw_service_put_IpVersion
,
284 fw_service_get_Scope
,
285 fw_service_put_Scope
,
286 fw_service_get_RemoteAddresses
,
287 fw_service_put_RemoteAddresses
,
288 fw_service_get_Enabled
,
289 fw_service_put_Enabled
,
290 fw_service_get_GloballyOpenPorts
293 static HRESULT
NetFwService_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
297 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
299 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
300 if (!fp
) return E_OUTOFMEMORY
;
302 fp
->INetFwService_iface
.lpVtbl
= &fw_service_vtbl
;
305 *ppObj
= &fp
->INetFwService_iface
;
307 TRACE("returning iface %p\n", *ppObj
);
311 typedef struct fw_services
313 INetFwServices INetFwServices_iface
;
317 static inline fw_services
*impl_from_INetFwServices( INetFwServices
*iface
)
319 return CONTAINING_RECORD(iface
, fw_services
, INetFwServices_iface
);
322 static ULONG WINAPI
fw_services_AddRef(
323 INetFwServices
*iface
)
325 fw_services
*fw_services
= impl_from_INetFwServices( iface
);
326 return InterlockedIncrement( &fw_services
->refs
);
329 static ULONG WINAPI
fw_services_Release(
330 INetFwServices
*iface
)
332 fw_services
*fw_services
= impl_from_INetFwServices( iface
);
333 LONG refs
= InterlockedDecrement( &fw_services
->refs
);
336 TRACE("destroying %p\n", fw_services
);
337 HeapFree( GetProcessHeap(), 0, fw_services
);
342 static HRESULT WINAPI
fw_services_QueryInterface(
343 INetFwServices
*iface
,
347 fw_services
*This
= impl_from_INetFwServices( iface
);
349 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
351 if ( IsEqualGUID( riid
, &IID_INetFwServices
) ||
352 IsEqualGUID( riid
, &IID_IDispatch
) ||
353 IsEqualGUID( riid
, &IID_IUnknown
) )
359 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
360 return E_NOINTERFACE
;
362 INetFwServices_AddRef( iface
);
366 static HRESULT WINAPI
fw_services_GetTypeInfoCount(
367 INetFwServices
*iface
,
370 fw_services
*This
= impl_from_INetFwServices( iface
);
372 FIXME("%p %p\n", This
, pctinfo
);
376 static HRESULT WINAPI
fw_services_GetTypeInfo(
377 INetFwServices
*iface
,
380 ITypeInfo
**ppTInfo
)
382 fw_services
*This
= impl_from_INetFwServices( iface
);
384 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
388 static HRESULT WINAPI
fw_services_GetIDsOfNames(
389 INetFwServices
*iface
,
396 fw_services
*This
= impl_from_INetFwServices( iface
);
398 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
402 static HRESULT WINAPI
fw_services_Invoke(
403 INetFwServices
*iface
,
408 DISPPARAMS
*pDispParams
,
410 EXCEPINFO
*pExcepInfo
,
413 fw_services
*This
= impl_from_INetFwServices( iface
);
415 FIXME("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
416 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
420 static HRESULT WINAPI
fw_services_get_Count(
421 INetFwServices
*iface
,
424 fw_services
*This
= impl_from_INetFwServices( iface
);
426 FIXME("%p, %p\n", This
, count
);
432 static HRESULT WINAPI
fw_services_Item(
433 INetFwServices
*iface
,
434 NET_FW_SERVICE_TYPE svcType
,
435 INetFwService
**service
)
437 fw_services
*This
= impl_from_INetFwServices( iface
);
439 FIXME("%p, %u, %p\n", This
, svcType
, service
);
440 return NetFwService_create( NULL
, (void **)service
);
443 static HRESULT WINAPI
fw_services_get__NewEnum(
444 INetFwServices
*iface
,
447 fw_services
*This
= impl_from_INetFwServices( iface
);
449 FIXME("%p, %p\n", This
, newEnum
);
453 static const struct INetFwServicesVtbl fw_services_vtbl
=
455 fw_services_QueryInterface
,
458 fw_services_GetTypeInfoCount
,
459 fw_services_GetTypeInfo
,
460 fw_services_GetIDsOfNames
,
462 fw_services_get_Count
,
464 fw_services_get__NewEnum
467 HRESULT
NetFwServices_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
471 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
473 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
474 if (!fp
) return E_OUTOFMEMORY
;
476 fp
->INetFwServices_iface
.lpVtbl
= &fw_services_vtbl
;
479 *ppObj
= &fp
->INetFwServices_iface
;
481 TRACE("returning iface %p\n", *ppObj
);