ReactOS  0.4.15-dev-1070-ge1a01de
tuningspace.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.cpp
5  * PURPOSE: ITuningSpace interface
6  *
7  * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8  */
9 #include "precomp.h"
10 
11 const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}};
12 
14 {
15 public:
17 
19  {
21  return m_Ref;
22  }
24  {
26 
27  WCHAR Buffer[100];
28  swprintf(Buffer, L"CTuningSpace::Release : %p Ref %lu\n", this, m_Ref);
30 
31  if (!m_Ref)
32  {
33  //delete this;
34  return 0;
35  }
36  return m_Ref;
37  }
38 
39  // IDispatch methods
41  HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
42  HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
43  HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
44 
45 
46  //ITuningSpace methods
66  // IDVBTuningSpace
69 
70  CTuningSpace() : m_Ref(0){};
71 
72  virtual ~CTuningSpace(){};
73 
74 protected:
75  LONG m_Ref;
76 };
77 
78 HRESULT
81  IN REFIID refiid,
82  OUT PVOID* Output)
83 {
84  if (IsEqualGUID(refiid, IID_IUnknown))
85  {
86  *Output = PVOID(this);
87  reinterpret_cast<IUnknown*>(*Output)->AddRef();
88  return NOERROR;
89  }
90 
91  if (IsEqualGUID(refiid, IID_ITuningSpace))
92  {
93  *Output = (ITuningSpace*)this;
94  reinterpret_cast<ITuningSpace*>(*Output)->AddRef();
95  return NOERROR;
96  }
97 
98  if (IsEqualGUID(refiid, IID_IDVBTuningSpace))
99  {
100  *Output = (IDVBTuningSpace*)this;
101  reinterpret_cast<IDVBTuningSpace*>(*Output)->AddRef();
102  return NOERROR;
103  }
104 
105 
107  LPOLESTR lpstr;
108  StringFromCLSID(refiid, &lpstr);
109  swprintf(Buffer, L"CTuningSpace::QueryInterface: NoInterface for %s", lpstr);
112 
113 
114  return E_NOINTERFACE;
115 }
116 
117 //-------------------------------------------------------------------
118 // IDispatch methods
119 //
120 HRESULT
123 {
124  OutputDebugStringW(L"CTuningSpace::GetTypeInfoCount : NotImplemented\n");
125  return E_NOTIMPL;
126 }
127 
128 HRESULT
131 {
132  OutputDebugStringW(L"CTuningSpace::GetTypeInfo : NotImplemented\n");
133  return E_NOTIMPL;
134 }
135 HRESULT
137 CTuningSpace::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
138 {
139  OutputDebugStringW(L"CTuningSpace::GetIDsOfNames : NotImplemented\n");
140  return E_NOTIMPL;
141 }
142 HRESULT
144 CTuningSpace::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
145 {
146  OutputDebugStringW(L"CTuningSpace::Invoke : NotImplemented\n");
147  return E_NOTIMPL;
148 }
149 
150 
151 //-------------------------------------------------------------------
152 // ITuningSpace interface
153 //
154 
155 HRESULT
158 {
159  OutputDebugStringW(L"CTuningSpace::get_UniqueName : NotImplemented\n");
160  return E_NOTIMPL;
161 }
162 
163 HRESULT
166 {
167  OutputDebugStringW(L"CTuningSpace::put_UniqueName : NotImplemented\n");
168  return E_NOTIMPL;
169 }
170 
171 HRESULT
174 {
175  OutputDebugStringW(L"CTuningSpace::get_FriendlyName : NotImplemented\n");
176  return E_NOTIMPL;
177 }
178 
179 HRESULT
182 {
183  OutputDebugStringW(L"CTuningSpace::put_FriendlyName : NotImplemented\n");
184  return E_NOTIMPL;
185 }
186 
187 HRESULT
190 {
191  OutputDebugStringW(L"CTuningSpace::get_CLSID : NotImplemented\n");
192  return E_NOTIMPL;
193 }
194 
195 HRESULT
198 {
199  OutputDebugStringW(L"CTuningSpace::get_NetworkType : stub\n");
200  return StringFromCLSID(CLSID_DVBTNetworkProvider, (LPOLESTR*)NetworkTypeGuid);
201 
202 }
203 
204 HRESULT
207 {
208  OutputDebugStringW(L"CTuningSpace::put_NetworkType : NotImplemented\n");
209  return E_NOTIMPL;
210 }
211 
212 HRESULT
215 {
216 #ifdef MSVIDCTL_TRACE
217  WCHAR Buffer[100];
218  swprintf(Buffer, L"CTuningSpace::get__NetworkType : %p stub\n", NetworkTypeGuid);
220 #endif
221 
222  CopyMemory(NetworkTypeGuid, &CLSID_DVBTNetworkProvider, sizeof(GUID));
223  OutputDebugStringW(L"CTuningSpace::get__NetworkType : done\n");
224  return S_OK;
225 }
226 
227 HRESULT
230 {
231  OutputDebugStringW(L"CTuningSpace::put__NetworkType : NotImplemented\n");
232  return E_NOTIMPL;
233 }
234 
235 HRESULT
238 {
239  OutputDebugStringW(L"CTuningSpace::CreateTuneRequest : stub\n");
240  return CTuneRequest_fnConstructor(NULL, (ITuningSpace*)this, IID_ITuneRequest, (void**)TuneRequest);
241 }
242 
243 HRESULT
246 {
247  OutputDebugStringW(L"CTuningSpace::EnumCategoryGUIDs : NotImplemented\n");
248  return E_NOTIMPL;
249 }
250 
251 HRESULT
254 {
255  OutputDebugStringW(L"CTuningSpace::EnumDeviceMonikers : NotImplemented\n");
256  return E_NOTIMPL;
257 }
258 
259 HRESULT
262 {
263  OutputDebugStringW(L"CTuningSpace::get_DefaultPreferredComponentTypes : NotImplemented\n");
264  return E_NOTIMPL;
265 }
266 
267 HRESULT
270 {
271  OutputDebugStringW(L"CTuningSpace::put_DefaultPreferredComponentTypes : NotImplemented\n");
272  return E_NOTIMPL;
273 }
274 
275 HRESULT
278 {
279  OutputDebugStringW(L"CTuningSpace::get_FrequencyMapping : NotImplemented\n");
280  return E_NOTIMPL;
281 }
282 
283 HRESULT
286 {
287  OutputDebugStringW(L"CTuningSpace::put_FrequencyMapping : NotImplemented\n");
288  return E_NOTIMPL;
289 }
290 
291 HRESULT
294 {
295  OutputDebugStringW(L"CTuningSpace::get_DefaultLocator : NotImplemented\n");
296  return E_NOTIMPL;
297 }
298 
299 HRESULT
302 {
303  OutputDebugStringW(L"CTuningSpace::put_DefaultLocator : NotImplemented\n");
304  return E_NOTIMPL;
305 }
306 
307 HRESULT
310 {
311  OutputDebugStringW(L"CTuningSpace::Clone : NotImplemented\n");
312  return E_NOTIMPL;
313 }
314 
315 //-------------------------------------------------------------------
316 // IDVBTuningSpace
317 //
318 HRESULT
321 {
322  OutputDebugStringW(L"CTuningSpace::get_SystemType : NotImplemented\n");
323  return E_NOTIMPL;
324 }
325 
326 HRESULT
329 {
330  OutputDebugStringW(L"CTuningSpace::put_SystemType : NotImplemented\n");
331  return E_NOTIMPL;
332 }
333 
334 HRESULT
335 WINAPI
338  REFIID riid,
339  LPVOID * ppv)
340 {
341  // construct device control
342  CTuningSpace * space = new CTuningSpace();
343 
344 #ifdef MSVIDCTL_TRACE
346  LPOLESTR lpstr;
348  swprintf(Buffer, L"CTuningSpace_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
350 #endif
351 
352  if (!space)
353  return E_OUTOFMEMORY;
354 
355  if (FAILED(space->QueryInterface(riid, ppv)))
356  {
357  /* not supported */
358  delete space;
359  return E_NOINTERFACE;
360  }
361 
362  return NOERROR;
363 }
364 
365 
HRESULT STDMETHODCALLTYPE get_SystemType(DVBSystemType *SysType)
#define IN
Definition: typedefs.h:39
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: tuningspace.cpp:80
#define REFIID
Definition: guiddef.h:118
virtual ~CTuningSpace()
Definition: tuningspace.cpp:72
STDMETHODIMP_(ULONG) Release()
Definition: tuningspace.cpp:23
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT STDMETHODCALLTYPE get_UniqueName(BSTR *Name)
HRESULT STDMETHODCALLTYPE put_DefaultLocator(ILocator *LocatorVal)
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
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
HRESULT STDMETHODCALLTYPE EnumDeviceMonikers(IEnumMoniker **ppEnum)
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT STDMETHODCALLTYPE get__NetworkType(GUID *NetworkTypeGuid)
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:2041
HRESULT WINAPI CTuneRequest_fnConstructor(IUnknown *pUnknown, ITuningSpace *TuningSpace, REFIID riid, LPVOID *ppv)
static LPOLESTR
Definition: stg_prop.c:27
HRESULT STDMETHODCALLTYPE put__NetworkType(REFCLSID NetworkTypeGuid)
HRESULT STDMETHODCALLTYPE put_UniqueName(BSTR Name)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE get_DefaultPreferredComponentTypes(IComponentTypes **ComponentTypes)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT STDMETHODCALLTYPE put_SystemType(DVBSystemType SysType)
long LONG
Definition: pedump.c:60
STDMETHODIMP_(ULONG) AddRef()
Definition: tuningspace.cpp:18
#define STDMETHODIMP
Definition: basetyps.h:43
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
HRESULT STDMETHODCALLTYPE put_DefaultPreferredComponentTypes(IComponentTypes *NewComponentTypes)
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
HRESULT STDMETHODCALLTYPE get_FriendlyName(BSTR *Name)
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
const GUID CLSID_DVBTNetworkProvider
Definition: tuningspace.cpp:11
__wchar_t WCHAR
Definition: xmlstorage.h:180
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
LONG HRESULT
Definition: typedefs.h:79
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:34
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:6
#define CopyMemory
Definition: winbase.h:1646
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned short WORD
Definition: ntddk_ex.h:93
ULONG AddRef()
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
DVBSystemType
Definition: bdatypes.h:162
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
static const WCHAR space[]
Definition: ConsoleCP.c:24
HRESULT STDMETHODCALLTYPE put_FriendlyName(BSTR Name)
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:51
static VARIANTARG static DISPID
Definition: ordinal.c:49
HRESULT STDMETHODCALLTYPE put_FrequencyMapping(BSTR Mapping)
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT STDMETHODCALLTYPE get_NetworkType(BSTR *NetworkTypeGuid)
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT STDMETHODCALLTYPE get_DefaultLocator(ILocator **LocatorVal)
HRESULT WINAPI CTuningSpace_fnConstructor(IUnknown *pUnknown, REFIID riid, LPVOID *ppv)
#define OUT
Definition: typedefs.h:40
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
HRESULT STDMETHODCALLTYPE put_NetworkType(BSTR NetworkTypeGuid)
HRESULT STDMETHODCALLTYPE get_FrequencyMapping(BSTR *pMapping)
HRESULT STDMETHODCALLTYPE CreateTuneRequest(ITuneRequest **TuneRequest)
HRESULT STDMETHODCALLTYPE get_CLSID(BSTR *SpaceCLSID)
HRESULT STDMETHODCALLTYPE Clone(ITuningSpace **NewTS)
HRESULT STDMETHODCALLTYPE EnumCategoryGUIDs(IEnumGUID **ppEnum)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412