ReactOS 0.4.15-dev-8100-g1887773
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 212 of file CRegFolder.cpp.

Constructor & Destructor Documentation

◆ CRegFolderEnum()

CRegFolderEnum::CRegFolderEnum ( )

Definition at line 226 of file CRegFolder.cpp.

227{
228}

◆ ~CRegFolderEnum()

CRegFolderEnum::~CRegFolderEnum ( )

Definition at line 230 of file CRegFolder.cpp.

231{
232}

Member Function Documentation

◆ AddItemsFromKey()

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

Definition at line 253 of file CRegFolder.cpp.

254{
256 HKEY hkey;
257
258 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) != ERROR_SUCCESS)
259 return S_FALSE;
260
261 for (int idx = 0; ; idx++)
262 {
263 if (RegEnumKeyW(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS)
264 break;
265
266 /* If the name of the key is not a guid try to get the default value of the key */
267 if (name[0] != L'{')
268 {
269 DWORD dwSize = sizeof(name);
271 }
272
273 if (*name == '{')
274 {
276
277 if (pidl)
278 AddToEnumList(pidl);
279 }
280 }
281
282 RegCloseKey(hkey);
283
284 return S_OK;
285}
#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:1756
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 234 of file CRegFolder.cpp.

235{
237
238 if (!(dwFlags & SHCONTF_FOLDERS))
239 return S_OK;
240
242 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace",
243 lpszEnumKeyName);
245 return hr;
246
249
250 return S_OK;
251}
HRESULT AddItemsFromKey(HKEY hkey_root, LPCWSTR szRepPath)
Definition: CRegFolder.cpp:253
#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: