ReactOS  0.4.14-dev-114-gc8cbd56
digitaldemo.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/digitaldemo.cpp
5  * PURPOSE: IBDA_DigitalDemodulator 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_DigitalDemodulator = {0xef30f379, 0x985b, 0x4d10, {0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x04, 0xe1, 0xe0}};
14 const GUID KSPROPSETID_BdaDigitalDemodulator = {0xef30f379, 0x985b, 0x4d10, {0xb6, 0x40, 0xa7, 0x9d, 0x5e, 0x4, 0xe1, 0xe0}};
15 #endif
16 
17 class CBDADigitalDemodulator : public IBDA_DigitalDemodulator
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  //IBDA_DigitalDemodulator methods
52 
55 
56 protected:
57  LONG m_Ref;
60 };
61 
62 HRESULT
65  IN REFIID refiid,
66  OUT PVOID* Output)
67 {
68  *Output = NULL;
69 
70  if (IsEqualGUID(refiid, IID_IUnknown))
71  {
72  *Output = PVOID(this);
73  reinterpret_cast<IUnknown*>(*Output)->AddRef();
74  return NOERROR;
75  }
76 
78  {
79  *Output = (IBDA_DigitalDemodulator*)(this);
80  reinterpret_cast<IBDA_DigitalDemodulator*>(*Output)->AddRef();
81  return NOERROR;
82  }
83 
84 #ifdef BDAPLGIN_TRACE
87  StringFromCLSID(refiid, &lpstr);
88  swprintf(Buffer, L"CBDADigitalDemodulator::QueryInterface: NoInterface for %s", lpstr);
91 DebugBreak();
92 #endif
93 
94  return E_NOINTERFACE;
95 }
96 
97 HRESULT
100 {
101  KSP_NODE Node;
102  HRESULT hr;
103 
104  // setup request
105  Node.NodeId = m_NodeId;
106  Node.Reserved = 0;
107 
108  // perform request
110 
111 
112 #ifdef BDAPLGIN_TRACE
113  WCHAR Buffer[100];
114  swprintf(Buffer, L"CBDADigitalDemodulator::put_ModulationType: pModulationType %lu hr %lx\n", *pModulationType, hr);
116 #endif
117 
118  return hr;
119 }
120 
121 HRESULT
124 {
125  return E_NOINTERFACE;
126 }
127 
128 HRESULT
131 {
132  KSP_NODE Node;
133  HRESULT hr;
134 
135  // setup request
136  Node.NodeId = m_NodeId;
137  Node.Reserved = 0;
138 
139  // perform request
141 
142 
143 #ifdef BDAPLGIN_TRACE
144  WCHAR Buffer[100];
145  swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr);
147 #endif
148 
149  return hr;
150 }
151 
152 HRESULT
155 {
156  return E_NOINTERFACE;
157 }
158 
159 HRESULT
162 {
163  KSP_NODE Node;
164  HRESULT hr;
165 
166  // setup request
167  Node.NodeId = m_NodeId;
168  Node.Reserved = 0;
169 
170  // perform request
172 
173 #ifdef BDAPLGIN_TRACE
174  WCHAR Buffer[100];
175  swprintf(Buffer, L"CBDADigitalDemodulator::put_InnerFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr);
177 #endif
178 
179  return hr;
180 }
181 
182 HRESULT
185 {
186  return E_NOINTERFACE;
187 }
188 
189 HRESULT
192 {
193  KSP_NODE Node;
194  HRESULT hr;
195 
196  // setup request
197  Node.NodeId = m_NodeId;
198  Node.Reserved = 0;
199 
200  // perform request
202 
203 #ifdef BDAPLGIN_TRACE
204  WCHAR Buffer[100];
205  swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECMethod: pFECMethod %lu hr %lx\n", *pFECMethod, hr);
207 #endif
208 
209  return hr;
210 }
211 
212 
213 HRESULT
215 {
216  return E_NOINTERFACE;
217 }
218 
219 HRESULT
222 {
223  KSP_NODE Node;
224  HRESULT hr;
225 
226  // setup request
227  Node.NodeId = m_NodeId;
228  Node.Reserved = 0;
229 
230  // perform request
232 
233 #ifdef BDAPLGIN_TRACE
234  WCHAR Buffer[100];
235  swprintf(Buffer, L"CBDADigitalDemodulator::put_OuterFECRate: pFECRate %lu hr %lx\n", *pFECRate, hr);
237 #endif
238 
239  return hr;
240 }
241 
242 HRESULT
245 {
246  return E_NOINTERFACE;
247 }
248 
249 HRESULT
252 {
253  KSP_NODE Node;
254  HRESULT hr;
255 
256  // setup request
257  Node.NodeId = m_NodeId;
258  Node.Reserved = 0;
259 
260  // perform request
261  hr = m_pProperty->Set(KSPROPSETID_BdaDigitalDemodulator, KSPROPERTY_BDA_SYMBOL_RATE, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), pSymbolRate, sizeof(ULONG));
262 
263 #ifdef BDAPLGIN_TRACE
264  WCHAR Buffer[100];
265  swprintf(Buffer, L"CBDADigitalDemodulator::put_SymbolRate: pSymbolRate %lu hr %lx\n", *pSymbolRate, hr);
267 #endif
268 
269  return hr;
270 }
271 
272 HRESULT
275 {
276  return E_NOINTERFACE;
277 }
278 
279 HRESULT
282 {
283  KSP_NODE Node;
284  HRESULT hr;
285 
286  // setup request
287  Node.NodeId = m_NodeId;
288  Node.Reserved = 0;
289 
290  // perform request
292 
293 #ifdef BDAPLGIN_TRACE
294  WCHAR Buffer[100];
295  swprintf(Buffer, L"CBDADigitalDemodulator::put_SpectralInversion: pSpectralInversion %lu hr %lx\n", *pSpectralInversion, hr);
297 #endif
298 
299  return hr;
300 }
301 
302 HRESULT
305 {
306  return E_NOINTERFACE;
307 }
308 
309 
310 HRESULT
311 WINAPI
314  ULONG NodeId,
315  REFIID riid,
316  LPVOID * ppv)
317 {
318  // construct device control
320 
321 #ifdef BDAPLGIN_TRACE
322  OutputDebugStringW(L"CBDADigitalDemodulator_fnConstructor\n");
323 #endif
324 
325  if (!handler)
326  return E_OUTOFMEMORY;
327 
328  if (FAILED(handler->QueryInterface(riid, ppv)))
329  {
330  /* not supported */
331  delete handler;
332  return E_NOINTERFACE;
333  }
334 
335  return NOERROR;
336 }
#define IN
Definition: typedefs.h:38
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: digitaldemo.cpp:64
FECMethod
Definition: bdatypes.h:253
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
_In_ BOOLEAN Release
Definition: classpnp.h:929
HRESULT STDMETHODCALLTYPE put_ModulationType(ModulationType *pModulationType)
Definition: digitaldemo.cpp:99
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
const GUID KSPROPSETID_BdaDigitalDemodulator
Definition: digitaldemo.cpp:14
HRESULT STDMETHODCALLTYPE put_SymbolRate(ULONG *pSymbolRate)
REFIID LPVOID * ppv
Definition: atlbase.h:39
CBDADigitalDemodulator(IKsPropertySet *pProperty, ULONG NodeId)
Definition: digitaldemo.cpp:53
static LPOLESTR
Definition: stg_prop.c:27
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
union node Node
Definition: types.h:1255
#define STDMETHODIMP
Definition: basetyps.h:43
void WINAPI DebugBreak(void)
smooth NULL
Definition: ftsmooth.c:416
Definition: ks.h:2074
HRESULT STDMETHODCALLTYPE get_SpectralInversion(SpectralInversion *pSpectralInversion)
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
STDMETHODIMP_(ULONG) AddRef()
Definition: digitaldemo.cpp:22
HRESULT STDMETHODCALLTYPE put_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
STDMETHODIMP_(ULONG) Release()
Definition: digitaldemo.cpp:27
HRESULT STDMETHODCALLTYPE put_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
HRESULT STDMETHODCALLTYPE get_InnerFECRate(BinaryConvolutionCodeRate *pFECRate)
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
const GUID IID_IBDA_DigitalDemodulator
Definition: digitaldemo.cpp:13
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
HRESULT STDMETHODCALLTYPE get_SymbolRate(ULONG *pSymbolRate)
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
BinaryConvolutionCodeRate
Definition: bdatypes.h:230
IKsPropertySet * m_pProperty
Definition: digitaldemo.cpp:58
ModulationType
Definition: bdatypes.h:261
HRESULT STDMETHODCALLTYPE get_ModulationType(ModulationType *pModulationType)
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)
HRESULT STDMETHODCALLTYPE put_OuterFECMethod(FECMethod *pFECMethod)
HRESULT STDMETHODCALLTYPE get_OuterFECMethod(FECMethod *pFECMethod)
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT STDMETHODCALLTYPE put_SpectralInversion(SpectralInversion *pSpectralInversion)
HRESULT WINAPI CBDADigitalDemodulator_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
SpectralInversion
Definition: bdatypes.h:244
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
HRESULT STDMETHODCALLTYPE get_OuterFECRate(BinaryConvolutionCodeRate *pFECRate)
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
HRESULT STDMETHODCALLTYPE put_InnerFECMethod(FECMethod *pFECMethod)
HRESULT STDMETHODCALLTYPE get_InnerFECMethod(FECMethod *pFECMethod)
Definition: dlist.c:348
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321