ReactOS 0.4.16-dev-455-g37b0646
CRegFolderEnum Class Reference
Inheritance diagram for CRegFolderEnum:
Collaboration diagram for CRegFolderEnum:

Public Member Functions

HRESULT Initialize (const REGFOLDERINFO *pInfo, IShellFolder *pSF, DWORD dwFlags)
 
HRESULT AddItemsFromKey (IShellFolder *pSF, HKEY hkey_root, LPCWSTR szRepPath)
 
const CLSIDGetPidlClsid (PCUITEMID_CHILD pidl)
 
BOOL HasItemWithCLSID (LPCITEMIDLIST pidl)
 
- Public Member Functions inherited from CEnumIDListBase
 CEnumIDListBase ()
 
virtual ~CEnumIDListBase ()
 
BOOL AddToEnumList (LPITEMIDLIST pidl)
 
BOOL DeleteList ()
 
BOOL HasItemWithCLSID (LPITEMIDLIST pidl)
 
HRESULT AppendItemsFromEnumerator (IEnumIDList *pEnum)
 
template<class T >
BOOL HasItemWithCLSIDImpl (LPCITEMIDLIST pidl)
 
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 ()
 
- Public Member Functions inherited from CRegFolderInfo
void InitializeFolderInfo (const REGFOLDERINFO *pInfo)
 
const CLSIDIsRegItem (LPCITEMIDLIST pidl) const
 
LPITEMIDLIST CreateItem (size_t i) const
 
LPCWSTR GetParsingPath () const
 
UINT GetCLSIDOffset () const
 
PIDLTYPE GetPidlType () const
 
UINT GetRequiredItemsCount () const
 
const REQUIREDREGITEMGetAt (size_t i) const
 

Private Attributes

SHCONTF m_SHCTF
 

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
 
- Public Attributes inherited from CRegFolderInfo
const REGFOLDERINFOm_pInfo
 
- Protected Attributes inherited from CEnumIDListBase
ENUMLISTmpFirst
 
ENUMLISTmpLast
 
ENUMLISTmpCurrent
 

Detailed Description

Definition at line 213 of file CRegFolder.cpp.

Member Function Documentation

◆ AddItemsFromKey()

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

Definition at line 259 of file CRegFolder.cpp.

260{
262 HKEY hkey;
263
264 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) != ERROR_SUCCESS)
265 return S_FALSE;
266
267 for (int idx = 0; ; idx++)
268 {
269 if (RegEnumKeyW(hkey, idx, name, MAX_PATH) != ERROR_SUCCESS)
270 break;
271
272 /* If the name of the key is not a guid try to get the default value of the key */
273 if (name[0] != L'{')
274 {
275 DWORD dwSize = sizeof(name);
277 }
278
279 if (*name == '{')
280 {
282 {
285 AddToEnumList(pidl);
286 else
287 ILFree(pidl);
288 }
289 }
290 }
291 RegCloseKey(hkey);
292
293 return S_OK;
294}
static LPITEMIDLIST CreateRegItem(PIDLTYPE type, REFCLSID clsid, BYTE order=0)
Definition: CRegFolder.cpp:38
#define RegCloseKey(hKey)
Definition: registry.h:49
BOOL AddToEnumList(LPITEMIDLIST pidl)
BOOL HasItemWithCLSID(LPCITEMIDLIST pidl)
Definition: CRegFolder.cpp:223
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
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
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
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
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1044
static SFGAOF SHELL_CreateFolderEnumItemAttributeQuery(SHCONTF Flags, BOOL ForRegItem)
Definition: shfldr.h:81
BOOL SHELL_IncludeItemInFolderEnum(IShellFolder *pSF, PCUITEMID_CHILD pidl, SFGAOF Query, SHCONTF Flags)
Definition: shlfolder.cpp:41
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
PIDLTYPE GetPidlType() const
Definition: CRegFolder.cpp:123
Definition: name.c:39
#define S_FALSE
Definition: winerror.h:2357
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Initialize().

◆ GetPidlClsid()

const CLSID * CRegFolderEnum::GetPidlClsid ( PCUITEMID_CHILD  pidl)
inline

Definition at line 222 of file CRegFolder.cpp.

222{ return IsRegItem(pidl); }
const CLSID * IsRegItem(LPCITEMIDLIST pidl) const
Definition: CRegFolder.cpp:98

◆ HasItemWithCLSID()

BOOL CRegFolderEnum::HasItemWithCLSID ( LPCITEMIDLIST  pidl)
inline

Definition at line 223 of file CRegFolder.cpp.

223{ return HasItemWithCLSIDImpl<CRegFolderEnum>(pidl); }

Referenced by AddItemsFromKey().

◆ Initialize()

HRESULT CRegFolderEnum::Initialize ( const REGFOLDERINFO pInfo,
IShellFolder pSF,
DWORD  dwFlags 
)

Definition at line 230 of file CRegFolder.cpp.

231{
234 if (!(dwFlags & SHCONTF_FOLDERS))
235 return S_OK;
236
239 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\%s\\Namespace",
240 pInfo->pszEnumKeyName);
242 return hr;
243
244 // First add the required items and then the items from the registry
246 for (size_t i = 0; i < GetRequiredItemsCount(); ++i)
247 {
248 LPITEMIDLIST pidl = CreateItem(i);
249 if (pidl && SHELL_IncludeItemInFolderEnum(pSF, pidl, query, m_SHCTF))
250 AddToEnumList(pidl);
251 else
252 ILFree(pidl);
253 }
256 return S_OK;
257}
HRESULT AddItemsFromKey(IShellFolder *pSF, HKEY hkey_root, LPCWSTR szRepPath)
Definition: CRegFolder.cpp:259
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
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
static SHCONTF
Definition: ordinal.c:64
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
void InitializeFolderInfo(const REGFOLDERINFO *pInfo)
Definition: CRegFolder.cpp:93
UINT GetRequiredItemsCount() const
Definition: CRegFolder.cpp:124
LPITEMIDLIST CreateItem(size_t i) const
Definition: CRegFolder.cpp:115
LPCWSTR pszEnumKeyName
Definition: shfldr.h:64
_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

Member Data Documentation

◆ m_SHCTF

SHCONTF CRegFolderEnum::m_SHCTF
private

Definition at line 217 of file CRegFolder.cpp.

Referenced by AddItemsFromKey(), and Initialize().


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