Author: janderwald
Date: Mon Mar 29 15:12:16 2010
New Revision: 46569
URL:
http://svn.reactos.org/svn/reactos?rev=46569&view=rev
Log:
[MSDVBNP]
- Implement IBDA_EthernetFilter, IBDA_IPV4Filter, IBDA_IPV6Filter
Added:
trunk/reactos/dll/directx/msdvbnp/ethernetfilter.cpp (with props)
trunk/reactos/dll/directx/msdvbnp/ipv4.cpp (with props)
trunk/reactos/dll/directx/msdvbnp/ipv6.cpp (with props)
Modified:
trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild
trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp
trunk/reactos/dll/directx/msdvbnp/precomp.h
Added: trunk/reactos/dll/directx/msdvbnp/ethernetfilter.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/ethern…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/ethernetfilter.cpp (added)
+++ trunk/reactos/dll/directx/msdvbnp/ethernetfilter.cpp [iso-8859-1] Mon Mar 29 15:12:16
2010
@@ -1,0 +1,169 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS BDA Proxy
+ * FILE: dll/directx/msdvbnp/ethernetfilter.cpp
+ * PURPOSE: IBDA_EthernetFilter interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+class CEthernetFilter : public IBDA_EthernetFilter
+{
+public:
+ STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
+
+ STDMETHODIMP_(ULONG) AddRef();
+ STDMETHODIMP_(ULONG) Release();
+
+ //IBDA_EthernetFilter
+ HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
+ HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE *
pAddressList);
+ HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE
*pAddressList);
+ HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
+ HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
+
+
+ CEthernetFilter(IBDA_NetworkProvider * pNetworkProvider);
+ virtual ~CEthernetFilter();
+
+protected:
+ IBDA_NetworkProvider * m_pNetworkProvider;
+ ULONG m_ulcbAddresses;
+ BYTE * m_pAddressList;
+ ULONG m_ulModeMask;
+};
+
+CEthernetFilter::CEthernetFilter(
+ IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
+ m_ulcbAddresses(0),
+ m_pAddressList(0),
+ m_ulModeMask(0)
+{
+}
+
+CEthernetFilter::~CEthernetFilter()
+{
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::QueryInterface(
+ REFIID InterfaceId,
+ PVOID* Interface)
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
+}
+
+ULONG
+STDMETHODCALLTYPE
+CEthernetFilter::AddRef()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->AddRef();
+}
+
+ULONG
+STDMETHODCALLTYPE
+CEthernetFilter::Release()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->Release();
+}
+
+//-------------------------------------------------------------------
+//IBDA_EthernetFilter
+//
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::PutMulticastList(
+ ULONG ulcbAddresses,
+ BYTE * pAddressList)
+{
+ if (!ulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+
+ m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
+ if (!m_pAddressList)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
+ m_ulcbAddresses = ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::GetMulticastList(
+ ULONG *pulcbAddresses,
+ BYTE *pAddressList)
+{
+ if (!pulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (*pulcbAddresses < m_ulcbAddresses)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
+ *pulcbAddresses = m_ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::GetMulticastListSize(
+ ULONG *pulcbAddresses)
+{
+ if (!pulcbAddresses)
+ return E_POINTER;
+
+ *pulcbAddresses = m_ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::PutMulticastMode(
+ ULONG ulModeMask)
+{
+ m_ulModeMask = ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CEthernetFilter::GetMulticastMode(
+ ULONG *pulModeMask)
+{
+ *pulModeMask = m_ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+WINAPI
+CEthernetFilter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CEthernetFilter * filter = new CEthernetFilter(pNetworkProvider);
+
+ if (!filter)
+ return E_OUTOFMEMORY;
+
+ if (FAILED(filter->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete filter;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
Propchange: trunk/reactos/dll/directx/msdvbnp/ethernetfilter.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/msdvbnp/ipv4.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/ipv4.c…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/ipv4.cpp (added)
+++ trunk/reactos/dll/directx/msdvbnp/ipv4.cpp [iso-8859-1] Mon Mar 29 15:12:16 2010
@@ -1,0 +1,170 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS BDA Proxy
+ * FILE: dll/directx/msdvbnp/ipv4.cpp
+ * PURPOSE: IBDA_IPV4Filter interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+class CIPV4Filter : public IBDA_IPV4Filter
+{
+public:
+ STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
+ STDMETHODIMP_(ULONG) AddRef();
+ STDMETHODIMP_(ULONG) Release();
+
+ //IBDA_IPV4Filter
+ HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
+ HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE *
pAddressList);
+ HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE
*pAddressList);
+ HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
+ HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
+
+
+ CIPV4Filter(IBDA_NetworkProvider * pNetworkProvider);
+ virtual ~CIPV4Filter();
+
+protected:
+ IBDA_NetworkProvider * m_pNetworkProvider;
+ ULONG m_ulcbAddresses;
+ BYTE * m_pAddressList;
+ ULONG m_ulModeMask;
+};
+
+CIPV4Filter::CIPV4Filter(
+ IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
+ m_ulcbAddresses(0),
+ m_pAddressList(0),
+ m_ulModeMask(0)
+{
+}
+
+CIPV4Filter::~CIPV4Filter()
+{
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+}
+
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::QueryInterface(
+ REFIID InterfaceId,
+ PVOID* Interface)
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
+}
+
+ULONG
+STDMETHODCALLTYPE
+CIPV4Filter::AddRef()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->AddRef();
+}
+
+ULONG
+STDMETHODCALLTYPE
+CIPV4Filter::Release()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->Release();
+}
+
+//-------------------------------------------------------------------
+//IBDA_IPV4Filter
+//
+
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::GetMulticastListSize(
+ ULONG *pulcbAddresses)
+{
+ if (!pulcbAddresses)
+ return E_POINTER;
+
+ *pulcbAddresses = 0;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::PutMulticastList(
+ ULONG ulcbAddresses,
+ BYTE * pAddressList)
+{
+ if (!ulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+
+ m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
+ if (!m_pAddressList)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
+ m_ulcbAddresses = ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::GetMulticastList(
+ ULONG *pulcbAddresses,
+ BYTE *pAddressList)
+{
+ if (!pulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (*pulcbAddresses < m_ulcbAddresses)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
+ *pulcbAddresses = m_ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::PutMulticastMode(
+ ULONG ulModeMask)
+{
+ m_ulModeMask = ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV4Filter::GetMulticastMode(
+ ULONG *pulModeMask)
+{
+ *pulModeMask = m_ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+WINAPI
+CIPV4Filter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CIPV4Filter * filter = new CIPV4Filter(pNetworkProvider);
+
+ if (!filter)
+ return E_OUTOFMEMORY;
+
+ if (FAILED(filter->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete filter;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
Propchange: trunk/reactos/dll/directx/msdvbnp/ipv4.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/msdvbnp/ipv6.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/ipv6.c…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/ipv6.cpp (added)
+++ trunk/reactos/dll/directx/msdvbnp/ipv6.cpp [iso-8859-1] Mon Mar 29 15:12:16 2010
@@ -1,0 +1,167 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS BDA Proxy
+ * FILE: dll/directx/msdvbnp/ipv6.cpp
+ * PURPOSE: IBDA_IPV6Filter interface
+ *
+ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org)
+ */
+#include "precomp.h"
+
+class CIPV6Filter : public IBDA_IPV6Filter
+{
+public:
+ STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
+ STDMETHODIMP_(ULONG) AddRef();
+ STDMETHODIMP_(ULONG) Release();
+
+ //IBDA_IPV6Filter
+ HRESULT STDMETHODCALLTYPE GetMulticastListSize(ULONG *pulcbAddresses);
+ HRESULT STDMETHODCALLTYPE PutMulticastList(ULONG ulcbAddresses, BYTE *
pAddressList);
+ HRESULT STDMETHODCALLTYPE GetMulticastList(ULONG *pulcbAddresses, BYTE
*pAddressList);
+ HRESULT STDMETHODCALLTYPE PutMulticastMode(ULONG ulModeMask);
+ HRESULT STDMETHODCALLTYPE GetMulticastMode(ULONG *pulModeMask);
+
+ CIPV6Filter(IBDA_NetworkProvider * pNetworkProvider);
+ virtual ~CIPV6Filter();
+
+protected:
+ IBDA_NetworkProvider * m_pNetworkProvider;
+ ULONG m_ulcbAddresses;
+ BYTE * m_pAddressList;
+ ULONG m_ulModeMask;
+};
+
+CIPV6Filter::CIPV6Filter(
+ IBDA_NetworkProvider * pNetworkProvider) : m_pNetworkProvider(pNetworkProvider),
+ m_ulcbAddresses(0),
+ m_pAddressList(0),
+ m_ulModeMask(0)
+{
+}
+
+CIPV6Filter::~CIPV6Filter()
+{
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::QueryInterface(
+ REFIID InterfaceId,
+ PVOID* Interface)
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->QueryInterface(InterfaceId, Interface);
+}
+
+ULONG
+STDMETHODCALLTYPE
+CIPV6Filter::AddRef()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->AddRef();
+}
+
+ULONG
+STDMETHODCALLTYPE
+CIPV6Filter::Release()
+{
+ assert(m_pNetworkProvider);
+ return m_pNetworkProvider->Release();
+}
+
+//-------------------------------------------------------------------
+//IBDA_IPV6Filter
+//
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::GetMulticastListSize(
+ ULONG *pulcbAddresses)
+{
+ if (!pulcbAddresses)
+ return E_POINTER;
+
+ *pulcbAddresses = 0;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::GetMulticastList(
+ ULONG *pulcbAddresses,
+ BYTE *pAddressList)
+{
+ if (!pulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (*pulcbAddresses < m_ulcbAddresses)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(pAddressList, m_pAddressList, m_ulcbAddresses);
+ *pulcbAddresses = m_ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::PutMulticastList(
+ ULONG ulcbAddresses,
+ BYTE * pAddressList)
+{
+ if (!ulcbAddresses || !pAddressList)
+ return E_POINTER;
+
+ if (m_pAddressList)
+ CoTaskMemFree(m_pAddressList);
+
+ m_pAddressList = (BYTE*)CoTaskMemAlloc(ulcbAddresses);
+ if (!m_pAddressList)
+ return E_OUTOFMEMORY;
+
+ CopyMemory(m_pAddressList, pAddressList, ulcbAddresses);
+ m_ulcbAddresses = ulcbAddresses;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::PutMulticastMode(
+ ULONG ulModeMask)
+{
+ m_ulModeMask = ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+STDMETHODCALLTYPE
+CIPV6Filter::GetMulticastMode(
+ ULONG *pulModeMask)
+{
+ *pulModeMask = m_ulModeMask;
+ return NOERROR;
+}
+
+HRESULT
+WINAPI
+CIPV6Filter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ CIPV6Filter * filter = new CIPV6Filter(pNetworkProvider);
+
+ if (!filter)
+ return E_OUTOFMEMORY;
+
+ if (FAILED(filter->QueryInterface(riid, ppv)))
+ {
+ /* not supported */
+ delete filter;
+ return E_NOINTERFACE;
+ }
+
+ return NOERROR;
+}
Propchange: trunk/reactos/dll/directx/msdvbnp/ipv6.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild [iso-8859-1] Mon Mar 29 15:12:16
2010
@@ -22,8 +22,11 @@
<file>classfactory.cpp</file>
<file>enum_mediatypes.cpp</file>
<file>enumpins.cpp</file>
+ <file>ethernetfilter.cpp</file>
<file>msdvbnp.cpp</file>
<file>msdvbnp.rc</file>
+ <file>ipv4.cpp</file>
+ <file>ipv6.cpp</file>
<file>networkprovider.cpp</file>
<file>pin.cpp</file>
<file>scanningtuner.cpp</file>
Modified: trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/networ…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] Mon Mar 29 15:12:16
2010
@@ -74,6 +74,9 @@
GUID m_ClassID;
DeviceFilterStack m_DeviceFilters;
IScanningTuner * m_Tuner;
+ IBDA_IPV6Filter * m_IPV6Filter;
+ IBDA_IPV4Filter * m_IPV4Filter;
+ IBDA_EthernetFilter * m_EthernetFilter;
};
HRESULT
@@ -112,6 +115,51 @@
}
m_Tuner->AddRef();
*Output = (IUnknown*)m_Tuner;
+
+ return NOERROR;
+ }
+
+ if (IsEqualGUID(refiid, IID_IBDA_IPV6Filter))
+ {
+ // construct scanning tuner
+ if (!m_IPV6Filter)
+ {
+ HRESULT hr = CIPV6Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid,
(void**)&m_IPV6Filter);
+ if (FAILED(hr))
+ return hr;
+ }
+ m_IPV6Filter->AddRef();
+ *Output = (IUnknown*)m_IPV6Filter;
+
+ return NOERROR;
+ }
+
+ if (IsEqualGUID(refiid, IID_IBDA_IPV4Filter))
+ {
+ // construct scanning tuner
+ if (!m_IPV4Filter)
+ {
+ HRESULT hr = CIPV4Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid,
(void**)&m_IPV4Filter);
+ if (FAILED(hr))
+ return hr;
+ }
+ m_IPV4Filter->AddRef();
+ *Output = (IUnknown*)m_IPV4Filter;
+
+ return NOERROR;
+ }
+
+ if (IsEqualGUID(refiid, IID_IBDA_EthernetFilter))
+ {
+ // construct scanning tuner
+ if (!m_EthernetFilter)
+ {
+ HRESULT hr = CIPV4Filter_fnConstructor((IBDA_NetworkProvider*)this, refiid,
(void**)&m_EthernetFilter);
+ if (FAILED(hr))
+ return hr;
+ }
+ m_EthernetFilter->AddRef();
+ *Output = (IUnknown*)m_EthernetFilter;
return NOERROR;
}
@@ -163,7 +211,10 @@
m_ReferenceClock(0),
m_FilterState(State_Stopped),
m_DeviceFilters(),
- m_Tuner(0)
+ m_Tuner(0),
+ m_IPV6Filter(0),
+ m_IPV4Filter(0),
+ m_EthernetFilter(0)
{
m_Pins[0] = 0;
Modified: trunk/reactos/dll/directx/msdvbnp/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/precom…
==============================================================================
--- trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] Mon Mar 29 15:12:16 2010
@@ -82,6 +82,30 @@
REFIID riid,
LPVOID * ppv);
+/* ethernetfilter.cpp */
+HRESULT
+WINAPI
+CEthernetFilter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv);
+
+/* ipv6.cpp */
+HRESULT
+WINAPI
+CIPV6Filter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv);
+
+/* ipv4.cpp */
+HRESULT
+WINAPI
+CIPV4Filter_fnConstructor(
+ IBDA_NetworkProvider * pNetworkProvider,
+ REFIID riid,
+ LPVOID * ppv);
+
#ifndef _MSC_VER
extern const GUID CLSID_DVBTNetworkProvider;
#endif