ReactOS  0.4.15-dev-1039-gb9754fa
IEnumFORMATETCImpl Class Reference
Inheritance diagram for IEnumFORMATETCImpl:
Collaboration diagram for IEnumFORMATETCImpl:

Public Member Functions

 IEnumFORMATETCImpl ()
 
 ~IEnumFORMATETCImpl ()
 
HRESULT WINAPI Initialize (UINT cfmt, const FORMATETC afmt[])
 
virtual HRESULT WINAPI Next (ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed)
 
virtual HRESULT WINAPI Skip (ULONG celt)
 
virtual HRESULT WINAPI Reset ()
 
virtual HRESULT WINAPI Clone (LPENUMFORMATETC *ppenum)
 
- 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 RemoteNext ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] FORMATETC *rgelt, [out] ULONG *pceltFetched)
 
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 }
smooth NULL
Definition: ftsmooth.c:416
LPFORMATETC pFmt
Definition: CIDLDataObj.cpp:24

◆ ~IEnumFORMATETCImpl()

IEnumFORMATETCImpl::~IEnumFORMATETCImpl ( )

Definition at line 48 of file CIDLDataObj.cpp.

49 {
50 }

Member Function Documentation

◆ Clone()

HRESULT WINAPI IEnumFORMATETCImpl::Clone ( LPENUMFORMATETC ppenum)
virtual

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 TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
LPFORMATETC pFmt
Definition: CIDLDataObj.cpp:24

◆ 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
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
struct IEnumFORMATETC::tagFORMATETC FORMATETC
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:51
LPFORMATETC pFmt
Definition: CIDLDataObj.cpp:24
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
struct IEnumFORMATETC::tagFORMATETC * LPFORMATETC

◆ Next()

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

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
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50
LPFORMATETC pFmt
Definition: CIDLDataObj.cpp:24

◆ Reset()

HRESULT WINAPI IEnumFORMATETCImpl::Reset ( void  )
virtual

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 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

◆ Skip()

HRESULT WINAPI IEnumFORMATETCImpl::Skip ( ULONG  celt)
virtual

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 }
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

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: