ReactOS 0.4.15-dev-5664-g3bf4ef6
ipv6.cpp
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS BDA Proxy
4 * FILE: dll/directx/msdvbnp/ipv6.cpp
5 * PURPOSE: IBDA_IPV6Filter interface
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9#include "precomp.h"
10
12{
13public:
17
18 //IBDA_IPV6Filter
20 HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE * pAddressList);
21 HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE *pAddressList);
24
25 CIPV6Filter(IBDA_NetworkProvider * pNetworkProvider);
26 virtual ~CIPV6Filter();
27
28protected:
33};
34
36 IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
37 m_ulcbAddresses(0),
38 m_pAddressList(0),
39 m_ulModeMask(0)
40{
41}
42
44{
47}
48
52 REFIID InterfaceId,
54{
56 return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
57}
58
62{
64 return m_pNetworkProvider->AddRef();
65}
66
70{
73}
74
75//-------------------------------------------------------------------
76//IBDA_IPV6Filter
77//
78
82 ULONG *pulcbAddresses)
83{
84 if (!pulcbAddresses)
85 return E_POINTER;
86
87 *pulcbAddresses = 0;
88 return NOERROR;
89}
90
94 ULONG *pulcbAddresses,
95 BYTE *pAddressList)
96{
97 if (!pulcbAddresses || !pAddressList)
98 return E_POINTER;
99
100 if (*pulcbAddresses < m_ulcbAddresses)
101 return E_OUTOFMEMORY;
102
104 *pulcbAddresses = m_ulcbAddresses;
105 return NOERROR;
106}
107
111 ULONG ulcbAddresses,
112 BYTE * pAddressList)
113{
114 if (!ulcbAddresses || !pAddressList)
115 return E_POINTER;
116
117 if (m_pAddressList)
119
120 m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
121 if (!m_pAddressList)
122 return E_OUTOFMEMORY;
123
124 CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
125 m_ulcbAddresses = ulcbAddresses;
126 return NOERROR;
127}
128
132 ULONG ulModeMask)
133{
134 m_ulModeMask = ulModeMask;
135 return NOERROR;
136}
137
141 ULONG *pulModeMask)
142{
143 *pulModeMask = m_ulModeMask;
144 return NOERROR;
145}
146
148WINAPI
150 IBDA_NetworkProvider * pNetworkProvider,
151 REFIID riid,
152 LPVOID * ppv)
153{
154 CIPV6Filter * filter = new CIPV6Filter(pNetworkProvider);
155
156 if (!filter)
157 return E_OUTOFMEMORY;
158
159 if (FAILED(filter->QueryInterface(riid, ppv)))
160 {
161 /* not supported */
162 delete filter;
163 return E_NOINTERFACE;
164 }
165
166 return NOERROR;
167}
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: ipv6.cpp:51
ULONG m_ulModeMask
Definition: ipv6.cpp:32
virtual ~CIPV6Filter()
Definition: ipv6.cpp:43
BYTE * m_pAddressList
Definition: ipv6.cpp:31
HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE *pAddressList)
Definition: ipv6.cpp:93
HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask)
Definition: ipv6.cpp:131
IBDA_NetworkProvider * m_pNetworkProvider
Definition: ipv6.cpp:29
ULONG m_ulcbAddresses
Definition: ipv6.cpp:30
STDMETHODIMP_(ULONG) AddRef()
HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses)
Definition: ipv6.cpp:81
STDMETHODIMP_(ULONG) Release()
CIPV6Filter(IBDA_NetworkProvider *pNetworkProvider)
Definition: ipv6.cpp:35
HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask)
Definition: ipv6.cpp:140
HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE *pAddressList)
Definition: ipv6.cpp:110
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define assert(x)
Definition: debug.h:53
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT WINAPI CIPV6Filter_fnConstructor(IBDA_NetworkProvider *pNetworkProvider, REFIID riid, LPVOID *ppv)
Definition: ipv6.cpp:149
unsigned int ULONG
Definition: retypes.h:1
#define REFIID
Definition: guiddef.h:118
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
#define CopyMemory
Definition: winbase.h:1668
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
#define E_POINTER
Definition: winerror.h:2365
unsigned char BYTE
Definition: xxhash.c:193