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

Public Member Functions

 CRegFolderEnum ()
 
 ~CRegFolderEnum ()
 
HRESULT Initialize (LPCWSTR lpszEnumKeyName, DWORD dwFlags)
 
HRESULT AddItemsFromKey (HKEY hkey_root, LPCWSTR szRepPath)
 
- Public Member Functions inherited from CEnumIDListBase
 CEnumIDListBase ()
 
virtual ~CEnumIDListBase ()
 
BOOL AddToEnumList (LPITEMIDLIST pidl)
 
BOOL DeleteList ()
 
BOOL HasItemWithCLSID (LPITEMIDLIST pidl)
 
HRESULT AppendItemsFromEnumerator (IEnumIDList *pEnum)
 
STDMETHOD() Next (ULONG celt, LPITEMIDLIST *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 ()
 
- 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 ()
 

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 222 of file CRegFolder.cpp.

Constructor & Destructor Documentation

◆ CRegFolderEnum()

CRegFolderEnum::CRegFolderEnum ( )

Definition at line 244 of file CRegFolder.cpp.

245{
246}

◆ ~CRegFolderEnum()

CRegFolderEnum::~CRegFolderEnum ( )

Definition at line 248 of file CRegFolder.cpp.

249{
250}

Member Function Documentation

◆ AddItemsFromKey()

HRESULT CRegFolderEnum::AddItemsFromKey ( HKEY  hkey_root,
LPCWSTR  szRepPath 
)

Definition at line 271 of file CRegFolder.cpp.

272{
274 HKEY hkey;
275
276 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) != ERROR_SUCCESS)
277 return S_FALSE;
278
279 for (int idx = 0; ; idx++)
280 {
281 if (RegEnumKeyW(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS)
282 break;
283
284 /* If the name of the key is not a guid try to get the default value of the key */
285 if (name[0] != L'{')
286 {
287 DWORD dwSize = sizeof(name);
289 }
290
291 if (*name == '{')
292 {
294
295 if (pidl)
296 AddToEnumList(pidl);
297 }
298 }
299
300 RegCloseKey(hkey);
301
302 return S_OK;
303}
#define RegCloseKey(hKey)
Definition: registry.h:49
BOOL AddToEnumList(LPITEMIDLIST pidl)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
unsigned int idx
Definition: utils.c:41
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define MAX_PATH
Definition: compat.h:34
#define RRF_RT_REG_SZ
Definition: driver.c:575
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define L(x)
Definition: ntvdm.h:50
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1769
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
Definition: name.c:39
#define S_FALSE
Definition: winerror.h:2357
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Initialize().

◆ Initialize()

HRESULT CRegFolderEnum::Initialize ( LPCWSTR  lpszEnumKeyName,
DWORD  dwFlags 
)

Definition at line 252 of file CRegFolder.cpp.

253{
255
256 if (!(dwFlags & SHCONTF_FOLDERS))
257 return S_OK;
258
260 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace",
261 lpszEnumKeyName);
263 return hr;
264
267
268 return S_OK;
269}
HRESULT AddItemsFromKey(HKEY hkey_root, LPCWSTR szRepPath)
Definition: CRegFolder.cpp:271
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT hr
Definition: shlfolder.c:183
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11

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