Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS BDA Proxy * FILE: dll/directx/bdaplgin/lnbinfo.cpp * PURPOSE: IBDA_LNBInfo interface * * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) */
#include "precomp.h"
#ifndef _MSC_VERconst 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}};#endif
class CBDALNBInfo : public IBDA_LNBInfo{public: STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef() { InterlockedIncrement(&m_Ref); return m_Ref; } STDMETHODIMP_(ULONG) Release() { InterlockedDecrement(&m_Ref); if (!m_Ref) { delete this; return 0; } return m_Ref; }
//IBDA_LNBInfo methods HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyLowBand(ULONG ulLOFLow); HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyLowBand(ULONG *pulLOFLow); HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyHighBand(ULONG ulLOFHigh); HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyHighBand(ULONG *pulLOFHigh); HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency); HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency);
CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId) : m_Ref(0), m_pProperty(pProperty), m_NodeId(NodeId){}; ~CBDALNBInfo(){};
protected: LONG m_Ref; IKsPropertySet * m_pProperty; ULONG m_NodeId;};
HRESULTSTDMETHODCALLTYPECBDALNBInfo::QueryInterface( IN REFIID refiid, OUT PVOID* Output){ *Output = NULL;
if (IsEqualGUID(refiid, IID_IUnknown)) { *Output = PVOID(this); reinterpret_cast<IUnknown*>(*Output)->AddRef(); return NOERROR; }
if (IsEqualGUID(refiid, IID_IBDA_LNBInfo)) { *Output = (IBDA_LNBInfo*)(this); reinterpret_cast<IBDA_LNBInfo*>(*Output)->AddRef(); 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;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::put_LocalOscillatorFrequencyLowBand(ULONG ulLOFLow){ KSP_NODE Node; HRESULT hr;
// setup request Node.NodeId = m_NodeId; Node.Reserved = 0;
// perform request 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_LocalOscillatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr); OutputDebugStringW(Buffer);#endif
return hr;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::get_LocalOscillatorFrequencyLowBand(ULONG *pulLOFLow){ return E_NOINTERFACE;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::put_LocalOscillatorFrequencyHighBand(ULONG ulLOFHigh){ KSP_NODE Node; HRESULT hr;
// setup request Node.NodeId = m_NodeId; Node.Reserved = 0;
// perform request 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_LocalOscillatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr); OutputDebugStringW(Buffer);#endif
return hr;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::get_LocalOscillatorFrequencyHighBand(ULONG *pulLOFHigh){ return E_NOINTERFACE;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency){ KSP_NODE Node; HRESULT hr;
// setup request Node.NodeId = m_NodeId; Node.Reserved = 0;
// perform request 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 ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr); OutputDebugStringW(Buffer);#endif
return hr;}
HRESULTSTDMETHODCALLTYPECBDALNBInfo::get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency){ return E_NOINTERFACE;}
HRESULTWINAPICBDALNBInfo_fnConstructor( IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID * ppv){ // construct device control CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
#ifdef BDAPLGIN_TRACE OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");#endif
if (!handler) return E_OUTOFMEMORY;
if (FAILED(handler->QueryInterface(riid, ppv))) { /* not supported */ delete handler; return E_NOINTERFACE; }
return NOERROR;}