Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS BDA Proxy * FILE: dll/directx/msvidctl/enumtuningspaces.cpp * PURPOSE: ITuningSpace interface * * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) */#include "precomp.h"
class CEnumTuningSpaces : public IEnumTuningSpaces{public: STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef() { InterlockedIncrement(&m_Ref); return m_Ref; } STDMETHODIMP_(ULONG) Release() { InterlockedDecrement(&m_Ref); if (!m_Ref) { //delete this; return 0; } return m_Ref; }
// IEnumTuningSpaces methods HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched); HRESULT STDMETHODCALLTYPE Skip(ULONG celt); HRESULT STDMETHODCALLTYPE Reset(); HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum);
CEnumTuningSpaces() : m_Ref(0){};
virtual ~CEnumTuningSpaces(){};
protected: LONG m_Ref;};
HRESULTSTDMETHODCALLTYPECEnumTuningSpaces::QueryInterface( IN REFIID refiid, OUT PVOID* Output){ if (IsEqualGUID(refiid, IID_IUnknown)) { *Output = PVOID(this); reinterpret_cast<IUnknown*>(*Output)->AddRef(); return NOERROR; }
if (IsEqualGUID(refiid, IID_IEnumTuningSpaces)) { *Output = (IEnumTuningSpaces*)this; reinterpret_cast<IEnumTuningSpaces*>(*Output)->AddRef(); return NOERROR; }
WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(refiid, &lpstr); swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr);
return E_NOINTERFACE;}
//-------------------------------------------------------------------// IEnumTuningSpaces//HRESULTSTDMETHODCALLTYPECEnumTuningSpaces::Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched){ OutputDebugStringW(L"CEnumTuningSpaces::Next : stub\n"); return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)rgelt);
}
HRESULTSTDMETHODCALLTYPECEnumTuningSpaces::Skip(ULONG celt){ OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n"); return E_NOTIMPL;}
HRESULTSTDMETHODCALLTYPECEnumTuningSpaces::Reset(){ OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n"); return E_NOTIMPL;}
HRESULTSTDMETHODCALLTYPECEnumTuningSpaces::Clone(IEnumTuningSpaces **ppEnum){ OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n"); return E_NOTIMPL;}
HRESULTWINAPICEnumTuningSpaces_fnConstructor( IUnknown *pUnknown, REFIID riid, LPVOID * ppv){ // construct device control CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces();
#ifdef MSVIDCTL_TRACE WCHAR Buffer[MAX_PATH]; LPOLESTR lpstr; StringFromCLSID(riid, &lpstr); swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); OutputDebugStringW(Buffer);#endif
if (!tuningspaces) return E_OUTOFMEMORY;
if (FAILED(tuningspaces->QueryInterface(riid, ppv))) { /* not supported */ delete tuningspaces; return E_NOINTERFACE; }
return NOERROR;}