{
case DLL_PROCESS_ATTACH:
CoInitialize(NULL);
+
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"BDAPLGIN::DllMain()\n");
+#endif
+
DisableThreadLibraryCalls(hInstDLL);
break;
default:
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
#include "precomp.h"
+const GUID IID_IKsPropertySet = {0x31efac30, 0x515c, 0x11d0, {0xa9,0xaa, 0x00,0xaa,0x00,0x61,0xbe,0x93}};
+
class CControlNode : public IUnknown
{
public:
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
}
else if(IsEqualGUID(refiid, IID_IBDA_FrequencyFilter))
{
- return CBDAFrequencyFilter_fnConstructor(m_hFile, refiid, Output);
+ return CBDAFrequencyFilter_fnConstructor(m_hFile, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_SignalStatistics))
{
- return CBDASignalStatistics_fnConstructor(m_hFile, refiid, Output);
+ return CBDASignalStatistics_fnConstructor(m_hFile, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_LNBInfo))
{
- return CBDALNBInfo_fnConstructor(m_hFile, refiid, Output);
+ return CBDALNBInfo_fnConstructor(m_hFile, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_DigitalDemodulator))
{
- return CBDADigitalDemodulator_fnConstructor(m_hFile, refiid, Output);
+ return CBDADigitalDemodulator_fnConstructor(m_hFile, m_NodeType, refiid, Output);
}
-
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
+#endif
return E_NOINTERFACE;
}
WINAPI
CControlNode_fnConstructor(
HANDLE hFile,
+ IBaseFilter * pFilter,
ULONG NodeType,
ULONG PinId,
REFIID riid,
LPVOID * ppv)
{
+ WCHAR Buffer[100];
+ HRESULT hr;
+ IPin * pPin = NULL;
+ IKsObject * pObject = NULL;
+
+ // store pin id
+ swprintf(Buffer, L"%u", PinId);
+
+ // try find target pin
+ hr = pFilter->FindPin(Buffer, &pPin);
+
+ if (FAILED(hr))
+ {
+#ifdef BDAPLGIN_TRACE
+ swprintf(Buffer, L"CControlNode_fnConstructor failed find pin %lu with %lx\n", PinId, hr);
+ OutputDebugStringW(Buffer);
+#endif
+ return hr;
+ }
+
+ // query IKsObject interface
+ hr = pPin->QueryInterface(IID_IKsObject, (void**)&pObject);
+
+#ifdef BDAPLGIN_TRACE
+ swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr);
+ OutputDebugStringW(Buffer);
+#endif
+
+ if (SUCCEEDED(hr))
+ {
+ // get pin handle
+ hFile = pObject->KsGetObjectHandle();
+ // release IKsObject interface
+ pObject->Release();
+ }
+ // release IPin interface
+ pPin->Release();
+
// construct device control
CControlNode * handler = new CControlNode(hFile, NodeType, PinId);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CControlNode_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;
const GUID KSPROPSETID_BdaTopology = {0xa14ee835, 0x0a23, 0x11d3, {0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
const GUID KSMETHODSETID_BdaDeviceConfiguration = {0x71985f45, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
const GUID IID_IBaseFilter = {0x56a86895, 0x0ad4, 0x11ce, {0xb0,0x3a, 0x00,0x20,0xaf,0x0b,0xa7,0x70}};
-
+const GUID KSMETHODSETID_BdaChangeSync = {0xfd0a5af3, 0xb41d, 0x11d2, {0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
class CBDADeviceControl : public IBDA_DeviceControl,
public IBDA_Topology
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
HRESULT STDMETHODCALLTYPE CreateTopology(ULONG ulInputPinId, ULONG ulOutputPinId);
HRESULT STDMETHODCALLTYPE GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG ulNodeType, IUnknown **ppControlNode);
- CBDADeviceControl(IUnknown * pUnkOuter, HANDLE hFile) : m_Ref(0), m_pUnkOuter(pUnkOuter), m_Handle(hFile){};
+ CBDADeviceControl(IUnknown * pUnkOuter, IBaseFilter *pFilter, HANDLE hFile) : m_Ref(0), m_pUnkOuter(pUnkOuter), m_Handle(hFile), m_pFilter(pFilter){};
virtual ~CBDADeviceControl(){};
protected:
LONG m_Ref;
IUnknown * m_pUnkOuter;
HANDLE m_Handle;
+ IBaseFilter * m_pFilter;
};
HRESULT
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
return NOERROR;
}
- if (IsEqualIID(refiid, IID_IDistributorNotify))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IDistributorNotify interface\n");
- return E_NOINTERFACE;
- }
-
- if (IsEqualGUID(refiid, IID_IAMOpenProgress))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IAMOpenProgress interface\n");
- return E_NOINTERFACE;
- }
-
- if (IsEqualGUID(refiid, IID_IBDA_NetworkProvider))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IID_IBDA_NetworkProvider interface\n");
- return E_NOINTERFACE;
- }
-
- if (IsEqualGUID(refiid, IID_IMatrixMixer))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IID_IMatrixMixer interface\n");
- return E_NOINTERFACE;
- }
-
- if (IsEqualGUID(refiid, IID_IAsyncReader))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IID_IAsyncReader interface\n");
- return E_NOINTERFACE;
- }
-
- if (IsEqualGUID(refiid, IID_IAC3Filter))
- {
- OutputDebugStringW(L"CBDADeviceControl::QueryInterface: No IID_IAC3Filter interface\n");
- return E_NOINTERFACE;
- }
-
- StringFromCLSID(refiid, &lpstr);
- swprintf(Buffer, L"CBDADeviceControl::QueryInterface: NoInterface for %s", lpstr);
- OutputDebugStringW(Buffer);
- CoTaskMemFree(lpstr);
-
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDADeviceControl::StartChanges( void)
{
- OutputDebugStringW(L"CBDADeviceControl::StartChanges: NotImplemented\n");
- return E_NOTIMPL;
+ KSMETHOD Method;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ /* setup request */
+ Method.Set = KSMETHODSETID_BdaChangeSync;
+ Method.Id = KSMETHOD_BDA_START_CHANGES;
+ Method.Flags = KSMETHOD_TYPE_NONE;
+
+ /* execute request */
+ hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_METHOD, (PVOID)&Method, sizeof(KSMETHOD), NULL, 0, &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADeviceControl::StartChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
STDMETHODCALLTYPE
CBDADeviceControl::CheckChanges( void)
{
- OutputDebugStringW(L"CBDADeviceControl::CheckChanges: NotImplemented\n");
- return E_NOTIMPL;
+ KSMETHOD Method;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ /* setup request */
+ Method.Set = KSMETHODSETID_BdaChangeSync;
+ Method.Id = KSMETHOD_BDA_CHECK_CHANGES;
+ Method.Flags = KSMETHOD_TYPE_NONE;
+
+ /* execute request */
+ hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_METHOD, (PVOID)&Method, sizeof(KSMETHOD), NULL, 0, &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADeviceControl::CheckChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
STDMETHODCALLTYPE
CBDADeviceControl::CommitChanges( void)
{
- OutputDebugStringW(L"CBDADeviceControl::CommitChanges: NotImplemented\n");
- return E_NOTIMPL;
+ KSMETHOD Method;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ /* setup request */
+ Method.Set = KSMETHODSETID_BdaChangeSync;
+ Method.Id = KSMETHOD_BDA_COMMIT_CHANGES;
+ Method.Flags = KSMETHOD_TYPE_NONE;
+
+ /* execute request */
+ hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_METHOD, (PVOID)&Method, sizeof(KSMETHOD), NULL, 0, &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADeviceControl::CommitChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADeviceControl::GetChangeState(ULONG *pState)
{
- OutputDebugStringW(L"CBDADeviceControl::GetChangeState: NotImplemented\n");
- return E_NOTIMPL;
+ if (pState)
+ {
+ *pState = BDA_CHANGES_COMPLETE;
+ return S_OK;
+ }
+ else
+ {
+ return E_POINTER;
+ }
}
//-------------------------------------------------------------------
KSPROPERTY Property;
HRESULT hr;
ULONG BytesReturned;
- WCHAR Buffer[100];
// setup request
Property.Set = KSPROPSETID_BdaTopology;
*pulcNodeTypes = (BytesReturned / sizeof(ULONG));
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::GetNodeTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
OutputDebugStringW(Buffer);
+ if (SUCCEEDED(hr))
+ {
+ for(ULONG Index = 0; Index < *pulcNodeTypes; Index++)
+ {
+ swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulNodeTypes[Index]);
+ OutputDebugStringW(Buffer);
+ }
+ }
+#endif
+
return hr;
}
KSPROPERTY Property;
HRESULT hr;
ULONG BytesReturned;
- WCHAR Buffer[100];
+
// setup request
Property.Set = KSPROPSETID_BdaTopology;
*ulcNodeDescriptors = (BytesReturned / sizeof(BDANODE_DESCRIPTOR));
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[1000];
swprintf(Buffer, L"CBDADeviceControl::GetNodeDescriptors: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
OutputDebugStringW(Buffer);
+
+ if (SUCCEEDED(hr))
+ {
+ for(ULONG Index = 0; Index < min(*ulcNodeDescriptors, ulcNodeDescriptorsMax); Index++)
+ {
+ LPOLESTR pGUIDFunction, pGUIDName;
+
+ StringFromCLSID(rgNodeDescriptors[Index].guidFunction, &pGUIDFunction);
+ StringFromCLSID(rgNodeDescriptors[Index].guidName, &pGUIDName);
+
+ swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\nFunction %s\n Name %s\n-----\n", Index, rgNodeDescriptors[Index].ulBdaNodeType, pGUIDFunction, pGUIDName);
+ OutputDebugStringW(Buffer);
+ }
+ }
+#endif
+
+
return hr;
}
KSP_NODE Property;
HRESULT hr;
ULONG BytesReturned;
- WCHAR Buffer[100];
+
// setup request
Property.Property.Set = KSPROPSETID_BdaTopology;
*pulcInterfaces = (BytesReturned / sizeof(GUID));
- swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: hr %lx, BytesReturned %lu ulNodeType %lu\n", hr, BytesReturned, ulNodeType);
OutputDebugStringW(Buffer);
+ if (SUCCEEDED(hr))
+ {
+ for(ULONG Index = 0; Index < min(*pulcInterfaces, ulcInterfacesMax); Index++)
+ {
+ LPOLESTR pstr;
+
+ StringFromCLSID(rgguidInterfaces[Index], &pstr);
+
+ swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: Index %lu Name %s\n", Index, pstr);
+ OutputDebugStringW(Buffer);
+ }
+ }
+#endif
+
return hr;
}
KSPROPERTY Property;
HRESULT hr;
ULONG BytesReturned;
- WCHAR Buffer[100];
// setup request
Property.Set = KSPROPSETID_BdaTopology;
*pulcPinTypes = (BytesReturned / sizeof(ULONG));
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
OutputDebugStringW(Buffer);
+ if (SUCCEEDED(hr))
+ {
+ for(ULONG Index = 0; Index < *pulcPinTypes; Index++)
+ {
+ swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulPinTypes[Index]);
+ OutputDebugStringW(Buffer);
+ }
+ }
+#endif
+
return hr;
}
STDMETHODCALLTYPE
CBDADeviceControl::GetTemplateConnections(ULONG *pulcConnections, ULONG ulcConnectionsMax, BDA_TEMPLATE_CONNECTION * rgConnections)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl::GetTemplateConnections: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDADeviceControl::CreatePin(ULONG ulPinType, ULONG *pulPinId)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl::CreatePin: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDADeviceControl::DeletePin(ULONG ulPinId)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl::DeletePin: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDADeviceControl::SetMediaType(ULONG ulPinId, AM_MEDIA_TYPE *pMediaType)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl::SetMediaType: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDADeviceControl::SetMedium(ULONG ulPinId, REGPINMEDIUM *pMedium)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl::SetMedium: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
CBDADeviceControl::CreateTopology(ULONG ulInputPinId, ULONG ulOutputPinId)
{
KSM_BDA_PIN_PAIR Method;
- WCHAR Buffer[100];
HRESULT hr;
ULONG BytesReturned = 0;
- Method.Method.Flags = 0;
+ Method.Method.Flags = KSMETHOD_TYPE_NONE;
Method.Method.Id = KSMETHOD_BDA_CREATE_TOPOLOGY;
Method.Method.Set = KSMETHODSETID_BdaDeviceConfiguration;
Method.InputPinId = ulInputPinId;
hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_METHOD, (PVOID)&Method, sizeof(KSM_BDA_PIN_PAIR), NULL, 0, &BytesReturned);
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::CreateTopology: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
OutputDebugStringW(Buffer);
+#endif
return hr;
}
STDMETHODCALLTYPE
CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG ulNodeType, IUnknown **ppControlNode)
{
- KSP_BDA_NODE_PIN Property;
- ULONG Dummy = 0;
HRESULT hr;
ULONG PinId = 0;
ULONG BytesReturned;
- WCHAR Buffer[100];
+ KSP_BDA_NODE_PIN Property;
//setup request
Property.Property.Set = KSPROPSETID_BdaTopology;
Property.ulNodeType = ulNodeType;
// perform request
+ // WinXP SP3 expects minimum sizeof(KSP_BDA_NODE_PIN) + sizeof(ULONG)
+ // seems a driver to be a driver bug
+
hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSP_BDA_NODE_PIN) + sizeof(ULONG), &PinId, sizeof(ULONG), &BytesReturned);
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu Dummy %lu\n", hr, BytesReturned, PinId, Dummy);
OutputDebugStringW(Buffer);
+#endif
if (FAILED(hr))
return hr;
- hr = CControlNode_fnConstructor(m_Handle, ulNodeType, PinId, IID_IUnknown, (LPVOID*)ppControlNode);
+ hr = CControlNode_fnConstructor(m_Handle, m_pFilter, ulNodeType, PinId, IID_IUnknown, (LPVOID*)ppControlNode);
+#ifdef BDAPLGIN_TRACE
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx\n", hr);
OutputDebugStringW(Buffer);
+#endif
+
return hr;
}
IBaseFilter *pFilter = NULL;
HANDLE hFile;
+ //DebugBreak();
+
// sanity check
assert(pUnkOuter);
// release IKsObject interface
pObject->Release();
+ // release filter
+ pFilter->Release();
+
// construct device control
- CBDADeviceControl * handler = new CBDADeviceControl(pUnkOuter, hFile);
+ CBDADeviceControl * handler = new CBDADeviceControl(pUnkOuter, pFilter, hFile);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADeviceControl_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;
#include "precomp.h"
const GUID IID_IBDA_DigitalDemodulator = {0xef30f379, 0x985b, 0x4d10, {0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x04, 0xe1, 0xe0}};
+const GUID KSPROPSETID_BdaDigitalDemodulator = {0xef30f379, 0x985b, 0x4d10, {0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x4, 0xe1, 0xe0}};
class CBDADigitalDemodulator : public IBDA_DigitalDemodulator
{
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
HRESULT STDMETHODCALLTYPE put_SpectralInversion(SpectralInversion *pSpectralInversion);
HRESULT STDMETHODCALLTYPE get_SpectralInversion(SpectralInversion *pSpectralInversion);
- CBDADigitalDemodulator(HANDLE hFile) : m_Ref(0), m_hFile(hFile){};
+ CBDADigitalDemodulator(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
~CBDADigitalDemodulator(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
-
+ ULONG m_NodeId;
};
HRESULT
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
return NOERROR;
}
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
+#endif
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_ModulationType(ModulationType *pModulationType)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_ModulationType NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_MODULATION_TYPE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pModulationType, sizeof(ModulationType), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_ModulationType(ModulationType *pModulationType)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_ModulationType NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_InnerFECMethod(FECMethod *pFECMethod)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_InnerFECMethod NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_INNER_FEC_TYPE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_InnerFECMethod(FECMethod *pFECMethod)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_InnerFECMethod NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_InnerFECRate NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_INNER_FEC_RATE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_InnerFECRate NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_OuterFECMethod(FECMethod *pFECMethod)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_OuterFECMethod NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_OUTER_FEC_TYPE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE CBDADigitalDemodulator::get_OuterFECMethod(FECMethod *pFECMethod)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_OuterFECMethod NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_OuterFECRate NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_OUTER_FEC_RATE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_OuterFECRate NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_SymbolRate(ULONG *pSymbolRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_SymbolRate NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_SYMBOL_RATE;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSymbolRate, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_SymbolRate(ULONG *pSymbolRate)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_SymbolRate NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::put_SpectralInversion(SpectralInversion *pSpectralInversion)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::put_SpectralInversion NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaDigitalDemodulator;
+ Node.Property.Id = KSPROPERTY_BDA_SPECTRAL_INVERSION;
+ Node.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY | KSPROPERTY_TYPE_SET;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSpectralInversion, sizeof(SpectralInversion), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDADigitalDemodulator::get_SpectralInversion(SpectralInversion *pSpectralInversion)
{
- OutputDebugStringW(L"CBDADigitalDemodulator::get_SpectralInversion NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
- CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(hFile);
+ CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(hFile, NodeId);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADigitalDemodulator_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;
#include "precomp.h"
const GUID IID_IBDA_FrequencyFilter = {0x71985f47, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
+const GUID KSPROPSETID_BdaFrequencyFilter = {0x71985f47, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
class CBDAFrequencyFilter : public IBDA_FrequencyFilter
{
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
HRESULT STDMETHODCALLTYPE put_FrequencyMultiplier(ULONG ulMultiplier);
HRESULT STDMETHODCALLTYPE get_FrequencyMultiplier(ULONG *pulMultiplier);
- CBDAFrequencyFilter(HANDLE hFile) : m_Ref(0), m_hFile(hFile){};
+ CBDAFrequencyFilter(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
virtual ~CBDAFrequencyFilter(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
+ ULONG m_NodeId;
};
HRESULT
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
return NOERROR;
}
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[MAX_PATH];
+ LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
+#endif
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_Autotune(ULONG ulTransponder)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_Autotune: NotImplemented\n");
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_Autotune(ULONG *pulTransponder)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_Autotune\n");
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_Frequency(ULONG ulFrequency)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_Frequency: NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
+ Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_FREQUENCY;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulFrequency, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_Frequency(ULONG *pulFrequency)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_Frequency\n");
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_Polarity(Polarisation Polarity)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_Polarity: NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
+ Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_POLARITY;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Polarity, sizeof(Polarisation), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_Polarity(Polarisation *pPolarity)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_Polarity\n");
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_Range(ULONG ulRange)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_Range: NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
+ Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_RANGE;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulRange, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_Range(ULONG *pulRange)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_Range\n");
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_Bandwidth(ULONG ulBandwidth)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_Bandwidth: NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
+ Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_BANDWIDTH;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulBandwidth, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_Bandwidth(ULONG *pulBandwidth)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_Bandwidth\n");
return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::put_FrequencyMultiplier(ULONG ulMultiplier)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::put_FrequencyMultiplier: NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaFrequencyFilter;
+ Node.Property.Id = KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulMultiplier, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAFrequencyFilter::get_FrequencyMultiplier(ULONG *pulMultiplier)
{
- OutputDebugStringW(L"CBDAFrequencyFilter::get_FrequencyMultiplier\n");
return E_NOINTERFACE;
}
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
- CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(hFile);
+ CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(hFile, NodeId);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAFrequencyFilter_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;
#include "precomp.h"
const GUID IID_IBDA_LNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x08, 0xf4}};
+const GUID KSPROPSETID_BdaLNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4}};
class CBDALNBInfo : public IBDA_LNBInfo
{
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency);
HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency);
- CBDALNBInfo(HANDLE hFile) : m_Ref(0), m_hFile(hFile){};
+ CBDALNBInfo(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
~CBDALNBInfo(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
+ ULONG m_NodeId;
};
HRESULT
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
return NOERROR;
}
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
+#endif
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDALNBInfo::put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow)
{
- OutputDebugStringW(L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaLNBInfo;
+ Node.Property.Id = KSPROPERTY_BDA_LNB_LOF_LOW_BAND;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFLow, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDALNBInfo::get_LocalOscilatorFrequencyLowBand(ULONG *pulLOFLow)
{
- OutputDebugStringW(L"CBDALNBInfo::get_LocalOscilatorFrequencyLowBand NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDALNBInfo::put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh)
{
- OutputDebugStringW(L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaLNBInfo;
+ Node.Property.Id = KSPROPERTY_BDA_LNB_LOF_HIGH_BAND;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFHigh, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDALNBInfo::get_LocalOscilatorFrequencyHighBand(ULONG *pulLOFHigh)
{
- OutputDebugStringW(L"CBDALNBInfo::get_LocalOscilatorFrequencyHighBand NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
{
- OutputDebugStringW(L"CBDALNBInfo::put_HighLowSwitchFrequency NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaLNBInfo;
+ Node.Property.Id = KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = m_NodeId;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulSwitchFrequency, sizeof(ULONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDALNBInfo::get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
{
- OutputDebugStringW(L"CBDALNBInfo::get_HighLowSwitchFrequency NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
- CBDALNBInfo * handler = new CBDALNBInfo(hFile);
+ CBDALNBInfo * handler = new CBDALNBInfo(hFile, NodeId);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
STDMETHODCALLTYPE
CBDAPinControl::GetPinID(ULONG *pulPinID)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl::GetPinID: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDAPinControl::GetPinType(ULONG *pulPinType)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl::GetPinType: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
STDMETHODCALLTYPE
CBDAPinControl::RegistrationContext(ULONG *pulRegistrationCtx)
{
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl::RegistrationContext: NotImplemented\n");
+#endif
+
return E_NOTIMPL;
}
CBDAPinControl * handler = new CBDAPinControl(hFile, pNetworkProvider, pConnectedPin);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl_fnConstructor");
+#endif
if (!handler)
return E_OUTOFMEMORY;
WINAPI
CControlNode_fnConstructor(
HANDLE hFile,
+ IBaseFilter * pFilter,
ULONG NodeType,
ULONG PinId,
REFIID riid,
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv);
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv);
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv);
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv);
#include "precomp.h"
const GUID IID_IBDA_SignalStatistics = {0x1347d106, 0xcf3a, 0x428a, {0xa5, 0xcb, 0xac, 0x0d, 0x9a, 0x2a, 0x43, 0x38}};
+const GUID KSPROPSETID_BdaSignalStats = {0x1347d106, 0xcf3a, 0x428a, {0xa5, 0xcb, 0xac, 0xd, 0x9a, 0x2a, 0x43, 0x38}};
class CBDASignalStatistics : public IBDA_SignalStatistics
{
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
-
if (!m_Ref)
{
delete this;
HRESULT STDMETHODCALLTYPE put_SampleTime(LONG lmsSampleTime);
HRESULT STDMETHODCALLTYPE get_SampleTime(LONG *plmsSampleTime);
- CBDASignalStatistics(HANDLE hFile) : m_Ref(0), m_hFile(hFile){};
+ CBDASignalStatistics(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
~CBDASignalStatistics(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
+ ULONG m_NodeId;
};
HRESULT
IN REFIID refiid,
OUT PVOID* Output)
{
- WCHAR Buffer[MAX_PATH];
- LPOLESTR lpstr;
-
*Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown))
return NOERROR;
}
- StringFromCLSID(refiid, &lpstr);
- swprintf(Buffer, L"CBDASignalStatistics::QueryInterface: NoInterface for %s", lpstr);
- OutputDebugStringW(Buffer);
- CoTaskMemFree(lpstr);
-
return E_NOINTERFACE;
}
STDMETHODCALLTYPE
CBDASignalStatistics::put_SignalStrength(LONG lDbStrength)
{
- OutputDebugStringW(L"CBDASignalStatistics::put_SignalStrength NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::get_SignalStrength(LONG *plDbStrength)
{
- OutputDebugStringW(L"CBDASignalStatistics::get_SignalStrength NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SIGNAL_STRENGTH;
+ Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plDbStrength, sizeof(LONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::get_SignalStrength: m_NodeId %lu hr %lx, BytesReturned %lu plDbStrength %ld\n", m_NodeId, hr, BytesReturned, *plDbStrength);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::put_SignalQuality(LONG lPercentQuality)
{
- OutputDebugStringW(L"CBDASignalStatistics::put_SignalQuality NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::get_SignalQuality(LONG *plPercentQuality)
{
- OutputDebugStringW(L"CBDASignalStatistics::get_SignalQuality NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SIGNAL_QUALITY;
+ Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plPercentQuality, sizeof(LONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::get_SignalQuality: m_NodeId %lu hr %lx, BytesReturned %lu plPercentQuality %lu\n", m_NodeId, hr, BytesReturned, *plPercentQuality);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::put_SignalPresent(BOOLEAN fPresent)
{
- OutputDebugStringW(L"CBDASignalStatistics::put_SignalPresent NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::get_SignalPresent(BOOLEAN *pfPresent)
{
- OutputDebugStringW(L"CBDASignalStatistics::get_SignalPresent NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG Present;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SIGNAL_PRESENT;
+ Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Present, sizeof(ULONG), &BytesReturned);
+ // store result
+ *pfPresent = Present;
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::get_SignalPresent: m_NodeId %lu hr %lx, BytesReturned %lu Present %lu\n", m_NodeId, hr, BytesReturned, Present);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::put_SignalLocked(BOOLEAN fLocked)
{
- OutputDebugStringW(L"CBDASignalStatistics::put_SignalLocked NotImplemented\n");
- return E_NOTIMPL;
+ return E_NOINTERFACE;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::get_SignalLocked(BOOLEAN *pfLocked)
{
- OutputDebugStringW(L"CBDASignalStatistics::get_SignalLocked NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG Locked;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SIGNAL_LOCKED;
+ Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Locked, sizeof(ULONG), &BytesReturned);
+ *pfLocked = Locked;
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::get_SignalLocked: m_NodeId %lu hr %lx, BytesReturned %lu Locked %lu\n", m_NodeId, hr, BytesReturned, Locked);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::put_SampleTime(LONG lmsSampleTime)
{
- OutputDebugStringW(L"CBDASignalStatistics::put_SampleTime NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SAMPLE_TIME;
+ Node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &lmsSampleTime, sizeof(LONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime)
{
- OutputDebugStringW(L"CBDASignalStatistics::get_SampleTime NotImplemented\n");
- return E_NOTIMPL;
+ KSP_NODE Node;
+ HRESULT hr;
+ ULONG BytesReturned;
+
+ // setup request
+ Node.Property.Set = KSPROPSETID_BdaSignalStats;
+ Node.Property.Id = KSPROPERTY_BDA_SAMPLE_TIME;
+ Node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
+ Node.NodeId = (ULONG)-1;
+
+ // perform request
+ hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plmsSampleTime, sizeof(LONG), &BytesReturned);
+
+#ifdef BDAPLGIN_TRACE
+ WCHAR Buffer[100];
+ swprintf(Buffer, L"CBDASignalStatistics::get_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu \n", m_NodeId, hr, BytesReturned);
+ OutputDebugStringW(Buffer);
+#endif
+
+ return hr;
}
HRESULT
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
+ ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
- CBDASignalStatistics * handler = new CBDASignalStatistics(hFile);
+ CBDASignalStatistics * handler = new CBDASignalStatistics(hFile, NodeId);
+#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDASignalStatistics_fnConstructor\n");
+#endif
if (!handler)
return E_OUTOFMEMORY;