ReactOS 0.4.15-dev-7089-gea8a49d
tunerequest.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/msvidctl/tunerequest.cpp
5 * PURPOSE: ITuningRequest interface
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9#include "precomp.h"
10
12{
13public:
15
17 {
19 return m_Ref;
20 }
22 {
24 if (!m_Ref)
25 {
26 OutputDebugStringW(L"CTuneRequest::Release : delete\n");
27
28 WCHAR Buffer[100];
29 swprintf(Buffer, L"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace);
31
32
34 //delete this;
35 return 0;
36 }
37 return m_Ref;
38 }
39
40 //IDispatch methods
42 HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
43 HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
44 HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
45
46 //ITuneRequest methods
52
53 //IDVBTuneRequest methods
60
61 CTuneRequest(ITuningSpace * TuningSpace) : m_Ref(0), m_ONID(-1), m_TSID(-1), m_SID(-1), m_Locator(0), m_TuningSpace(TuningSpace)
62 {
64 };
65
66 CTuneRequest(ITuningSpace * TuningSpace, LONG ONID, LONG TSID, LONG SID, ILocator * Locator) : m_Ref(1), m_ONID(ONID), m_TSID(TSID), m_SID(SID), m_Locator(Locator), m_TuningSpace(TuningSpace)
67 {
68 if (m_Locator)
70
72 };
73
74 virtual ~CTuneRequest(){};
75
76protected:
83};
84
85
89 IN REFIID refiid,
91{
92 if (IsEqualGUID(refiid, IID_IUnknown))
93 {
94 *Output = PVOID(this);
95 reinterpret_cast<IUnknown*>(*Output)->AddRef();
96 return NOERROR;
97 }
98
99 if (IsEqualGUID(refiid, IID_ITuneRequest))
100 {
101 *Output = (ITuneRequest*)this;
102 reinterpret_cast<ITuneRequest*>(*Output)->AddRef();
103 return NOERROR;
104 }
105
106 if (IsEqualGUID(refiid, IID_IDVBTuneRequest))
107 {
108 *Output = (IDVBTuneRequest*)this;
109 reinterpret_cast<IDVBTuneRequest*>(*Output)->AddRef();
110 return NOERROR;
111 }
112
115 StringFromCLSID(refiid, &lpstr);
116 swprintf(Buffer, L"CTuneRequest::QueryInterface: NoInterface for %s", lpstr);
119
120
121 return E_NOINTERFACE;
122}
123
124//-------------------------------------------------------------------
125// IDispatch methods
126//
130{
131 OutputDebugStringW(L"CTuneRequest::GetTypeInfoCount : NotImplemented\n");
132 return E_NOTIMPL;
133}
134
138{
139 OutputDebugStringW(L"CTuneRequest::GetTypeInfo : NotImplemented\n");
140 return E_NOTIMPL;
141}
144CTuneRequest::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
145{
146 OutputDebugStringW(L"CTuneRequest::GetIDsOfNames : NotImplemented\n");
147 return E_NOTIMPL;
148}
151CTuneRequest::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
152{
153 OutputDebugStringW(L"CTuneRequest::Invoke : NotImplemented\n");
154 return E_NOTIMPL;
155}
156
157//-------------------------------------------------------------------
158// ITuneRequest interface
159//
160
164{
165#ifdef MSVIDCTL_TRACE
166 OutputDebugStringW(L"CTuneRequest::get_TuningSpace\n");
167#endif
168
169 *TuningSpace = m_TuningSpace;
171
172 return S_OK;
173}
174
178{
179 OutputDebugStringW(L"CTuneRequest::get_Components : NotImplemented\n");
180 return E_NOTIMPL;
181}
182
186{
187#ifdef MSVIDCTL_TRACE
188 WCHAR Buffer[100];
189 swprintf(Buffer, L"CTuneRequest::Clone %p\n", NewTuneRequest);
191#endif
192
193 *NewTuneRequest = new CTuneRequest(m_TuningSpace, m_ONID, m_TSID, m_SID, m_Locator);
194
195 if (!*NewTuneRequest)
196 return E_OUTOFMEMORY;
197
198 return S_OK;
199}
200
204{
205 OutputDebugStringW(L"CTuneRequest::get_Locator : NotImplemented\n");
206 return E_NOTIMPL;
207}
208
212{
213 OutputDebugStringW(L"CTuneRequest::put_Locator : stub\n");
214 m_Locator = Locator;
215
216 return S_OK;
217}
218
219//-------------------------------------------------------------------
220// IDVBTuneRequest interface
221//
222
226{
227#ifdef MSVIDCTL_TRACE
228 OutputDebugStringW(L"CTuneRequest::get_ONID\n");
229#endif
230
231 *ONID = m_ONID;
232 return S_OK;
233}
234
238{
239#ifdef MSVIDCTL_TRACE
240 WCHAR Buffer[100];
241 swprintf(Buffer, L"CTuneRequest::put_ONID : %lu\n", ONID);
243#endif
244
245 m_ONID = ONID;
246 return S_OK;
247}
248
252{
253#ifdef MSVIDCTL_TRACE
254 OutputDebugStringW(L"CTuneRequest::get_TSID\n");
255#endif
256
257 *TSID = m_TSID;
258 return S_OK;
259}
260
264{
265#ifdef MSVIDCTL_TRACE
266 WCHAR Buffer[100];
267 swprintf(Buffer, L"CTuneRequest::put_TSID : %lu\n", TSID);
269#endif
270
271 m_TSID = TSID;
272 return S_OK;
273}
274
278{
279#ifdef MSVIDCTL_TRACE
280 OutputDebugStringW(L"CTuneRequest::get_SID\n");
281#endif
282
283 *SID = m_SID;
284 return S_OK;
285}
286
290{
291#ifdef MSVIDCTL_TRACE
292 WCHAR Buffer[100];
293 swprintf(Buffer, L"CTuneRequest::put_SID : %lu\n", SID);
295#endif
296
297 m_SID = SID;
298 return S_OK;
299}
300
302WINAPI
305 ITuningSpace * TuningSpace,
306 REFIID riid,
307 LPVOID * ppv)
308{
309 // construct device control
310 CTuneRequest * request = new CTuneRequest(TuningSpace);
311
312#ifdef MSVIDCTL_TRACE
316 swprintf(Buffer, L"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
318#endif
319
320 if (!request)
321 return E_OUTOFMEMORY;
322
323 if (FAILED(request->QueryInterface(riid, ppv)))
324 {
325 /* not supported */
326 delete request;
327 return E_NOINTERFACE;
328 }
329
330 return NOERROR;
331}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
_In_ BOOLEAN Release
Definition: cdrom.h:920
Definition: bufpool.h:45
CTuneRequest(ITuningSpace *TuningSpace)
Definition: tunerequest.cpp:61
HRESULT STDMETHODCALLTYPE get_TuningSpace(ITuningSpace **TuningSpace)
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
ITuningSpace * m_TuningSpace
Definition: tunerequest.cpp:82
HRESULT STDMETHODCALLTYPE get_SID(long *SID)
CTuneRequest(ITuningSpace *TuningSpace, LONG ONID, LONG TSID, LONG SID, ILocator *Locator)
Definition: tunerequest.cpp:66
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
ILocator * m_Locator
Definition: tunerequest.cpp:81
STDMETHODIMP_(ULONG) AddRef()
Definition: tunerequest.cpp:16
HRESULT STDMETHODCALLTYPE get_Locator(ILocator **Locator)
HRESULT STDMETHODCALLTYPE get_Components(IComponents **Components)
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
HRESULT STDMETHODCALLTYPE put_SID(long SID)
HRESULT STDMETHODCALLTYPE get_TSID(long *TSID)
HRESULT STDMETHODCALLTYPE put_Locator(ILocator *Locator)
HRESULT STDMETHODCALLTYPE get_ONID(long *ONID)
virtual ~CTuneRequest()
Definition: tunerequest.cpp:74
HRESULT STDMETHODCALLTYPE put_ONID(long ONID)
HRESULT STDMETHODCALLTYPE put_TSID(long TSID)
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: tunerequest.cpp:88
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
HRESULT STDMETHODCALLTYPE Clone(ITuneRequest **NewTuneRequest)
STDMETHODIMP_(ULONG) Release()
Definition: tunerequest.cpp:21
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
#define swprintf
Definition: precomp.h:40
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
unsigned short WORD
Definition: ntddk_ex.h:93
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
ULONG AddRef()
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static LPCSTR lpstr
Definition: font.c:51
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
struct _SID SID
unsigned int UINT
Definition: ndis.h:50
#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
DWORD LCID
Definition: nls.h:13
@ Output
Definition: arc.h:85
Definition: tftpd.h:86
HRESULT WINAPI CTuneRequest_fnConstructor(IUnknown *pUnknown, ITuningSpace *TuningSpace, REFIID riid, LPVOID *ppv)
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
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#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