ReactOS 0.4.16-dev-329-g9223134
controlnode.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/controlnode.cpp
5 * PURPOSE: ControlNode interface
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9
10#include "precomp.h"
11
12#ifndef _MSC_VER
13const GUID IID_IKsPropertySet = {0x31efac30, 0x515c, 0x11d0, {0xa9,0xaa, 0x00,0xaa,0x00,0x61,0xbe,0x93}};
14#endif
15
16class CControlNode : public IUnknown
17{
18public:
20
22 {
24 return m_Ref;
25 }
27 {
29 if (!m_Ref)
30 {
31 delete this;
32 return 0;
33 }
34 return m_Ref;
35 }
36
38 virtual ~CControlNode(){};
39
40protected:
45};
46
50 IN REFIID refiid,
52{
53 *Output = NULL;
54
55 if (IsEqualGUID(refiid, IID_IUnknown))
56 {
57 *Output = PVOID(this);
58 reinterpret_cast<IUnknown*>(*Output)->AddRef();
59 return NOERROR;
60 }
62 {
64 }
66 {
68 }
69 else if(IsEqualGUID(refiid, IID_IBDA_LNBInfo))
70 {
72 }
74 {
76 }
77#ifdef BDAPLGIN_TRACE
80 StringFromCLSID(refiid, &lpstr);
81 swprintf(Buffer, L"CControlNode::QueryInterface: NoInterface for %s", lpstr);
84#endif
85
86 return E_NOINTERFACE;
87}
88
89
93 IBaseFilter * pFilter,
95 ULONG PinId,
97 LPVOID * ppv)
98{
99 WCHAR Buffer[100];
100 HRESULT hr;
101 IPin * pPin = NULL;
103
104 // store pin id
105 swprintf(Buffer, L"%u", PinId);
106
107 // try find target pin
108 hr = pFilter->FindPin(Buffer, &pPin);
109
110 if (FAILED(hr))
111 {
112#ifdef BDAPLGIN_TRACE
113 swprintf(Buffer, L"CControlNode_fnConstructor failed find pin %lu with %lx\n", PinId, hr);
115#endif
116 return hr;
117 }
118
119 // query for IKsPropertySet interface
121 if (FAILED(hr))
122 return hr;
123
124#ifdef BDAPLGIN_TRACE
125 swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr);
127#endif
128
129 // release IPin interface
130 pPin->Release();
131
132 // construct device control
134
135#ifdef BDAPLGIN_TRACE
136 OutputDebugStringW(L"CControlNode_fnConstructor\n");
137#endif
138
139 if (!handler)
140 return E_OUTOFMEMORY;
141
142 if (FAILED(handler->QueryInterface(riid, ppv)))
143 {
144 /* not supported */
145 delete handler;
146 return E_NOINTERFACE;
147 }
148
149 return NOERROR;
150}
NodeType
Definition: Node.h:6
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define STDMETHODIMP
Definition: basetyps.h:43
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
ULONG m_NodeType
Definition: controlnode.cpp:43
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: controlnode.cpp:49
STDMETHODIMP_(ULONG) AddRef()
Definition: controlnode.cpp:21
CControlNode(IKsPropertySet *pProperty, ULONG NodeType, ULONG PinId)
Definition: controlnode.cpp:37
IKsPropertySet * m_pKsProperty
Definition: controlnode.cpp:42
STDMETHODIMP_(ULONG) Release()
Definition: controlnode.cpp:26
virtual ~CControlNode()
Definition: controlnode.cpp:38
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
HRESULT WINAPI CControlNode_fnConstructor(IBaseFilter *pFilter, ULONG NodeType, ULONG PinId, REFIID riid, LPVOID *ppv)
Definition: controlnode.cpp:92
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const GUID IID_IBDA_DigitalDemodulator
Definition: digitaldemo.cpp:13
HRESULT WINAPI CBDADigitalDemodulator_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
#define NULL
Definition: types.h:112
HRESULT WINAPI CBDASignalStatistics_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
#define MAX_PATH
Definition: compat.h:34
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define swprintf
Definition: precomp.h:40
HRESULT WINAPI CBDAFrequencyFilter_fnConstructor(IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
const GUID IID_IBDA_FrequencyFilter
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 FindPin([in, string] LPCWSTR Id, [out] IPin **ppPin)
Definition: axcore.idl:92
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
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
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
const GUID IID_IBDA_SignalStatistics
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
_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