Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenenumtuningspaces.cpp
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS BDA Proxy 00004 * FILE: dll/directx/msvidctl/tuningspace.cpp 00005 * PURPOSE: ITuningSpace interface 00006 * 00007 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) 00008 */ 00009 #include "precomp.h" 00010 00011 class CEnumTuningSpaces : public IEnumTuningSpaces 00012 { 00013 public: 00014 STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); 00015 00016 STDMETHODIMP_(ULONG) AddRef() 00017 { 00018 InterlockedIncrement(&m_Ref); 00019 return m_Ref; 00020 } 00021 STDMETHODIMP_(ULONG) Release() 00022 { 00023 InterlockedDecrement(&m_Ref); 00024 if (!m_Ref) 00025 { 00026 //delete this; 00027 return 0; 00028 } 00029 return m_Ref; 00030 } 00031 00032 // IEnumTuningSpaces methods 00033 HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched); 00034 HRESULT STDMETHODCALLTYPE Skip(ULONG celt); 00035 HRESULT STDMETHODCALLTYPE Reset(); 00036 HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum); 00037 00038 CEnumTuningSpaces() : m_Ref(0){}; 00039 00040 virtual ~CEnumTuningSpaces(){}; 00041 00042 protected: 00043 LONG m_Ref; 00044 }; 00045 00046 HRESULT 00047 STDMETHODCALLTYPE 00048 CEnumTuningSpaces::QueryInterface( 00049 IN REFIID refiid, 00050 OUT PVOID* Output) 00051 { 00052 if (IsEqualGUID(refiid, IID_IUnknown)) 00053 { 00054 *Output = PVOID(this); 00055 reinterpret_cast<IUnknown*>(*Output)->AddRef(); 00056 return NOERROR; 00057 } 00058 00059 if (IsEqualGUID(refiid, IID_IEnumTuningSpaces)) 00060 { 00061 *Output = (IEnumTuningSpaces*)this; 00062 reinterpret_cast<IEnumTuningSpaces*>(*Output)->AddRef(); 00063 return NOERROR; 00064 } 00065 00066 WCHAR Buffer[MAX_PATH]; 00067 LPOLESTR lpstr; 00068 StringFromCLSID(refiid, &lpstr); 00069 swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr); 00070 OutputDebugStringW(Buffer); 00071 CoTaskMemFree(lpstr); 00072 00073 return E_NOINTERFACE; 00074 } 00075 00076 //------------------------------------------------------------------- 00077 // IEnumTuningSpaces 00078 // 00079 HRESULT 00080 STDMETHODCALLTYPE 00081 CEnumTuningSpaces::Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched) 00082 { 00083 OutputDebugStringW(L"CEnumTuningSpaces::Next : stub\n"); 00084 return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)rgelt); 00085 00086 } 00087 00088 HRESULT 00089 STDMETHODCALLTYPE 00090 CEnumTuningSpaces::Skip(ULONG celt) 00091 { 00092 OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n"); 00093 return E_NOTIMPL; 00094 } 00095 00096 HRESULT 00097 STDMETHODCALLTYPE 00098 CEnumTuningSpaces::Reset() 00099 { 00100 OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n"); 00101 return E_NOTIMPL; 00102 } 00103 00104 HRESULT 00105 STDMETHODCALLTYPE 00106 CEnumTuningSpaces::Clone(IEnumTuningSpaces **ppEnum) 00107 { 00108 OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n"); 00109 return E_NOTIMPL; 00110 } 00111 00112 HRESULT 00113 WINAPI 00114 CEnumTuningSpaces_fnConstructor( 00115 IUnknown *pUnknown, 00116 REFIID riid, 00117 LPVOID * ppv) 00118 { 00119 // construct device control 00120 CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces(); 00121 00122 #ifdef MSVIDCTL_TRACE 00123 WCHAR Buffer[MAX_PATH]; 00124 LPOLESTR lpstr; 00125 StringFromCLSID(riid, &lpstr); 00126 swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); 00127 OutputDebugStringW(Buffer); 00128 #endif 00129 00130 if (!tuningspaces) 00131 return E_OUTOFMEMORY; 00132 00133 if (FAILED(tuningspaces->QueryInterface(riid, ppv))) 00134 { 00135 /* not supported */ 00136 delete tuningspaces; 00137 return E_NOINTERFACE; 00138 } 00139 00140 return NOERROR; 00141 } 00142 Generated on Mon May 28 2012 04:21:23 for ReactOS by
1.7.6.1
|