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

Public Member Functions

void AddItemsFromClassicStartMenuKey (HKEY hKeyRoot)
 
HRESULT WINAPI Initialize (DWORD dwFlags, IEnumIDList *pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
 
- 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 193 of file CDesktopFolder.cpp.

Member Function Documentation

◆ AddItemsFromClassicStartMenuKey()

void CDesktopFolderEnum::AddItemsFromClassicStartMenuKey ( HKEY  hKeyRoot)
inline

Definition at line 201 of file CDesktopFolder.cpp.

202 {
203 DWORD dwResult;
204 HKEY hkey;
205 DWORD j = 0, dwVal, Val, dwType, dwIID;
206 LONG r;
207 WCHAR iid[50];
208 LPITEMIDLIST pidl;
209
210 dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
211 if (dwResult != ERROR_SUCCESS)
212 return;
213
214 while(1)
215 {
216 dwVal = sizeof(Val);
217 dwIID = sizeof(iid) / sizeof(WCHAR);
218
219 r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
220 if (r != ERROR_SUCCESS)
221 break;
222
223 if (Val == 0 && dwType == REG_DWORD)
224 {
225 pidl = _ILCreateGuidFromStrW(iid);
226 if (pidl != NULL)
227 {
228 if (!HasItemWithCLSID(pidl))
229 AddToEnumList(pidl);
230 else
231 SHFree(pidl);
232 }
233 }
234 }
235 RegCloseKey(hkey);
236 }
static const WCHAR ClassicStartMenuW[]
#define RegCloseKey(hKey)
Definition: registry.h:49
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
BOOL AddToEnumList(LPITEMIDLIST pidl)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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 GLint GLint j
Definition: glfuncs.h:250
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1769
#define REG_DWORD
Definition: sdbapi.c:596
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
unsigned char * LPBYTE
Definition: typedefs.h:53
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Initialize().

◆ Initialize()

HRESULT WINAPI CDesktopFolderEnum::Initialize ( DWORD  dwFlags,
IEnumIDList pRegEnumerator,
IEnumIDList pDesktopEnumerator,
IEnumIDList pCommonDesktopEnumerator 
)
inline

Definition at line 238 of file CDesktopFolder.cpp.

239 {
240 BOOL ret = TRUE;
241 LPITEMIDLIST pidl;
242
243 static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
244 static const WCHAR InternetClassString[] = L"{871C5380-42A0-1069-A2EA-08002B30309D}";
245
246 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
247
248 /* enumerate the root folders */
249 if (dwFlags & SHCONTF_FOLDERS)
250 {
252 if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
254 if (IsNamespaceExtensionHidden(InternetClassString) < 1)
256
257 DWORD dwFetched;
258 while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched)
259 {
260 if (IsNamespaceExtensionHidden(pidl) < 1)
261 {
262 if (!HasItemWithCLSID(pidl))
263 AddToEnumList(pidl);
264 else
265 SHFree(pidl);
266 }
267 }
270 }
271
272 /* Enumerate the items in the two fs folders */
273 AppendItemsFromEnumerator(pDesktopEnumerator);
274 AppendItemsFromEnumerator(pCommonDesktopEnumerator);
275
276 return ret ? S_OK : E_FAIL;
277 }
static INT IsNamespaceExtensionHidden(const WCHAR *iid)
void AddItemsFromClassicStartMenuKey(HKEY hKeyRoot)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
#define S_OK
Definition: intsafe.h:52
#define L(x)
Definition: ntvdm.h:50
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1657
LPITEMIDLIST _ILCreateIExplore(void)
Definition: pidl.c:1669
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1663
#define TRACE(s)
Definition: solgame.cpp:4
int ret
_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: