ReactOS 0.4.16-dev-334-g4d9f67c
CEnumMediaTypes Class Reference
Inheritance diagram for CEnumMediaTypes:
Collaboration diagram for CEnumMediaTypes:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
HRESULT STDMETHODCALLTYPE Next (ULONG cMediaTypes, AM_MEDIA_TYPE **ppMediaTypes, ULONG *pcFetched)
 
HRESULT STDMETHODCALLTYPE Skip (ULONG cMediaTypes)
 
HRESULT STDMETHODCALLTYPE Reset ()
 
HRESULT STDMETHODCALLTYPE Clone (IEnumMediaTypes **ppEnum)
 
 CEnumMediaTypes (ULONG MediaTypeCount, AM_MEDIA_TYPE *MediaTypes)
 
virtual ~CEnumMediaTypes ()
 
STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
HRESULT STDMETHODCALLTYPE Next (ULONG cMediaTypes, AM_MEDIA_TYPE **ppMediaTypes, ULONG *pcFetched)
 
HRESULT STDMETHODCALLTYPE Skip (ULONG cMediaTypes)
 
HRESULT STDMETHODCALLTYPE Reset ()
 
HRESULT STDMETHODCALLTYPE Clone (IEnumMediaTypes **ppEnum)
 
 CEnumMediaTypes (ULONG MediaTypeCount, AM_MEDIA_TYPE *MediaTypes)
 
virtual ~CEnumMediaTypes ()
 
- Public Member Functions inherited from IEnumMediaTypes
HRESULT Next ([in] ULONG cMediaTypes, [out, size_is(cMediaTypes)] AM_MEDIA_TYPE **ppMediaTypes, [out] ULONG *pcFetched)
 
HRESULT Skip ([in] ULONG cMediaTypes)
 
HRESULT Reset (void)
 
HRESULT Clone ([out] IEnumMediaTypes **ppEnum)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Protected Attributes

LONG m_Ref
 
ULONG m_MediaTypeCount
 
AM_MEDIA_TYPEm_MediaTypes
 
ULONG m_Index
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 11 of file enum_mediatypes.cpp.

Constructor & Destructor Documentation

◆ CEnumMediaTypes() [1/2]

CEnumMediaTypes::CEnumMediaTypes ( ULONG  MediaTypeCount,
AM_MEDIA_TYPE MediaTypes 
)
inline

Definition at line 38 of file enum_mediatypes.cpp.

38: m_Ref(0), m_MediaTypeCount(MediaTypeCount), m_MediaTypes(MediaTypes), m_Index(0){};
AM_MEDIA_TYPE * m_MediaTypes

◆ ~CEnumMediaTypes() [1/2]

virtual CEnumMediaTypes::~CEnumMediaTypes ( )
inlinevirtual

Definition at line 39 of file enum_mediatypes.cpp.

39{};

◆ CEnumMediaTypes() [2/2]

CEnumMediaTypes::CEnumMediaTypes ( ULONG  MediaTypeCount,
AM_MEDIA_TYPE MediaTypes 
)
inline

Definition at line 38 of file enum_mediatypes.cpp.

38: m_Ref(0), m_MediaTypeCount(MediaTypeCount), m_MediaTypes(MediaTypes), m_Index(0){};

◆ ~CEnumMediaTypes() [2/2]

virtual CEnumMediaTypes::~CEnumMediaTypes ( )
inlinevirtual

Definition at line 39 of file enum_mediatypes.cpp.

39{};

Member Function Documentation

◆ Clone() [1/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Clone ( IEnumMediaTypes **  ppEnum)

Implements IEnumMediaTypes.

Definition at line 164 of file enum_mediatypes.cpp.

166{
167#ifdef KSPROXY_TRACE
168 OutputDebugStringW(L"CEnumMediaTypes::Clone : NotImplemented\n");
169#endif
170 return E_NOTIMPL;
171}
#define E_NOTIMPL
Definition: ddrawi.h:99
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define L(x)
Definition: ntvdm.h:50

◆ Clone() [2/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Clone ( IEnumMediaTypes **  ppEnum)

Implements IEnumMediaTypes.

◆ Next() [1/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Next ( ULONG  cMediaTypes,
AM_MEDIA_TYPE **  ppMediaTypes,
ULONG pcFetched 
)

Definition at line 76 of file enum_mediatypes.cpp.

80{
81 ULONG i = 0;
82 AM_MEDIA_TYPE * MediaType;
83
84 if (!ppMediaTypes)
85 return E_POINTER;
86
87 if (cMediaTypes > 1 && !pcFetched)
88 return E_INVALIDARG;
89
90 while(i < cMediaTypes)
91 {
92 if (m_Index + i >= m_MediaTypeCount)
93 break;
94
95 MediaType = (AM_MEDIA_TYPE*)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
96 if (!MediaType)
97 break;
98
99 if (m_MediaTypes[m_Index + i].cbFormat)
100 {
101 LPBYTE pFormat = (LPBYTE)CoTaskMemAlloc(m_MediaTypes[m_Index + i].cbFormat);
102 if (!pFormat)
103 {
104 CoTaskMemFree(MediaType);
105 break;
106 }
107
108 CopyMemory(MediaType, &m_MediaTypes[m_Index + i], sizeof(AM_MEDIA_TYPE));
109 MediaType->pbFormat = pFormat;
110 CopyMemory(MediaType->pbFormat, m_MediaTypes[m_Index + i].pbFormat, m_MediaTypes[m_Index + i].cbFormat);
111 MediaType->pUnk = (IUnknown *)this;
112 MediaType->pUnk->AddRef();
113 }
114 else
115 {
116 CopyMemory(MediaType, &m_MediaTypes[m_Index + i], sizeof(AM_MEDIA_TYPE));
117 }
118
119 if (MediaType->pUnk)
120 {
121 MediaType->pUnk->AddRef();
122 }
123
124 ppMediaTypes[i] = MediaType;
125 i++;
126 }
127
128 if (pcFetched)
129 {
130 *pcFetched = i;
131 }
132
133 m_Index += i;
134 if (i < cMediaTypes)
135 return S_FALSE;
136 else
137 return S_OK;
138}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define S_OK
Definition: intsafe.h:52
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define CopyMemory
Definition: winbase.h:1735
#define S_FALSE
Definition: winerror.h:2357
#define E_POINTER
Definition: winerror.h:2365

◆ Next() [2/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Next ( ULONG  cMediaTypes,
AM_MEDIA_TYPE **  ppMediaTypes,
ULONG pcFetched 
)

◆ QueryInterface() [1/2]

STDMETHODIMP CEnumMediaTypes::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

◆ QueryInterface() [2/2]

STDMETHODIMP CEnumMediaTypes::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

◆ Reset() [1/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Reset ( void  )

Implements IEnumMediaTypes.

Definition at line 156 of file enum_mediatypes.cpp.

157{
158 m_Index = 0;
159 return S_OK;
160}

◆ Reset() [2/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Reset ( )

Implements IEnumMediaTypes.

◆ Skip() [1/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Skip ( ULONG  cMediaTypes)

Implements IEnumMediaTypes.

Definition at line 142 of file enum_mediatypes.cpp.

144{
145 if (cMediaTypes + m_Index >= m_MediaTypeCount)
146 {
147 return S_FALSE;
148 }
149
150 m_Index += cMediaTypes;
151 return S_OK;
152}

◆ Skip() [2/2]

HRESULT STDMETHODCALLTYPE CEnumMediaTypes::Skip ( ULONG  cMediaTypes)

Implements IEnumMediaTypes.

◆ STDMETHODIMP_() [1/4]

CEnumMediaTypes::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 16 of file enum_mediatypes.cpp.

17 {
19 return m_Ref;
20 }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/4]

CEnumMediaTypes::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 16 of file enum_mediatypes.cpp.

17 {
19 return m_Ref;
20 }

◆ STDMETHODIMP_() [3/4]

CEnumMediaTypes::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 21 of file enum_mediatypes.cpp.

22 {
24 if (!m_Ref)
25 {
26 delete this;
27 return 0;
28 }
29 return m_Ref;
30 }
#define InterlockedDecrement
Definition: armddk.h:52

◆ STDMETHODIMP_() [4/4]

CEnumMediaTypes::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 21 of file enum_mediatypes.cpp.

22 {
24 if (!m_Ref)
25 {
26 delete this;
27 return 0;
28 }
29 return m_Ref;
30 }

Member Data Documentation

◆ m_Index

ULONG CEnumMediaTypes::m_Index
protected

Definition at line 45 of file enum_mediatypes.cpp.

Referenced by Next(), Reset(), and Skip().

◆ m_MediaTypeCount

ULONG CEnumMediaTypes::m_MediaTypeCount
protected

Definition at line 43 of file enum_mediatypes.cpp.

Referenced by Next(), and Skip().

◆ m_MediaTypes

AM_MEDIA_TYPE * CEnumMediaTypes::m_MediaTypes
protected

Definition at line 44 of file enum_mediatypes.cpp.

Referenced by Next().

◆ m_Ref

LONG CEnumMediaTypes::m_Ref
protected

Definition at line 42 of file enum_mediatypes.cpp.

Referenced by STDMETHODIMP_().


The documentation for this class was generated from the following files: