[BDAPLGIN]

- Perform property request by passing the request through IKsPropertySet interface. This is necessary as the pin handle might not have been created at the time the proxy plugin has been loaded
- Set Reserved of KSP_NODE request to zero as required by the documentation

svn path=/trunk/; revision=46464
This commit is contained in:
Johannes Anderwald 2010-03-26 11:43:52 +00:00
parent 938600f750
commit 5dc1068022
7 changed files with 111 additions and 162 deletions

View file

@ -34,12 +34,12 @@ public:
return m_Ref;
}
CControlNode(HANDLE hFile, ULONG NodeType, ULONG PinId) : m_Ref(0), m_hFile(hFile), m_NodeType(NodeType), m_PinId(PinId){};
CControlNode(IKsPropertySet * pProperty, ULONG NodeType, ULONG PinId) : m_Ref(0), m_pKsProperty(pProperty), m_NodeType(NodeType), m_PinId(PinId){};
virtual ~CControlNode(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pKsProperty;
ULONG m_NodeType;
ULONG m_PinId;
};
@ -60,19 +60,19 @@ CControlNode::QueryInterface(
}
else if(IsEqualGUID(refiid, IID_IBDA_FrequencyFilter))
{
return CBDAFrequencyFilter_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDAFrequencyFilter_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_SignalStatistics))
{
return CBDASignalStatistics_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDASignalStatistics_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_LNBInfo))
{
return CBDALNBInfo_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDALNBInfo_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
else if(IsEqualGUID(refiid, IID_IBDA_DigitalDemodulator))
{
return CBDADigitalDemodulator_fnConstructor(m_hFile, m_NodeType, refiid, Output);
return CBDADigitalDemodulator_fnConstructor(m_pKsProperty, m_NodeType, refiid, Output);
}
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[MAX_PATH];
@ -99,8 +99,7 @@ CControlNode_fnConstructor(
WCHAR Buffer[100];
HRESULT hr;
IPin * pPin = NULL;
IKsObject * pObject = NULL;
HANDLE hFile = INVALID_HANDLE_VALUE;
IKsPropertySet * pProperty;
// store pin id
swprintf(Buffer, L"%u", PinId);
@ -117,26 +116,21 @@ CControlNode_fnConstructor(
return hr;
}
// query IKsObject interface
hr = pPin->QueryInterface(IID_IKsObject, (void**)&pObject);
// query for IKsPropertySet interface
hr = pPin->QueryInterface(IID_IKsPropertySet, (void**)&pProperty);
if (FAILED(hr))
return hr;
#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);
CControlNode * handler = new CControlNode(pProperty, NodeType, PinId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CControlNode_fnConstructor\n");

View file

@ -50,12 +50,12 @@ public:
HRESULT STDMETHODCALLTYPE put_SpectralInversion(SpectralInversion *pSpectralInversion);
HRESULT STDMETHODCALLTYPE get_SpectralInversion(SpectralInversion *pSpectralInversion);
CBDADigitalDemodulator(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDADigitalDemodulator(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDADigitalDemodulator(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -88,6 +88,7 @@ CBDADigitalDemodulator::QueryInterface(
swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
DebugBreak();
#endif
return E_NOINTERFACE;
@ -100,20 +101,17 @@ CBDADigitalDemodulator::put_ModulationType(ModulationType *pModulationType)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pModulationType, sizeof(ModulationType), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_MODULATION_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pModulationType, sizeof(ModulationType));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -133,20 +131,18 @@ CBDADigitalDemodulator::put_InnerFECMethod(FECMethod *pFECMethod)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_INNER_FEC_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECMethod, sizeof(FECMethod));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -167,20 +163,16 @@ CBDADigitalDemodulator::put_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_INNER_FEC_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECRate, sizeof(BinaryConvolutionCodeRate));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -200,20 +192,17 @@ CBDADigitalDemodulator::put_OuterFECMethod(FECMethod *pFECMethod)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECMethod, sizeof(FECMethod), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_OUTER_FEC_TYPE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECMethod, sizeof(FECMethod));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -234,20 +223,16 @@ CBDADigitalDemodulator::put_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pFECRate, sizeof(BinaryConvolutionCodeRate), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_OUTER_FEC_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pFECRate, sizeof(BinaryConvolutionCodeRate));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -267,20 +252,17 @@ CBDADigitalDemodulator::put_SymbolRate(ULONG *pSymbolRate)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSymbolRate, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_SYMBOL_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pSymbolRate, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -300,20 +282,17 @@ CBDADigitalDemodulator::put_SpectralInversion(SpectralInversion *pSpectralInvers
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), pSpectralInversion, sizeof(SpectralInversion), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_SPECTRAL_INVERSION, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pSpectralInversion, sizeof(SpectralInversion));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: hr %lx\n", hr);
OutputDebugStringW(Buffer);
#endif
@ -331,13 +310,13 @@ CBDADigitalDemodulator::get_SpectralInversion(SpectralInversion *pSpectralInvers
HRESULT
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(hFile, NodeId);
CBDADigitalDemodulator * handler = new CBDADigitalDemodulator(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDADigitalDemodulator_fnConstructor\n");

View file

@ -48,12 +48,12 @@ public:
HRESULT STDMETHODCALLTYPE put_FrequencyMultiplier(ULONG ulMultiplier);
HRESULT STDMETHODCALLTYPE get_FrequencyMultiplier(ULONG *pulMultiplier);
CBDAFrequencyFilter(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDAFrequencyFilter(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
virtual ~CBDAFrequencyFilter(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -86,6 +86,7 @@ CBDAFrequencyFilter::QueryInterface(
swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
DebugBreak();
#endif
return E_NOINTERFACE;
@ -112,20 +113,16 @@ CBDAFrequencyFilter::put_Frequency(ULONG ulFrequency)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulFrequency, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulFrequency, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -145,20 +142,17 @@ CBDAFrequencyFilter::put_Polarity(Polarisation Polarity)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Polarity, sizeof(Polarisation), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_POLARITY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Polarity, sizeof(Polarisation));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -178,20 +172,17 @@ CBDAFrequencyFilter::put_Range(ULONG ulRange)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulRange, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_RANGE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulRange, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -211,20 +202,17 @@ CBDAFrequencyFilter::put_Bandwidth(ULONG ulBandwidth)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulBandwidth, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_BANDWIDTH, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulBandwidth, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -243,20 +231,17 @@ CBDAFrequencyFilter::put_FrequencyMultiplier(ULONG ulMultiplier)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulMultiplier, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaFrequencyFilter, KSPROPERTY_BDA_RF_TUNER_FREQUENCY_MULTIPLIER, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulMultiplier, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -273,13 +258,13 @@ CBDAFrequencyFilter::get_FrequencyMultiplier(ULONG *pulMultiplier)
HRESULT
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
IKsPropertySet* pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(hFile, NodeId);
CBDAFrequencyFilter * handler = new CBDAFrequencyFilter(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAFrequencyFilter_fnConstructor\n");

View file

@ -43,12 +43,12 @@ public:
HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency);
HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency);
CBDALNBInfo(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDALNBInfo(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -92,20 +92,17 @@ CBDALNBInfo::put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFLow, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_LOW_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFLow, sizeof(LONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -125,20 +122,17 @@ CBDALNBInfo::put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulLOFHigh, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_HIGH_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFHigh, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -158,20 +152,17 @@ CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &ulSwitchFrequency, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulSwitchFrequency, sizeof(ULONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -188,13 +179,13 @@ CBDALNBInfo::get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
HRESULT
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
IKsPropertySet *pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDALNBInfo * handler = new CBDALNBInfo(hFile, NodeId);
CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");

View file

@ -76,7 +76,7 @@ CBDAPinControl::QueryInterface(
reinterpret_cast<IBDA_PinControl*>(*Output)->AddRef();
return NOERROR;
}
DebugBreak();
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
@ -252,6 +252,9 @@ CBDAPinControl_fnConstructor(
if (!pUnkOuter)
return E_POINTER;
OutputDebugStringW(L"CBDAPinControl_fnConstructor\n");
//DebugBreak();
// query for IKsObject interface
hr = pUnkOuter->QueryInterface(IID_IKsObject, (void**)&pObject);
@ -353,6 +356,13 @@ CBDAPinControl_fnConstructor(
hr = E_UNEXPECTED;
}
}
else
{
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAPinControl_fnConstructor failed to register filter with %lx\n", hr);
OutputDebugStringW(Buffer);
DebugBreak();
}
}
}
}

View file

@ -1,7 +1,7 @@
#ifndef PRECOMP_H__
#define PRECOMP_H__
//#define BDAPLGIN_TRACE
#define BDAPLGIN_TRACE
#define BUILDING_KS
#define _KSDDK_
#include <dshow.h>
@ -67,7 +67,7 @@ CControlNode_fnConstructor(
HRESULT
WINAPI
CBDAFrequencyFilter_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -77,7 +77,7 @@ CBDAFrequencyFilter_fnConstructor(
HRESULT
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -87,7 +87,7 @@ CBDASignalStatistics_fnConstructor(
HRESULT
WINAPI
CBDALNBInfo_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);
@ -96,7 +96,7 @@ CBDALNBInfo_fnConstructor(
HRESULT
WINAPI
CBDADigitalDemodulator_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv);

View file

@ -47,12 +47,12 @@ public:
HRESULT STDMETHODCALLTYPE put_SampleTime(LONG lmsSampleTime);
HRESULT STDMETHODCALLTYPE get_SampleTime(LONG *plmsSampleTime);
CBDASignalStatistics(HANDLE hFile, ULONG NodeId) : m_Ref(0), m_hFile(hFile), m_NodeId(NodeId){};
CBDASignalStatistics(IKsPropertySet * pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){};
~CBDASignalStatistics(){};
protected:
LONG m_Ref;
HANDLE m_hFile;
IKsPropertySet * m_pProperty;
ULONG m_NodeId;
};
@ -77,7 +77,6 @@ CBDASignalStatistics::QueryInterface(
reinterpret_cast<IBDA_SignalStatistics*>(*Output)->AddRef();
return NOERROR;
}
return E_NOINTERFACE;
}
@ -97,13 +96,13 @@ CBDASignalStatistics::get_SignalStrength(LONG *plDbStrength)
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;
Node.Reserved = 0;
assert(m_pProperty);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_STRENGTH, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plDbStrength, sizeof(LONG), &BytesReturned);
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plDbStrength, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -130,13 +129,11 @@ CBDASignalStatistics::get_SignalQuality(LONG *plPercentQuality)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plPercentQuality, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_QUALITY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plPercentQuality, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -164,13 +161,12 @@ CBDASignalStatistics::get_SignalPresent(BOOLEAN *pfPresent)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Present, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_PRESENT, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Present, sizeof(ULONG), &BytesReturned);
// store result
*pfPresent = Present;
@ -200,13 +196,12 @@ CBDASignalStatistics::get_SignalLocked(BOOLEAN *pfLocked)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &Locked, sizeof(ULONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_LOCKED, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &Locked, sizeof(ULONG), &BytesReturned);
*pfLocked = Locked;
#ifdef BDAPLGIN_TRACE
@ -224,20 +219,17 @@ CBDASignalStatistics::put_SampleTime(LONG lmsSampleTime)
{
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), &lmsSampleTime, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Set(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &lmsSampleTime, sizeof(LONG));
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId, hr, BytesReturned);
swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx\n", m_NodeId, hr);
OutputDebugStringW(Buffer);
#endif
@ -253,13 +245,11 @@ CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime)
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;
Node.Reserved = 0;
// perform request
hr = KsSynchronousDeviceControl(m_hFile, IOCTL_KS_PROPERTY, (PVOID)&Node, sizeof(KSP_NODE), plmsSampleTime, sizeof(LONG), &BytesReturned);
hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plmsSampleTime, sizeof(LONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
@ -273,13 +263,13 @@ CBDASignalStatistics::get_SampleTime(LONG *plmsSampleTime)
HRESULT
WINAPI
CBDASignalStatistics_fnConstructor(
HANDLE hFile,
IKsPropertySet * pProperty,
ULONG NodeId,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CBDASignalStatistics * handler = new CBDASignalStatistics(hFile, NodeId);
CBDASignalStatistics * handler = new CBDASignalStatistics(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDASignalStatistics_fnConstructor\n");