ReactOS 0.4.15-dev-7931-gfd331f1
CSHEnumClassesOfCategories Class Reference
Inheritance diagram for CSHEnumClassesOfCategories:
Collaboration diagram for CSHEnumClassesOfCategories:

Public Member Functions

 CSHEnumClassesOfCategories ()
 
virtual ~CSHEnumClassesOfCategories ()
 
STDMETHOD() Initialize (ULONG cImplemented, CATID *pImplemented, ULONG cRequired, CATID *pRequired)
 
STDMETHOD() Clone (IEnumCLSID **ppvOut) override
 
STDMETHOD() Next (ULONG cElt, CLSID *pElts, ULONG *pFetched) override
 
STDMETHOD() Reset () override
 
STDMETHOD() Skip (ULONG nbElts) 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 IEnumGUID
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] GUID *rgelt, [out] ULONG *pceltFetched)
 
HRESULT Skip ([in] ULONG celt)
 
HRESULT Reset ()
 
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 238 of file CSHEnumClassesOfCategories.cpp.

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

◆ ~CSHEnumClassesOfCategories()

CSHEnumClassesOfCategories::~CSHEnumClassesOfCategories ( )
virtual

Definition at line 244 of file CSHEnumClassesOfCategories.cpp.

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

Member Function Documentation

◆ Clone()

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

Definition at line 292 of file CSHEnumClassesOfCategories.cpp.

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

◆ Initialize()

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

Definition at line 250 of file CSHEnumClassesOfCategories.cpp.

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

◆ Next()

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

Definition at line 297 of file CSHEnumClassesOfCategories.cpp.

298{
299 ULONG i;
300 ULONG read;
301 GUID *tmp;
302
303 if (!pElts)
304 return E_INVALIDARG;
305 read = 0;
306 for (i = 0; i < cElt && (fCursor < (ULONG)DSA_GetItemCount(fDsa)); i++)
307 {
308 tmp = (GUID*)DSA_GetItemPtr(fDsa, fCursor + i);
309 if (!tmp)
310 break;
311 pElts[i] = *tmp;
312 read++;
313 }
314 fCursor += read;
315 if (pFetched)
316 *pFetched = read;
317 return S_OK;
318}
#define read
Definition: acwin.h:96
LPVOID WINAPI DSA_GetItemPtr(HDSA hdsa, INT nIndex)
Definition: dsa.c:162
#define DSA_GetItemCount(hdsa)
Definition: commctrl.h:4826
uint32_t ULONG
Definition: typedefs.h:59

◆ Reset()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Reset ( )
override

Implements IEnumGUID.

Definition at line 320 of file CSHEnumClassesOfCategories.cpp.

321{
322 fCursor = 0;
323 return S_OK;
324}

◆ Skip()

HRESULT STDMETHODCALLTYPE CSHEnumClassesOfCategories::Skip ( ULONG  nbElts)
override

Implements IEnumGUID.

Definition at line 326 of file CSHEnumClassesOfCategories.cpp.

327{
328 if (fCursor + nbElts >= (ULONG)DSA_GetItemCount(fDsa))
329 return E_INVALIDARG;
330 fCursor += nbElts;
331 return S_OK;
332}

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: