ReactOS  0.4.15-dev-1386-g5cb9f87
CSHEnumClassesOfCategories Class Reference
Inheritance diagram for CSHEnumClassesOfCategories:
Collaboration diagram for CSHEnumClassesOfCategories:

Public Member Functions

 CSHEnumClassesOfCategories ()
 
virtual ~CSHEnumClassesOfCategories ()
 
virtual HRESULT STDMETHODCALLTYPE Initialize (ULONG cImplemented, CATID *pImplemented, ULONG cRequired, CATID *pRequired)
 
virtual HRESULT STDMETHODCALLTYPE Clone (IEnumCLSID **ppvOut)
 
virtual HRESULT STDMETHODCALLTYPE Next (ULONG cElt, CLSID *pElts, ULONG *pFetched)
 
virtual HRESULT STDMETHODCALLTYPE Reset ()
 
virtual HRESULT STDMETHODCALLTYPE Skip (ULONG nbElts)
 
- 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 IEnumGUID
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched)
 
HRESULT Clone ([out] IEnumGUID **ppenum)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

CComPtr< ICatInformationfCatInformation
 
HDSA fDsa
 
ULONG fCursor
 

Additional Inherited Members

- Public Types inherited from IEnumGUID
typedef IEnumGUIDLPENUMGUID
 
- 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 212 of file CSHEnumClassesOfCategories.cpp.

Constructor & Destructor Documentation

◆ CSHEnumClassesOfCategories()

CSHEnumClassesOfCategories::CSHEnumClassesOfCategories ( )

Definition at line 237 of file CSHEnumClassesOfCategories.cpp.

238 {
239  fCursor = 0;
240  fDsa = DSA_Create(sizeof(GUID), 5);
241 }
HDSA WINAPI DSA_Create(INT nSize, INT nGrow)
Definition: dsa.c:71

◆ ~CSHEnumClassesOfCategories()

CSHEnumClassesOfCategories::~CSHEnumClassesOfCategories ( )
virtual

Definition at line 243 of file CSHEnumClassesOfCategories.cpp.

244 {
245  if (fDsa)
246  DSA_Destroy(fDsa);
247 }
BOOL WINAPI DSA_Destroy(HDSA hdsa)
Definition: dsa.c:103

Member Function Documentation

◆ Clone()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Clone ( IEnumCLSID **  ppvOut)
virtual

Definition at line 291 of file CSHEnumClassesOfCategories.cpp.

292 {
293  return E_NOTIMPL;
294 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

HRESULT CSHEnumClassesOfCategories::Initialize ( ULONG  cImplemented,
CATID pImplemented,
ULONG  cRequired,
CATID pRequired 
)
virtual

Definition at line 249 of file CSHEnumClassesOfCategories.cpp.

250 {
251  UINT i;
252  HRESULT hr;
253 
254  if (!fDsa)
255  return E_FAIL;
256 
257  // Parameter validation:
258  // - We must have at least one category to manage.
259  // - The array pointers must not be NULL if there is a non-zero
260  // element count specified for them.
261  if (cImplemented == 0 && cRequired == 0)
262  return E_INVALIDARG;
263  if ((cImplemented && !pImplemented) || (cRequired && !pRequired))
264  return E_INVALIDARG;
265 
266  // For each implemented category, create a cache and add it to our local DSA.
267  for (i = 0; i < cImplemented; i++)
268  {
269  CComCatCachedCategory cachedCat;
270  hr = cachedCat.Initialize(pImplemented[i], FALSE);
271  if (FAILED_UNEXPECTEDLY(hr))
272  return hr;
273  cachedCat.WriteCacheToDSA(fDsa);
274  }
275 
276  // TODO: Implement caching of the required categories.
277  if (cRequired > 0)
278  {
279  FIXME("Implement required categories class enumeration\n");
280 
281  // Only fail in case we didn't look at the implemented categories.
282  if (cImplemented == 0)
283  return E_NOTIMPL;
284  }
285 
286  return S_OK;
287 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
HRESULT STDMETHODCALLTYPE Initialize(CATID &catID, BOOL reloadCache)
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_INVALIDARG
Definition: ddrawi.h:101
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:51
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 E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50

◆ Next()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Next ( ULONG  cElt,
CLSID pElts,
ULONG pFetched 
)
virtual

Definition at line 296 of file CSHEnumClassesOfCategories.cpp.

297 {
298  ULONG i;
299  ULONG read;
300  GUID *tmp;
301 
302  if (!pElts)
303  return E_INVALIDARG;
304  read = 0;
305  for (i = 0; i < cElt && (fCursor < (ULONG)DSA_GetItemCount(fDsa)); i++)
306  {
307  tmp = (GUID*)DSA_GetItemPtr(fDsa, fCursor + i);
308  if (!tmp)
309  break;
310  pElts[i] = *tmp;
311  read++;
312  }
313  fCursor += read;
314  if (pFetched)
315  *pFetched = read;
316  return S_OK;
317 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DSA_GetItemCount(hdsa)
Definition: commctrl.h:4822
#define S_OK
Definition: intsafe.h:51
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
LPVOID WINAPI DSA_GetItemPtr(HDSA hdsa, INT nIndex)
Definition: dsa.c:162
unsigned int ULONG
Definition: retypes.h:1
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

◆ Reset()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Reset ( void  )
virtual

Implements IEnumGUID.

Definition at line 319 of file CSHEnumClassesOfCategories.cpp.

320 {
321  fCursor = 0;
322  return S_OK;
323 }
#define S_OK
Definition: intsafe.h:51

◆ Skip()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Skip ( ULONG  nbElts)
virtual

Implements IEnumGUID.

Definition at line 325 of file CSHEnumClassesOfCategories.cpp.

326 {
327  if (fCursor + nbElts >= (ULONG)DSA_GetItemCount(fDsa))
328  return E_INVALIDARG;
329  fCursor += nbElts;
330  return S_OK;
331 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DSA_GetItemCount(hdsa)
Definition: commctrl.h:4822
#define S_OK
Definition: intsafe.h:51
unsigned int ULONG
Definition: retypes.h:1

Member Data Documentation

◆ fCatInformation

CComPtr<ICatInformation> CSHEnumClassesOfCategories::fCatInformation
private

Definition at line 218 of file CSHEnumClassesOfCategories.cpp.

◆ fCursor

ULONG CSHEnumClassesOfCategories::fCursor
private

Definition at line 220 of file CSHEnumClassesOfCategories.cpp.

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

◆ fDsa

HDSA CSHEnumClassesOfCategories::fDsa
private

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