ReactOS 0.4.15-dev-5667-ged97270
lnbinfo.cpp
Go to the documentation of this file.
1/*
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
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9
10#include "precomp.h"
11
12#ifndef _MSC_VER
13const GUID IID_IBDA_LNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x08, 0xf4}};
14const GUID KSPROPSETID_BdaLNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4}};
15#endif
16
18{
19public:
21
23 {
25 return m_Ref;
26 }
28 {
30 if (!m_Ref)
31 {
32 delete this;
33 return 0;
34 }
35 return m_Ref;
36 }
37
38 //IBDA_LNBInfo methods
45
48
49protected:
53};
54
58 IN REFIID refiid,
60{
61 *Output = NULL;
62
63 if (IsEqualGUID(refiid, IID_IUnknown))
64 {
65 *Output = PVOID(this);
66 reinterpret_cast<IUnknown*>(*Output)->AddRef();
67 return NOERROR;
68 }
69
70 if (IsEqualGUID(refiid, IID_IBDA_LNBInfo))
71 {
72 *Output = (IBDA_LNBInfo*)(this);
73 reinterpret_cast<IBDA_LNBInfo*>(*Output)->AddRef();
74 return NOERROR;
75 }
76
77#ifdef BDAPLGIN_TRACE
78 WCHAR Buffer[100];
80 StringFromCLSID(refiid, &lpstr);
81 swprintf(Buffer, L"CBDALNBInfo::QueryInterface: NoInterface for %s", lpstr);
84#endif
85
86 return E_NOINTERFACE;
87}
88
92{
94 HRESULT hr;
95
96 // setup request
97 Node.NodeId = m_NodeId;
98 Node.Reserved = 0;
99
100 // perform request
101 hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_LOW_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFLow, sizeof(LONG));
102
103#ifdef BDAPLGIN_TRACE
104 WCHAR Buffer[100];
105 swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyLowBand: m_NodeId %lu ulLOFLow %lu hr %lx\n", m_NodeId, ulLOFLow, hr);
107#endif
108
109 return hr;
110}
111
115{
116 return E_NOINTERFACE;
117}
118
122{
124 HRESULT hr;
125
126 // setup request
127 Node.NodeId = m_NodeId;
128 Node.Reserved = 0;
129
130 // perform request
131 hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_LOF_HIGH_BAND, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulLOFHigh, sizeof(ULONG));
132
133#ifdef BDAPLGIN_TRACE
134 WCHAR Buffer[100];
135 swprintf(Buffer, L"CBDALNBInfo::put_LocalOscillatorFrequencyHighBand: m_NodeId %lu ulLOFHigh %lu hr %lx\n", m_NodeId, ulLOFHigh, hr);
137#endif
138
139 return hr;
140}
141
145{
146 return E_NOINTERFACE;
147}
148
152{
154 HRESULT hr;
155
156 // setup request
157 Node.NodeId = m_NodeId;
158 Node.Reserved = 0;
159
160 // perform request
161 hr = m_pProperty->Set(KSPROPSETID_BdaLNBInfo, KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &ulSwitchFrequency, sizeof(ULONG));
162
163#ifdef BDAPLGIN_TRACE
164 WCHAR Buffer[100];
165 swprintf(Buffer, L"CBDALNBInfo::put_HighLowSwitchFrequency: m_NodeId %lu ulSwitchFrequency %lu hr %lx\n", m_NodeId, ulSwitchFrequency, hr);
167#endif
168
169 return hr;
170}
171
175{
176 return E_NOINTERFACE;
177}
178
180WINAPI
183 ULONG NodeId,
184 REFIID riid,
185 LPVOID * ppv)
186{
187 // construct device control
188 CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
189
190#ifdef BDAPLGIN_TRACE
191 OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");
192#endif
193
194 if (!handler)
195 return E_OUTOFMEMORY;
196
197 if (FAILED(handler->QueryInterface(riid, ppv)))
198 {
199 /* not supported */
200 delete handler;
201 return E_NOINTERFACE;
202 }
203
204 return NOERROR;
205}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define STDMETHODIMP
Definition: basetyps.h:43
@ KSPROPERTY_BDA_LNB_LOF_HIGH_BAND
Definition: bdamedia.h:316
@ KSPROPERTY_BDA_LNB_LOF_LOW_BAND
Definition: bdamedia.h:315
@ KSPROPERTY_BDA_LNB_SWITCH_FREQUENCY
Definition: bdamedia.h:317
const GUID IID_IUnknown
_Must_inspect_result_ _In_ KSP_BDA_NODE_PIN * pProperty
Definition: bdasup.h:156
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
Definition: bufpool.h:45
STDMETHODIMP_(ULONG) AddRef()
Definition: lnbinfo.cpp:22
STDMETHODIMP_(ULONG) Release()
Definition: lnbinfo.cpp:27
IKsPropertySet * m_pProperty
Definition: lnbinfo.cpp:51
HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyHighBand(ULONG ulLOFHigh)
Definition: lnbinfo.cpp:121
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: lnbinfo.cpp:57
LONG m_Ref
Definition: lnbinfo.cpp:50
HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyLowBand(ULONG *pulLOFLow)
Definition: lnbinfo.cpp:114
HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyHighBand(ULONG *pulLOFHigh)
Definition: lnbinfo.cpp:144
CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId)
Definition: lnbinfo.cpp:46
HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyLowBand(ULONG ulLOFLow)
Definition: lnbinfo.cpp:91
ULONG m_NodeId
Definition: lnbinfo.cpp:52
~CBDALNBInfo()
Definition: lnbinfo.cpp:47
HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
Definition: lnbinfo.cpp:151
HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
Definition: lnbinfo.cpp:174
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
union node Node
Definition: types.h:1255
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define swprintf
Definition: precomp.h:40
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT Set([in] REFGUID guidPropSet, [in] DWORD dwPropID, [in, size_is(cbInstanceData)] LPVOID pInstanceData, [in] DWORD cbInstanceData, [in, size_is(cbPropData)] LPVOID pPropData, [in] DWORD cbPropData)
ULONG AddRef()
ULONG Release()
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT WINAPI CBDALNBInfo_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
Definition: lnbinfo.cpp:181
const GUID IID_IBDA_LNBInfo
Definition: lnbinfo.cpp:13
const GUID KSPROPSETID_BdaLNBInfo
Definition: lnbinfo.cpp:14
static LPCSTR lpstr
Definition: font.c:51
static LPOLESTR
Definition: stg_prop.c:27
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
@ Output
Definition: arc.h:85
HRESULT hr
Definition: shlfolder.c:183
Definition: ks.h:2074
void * PVOID
Definition: typedefs.h:50
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
Definition: dlist.c:348
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
__wchar_t WCHAR
Definition: xmlstorage.h:180