ReactOS  0.4.14-dev-77-gd9e7c48
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
13 const GUID IID_IBDA_LNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x08, 0xf4}};
14 const GUID KSPROPSETID_BdaLNBInfo = {0x992cf102, 0x49f9, 0x4719, {0xa6, 0x64, 0xc4, 0xf2, 0x3e, 0x24, 0x8, 0xf4}};
15 #endif
16 
17 class CBDALNBInfo : public IBDA_LNBInfo
18 {
19 public:
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 
49 protected:
50  LONG m_Ref;
53 };
54 
55 HRESULT
58  IN REFIID refiid,
59  OUT PVOID* Output)
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 
89 HRESULT
92 {
93  KSP_NODE Node;
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 
112 HRESULT
115 {
116  return E_NOINTERFACE;
117 }
118 
119 HRESULT
122 {
123  KSP_NODE Node;
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 
142 HRESULT
145 {
146  return E_NOINTERFACE;
147 }
148 
149 HRESULT
152 {
153  KSP_NODE Node;
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 
172 HRESULT
175 {
176  return E_NOINTERFACE;
177 }
178 
179 HRESULT
180 WINAPI
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 }
HRESULT STDMETHODCALLTYPE get_HighLowSwitchFrequency(ULONG *pulSwitchFrequency)
Definition: lnbinfo.cpp:174
#define IN
Definition: typedefs.h:38
#define REFIID
Definition: guiddef.h:118
IKsPropertySet * m_pProperty
Definition: lnbinfo.cpp:51
#define E_NOINTERFACE
Definition: winerror.h:2364
LONG m_Ref
Definition: lnbinfo.cpp:47
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyLowBand(ULONG ulLOFLow)
Definition: lnbinfo.cpp:91
#define NOERROR
Definition: winerror.h:2354
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: lnbinfo.cpp:57
HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyHighBand(ULONG *pulLOFHigh)
Definition: lnbinfo.cpp:144
REFIID riid
Definition: precomp.h:44
ULONG m_NodeId
Definition: lnbinfo.cpp:52
REFIID LPVOID * ppv
Definition: atlbase.h:39
static LPOLESTR
Definition: stg_prop.c:27
HRESULT STDMETHODCALLTYPE get_LocalOscillatorFrequencyLowBand(ULONG *pulLOFLow)
Definition: lnbinfo.cpp:114
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
CBDALNBInfo(IKsPropertySet *pProperty, ULONG NodeId)
Definition: lnbinfo.cpp:46
union node Node
Definition: types.h:1255
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP_(ULONG) AddRef()
Definition: lnbinfo.cpp:22
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
Definition: ks.h:2074
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
HRESULT WINAPI CBDALNBInfo_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
Definition: lnbinfo.cpp:181
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
_Must_inspect_result_ _In_ KSP_BDA_NODE_PIN * pProperty
Definition: bdasup.h:156
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:8
HRESULT STDMETHODCALLTYPE put_LocalOscillatorFrequencyHighBand(ULONG ulLOFHigh)
Definition: lnbinfo.cpp:121
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
ULONG AddRef()
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
const GUID IID_IBDA_LNBInfo
Definition: lnbinfo.cpp:13
HRESULT STDMETHODCALLTYPE put_HighLowSwitchFrequency(ULONG ulSwitchFrequency)
Definition: lnbinfo.cpp:151
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)
const GUID KSPROPSETID_BdaLNBInfo
Definition: lnbinfo.cpp:14
#define InterlockedIncrement
Definition: armddk.h:53
~CBDALNBInfo()
Definition: lnbinfo.cpp:47
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
STDMETHODIMP_(ULONG) Release()
Definition: lnbinfo.cpp:27
static LPCSTR lpstr
Definition: font.c:51
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
Definition: dlist.c:348
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321