ReactOS 0.4.15-dev-7934-g1dc8d80
enumtuningspaces.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/enumtuningspaces.cpp
5 * PURPOSE: ITuningSpace 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 //delete this;
27 return 0;
28 }
29 return m_Ref;
30 }
31
32 // IEnumTuningSpaces methods
33 HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched);
37
39
40 virtual ~CEnumTuningSpaces(){};
41
42protected:
44};
45
49 IN REFIID refiid,
51{
52 if (IsEqualGUID(refiid, IID_IUnknown))
53 {
54 *Output = PVOID(this);
55 reinterpret_cast<IUnknown*>(*Output)->AddRef();
56 return NOERROR;
57 }
58
59 if (IsEqualGUID(refiid, IID_IEnumTuningSpaces))
60 {
61 *Output = (IEnumTuningSpaces*)this;
62 reinterpret_cast<IEnumTuningSpaces*>(*Output)->AddRef();
63 return NOERROR;
64 }
65
68 StringFromCLSID(refiid, &lpstr);
69 swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr);
72
73 return E_NOINTERFACE;
74}
75
76//-------------------------------------------------------------------
77// IEnumTuningSpaces
78//
81CEnumTuningSpaces::Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched)
82{
83 OutputDebugStringW(L"CEnumTuningSpaces::Next : stub\n");
84 return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)rgelt);
85
86}
87
91{
92 OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n");
93 return E_NOTIMPL;
94}
95
99{
100 OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n");
101 return E_NOTIMPL;
102}
103
107{
108 OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n");
109 return E_NOTIMPL;
110}
111
113WINAPI
116 REFIID riid,
117 LPVOID * ppv)
118{
119 // construct device control
120 CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces();
121
122#ifdef MSVIDCTL_TRACE
126 swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
128#endif
129
130 if (!tuningspaces)
131 return E_OUTOFMEMORY;
132
133 if (FAILED(tuningspaces->QueryInterface(riid, ppv)))
134 {
135 /* not supported */
136 delete tuningspaces;
137 return E_NOINTERFACE;
138 }
139
140 return NOERROR;
141}
142
#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
Definition: bufpool.h:45
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
HRESULT STDMETHODCALLTYPE Skip(ULONG celt)
STDMETHODIMP_(ULONG) AddRef()
virtual ~CEnumTuningSpaces()
STDMETHODIMP_(ULONG) Release()
HRESULT STDMETHODCALLTYPE Reset()
HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched)
HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
HRESULT WINAPI CTuningSpace_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
#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
HRESULT WINAPI CEnumTuningSpaces_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
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 FAILED(hr)
Definition: intsafe.h:51
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
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