ReactOS 0.4.16-dev-197-g92996da
IEnumFORMATETCImpl Class Reference
Inheritance diagram for IEnumFORMATETCImpl:
Collaboration diagram for IEnumFORMATETCImpl:

Public Member Functions

 IEnumFORMATETCImpl ()
 
 ~IEnumFORMATETCImpl ()
 
HRESULT WINAPI Initialize (UINT cfmt, const FORMATETC afmt[])
 
STDMETHOD() Next (ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed) override
 
STDMETHOD() Skip (ULONG celt) override
 
STDMETHOD() Reset () override
 
STDMETHOD() Clone (LPENUMFORMATETC *ppenum) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IEnumFORMATETC
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] FORMATETC *rgelt, [out] ULONG *pceltFetched)
 
HRESULT RemoteNext ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] FORMATETC *rgelt, [out] ULONG *pceltFetched)
 
HRESULT Skip ([in] ULONG celt)
 
HRESULT Reset ()
 
HRESULT Clone ([out] IEnumFORMATETC **ppenum)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

UINT posFmt
 
UINT countFmt
 
LPFORMATETC pFmt
 

Additional Inherited Members

- Public Types inherited from IEnumFORMATETC
typedef IEnumFORMATETCLPENUMFORMATETC
 
typedef struct IEnumFORMATETC::tagDVTARGETDEVICE DVTARGETDEVICE
 
typedef CLIPFORMAT * LPCLIPFORMAT
 
typedef struct IEnumFORMATETC::tagFORMATETC FORMATETC
 
typedef struct IEnumFORMATETC::tagFORMATETCLPFORMATETC
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 17 of file CIDLDataObj.cpp.

Constructor & Destructor Documentation

◆ IEnumFORMATETCImpl()

IEnumFORMATETCImpl::IEnumFORMATETCImpl ( )

Definition at line 41 of file CIDLDataObj.cpp.

42{
43 posFmt = 0;
44 countFmt = 0;
45 pFmt = NULL;
46}
LPFORMATETC pFmt
Definition: CIDLDataObj.cpp:24
#define NULL
Definition: types.h:112

◆ ~IEnumFORMATETCImpl()

IEnumFORMATETCImpl::~IEnumFORMATETCImpl ( )

Definition at line 48 of file CIDLDataObj.cpp.

49{
50}

Member Function Documentation

◆ Clone()

HRESULT WINAPI IEnumFORMATETCImpl::Clone ( LPENUMFORMATETC ppenum)
override

Definition at line 108 of file CIDLDataObj.cpp.

109{
110 HRESULT hResult;
111
112 TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
113
114 if (!ppenum) return E_INVALIDARG;
115 hResult = IEnumFORMATETC_Constructor(countFmt, pFmt, ppenum);
116 if (FAILED_UNEXPECTEDLY(hResult))
117 return hResult;
118 return (*ppenum)->Skip(posFmt);
119}
HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppFormat)
#define E_INVALIDARG
Definition: ddrawi.h:101
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define TRACE(s)
Definition: solgame.cpp:4

◆ Initialize()

HRESULT WINAPI IEnumFORMATETCImpl::Initialize ( UINT  cfmt,
const FORMATETC  afmt[] 
)

Definition at line 52 of file CIDLDataObj.cpp.

53{
54 DWORD size;
55
56 size = cfmt * sizeof(FORMATETC);
57 countFmt = cfmt;
59 if (pFmt == NULL)
60 return E_OUTOFMEMORY;
61
62 memcpy(pFmt, afmt, size);
63 return S_OK;
64}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
struct IEnumFORMATETC::tagFORMATETC * LPFORMATETC
struct IEnumFORMATETC::tagFORMATETC FORMATETC
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

◆ Next()

HRESULT WINAPI IEnumFORMATETCImpl::Next ( ULONG  celt,
FORMATETC rgelt,
ULONG pceltFethed 
)
override

Implements IEnumFORMATETC.

Definition at line 66 of file CIDLDataObj.cpp.

67{
68 UINT i;
69
70 TRACE("(%p)->(%u,%p)\n", this, celt, rgelt);
71
72 if (!pFmt)
73 return S_FALSE;
74 if (!rgelt)
75 return E_INVALIDARG;
76 if (pceltFethed)
77 *pceltFethed = 0;
78
79 for (i = 0; posFmt < countFmt && celt > i; i++)
80 {
81 *rgelt++ = pFmt[posFmt++];
82 }
83
84 if (pceltFethed)
85 *pceltFethed = i;
86
87 return ((i == celt) ? S_OK : S_FALSE);
88}
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
unsigned int UINT
Definition: ndis.h:50
#define S_FALSE
Definition: winerror.h:2357

◆ Reset()

HRESULT WINAPI IEnumFORMATETCImpl::Reset ( )
override

Implements IEnumFORMATETC.

Definition at line 100 of file CIDLDataObj.cpp.

101{
102 TRACE("(%p)->()\n", this);
103
104 posFmt = 0;
105 return S_OK;
106}

◆ Skip()

HRESULT WINAPI IEnumFORMATETCImpl::Skip ( ULONG  celt)
override

Implements IEnumFORMATETC.

Definition at line 90 of file CIDLDataObj.cpp.

91{
92 TRACE("(%p)->(num=%u)\n", this, celt);
93
94 if (posFmt + celt >= countFmt)
95 return S_FALSE;
96 posFmt += celt;
97 return S_OK;
98}

Member Data Documentation

◆ countFmt

UINT IEnumFORMATETCImpl::countFmt
private

Definition at line 23 of file CIDLDataObj.cpp.

Referenced by Clone(), IEnumFORMATETCImpl(), Initialize(), and Skip().

◆ pFmt

LPFORMATETC IEnumFORMATETCImpl::pFmt
private

Definition at line 24 of file CIDLDataObj.cpp.

Referenced by Clone(), IEnumFORMATETCImpl(), Initialize(), and Next().

◆ posFmt

UINT IEnumFORMATETCImpl::posFmt
private

Definition at line 22 of file CIDLDataObj.cpp.

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


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