ReactOS 0.4.15-dev-7906-g1b85a5f
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{
15public:
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);
50 HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID);
51 HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex);
56
58
60
61protected:
63
64};
65
69 IN REFIID refiid,
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 {
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//
103{
104 OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfoCount : NotImplemented\n");
105 return E_NOTIMPL;
106}
107
111{
112 OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfo : NotImplemented\n");
113 return E_NOTIMPL;
114}
118{
119 OutputDebugStringW(L"CTuningSpaceContainer::GetIDsOfNames : NotImplemented\n");
120 return E_NOTIMPL;
121}
124CTuningSpaceContainer::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
137{
138 OutputDebugStringW(L"CTuningSpaceContainer::get_Count : NotImplemented\n");
139 return E_NOTIMPL;
140}
144{
145 OutputDebugStringW(L"CTuningSpaceContainer::get__NewEnum : NotImplemented\n");
146 return E_NOTIMPL;
147}
148
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}
164{
165 OutputDebugStringW(L"CTuningSpaceContainer::put_Item : NotImplemented\n");
166 return E_NOTIMPL;
167}
168
172{
173 OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForCLSID : NotImplemented\n");
174 return E_NOTIMPL;
175}
179{
180 OutputDebugStringW(L"CTuningSpaceContainer::_TuningSpacesForCLSID : NotImplemented\n");
181 return E_NOTIMPL;
182}
183
187{
188 OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForName : NotImplemented\n");
189 return E_NOTIMPL;
190}
191
195{
196 OutputDebugStringW(L"CTuningSpaceContainer::FindID : NotImplemented\n");
197 return E_NOTIMPL;
198}
199
203{
204 OutputDebugStringW(L"CTuningSpaceContainer::Add : stub\n");
205 TuningSpace->AddRef();
206 NewIndex->vt = VT_BSTR;
208 return TuningSpace->get_FriendlyName(&NewIndex->bstrVal);
209}
213{
214 OutputDebugStringW(L"CTuningSpaceContainer::get_EnumTuningSpaces : stub\n");
215 return CEnumTuningSpaces_fnConstructor(NULL, IID_IEnumTuningSpaces, (void**)ppEnum);
216}
217
221{
222 OutputDebugStringW(L"CTuningSpaceContainer::Remove: NotImplemented\n");
223 return E_NOTIMPL;
224}
225
229{
230 OutputDebugStringW(L"CTuningSpaceContainer::get_MaxCount : NotImplemented\n");
231 return E_NOTIMPL;
232}
233
237{
238 OutputDebugStringW(L"CTuningSpaceContainer::put_MaxCount : NotImplemented\n");
239 return E_NOTIMPL;
240}
241
242
244WINAPI
247 REFIID riid,
248 LPVOID * ppv)
249{
250 // construct device control
252
253#ifdef MSVIDCTL_TRACE
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 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
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum)
HRESULT STDMETHODCALLTYPE get__NewEnum(IEnumVARIANT **NewEnum)
HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex)
HRESULT STDMETHODCALLTYPE get_Count(long *Count)
HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl)
HRESULT STDMETHODCALLTYPE get_Item(VARIANT varIndex, ITuningSpace **TuningSpace)
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
HRESULT STDMETHODCALLTYPE Remove(VARIANT Index)
HRESULT STDMETHODCALLTYPE put_Item(VARIANT varIndex, ITuningSpace *TuningSpace)
HRESULT STDMETHODCALLTYPE get_MaxCount(long *MaxCount)
HRESULT STDMETHODCALLTYPE TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl)
HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID)
HRESULT STDMETHODCALLTYPE put_MaxCount(long MaxCount)
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl)
#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)
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
@ VT_BSTR
Definition: compat.h:2303
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)
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
HRESULT get_FriendlyName([out] BSTR *Name)
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
static VARIANTARG static DISPID
Definition: ordinal.c:52
unsigned int UINT
Definition: ndis.h:50
int Count
Definition: noreturn.cpp:7
#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
#define REFCLSID
Definition: guiddef.h:117
#define ID
Definition: ruserpass.c:36
DWORD LCID
Definition: nls.h:13
@ Output
Definition: arc.h:85
BSTR bstrVal
Definition: compat.h:2399
VARTYPE vt
Definition: compat.h:2381
HRESULT WINAPI CTuningSpaceContainer_fnConstructor(IUnknown *pUnknown, 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
_In_ WDFCOLLECTION _In_ ULONG Index
_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
_In_ BOOLEAN Remove
Definition: psfuncs.h:110
__wchar_t WCHAR
Definition: xmlstorage.h:180