ReactOS 0.4.15-dev-8102-g108db8f
signalstatistics.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/signalstatistics.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
13const GUID IID_IBDA_SignalStatistics = {0x1347d106, 0xcf3a, 0x428a, {0xa5, 0xcb, 0xac, 0x0d, 0x9a, 0x2a, 0x43, 0x38}};
14const GUID KSPROPSETID_BdaSignalStats = {0x1347d106, 0xcf3a, 0x428a, {0xa5, 0xcb, 0xac, 0xd, 0x9a, 0x2a, 0x43, 0x38}};
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_SignalStatistics methods
49
52
53protected:
57};
58
62 IN REFIID refiid,
64{
65 *Output = NULL;
66
67 if (IsEqualGUID(refiid, IID_IUnknown))
68 {
69 *Output = PVOID(this);
70 reinterpret_cast<IUnknown*>(*Output)->AddRef();
71 return NOERROR;
72 }
73
75 {
76 *Output = (IBDA_SignalStatistics*)(this);
77 reinterpret_cast<IBDA_SignalStatistics*>(*Output)->AddRef();
78 return NOERROR;
79 }
80 return E_NOINTERFACE;
81}
82
86{
87 return E_NOINTERFACE;
88}
89
93{
95 HRESULT hr;
97
98 // setup request
99 Node.NodeId = (ULONG)-1;
100 Node.Reserved = 0;
101
103
105
106
107#ifdef BDAPLGIN_TRACE
108 WCHAR Buffer[100];
109 swprintf(Buffer, L"CBDASignalStatistics::get_SignalStrength: m_NodeId %lu hr %lx, BytesReturned %lu plDbStrength %ld\n", m_NodeId, hr, BytesReturned, *plDbStrength);
111#endif
112
113 return hr;
114}
115
119{
120 return E_NOINTERFACE;
121}
122
126{
128 HRESULT hr;
130
131 // setup request
132 Node.NodeId = (ULONG)-1;
133 Node.Reserved = 0;
134
135 // perform request
136 hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SIGNAL_QUALITY, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plPercentQuality, sizeof(LONG), &BytesReturned);
137
138#ifdef BDAPLGIN_TRACE
139 WCHAR Buffer[100];
140 swprintf(Buffer, L"CBDASignalStatistics::get_SignalQuality: m_NodeId %lu hr %lx, BytesReturned %lu plPercentQuality %lu\n", m_NodeId, hr, BytesReturned, *plPercentQuality);
142#endif
143
144 return hr;
145}
146
150{
151 return E_NOINTERFACE;
152}
153
157{
159 HRESULT hr;
160 ULONG Present;
162
163 // setup request
164 Node.NodeId = (ULONG)-1;
165 Node.Reserved = 0;
166
167 // perform request
169
170 // store result
171 *pfPresent = Present;
172
173#ifdef BDAPLGIN_TRACE
174 WCHAR Buffer[100];
175 swprintf(Buffer, L"CBDASignalStatistics::get_SignalPresent: m_NodeId %lu hr %lx, BytesReturned %lu Present %lu\n", m_NodeId, hr, BytesReturned, Present);
177#endif
178
179 return hr;
180}
181
185{
186 return E_NOINTERFACE;
187}
188
192{
194 HRESULT hr;
197
198 // setup request
199 Node.NodeId = (ULONG)-1;
200 Node.Reserved = 0;
201
202 // perform request
204
205 *pfLocked = Locked;
206
207#ifdef BDAPLGIN_TRACE
208 WCHAR Buffer[100];
209 swprintf(Buffer, L"CBDASignalStatistics::get_SignalLocked: m_NodeId %lu hr %lx, BytesReturned %lu Locked %lu\n", m_NodeId, hr, BytesReturned, Locked);
211#endif
212
213 return hr;
214}
215
219{
221 HRESULT hr;
222
223 // setup request
224 Node.NodeId = (ULONG)-1;
225 Node.Reserved = 0;
226
227 // perform request
228 hr = m_pProperty->Set(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), &lmsSampleTime, sizeof(LONG));
229
230#ifdef BDAPLGIN_TRACE
231 WCHAR Buffer[100];
232 swprintf(Buffer, L"CBDASignalStatistics::put_SampleTime: m_NodeId %lu hr %lx\n", m_NodeId, hr);
234#endif
235
236 return hr;
237}
238
242{
244 HRESULT hr;
246
247 // setup request
248 Node.NodeId = (ULONG)-1;
249 Node.Reserved = 0;
250
251 // perform request
252 hr = m_pProperty->Get(KSPROPSETID_BdaSignalStats, KSPROPERTY_BDA_SAMPLE_TIME, &Node.NodeId, sizeof(KSP_NODE)-sizeof(KSPROPERTY), plmsSampleTime, sizeof(LONG), &BytesReturned);
253
254#ifdef BDAPLGIN_TRACE
255 WCHAR Buffer[100];
256 swprintf(Buffer, L"CBDASignalStatistics::get_SampleTime: m_NodeId %lu hr %lx, BytesReturned %lu \n", m_NodeId, hr, BytesReturned);
258#endif
259
260 return hr;
261}
262
264WINAPI
267 ULONG NodeId,
268 REFIID riid,
269 LPVOID * ppv)
270{
271 // construct device control
273
274#ifdef BDAPLGIN_TRACE
275 OutputDebugStringW(L"CBDASignalStatistics_fnConstructor\n");
276#endif
277
278 if (!handler)
279 return E_OUTOFMEMORY;
280
281 if (FAILED(handler->QueryInterface(riid, ppv)))
282 {
283 /* not supported */
284 delete handler;
285 return E_NOINTERFACE;
286 }
287
288 return NOERROR;
289}
unsigned char BOOLEAN
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define STDMETHODIMP
Definition: basetyps.h:43
@ KSPROPERTY_BDA_SIGNAL_PRESENT
Definition: bdamedia.h:330
@ KSPROPERTY_BDA_SAMPLE_TIME
Definition: bdamedia.h:332
@ KSPROPERTY_BDA_SIGNAL_STRENGTH
Definition: bdamedia.h:328
@ KSPROPERTY_BDA_SIGNAL_LOCKED
Definition: bdamedia.h:331
@ KSPROPERTY_BDA_SIGNAL_QUALITY
Definition: bdamedia.h:329
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
HRESULT STDMETHODCALLTYPE put_SignalPresent(BOOLEAN fPresent)
CBDASignalStatistics(IKsPropertySet *pProperty, ULONG NodeId)
IKsPropertySet * m_pProperty
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
STDMETHODIMP_(ULONG) AddRef()
HRESULT STDMETHODCALLTYPE get_SignalQuality(LONG *plPercentQuality)
HRESULT STDMETHODCALLTYPE put_SignalStrength(LONG lDbStrength)
STDMETHODIMP_(ULONG) Release()
HRESULT STDMETHODCALLTYPE get_SignalStrength(LONG *plDbStrength)
HRESULT STDMETHODCALLTYPE put_SampleTime(LONG lmsSampleTime)
HRESULT STDMETHODCALLTYPE put_SignalQuality(LONG lPercentQuality)
HRESULT STDMETHODCALLTYPE get_SignalPresent(BOOLEAN *pfPresent)
HRESULT STDMETHODCALLTYPE get_SignalLocked(BOOLEAN *pfLocked)
HRESULT STDMETHODCALLTYPE get_SampleTime(LONG *plmsSampleTime)
HRESULT STDMETHODCALLTYPE put_SignalLocked(BOOLEAN fLocked)
#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
#define swprintf
Definition: precomp.h:40
#define assert(x)
Definition: debug.h:53
struct KSIDENTIFIER KSPROPERTY
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)
HRESULT Get([in] REFGUID guidPropSet, [in] DWORD dwPropID, [in, size_is(cbInstanceData)] LPVOID pInstanceData, [in] DWORD cbInstanceData, [out, size_is(cbPropData)] LPVOID pPropData, [in] DWORD cbPropData, [out] DWORD *pcbReturned)
ULONG AddRef()
ULONG Release()
#define FAILED(hr)
Definition: intsafe.h:51
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:209
#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
const GUID KSPROPSETID_BdaSignalStats
HRESULT WINAPI CBDASignalStatistics_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
const GUID IID_IBDA_SignalStatistics
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
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052
#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