ReactOS  0.4.15-dev-439-g292f67a
CEnumIDList Class Reference
Inheritance diagram for CEnumIDList:
Collaboration diagram for CEnumIDList:

Public Member Functions

 CEnumIDList ()
 
 ~CEnumIDList ()
 
HRESULT Initialize ()
 
virtual HRESULT STDMETHODCALLTYPE Next (ULONG celt, PITEMID_CHILD *rgelt, ULONG *pceltFetched)
 
virtual HRESULT STDMETHODCALLTYPE Skip (ULONG celt)
 
virtual HRESULT STDMETHODCALLTYPE Reset ()
 
virtual HRESULT STDMETHODCALLTYPE Clone (IEnumIDList **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 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 129 of file enumlist.cpp.

Constructor & Destructor Documentation

◆ CEnumIDList()

CEnumIDList::CEnumIDList ( )

Definition at line 197 of file enumlist.cpp.

197  :
198  m_pFirst(NULL),
199  m_pLast(NULL),
201 {
202 }
LPENUMLIST m_pFirst
Definition: enumlist.cpp:148
smooth NULL
Definition: ftsmooth.c:416
LPENUMLIST m_pLast
Definition: enumlist.cpp:149
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:150

◆ ~CEnumIDList()

CEnumIDList::~CEnumIDList ( )

Definition at line 204 of file enumlist.cpp.

205 {
206  LPENUMLIST pDelete;
207 
208  while (m_pFirst)
209  {
210  pDelete = m_pFirst;
211  m_pFirst = pDelete->pNext;
212  SHFree(pDelete->pidl);
213  SHFree(pDelete);
214  }
215 }
PITEMID_CHILD pidl
Definition: enumlist.cpp:126
struct tagENUMLIST * pNext
Definition: enumlist.cpp:125
LPENUMLIST m_pFirst
Definition: enumlist.cpp:148
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331

Member Function Documentation

◆ AddToEnumList()

BOOL CEnumIDList::AddToEnumList ( PITEMID_CHILD  pidl)
private

Definition at line 165 of file enumlist.cpp.

166 {
167  LPENUMLIST pNew;
168 
169  if (!pidl)
170  return FALSE;
171 
172  pNew = static_cast<LPENUMLIST>(SHAlloc(sizeof(ENUMLIST)));
173  if (pNew)
174  {
175  pNew->pNext = NULL;
176  pNew->pidl = pidl;
177 
178  if (!m_pFirst)
179  {
180  m_pFirst = pNew;
181  m_pCurrent = pNew;
182  }
183 
184  if (m_pLast)
185  {
186  /*add the new item to the end of the list */
187  m_pLast->pNext = pNew;
188  }
189 
190  /*update the last item pointer */
191  m_pLast = pNew;
192  return TRUE;
193  }
194  return FALSE;
195 }
PITEMID_CHILD pidl
Definition: enumlist.cpp:126
struct tagENUMLIST * pNext
Definition: enumlist.cpp:125
#define TRUE
Definition: types.h:120
LPENUMLIST m_pFirst
Definition: enumlist.cpp:148
smooth NULL
Definition: ftsmooth.c:416
LPENUMLIST m_pLast
Definition: enumlist.cpp:149
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:309
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:150

Referenced by Initialize().

◆ Clone()

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

Implements IEnumIDList.

Definition at line 323 of file enumlist.cpp.

325 {
326  return E_NOTIMPL;
327 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Initialize()

HRESULT CEnumIDList::Initialize ( )

Definition at line 218 of file enumlist.cpp.

219 {
220  HRESULT hr;
223  ULONG Count;
224  PITEMID_CHILD pidl;
225 
226  /* get an instance to of IConnectionManager */
227  hr = CNetConnectionManager_CreateInstance(IID_PPV_ARG(INetConnectionManager, &pNetConMan));
228  if (FAILED_UNEXPECTEDLY(hr))
229  return S_OK;
230 
231  hr = pNetConMan->EnumConnections(NCME_DEFAULT, &pEnumCon);
232  if (FAILED_UNEXPECTEDLY(hr))
233  return S_OK;
234 
235  while (TRUE)
236  {
237  CComPtr<INetConnection> INetCon;
238 
239  hr = pEnumCon->Next(1, &INetCon, &Count);
240  if (hr != S_OK)
241  break;
242 
243  pidl = ILCreateNetConnectItem(INetCon);
244  if (pidl)
245  {
246  AddToEnumList(pidl);
247  }
248  }
249 
250  return S_OK;
251 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define IID_PPV_ARG(Itype, ppType)
LONG HRESULT
Definition: typedefs.h:78
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
PITEMID_CHILD ILCreateNetConnectItem(INetConnection *pItem)
Definition: enumlist.cpp:33
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI CNetConnectionManager_CreateInstance(REFIID riid, LPVOID *ppv)
BOOL AddToEnumList(PITEMID_CHILD pidl)
Definition: enumlist.cpp:165
unsigned int ULONG
Definition: retypes.h:1

◆ Next()

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

Implements IEnumIDList.

Definition at line 255 of file enumlist.cpp.

259 {
260  ULONG i;
261  HRESULT hr = S_OK;
263 
264  if (pceltFetched)
265  *pceltFetched = 0;
266 
267  if (celt > 1 && !pceltFetched)
268  {
269  return E_INVALIDARG;
270  }
271 
272  if (celt > 0 && !m_pCurrent)
273  {
274  return S_FALSE;
275  }
276 
277  for (i = 0; i < celt; i++)
278  {
279  if (!m_pCurrent)
280  break;
281 
283  rgelt[i] = temp;
285  }
286 
287  if (pceltFetched)
288  *pceltFetched = i;
289 
290  return hr;
291 }
PITEMID_CHILD pidl
Definition: enumlist.cpp:126
struct tagENUMLIST * pNext
Definition: enumlist.cpp:125
HRESULT hr
Definition: shlfolder.c:183
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
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
static calc_node_t temp
Definition: rpn_ieee.c:38
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
unsigned int ULONG
Definition: retypes.h:1
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:150

◆ Reset()

HRESULT WINAPI CEnumIDList::Reset ( void  )
virtual

Implements IEnumIDList.

Definition at line 315 of file enumlist.cpp.

316 {
318  return S_OK;
319 }
LPENUMLIST m_pFirst
Definition: enumlist.cpp:148
#define S_OK
Definition: intsafe.h:59
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:150

◆ Skip()

HRESULT WINAPI CEnumIDList::Skip ( ULONG  celt)
virtual

Implements IEnumIDList.

Definition at line 295 of file enumlist.cpp.

296 {
297  DWORD dwIndex;
298  HRESULT hr = S_OK;
299 
300  for (dwIndex = 0; dwIndex < celt; dwIndex++)
301  {
302  if (!m_pCurrent)
303  {
304  hr = S_FALSE;
305  break;
306  }
308  }
309 
310  return hr;
311 }
struct tagENUMLIST * pNext
Definition: enumlist.cpp:125
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
LPENUMLIST m_pCurrent
Definition: enumlist.cpp:150

Member Data Documentation

◆ m_pCurrent

LPENUMLIST CEnumIDList::m_pCurrent
private

Definition at line 150 of file enumlist.cpp.

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

◆ m_pFirst

LPENUMLIST CEnumIDList::m_pFirst
private

Definition at line 148 of file enumlist.cpp.

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

◆ m_pLast

LPENUMLIST CEnumIDList::m_pLast
private

Definition at line 149 of file enumlist.cpp.

Referenced by AddToEnumList().


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