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_port
43 INetFwOpenPort INetFwOpenPort_iface
;
47 static inline fw_port
*impl_from_INetFwOpenPort( INetFwOpenPort
*iface
)
49 return CONTAINING_RECORD(iface
, fw_port
, INetFwOpenPort_iface
);
52 static ULONG WINAPI
fw_port_AddRef(
53 INetFwOpenPort
*iface
)
55 fw_port
*fw_port
= impl_from_INetFwOpenPort( iface
);
56 return InterlockedIncrement( &fw_port
->refs
);
59 static ULONG WINAPI
fw_port_Release(
60 INetFwOpenPort
*iface
)
62 fw_port
*fw_port
= impl_from_INetFwOpenPort( iface
);
63 LONG refs
= InterlockedDecrement( &fw_port
->refs
);
66 TRACE("destroying %p\n", fw_port
);
67 HeapFree( GetProcessHeap(), 0, fw_port
);
72 static HRESULT WINAPI
fw_port_QueryInterface(
73 INetFwOpenPort
*iface
,
77 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
79 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
81 if ( IsEqualGUID( riid
, &IID_INetFwOpenPort
) ||
82 IsEqualGUID( riid
, &IID_IDispatch
) ||
83 IsEqualGUID( riid
, &IID_IUnknown
) )
89 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
92 INetFwOpenPort_AddRef( iface
);
96 static HRESULT WINAPI
fw_port_GetTypeInfoCount(
97 INetFwOpenPort
*iface
,
100 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
102 FIXME("%p %p\n", This
, pctinfo
);
106 static HRESULT WINAPI
fw_port_GetTypeInfo(
107 INetFwOpenPort
*iface
,
110 ITypeInfo
**ppTInfo
)
112 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
114 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
118 static HRESULT WINAPI
fw_port_GetIDsOfNames(
119 INetFwOpenPort
*iface
,
126 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
128 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
132 static HRESULT WINAPI
fw_port_Invoke(
133 INetFwOpenPort
*iface
,
138 DISPPARAMS
*pDispParams
,
140 EXCEPINFO
*pExcepInfo
,
143 fw_port
*This
= impl_from_INetFwOpenPort( 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_port_get_Name(
151 INetFwOpenPort
*iface
,
154 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
156 FIXME("%p %p\n", This
, name
);
160 static HRESULT WINAPI
fw_port_put_Name(
161 INetFwOpenPort
*iface
,
164 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
166 FIXME("%p %s\n", This
, debugstr_w(name
));
170 static HRESULT WINAPI
fw_port_get_IpVersion(
171 INetFwOpenPort
*iface
,
172 NET_FW_IP_VERSION
*ipVersion
)
174 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
176 FIXME("%p %p\n", This
, ipVersion
);
180 static HRESULT WINAPI
fw_port_put_IpVersion(
181 INetFwOpenPort
*iface
,
182 NET_FW_IP_VERSION ipVersion
)
184 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
186 FIXME("%p %u\n", This
, ipVersion
);
190 static HRESULT WINAPI
fw_port_get_Protocol(
191 INetFwOpenPort
*iface
,
192 NET_FW_IP_PROTOCOL
*ipProtocol
)
194 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
196 FIXME("%p %p\n", This
, ipProtocol
);
200 static HRESULT WINAPI
fw_port_put_Protocol(
201 INetFwOpenPort
*iface
,
202 NET_FW_IP_PROTOCOL ipProtocol
)
204 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
206 FIXME("%p %u\n", This
, ipProtocol
);
210 static HRESULT WINAPI
fw_port_get_Port(
211 INetFwOpenPort
*iface
,
214 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
216 FIXME("%p %p\n", This
, portNumber
);
220 static HRESULT WINAPI
fw_port_put_Port(
221 INetFwOpenPort
*iface
,
224 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
226 FIXME("%p %d\n", This
, portNumber
);
230 static HRESULT WINAPI
fw_port_get_Scope(
231 INetFwOpenPort
*iface
,
234 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
236 FIXME("%p %p\n", This
, scope
);
240 static HRESULT WINAPI
fw_port_put_Scope(
241 INetFwOpenPort
*iface
,
244 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
246 FIXME("%p %u\n", This
, scope
);
250 static HRESULT WINAPI
fw_port_get_RemoteAddresses(
251 INetFwOpenPort
*iface
,
254 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
256 FIXME("%p %p\n", This
, remoteAddrs
);
260 static HRESULT WINAPI
fw_port_put_RemoteAddresses(
261 INetFwOpenPort
*iface
,
264 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
266 FIXME("%p %s\n", This
, debugstr_w(remoteAddrs
));
270 static HRESULT WINAPI
fw_port_get_Enabled(
271 INetFwOpenPort
*iface
,
272 VARIANT_BOOL
*enabled
)
274 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
276 FIXME("%p %p\n", This
, enabled
);
278 *enabled
= VARIANT_TRUE
;
282 static HRESULT WINAPI
fw_port_put_Enabled(
283 INetFwOpenPort
*iface
,
284 VARIANT_BOOL enabled
)
286 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
288 FIXME("%p %d\n", This
, enabled
);
292 static HRESULT WINAPI
fw_port_get_BuiltIn(
293 INetFwOpenPort
*iface
,
294 VARIANT_BOOL
*builtIn
)
296 fw_port
*This
= impl_from_INetFwOpenPort( iface
);
298 FIXME("%p %p\n", This
, builtIn
);
302 static const struct INetFwOpenPortVtbl fw_port_vtbl
=
304 fw_port_QueryInterface
,
307 fw_port_GetTypeInfoCount
,
309 fw_port_GetIDsOfNames
,
313 fw_port_get_IpVersion
,
314 fw_port_put_IpVersion
,
315 fw_port_get_Protocol
,
316 fw_port_put_Protocol
,
321 fw_port_get_RemoteAddresses
,
322 fw_port_put_RemoteAddresses
,
328 static HRESULT
NetFwOpenPort_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
332 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
334 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
335 if (!fp
) return E_OUTOFMEMORY
;
337 fp
->INetFwOpenPort_iface
.lpVtbl
= &fw_port_vtbl
;
340 *ppObj
= &fp
->INetFwOpenPort_iface
;
342 TRACE("returning iface %p\n", *ppObj
);
346 typedef struct fw_ports
348 INetFwOpenPorts INetFwOpenPorts_iface
;
352 static inline fw_ports
*impl_from_INetFwOpenPorts( INetFwOpenPorts
*iface
)
354 return CONTAINING_RECORD(iface
, fw_ports
, INetFwOpenPorts_iface
);
357 static ULONG WINAPI
fw_ports_AddRef(
358 INetFwOpenPorts
*iface
)
360 fw_ports
*fw_ports
= impl_from_INetFwOpenPorts( iface
);
361 return InterlockedIncrement( &fw_ports
->refs
);
364 static ULONG WINAPI
fw_ports_Release(
365 INetFwOpenPorts
*iface
)
367 fw_ports
*fw_ports
= impl_from_INetFwOpenPorts( iface
);
368 LONG refs
= InterlockedDecrement( &fw_ports
->refs
);
371 TRACE("destroying %p\n", fw_ports
);
372 HeapFree( GetProcessHeap(), 0, fw_ports
);
377 static HRESULT WINAPI
fw_ports_QueryInterface(
378 INetFwOpenPorts
*iface
,
382 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
384 TRACE("%p %s %p\n", This
, debugstr_guid( riid
), ppvObject
);
386 if ( IsEqualGUID( riid
, &IID_INetFwOpenPorts
) ||
387 IsEqualGUID( riid
, &IID_IDispatch
) ||
388 IsEqualGUID( riid
, &IID_IUnknown
) )
394 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
395 return E_NOINTERFACE
;
397 INetFwOpenPorts_AddRef( iface
);
401 static HRESULT WINAPI
fw_ports_GetTypeInfoCount(
402 INetFwOpenPorts
*iface
,
405 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
407 FIXME("%p %p\n", This
, pctinfo
);
411 static HRESULT WINAPI
fw_ports_GetTypeInfo(
412 INetFwOpenPorts
*iface
,
415 ITypeInfo
**ppTInfo
)
417 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
419 FIXME("%p %u %u %p\n", This
, iTInfo
, lcid
, ppTInfo
);
423 static HRESULT WINAPI
fw_ports_GetIDsOfNames(
424 INetFwOpenPorts
*iface
,
431 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
433 FIXME("%p %s %p %u %u %p\n", This
, debugstr_guid(riid
), rgszNames
, cNames
, lcid
, rgDispId
);
437 static HRESULT WINAPI
fw_ports_Invoke(
438 INetFwOpenPorts
*iface
,
443 DISPPARAMS
*pDispParams
,
445 EXCEPINFO
*pExcepInfo
,
448 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
450 FIXME("%p %d %s %d %d %p %p %p %p\n", This
, dispIdMember
, debugstr_guid(riid
),
451 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
455 static HRESULT WINAPI
fw_ports_get_Count(
456 INetFwOpenPorts
*iface
,
459 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
461 FIXME("%p, %p\n", This
, count
);
467 static HRESULT WINAPI
fw_ports_Add(
468 INetFwOpenPorts
*iface
,
469 INetFwOpenPort
*port
)
471 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
473 FIXME("%p, %p\n", This
, port
);
477 static HRESULT WINAPI
fw_ports_Remove(
478 INetFwOpenPorts
*iface
,
480 NET_FW_IP_PROTOCOL ipProtocol
)
482 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
484 FIXME("%p, %d, %u\n", This
, portNumber
, ipProtocol
);
488 static HRESULT WINAPI
fw_ports_Item(
489 INetFwOpenPorts
*iface
,
491 NET_FW_IP_PROTOCOL ipProtocol
,
492 INetFwOpenPort
**openPort
)
495 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
497 FIXME("%p, %d, %u, %p\n", This
, portNumber
, ipProtocol
, openPort
);
499 hr
= NetFwOpenPort_create( NULL
, (void **)openPort
);
502 INetFwOpenPort_put_Protocol( *openPort
, ipProtocol
);
503 INetFwOpenPort_put_Port( *openPort
, portNumber
);
508 static HRESULT WINAPI
fw_ports_get__NewEnum(
509 INetFwOpenPorts
*iface
,
512 fw_ports
*This
= impl_from_INetFwOpenPorts( iface
);
514 FIXME("%p, %p\n", This
, newEnum
);
518 static const struct INetFwOpenPortsVtbl fw_ports_vtbl
=
520 fw_ports_QueryInterface
,
523 fw_ports_GetTypeInfoCount
,
524 fw_ports_GetTypeInfo
,
525 fw_ports_GetIDsOfNames
,
531 fw_ports_get__NewEnum
534 HRESULT
NetFwOpenPorts_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
538 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
540 fp
= HeapAlloc( GetProcessHeap(), 0, sizeof(*fp
) );
541 if (!fp
) return E_OUTOFMEMORY
;
543 fp
->INetFwOpenPorts_iface
.lpVtbl
= &fw_ports_vtbl
;
546 *ppObj
= &fp
->INetFwOpenPorts_iface
;
548 TRACE("returning iface %p\n", *ppObj
);