ReactOS  0.4.15-dev-1207-g698a8e6
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 {
13 public:
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 
42 protected:
43  LONG m_Ref;
44 };
45 
46 HRESULT
49  IN REFIID refiid,
50  OUT PVOID* Output)
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 //
79 HRESULT
81 CEnumTuningSpaces::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 
88 HRESULT
91 {
92  OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n");
93  return E_NOTIMPL;
94 }
95 
96 HRESULT
99 {
100  OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n");
101  return E_NOTIMPL;
102 }
103 
104 HRESULT
107 {
108  OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n");
109  return E_NOTIMPL;
110 }
111 
112 HRESULT
113 WINAPI
116  REFIID riid,
117  LPVOID * ppv)
118 {
119  // construct device control
120  CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces();
121 
122 #ifdef MSVIDCTL_TRACE
124  LPOLESTR lpstr;
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 IN
Definition: typedefs.h:39
#define REFIID
Definition: guiddef.h:118
HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched)
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define NOERROR
Definition: winerror.h:2354
virtual ~CEnumTuningSpaces()
REFIID riid
Definition: precomp.h:44
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
HRESULT STDMETHODCALLTYPE Reset()
HRESULT STDMETHODCALLTYPE Skip(ULONG celt)
REFIID LPVOID * ppv
Definition: atlbase.h:39
STDMETHODIMP_(ULONG) Release()
static LPOLESTR
Definition: stg_prop.c:27
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define STDMETHODIMP
Definition: basetyps.h:43
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
HRESULT WINAPI CEnumTuningSpaces_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
#define MAX_PATH
Definition: compat.h:34
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
STDMETHODIMP_(ULONG) AddRef()
ULONG AddRef()
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum)
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
HRESULT WINAPI CTuningSpace_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412