2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS BDA Proxy
4 * FILE: dll/directx/bdaplgin/lnbinfo.cpp
5 * PURPOSE: IBDA_LNBInfo interface
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
12 const GUID IID_IBDA_LNBInfo
= {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x08, 0xf4}};
13 const GUID KSPROPSETID_BdaLNBInfo
= {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4}};
15 class CBDALNBInfo
: public IBDA_LNBInfo
18 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
20 STDMETHODIMP_(ULONG
) AddRef()
22 InterlockedIncrement(&m_Ref
);
25 STDMETHODIMP_(ULONG
) Release()
27 InterlockedDecrement(&m_Ref
);
36 //IBDA_LNBInfo methods
37 HRESULT STDMETHODCALLTYPE
put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow
);
38 HRESULT STDMETHODCALLTYPE
get_LocalOscilatorFrequencyLowBand(ULONG
*pulLOFLow
);
39 HRESULT STDMETHODCALLTYPE
put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh
);
40 HRESULT STDMETHODCALLTYPE
get_LocalOscilatorFrequencyHighBand(ULONG
*pulLOFHigh
);
41 HRESULT STDMETHODCALLTYPE
put_HighLowSwitchFrequency(ULONG ulSwitchFrequency
);
42 HRESULT STDMETHODCALLTYPE
get_HighLowSwitchFrequency(ULONG
*pulSwitchFrequency
);
44 CBDALNBInfo(HANDLE hFile
, ULONG NodeId
) : m_Ref(0), m_hFile(hFile
), m_NodeId(NodeId
){};
55 CBDALNBInfo::QueryInterface(
61 if (IsEqualGUID(refiid
, IID_IUnknown
))
63 *Output
= PVOID(this);
64 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
68 if (IsEqualGUID(refiid
, IID_IBDA_LNBInfo
))
70 *Output
= (IBDA_LNBInfo
*)(this);
71 reinterpret_cast<IBDA_LNBInfo
*>(*Output
)->AddRef();
78 StringFromCLSID(refiid
, &lpstr
);
79 swprintf(Buffer
, L
"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr
);
80 OutputDebugStringW(Buffer
);
89 CBDALNBInfo::put_LocalOscilatorFrequencyLowBand(ULONG ulLOFLow
)
96 Node
.Property
.Set
= KSPROPSETID_BdaLNBInfo
;
97 Node
.Property
.Id
= KSPROPERTY_BDA_LNB_LOF_LOW_BAND
;
98 Node
.Property
.Flags
= KSPROPERTY_TYPE_SET
| KSPROPERTY_TYPE_TOPOLOGY
;
99 Node
.NodeId
= m_NodeId
;
102 hr
= KsSynchronousDeviceControl(m_hFile
, IOCTL_KS_PROPERTY
, (PVOID
)&Node
, sizeof(KSP_NODE
), &ulLOFLow
, sizeof(ULONG
), &BytesReturned
);
104 #ifdef BDAPLGIN_TRACE
106 swprintf(Buffer
, L
"CBDALNBInfo::put_LocalOscilatorFrequencyLowBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId
, hr
, BytesReturned
);
107 OutputDebugStringW(Buffer
);
115 CBDALNBInfo::get_LocalOscilatorFrequencyLowBand(ULONG
*pulLOFLow
)
117 return E_NOINTERFACE
;
122 CBDALNBInfo::put_LocalOscilatorFrequencyHighBand(ULONG ulLOFHigh
)
129 Node
.Property
.Set
= KSPROPSETID_BdaLNBInfo
;
130 Node
.Property
.Id
= KSPROPERTY_BDA_LNB_LOF_HIGH_BAND
;
131 Node
.Property
.Flags
= KSPROPERTY_TYPE_SET
| KSPROPERTY_TYPE_TOPOLOGY
;
132 Node
.NodeId
= m_NodeId
;
135 hr
= KsSynchronousDeviceControl(m_hFile
, IOCTL_KS_PROPERTY
, (PVOID
)&Node
, sizeof(KSP_NODE
), &ulLOFHigh
, sizeof(ULONG
), &BytesReturned
);
137 #ifdef BDAPLGIN_TRACE
139 swprintf(Buffer
, L
"CBDALNBInfo::put_LocalOscilatorFrequencyHighBand: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId
, hr
, BytesReturned
);
140 OutputDebugStringW(Buffer
);
148 CBDALNBInfo::get_LocalOscilatorFrequencyHighBand(ULONG
*pulLOFHigh
)
150 return E_NOINTERFACE
;
155 CBDALNBInfo::put_HighLowSwitchFrequency(ULONG ulSwitchFrequency
)
162 Node
.Property
.Set
= KSPROPSETID_BdaLNBInfo
;
163 Node
.Property
.Id
= KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY
;
164 Node
.Property
.Flags
= KSPROPERTY_TYPE_SET
| KSPROPERTY_TYPE_TOPOLOGY
;
165 Node
.NodeId
= m_NodeId
;
168 hr
= KsSynchronousDeviceControl(m_hFile
, IOCTL_KS_PROPERTY
, (PVOID
)&Node
, sizeof(KSP_NODE
), &ulSwitchFrequency
, sizeof(ULONG
), &BytesReturned
);
170 #ifdef BDAPLGIN_TRACE
172 swprintf(Buffer
, L
"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu hr %lx, BytesReturned %lu\n", m_NodeId
, hr
, BytesReturned
);
173 OutputDebugStringW(Buffer
);
181 CBDALNBInfo::get_HighLowSwitchFrequency(ULONG
*pulSwitchFrequency
)
183 return E_NOINTERFACE
;
188 CBDALNBInfo_fnConstructor(
194 // construct device control
195 CBDALNBInfo
* handler
= new CBDALNBInfo(hFile
, NodeId
);
197 #ifdef BDAPLGIN_TRACE
198 OutputDebugStringW(L
"CBDALNBInfo_fnConstructor\n");
202 return E_OUTOFMEMORY
;
204 if (FAILED(handler
->QueryInterface(riid
, ppv
)))
208 return E_NOINTERFACE
;