ReactOS  0.4.15-dev-344-g6808e40
tuningspace_container.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/tuningspace_container.cpp
5  * PURPOSE: ITuningSpaceContainer interface
6  *
7  * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8  */
9 #define _FORCENAMELESSUNION
10 #include "precomp.h"
11 
12 
14 {
15 public:
16 
18 
20  {
22  return m_Ref;
23  }
25  {
27  if (!m_Ref)
28  {
29  OutputDebugStringW(L"CTuningSpaceContainer::Release : delete\n");
30  //delete this;
31  return 0;
32  }
33  return m_Ref;
34  }
35 
36  // IDispatch methods
38  HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
39  HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
40  HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
41 
42  //ITuningSpaceContainer methods
45  HRESULT STDMETHODCALLTYPE get_Item(VARIANT varIndex, ITuningSpace **TuningSpace);
46  HRESULT STDMETHODCALLTYPE put_Item(VARIANT varIndex, ITuningSpace *TuningSpace);
50  HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID);
51  HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex);
54  HRESULT STDMETHODCALLTYPE get_MaxCount(long *MaxCount);
55  HRESULT STDMETHODCALLTYPE put_MaxCount(long MaxCount);
56 
58 
60 
61 protected:
62  LONG m_Ref;
63 
64 };
65 
66 HRESULT
69  IN REFIID refiid,
70  OUT PVOID* Output)
71 {
72  if (IsEqualGUID(refiid, IID_IUnknown))
73  {
74  *Output = PVOID(this);
75  reinterpret_cast<IUnknown*>(*Output)->AddRef();
76  return NOERROR;
77  }
78 
79  if (IsEqualGUID(refiid, IID_ITuningSpaceContainer))
80  {
81  *Output = (ITuningSpaceContainer*)this;
82  reinterpret_cast<ITuningSpaceContainer*>(*Output)->AddRef();
83  return NOERROR;
84  }
85 
88  StringFromCLSID(refiid, &lpstr);
89  swprintf(Buffer, L"CTuningSpaceContainer::QueryInterface: NoInterface for %s", lpstr);
92 
93 
94  return E_NOINTERFACE;
95 }
96 
97 //-------------------------------------------------------------------
98 // IDispatch methods
99 //
100 HRESULT
103 {
104  OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfoCount : NotImplemented\n");
105  return E_NOTIMPL;
106 }
107 
108 HRESULT
111 {
112  OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfo : NotImplemented\n");
113  return E_NOTIMPL;
114 }
115 HRESULT
118 {
119  OutputDebugStringW(L"CTuningSpaceContainer::GetIDsOfNames : NotImplemented\n");
120  return E_NOTIMPL;
121 }
122 HRESULT
124 CTuningSpaceContainer::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
125 {
126  OutputDebugStringW(L"CTuningSpaceContainer::Invoke : NotImplemented\n");
127  return E_NOTIMPL;
128 }
129 
130 //-------------------------------------------------------------------
131 // ITuningSpaceContainer methods
132 //
133 
134 HRESULT
137 {
138  OutputDebugStringW(L"CTuningSpaceContainer::get_Count : NotImplemented\n");
139  return E_NOTIMPL;
140 }
141 HRESULT
144 {
145  OutputDebugStringW(L"CTuningSpaceContainer::get__NewEnum : NotImplemented\n");
146  return E_NOTIMPL;
147 }
148 
149 HRESULT
152 {
153 #ifdef MSVIDCTL_TRACE
154  WCHAR Buffer[100];
155  swprintf(Buffer, L"CTuningSpaceContainer::get_Item : type %x value %s stub\n", varIndex.vt, varIndex.bstrVal);
157 #endif
158 
159  return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)TuningSpace);
160 }
161 HRESULT
164 {
165  OutputDebugStringW(L"CTuningSpaceContainer::put_Item : NotImplemented\n");
166  return E_NOTIMPL;
167 }
168 
169 HRESULT
172 {
173  OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForCLSID : NotImplemented\n");
174  return E_NOTIMPL;
175 }
176 HRESULT
179 {
180  OutputDebugStringW(L"CTuningSpaceContainer::_TuningSpacesForCLSID : NotImplemented\n");
181  return E_NOTIMPL;
182 }
183 
184 HRESULT
187 {
188  OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForName : NotImplemented\n");
189  return E_NOTIMPL;
190 }
191 
192 HRESULT
195 {
196  OutputDebugStringW(L"CTuningSpaceContainer::FindID : NotImplemented\n");
197  return E_NOTIMPL;
198 }
199 
200 HRESULT
203 {
204  OutputDebugStringW(L"CTuningSpaceContainer::Add : stub\n");
205  TuningSpace->AddRef();
206  NewIndex->vt = VT_BSTR;
208  return TuningSpace->get_FriendlyName(&NewIndex->bstrVal);;
209 }
210 HRESULT
213 {
214  OutputDebugStringW(L"CTuningSpaceContainer::get_EnumTuningSpaces : stub\n");
215  return CEnumTuningSpaces_fnConstructor(NULL, IID_IEnumTuningSpaces, (void**)ppEnum);
216 }
217 
218 HRESULT
221 {
222  OutputDebugStringW(L"CTuningSpaceContainer::Remove: NotImplemented\n");
223  return E_NOTIMPL;
224 }
225 
226 HRESULT
229 {
230  OutputDebugStringW(L"CTuningSpaceContainer::get_MaxCount : NotImplemented\n");
231  return E_NOTIMPL;
232 }
233 
234 HRESULT
237 {
238  OutputDebugStringW(L"CTuningSpaceContainer::put_MaxCount : NotImplemented\n");
239  return E_NOTIMPL;
240 }
241 
242 
243 HRESULT
244 WINAPI
247  REFIID riid,
248  LPVOID * ppv)
249 {
250  // construct device control
251  CTuningSpaceContainer * provider = new CTuningSpaceContainer();
252 
253 #ifdef MSVIDCTL_TRACE
255  LPOLESTR lpstr;
257  swprintf(Buffer, L"CTuningSpaceContainer_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
259 #endif
260 
261  if (!provider)
262  return E_OUTOFMEMORY;
263 
264  if (FAILED(provider->QueryInterface(riid, ppv)))
265  {
266  /* not supported */
267  delete provider;
268  return E_NOINTERFACE;
269  }
270 
271  return NOERROR;
272 }
#define IN
Definition: typedefs.h:39
HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl)
#define REFIID
Definition: guiddef.h:118
HRESULT STDMETHODCALLTYPE put_MaxCount(long MaxCount)
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT STDMETHODCALLTYPE get_Item(VARIANT varIndex, ITuningSpace **TuningSpace)
HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
REFIID LPVOID * ppv
Definition: atlbase.h:39
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1943
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
static LPOLESTR
Definition: stg_prop.c:27
HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl)
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
long LONG
Definition: pedump.c:60
#define STDMETHODIMP
Definition: basetyps.h:43
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
HRESULT STDMETHODCALLTYPE get__NewEnum(IEnumVARIANT **NewEnum)
HRESULT STDMETHODCALLTYPE get_Count(long *Count)
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
HRESULT WINAPI CTuningSpaceContainer_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
_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:78
const GUID IID_IUnknown
HRESULT WINAPI CEnumTuningSpaces_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:6
static const UCHAR Index[8]
Definition: usbohci.c:18
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned short WORD
Definition: ntddk_ex.h:93
ULONG AddRef()
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
#define ID
Definition: ruserpass.c:36
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT get_FriendlyName([out] BSTR *Name)
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
VARTYPE vt
Definition: compat.h:2031
HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum)
HRESULT STDMETHODCALLTYPE TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl)
HRESULT STDMETHODCALLTYPE put_Item(VARIANT varIndex, ITuningSpace *TuningSpace)
#define OUT
Definition: typedefs.h:40
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
BSTR bstrVal
Definition: compat.h:2049
HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex)
HRESULT STDMETHODCALLTYPE Remove(VARIANT Index)
HRESULT WINAPI CTuningSpace_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
HRESULT STDMETHODCALLTYPE get_MaxCount(long *MaxCount)
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412