ReactOS  0.4.13-dev-259-g5ca9c9c
frequencyfilter.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/frequencyfilter.cpp
5  * PURPOSE: IBDA_FrequencyFilter 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_FrequencyFilter = {0x71985f47, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x00, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
14 const GUID KSPROPSETID_BdaFrequencyFilter = {0x71985f47, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
15 #endif
16 
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 
50 
52  virtual ~CBDAFrequencyFilter(){};
53 
54 protected:
55  LONG m_Ref;
58 };
59 
60 HRESULT
63  IN REFIID refiid,
64  OUT PVOID* Output)
65 {
66  *Output = NULL;
67 
68  if (IsEqualGUID(refiid, IID_IUnknown))
69  {
70  *Output = PVOID(this);
71  reinterpret_cast<IUnknown*>(*Output)->AddRef();
72  return NOERROR;
73  }
74 
76  {
77  *Output = (IBDA_FrequencyFilter*)(this);
78  reinterpret_cast<IBDA_FrequencyFilter*>(*Output)->AddRef();
79  return NOERROR;
80  }
81 
82 #ifdef BDAPLGIN_TRACE
85  StringFromCLSID(refiid, &lpstr);
86  swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
89 DebugBreak();
90 #endif
91 
92  return E_NOINTERFACE;
93 }
94 
95 HRESULT
98 {
99  return E_NOINTERFACE;
100 }
101 
102 HRESULT
105 {
106  return E_NOINTERFACE;
107 }
108 
109 HRESULT
112 {
113  KSP_NODE Node;
114  HRESULT hr;
115 
116  // setup request
117  Node.NodeId = m_NodeId;
118  Node.Reserved = 0;
119 
120  // perform request
122 
123 #ifdef BDAPLGIN_TRACE
124  WCHAR Buffer[100];
125  swprintf(Buffer, L"CBDAFrequencyFilter::put_Frequency: m_NodeId %lu ulFrequency %lu hr %lx\n", m_NodeId, ulFrequency, hr);
127 #endif
128 
129  return hr;
130 }
131 
132 HRESULT
135 {
136  return E_NOINTERFACE;
137 }
138 
139 HRESULT
142 {
143  KSP_NODE Node;
144  HRESULT hr;
145 
146  // setup request
147  Node.NodeId = m_NodeId;
148  Node.Reserved = 0;
149 
150  // perform request
152 
153 #ifdef BDAPLGIN_TRACE
154  WCHAR Buffer[100];
155  swprintf(Buffer, L"CBDAFrequencyFilter::put_Polarity: m_NodeId %lu Polarity %lu hr %lx\n", m_NodeId, Polarity, hr);
157 #endif
158 
159  return hr;
160 }
161 
162 HRESULT
165 {
166  return E_NOINTERFACE;
167 }
168 
169 HRESULT
172 {
173  KSP_NODE Node;
174  HRESULT hr;
175 
176  // setup request
177  Node.NodeId = m_NodeId;
178  Node.Reserved = 0;
179 
180  // perform request
182 
183 #ifdef BDAPLGIN_TRACE
184  WCHAR Buffer[100];
185  swprintf(Buffer, L"CBDAFrequencyFilter::put_Range: m_NodeId %lu ulRange %lu hr %lx\n", m_NodeId, ulRange, hr);
187 #endif
188 
189  return hr;
190 }
191 
192 HRESULT
195 {
196  return E_NOINTERFACE;
197 }
198 
199 HRESULT
202 {
203  KSP_NODE Node;
204  HRESULT hr;
205 
206  // setup request
207  Node.NodeId = m_NodeId;
208  Node.Reserved = 0;
209 
210  // perform request
212 
213 #ifdef BDAPLGIN_TRACE
214  WCHAR Buffer[100];
215  swprintf(Buffer, L"CBDAFrequencyFilter::put_Bandwidth: m_NodeId %lu ulBandwidth %lu hr %lx\n", m_NodeId, ulBandwidth, hr);
217 #endif
218 
219  return hr;
220 }
221 
222 HRESULT
225 {
226  return E_NOINTERFACE;
227 }
228 HRESULT
231 {
232  KSP_NODE Node;
233  HRESULT hr;
234 
235  // setup request
236  Node.NodeId = m_NodeId;
237  Node.Reserved = 0;
238 
239  // perform request
241 
242 #ifdef BDAPLGIN_TRACE
243  WCHAR Buffer[100];
244  swprintf(Buffer, L"CBDAFrequencyFilter::put_FrequencyMultiplier: m_NodeId %lu ulMultiplier %lu hr %lx\n", m_NodeId, ulMultiplier, hr);
246 #endif
247 
248  return hr;
249 }
250 
251 HRESULT
254 {
255  return E_NOINTERFACE;
256 }
257 
258 HRESULT
259 WINAPI
262  ULONG NodeId,
263  REFIID riid,
264  LPVOID * ppv)
265 {
266  // construct device control
268 
269 #ifdef BDAPLGIN_TRACE
270  OutputDebugStringW(L"CBDAFrequencyFilter_fnConstructor\n");
271 #endif
272 
273  if (!handler)
274  return E_OUTOFMEMORY;
275 
276  if (FAILED(handler->QueryInterface(riid, ppv)))
277  {
278  /* not supported */
279  delete handler;
280  return E_NOINTERFACE;
281  }
282 
283  return NOERROR;
284 }
HRESULT STDMETHODCALLTYPE get_FrequencyMultiplier(ULONG *pulMultiplier)
HRESULT STDMETHODCALLTYPE get_Bandwidth(ULONG *pulBandwidth)
#define IN
Definition: typedefs.h:38
#define REFIID
Definition: guiddef.h:113
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI CBDAFrequencyFilter_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static LPOLESTR
Definition: stg_prop.c:27
STDMETHODIMP_(ULONG) AddRef()
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
Polarisation
Definition: bdatypes.h:301
HRESULT STDMETHODCALLTYPE put_Autotune(ULONG ulTransponder)
#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
ULONG Release()
void WINAPI DebugBreak(void)
smooth NULL
Definition: ftsmooth.c:416
Definition: ks.h:2104
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
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 KSPROPSETID_BdaFrequencyFilter
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT STDMETHODCALLTYPE get_Range(ULONG *pulRange)
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
IKsPropertySet * m_pProperty
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
ULONG AddRef()
virtual ~CBDAFrequencyFilter()
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
const GUID IID_IBDA_FrequencyFilter
STDMETHODIMP_(ULONG) Release()
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)
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT STDMETHODCALLTYPE put_Polarity(Polarisation Polarity)
HRESULT STDMETHODCALLTYPE get_Frequency(ULONG *pulFrequency)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
HRESULT STDMETHODCALLTYPE put_Range(ULONG ulRange)
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
HRESULT STDMETHODCALLTYPE put_Frequency(ULONG ulFrequency)
CBDAFrequencyFilter(IKsPropertySet *pProperty, ULONG NodeId)
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
HRESULT STDMETHODCALLTYPE put_Bandwidth(ULONG ulBandwidth)
HRESULT STDMETHODCALLTYPE get_Polarity(Polarisation *pPolarity)
HRESULT STDMETHODCALLTYPE put_FrequencyMultiplier(ULONG ulMultiplier)
HRESULT STDMETHODCALLTYPE get_Autotune(ULONG *pulTransponder)
Definition: dlist.c:348
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321