ReactOS 0.4.15-dev-7906-g1b85a5f
CEnumRegRoot Class Reference
Inheritance diagram for CEnumRegRoot:
Collaboration diagram for CEnumRegRoot:

Public Member Functions

 CEnumRegRoot ()
 
 ~CEnumRegRoot ()
 
HRESULT EnumerateNext (LPITEMIDLIST *ppidl)
 
STDMETHODIMP Next (ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) override
 
STDMETHODIMP Skip (ULONG celt) override
 
STDMETHODIMP Reset () override
 
STDMETHODIMP 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 ()
 
- Public Member Functions inherited from IEnumIDList
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 Attributes

UINT m_idx
 

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 184 of file ntobjenum.cpp.

Constructor & Destructor Documentation

◆ CEnumRegRoot()

CEnumRegRoot::CEnumRegRoot ( )
inline

Definition at line 191 of file ntobjenum.cpp.

192 : m_idx(0)
193 {
194 }

◆ ~CEnumRegRoot()

CEnumRegRoot::~CEnumRegRoot ( )
inline

Definition at line 196 of file ntobjenum.cpp.

197 {
198 }

Member Function Documentation

◆ Clone()

STDMETHODIMP CEnumRegRoot::Clone ( IEnumIDList **  ppenum)
inlineoverride

Implements IEnumIDList.

Definition at line 285 of file ntobjenum.cpp.

286 {
287 return E_NOTIMPL;
288 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EnumerateNext()

HRESULT CEnumRegRoot::EnumerateNext ( LPITEMIDLIST ppidl)
inline

Definition at line 200 of file ntobjenum.cpp.

201 {
202 if (m_idx >= _countof(RootKeys))
203 return S_FALSE;
204
206
207 PCWSTR name = key.keyName;
209
211
212 DWORD entryBufferLength = FIELD_OFFSET(RegPidlEntry, entryName) + sizeof(WCHAR) + cchName * sizeof(WCHAR);
213
214 // allocate space for the terminator
215 entryBufferLength += FIELD_OFFSET(SHITEMID, abID);
216
217 RegPidlEntry* entry = (RegPidlEntry*) CoTaskMemAlloc(entryBufferLength);
218 if (!entry)
219 return E_OUTOFMEMORY;
220
221 memset(entry, 0, entryBufferLength);
222
223 entry->cb = FIELD_OFFSET(RegPidlEntry, entryName);
224 entry->magic = REGISTRY_PIDL_MAGIC;
225 entry->entryType = otype;
226 entry->rootKey = key.key;
227
228 if (cchName > 0)
229 {
230 entry->entryNameLength = cchName * sizeof(WCHAR);
231 StringCbCopyNW(entry->entryName, entryBufferLength, name, entry->entryNameLength);
232 entry->cb += entry->entryNameLength + sizeof(WCHAR);
233 }
234 else
235 {
236 entry->entryNameLength = 0;
237 entry->entryName[0] = 0;
238 entry->cb += sizeof(WCHAR);
239 }
240
241 if (ppidl)
242 *ppidl = (LPITEMIDLIST) entry;
243 return S_OK;
244 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned long DWORD
Definition: ntddk_ex.h:95
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
uint32_t entry
Definition: isohybrid.c:63
static struct RootKeyEntry RootKeys[]
#define REGISTRY_PIDL_MAGIC
Definition: ntobjenum.h:26
REG_ENTRY_TYPE
Definition: ntobjenum.h:51
@ REG_ENTRY_ROOT
Definition: ntobjenum.h:52
#define memset(x, y, z)
Definition: compat.h:39
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCbCopyNW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cbToCopy)
Definition: strsafe.h:255
Definition: copy.c:22
Definition: name.c:39
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767
#define S_FALSE
Definition: winerror.h:2357
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Next(), CEnumRegKey::Next(), CEnumNTDirectory::Next(), Skip(), CEnumRegKey::Skip(), and CEnumNTDirectory::Skip().

◆ Next()

STDMETHODIMP CEnumRegRoot::Next ( ULONG  celt,
LPITEMIDLIST rgelt,
ULONG pceltFetched 
)
inlineoverride

Definition at line 246 of file ntobjenum.cpp.

247 {
248 if (pceltFetched)
249 *pceltFetched = 0;
250
251 while (celt-- > 0)
252 {
253 HRESULT hr = EnumerateNext(rgelt);
254 if (hr != S_OK)
255 return hr;
256
257 if (pceltFetched)
258 (*pceltFetched)++;
259 if (rgelt)
260 rgelt++;
261 }
262
263 return S_OK;
264 }
HRESULT EnumerateNext(LPITEMIDLIST *ppidl)
Definition: ntobjenum.cpp:200
HRESULT hr
Definition: shlfolder.c:183

◆ Reset()

STDMETHODIMP CEnumRegRoot::Reset ( )
inlineoverride

Implements IEnumIDList.

Definition at line 280 of file ntobjenum.cpp.

281 {
282 return E_NOTIMPL;
283 }

◆ Skip()

STDMETHODIMP CEnumRegRoot::Skip ( ULONG  celt)
inlineoverride

Implements IEnumIDList.

Definition at line 266 of file ntobjenum.cpp.

267 {
268 while (celt > 0)
269 {
271 if (FAILED(hr))
272 return hr;
273 if (hr != S_OK)
274 break;
275 }
276
277 return S_OK;
278 }
#define NULL
Definition: types.h:112
#define FAILED(hr)
Definition: intsafe.h:51

Member Data Documentation

◆ m_idx

UINT CEnumRegRoot::m_idx
private

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