ReactOS 0.4.16-dev-122-g325d74c
CEnumIDList Class Reference
Inheritance diagram for CEnumIDList:
Collaboration diagram for CEnumIDList:

Public Member Functions

 CEnumIDList ()
 
 ~CEnumIDList ()
 
HRESULT Initialize ()
 
STDMETHOD() Next (ULONG celt, PITEMID_CHILD *rgelt, ULONG *pceltFetched) override
 
STDMETHOD() Skip (ULONG celt) override
 
STDMETHOD() Reset () override
 
STDMETHOD() Clone (IEnumIDList **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 ()
 
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
 
HRESULT Skip ([in] ULONG celt)
 
HRESULT Reset ()
 
HRESULT Clone ([out] IEnumIDList **ppenum)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Member Functions

BOOL AddToEnumList (PITEMID_CHILD pidl)
 

Private Attributes

LPENUMLIST m_pFirst
 
LPENUMLIST m_pLast
 
LPENUMLIST m_pCurrent
 

Additional Inherited Members

- Public Types inherited from IEnumIDList
typedef IEnumIDListLPENUMIDLIST
 
- 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 137 of file enumlist.cpp.

Constructor & Destructor Documentation

◆ CEnumIDList()

CEnumIDList::CEnumIDList ( )

Definition at line 205 of file enumlist.cpp.

205 :
206 m_pFirst(NULL),
207 m_pLast(NULL),
209{
210}
LPENUMLIST m_pFirst
Definition: enumlist.cpp:156
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:158
LPENUMLIST m_pLast
Definition: enumlist.cpp:157
#define NULL
Definition: types.h:112

◆ ~CEnumIDList()

CEnumIDList::~CEnumIDList ( )

Definition at line 212 of file enumlist.cpp.

213{
214 LPENUMLIST pDelete;
215
216 while (m_pFirst)
217 {
218 pDelete = m_pFirst;
219 m_pFirst = pDelete->pNext;
220 SHFree(pDelete->pidl);
221 SHFree(pDelete);
222 }
223}
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
struct tagENUMLIST * pNext
Definition: enumlist.cpp:133
PITEMID_CHILD pidl
Definition: enumlist.cpp:134

Member Function Documentation

◆ AddToEnumList()

BOOL CEnumIDList::AddToEnumList ( PITEMID_CHILD  pidl)
private

Definition at line 173 of file enumlist.cpp.

174{
175 LPENUMLIST pNew;
176
177 if (!pidl)
178 return FALSE;
179
180 pNew = static_cast<LPENUMLIST>(SHAlloc(sizeof(ENUMLIST)));
181 if (pNew)
182 {
183 pNew->pNext = NULL;
184 pNew->pidl = pidl;
185
186 if (!m_pFirst)
187 {
188 m_pFirst = pNew;
189 m_pCurrent = pNew;
190 }
191
192 if (m_pLast)
193 {
194 /*add the new item to the end of the list */
195 m_pLast->pNext = pNew;
196 }
197
198 /*update the last item pointer */
199 m_pLast = pNew;
200 return TRUE;
201 }
202 return FALSE;
203}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304

Referenced by Initialize().

◆ Clone()

HRESULT WINAPI CEnumIDList::Clone ( IEnumIDList **  ppenum)
override

Implements IEnumIDList.

Definition at line 339 of file enumlist.cpp.

341{
342 return E_NOTIMPL;
343}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

HRESULT CEnumIDList::Initialize ( )

Definition at line 226 of file enumlist.cpp.

227{
228 HRESULT hr;
231 ULONG Count;
232 PITEMID_CHILD pidl;
233
234 /* get an instance to of IConnectionManager */
235 hr = CNetConnectionManager_CreateInstance(IID_PPV_ARG(INetConnectionManager, &pNetConMan));
237 return S_OK;
238
239 hr = pNetConMan->EnumConnections(NCME_DEFAULT, &pEnumCon);
241 return S_OK;
242
243 while (TRUE)
244 {
246
247 hr = pEnumCon->Next(1, &INetCon, &Count);
248 if (hr != S_OK)
249 break;
250
251 pidl = ILCreateNetConnectItem(INetCon);
252 if (pidl)
253 {
254 AddToEnumList(pidl);
255 }
256 }
257
258 return S_OK;
259}
BOOL AddToEnumList(PITEMID_CHILD pidl)
Definition: enumlist.cpp:173
HRESULT WINAPI CNetConnectionManager_CreateInstance(REFIID riid, LPVOID *ppv)
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:37
#define S_OK
Definition: intsafe.h:52
@ NCME_DEFAULT
Definition: netcon.h:10
int Count
Definition: noreturn.cpp:7
HRESULT hr
Definition: shlfolder.c:183
uint32_t ULONG
Definition: typedefs.h:59
#define IID_PPV_ARG(Itype, ppType)

◆ Next()

HRESULT WINAPI CEnumIDList::Next ( ULONG  celt,
PITEMID_CHILD rgelt,
ULONG pceltFetched 
)
override

Implements IEnumIDList.

Definition at line 263 of file enumlist.cpp.

267{
268 ULONG i;
269 HRESULT hr = S_OK;
271
272 if (pceltFetched)
273 *pceltFetched = 0;
274
275 if (celt > 1 && !pceltFetched)
276 {
277 return E_INVALIDARG;
278 }
279
280 if (celt > 0 && !m_pCurrent)
281 {
282 return S_FALSE;
283 }
284
285 for (i = 0; i < celt; i++)
286 {
287 if (!m_pCurrent)
288 {
289 hr = S_FALSE;
290 break;
291 }
292
294 if (!temp)
295 {
297 break;
298 }
299 rgelt[i] = temp;
301 }
302
303 if (pceltFetched)
304 *pceltFetched = i;
305
306 return hr;
307}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#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
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
static calc_node_t temp
Definition: rpn_ieee.c:38
#define S_FALSE
Definition: winerror.h:2357

◆ Reset()

HRESULT WINAPI CEnumIDList::Reset ( )
override

Implements IEnumIDList.

Definition at line 331 of file enumlist.cpp.

332{
334 return S_OK;
335}

◆ Skip()

HRESULT WINAPI CEnumIDList::Skip ( ULONG  celt)
override

Implements IEnumIDList.

Definition at line 311 of file enumlist.cpp.

312{
313 DWORD dwIndex;
314 HRESULT hr = S_OK;
315
316 for (dwIndex = 0; dwIndex < celt; dwIndex++)
317 {
318 if (!m_pCurrent)
319 {
320 hr = S_FALSE;
321 break;
322 }
324 }
325
326 return hr;
327}
unsigned long DWORD
Definition: ntddk_ex.h:95

Member Data Documentation

◆ m_pCurrent

LPENUMLIST CEnumIDList::m_pCurrent
private

Definition at line 158 of file enumlist.cpp.

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

◆ m_pFirst

LPENUMLIST CEnumIDList::m_pFirst
private

Definition at line 156 of file enumlist.cpp.

Referenced by AddToEnumList(), Reset(), and ~CEnumIDList().

◆ m_pLast

LPENUMLIST CEnumIDList::m_pLast
private

Definition at line 157 of file enumlist.cpp.

Referenced by AddToEnumList().


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