ReactOS  0.4.14-dev-854-gb9426a3
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)
 
virtual HRESULT STDMETHODCALLTYPE Next (ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched)
 
virtual HRESULT STDMETHODCALLTYPE Skip (ULONG celt)
 
virtual HRESULT STDMETHODCALLTYPE Reset ()
 
virtual HRESULT STDMETHODCALLTYPE Clone (IEnumIDList **ppenum)
 
- 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)
 
- 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 81 of file CDesktopFolder.cpp.

Member Function Documentation

◆ AddItemsFromClassicStartMenuKey()

void CDesktopFolderEnum::AddItemsFromClassicStartMenuKey ( HKEY  hKeyRoot)
inline

Definition at line 89 of file CDesktopFolder.cpp.

90  {
91  DWORD dwResult;
92  HKEY hkey;
93  DWORD j = 0, dwVal, Val, dwType, dwIID;
94  LONG r;
95  WCHAR iid[50];
96  LPITEMIDLIST pidl;
97 
98  dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
99  if (dwResult != ERROR_SUCCESS)
100  return;
101 
102  while(1)
103  {
104  dwVal = sizeof(Val);
105  dwIID = sizeof(iid) / sizeof(WCHAR);
106 
107  r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
108  if (r != ERROR_SUCCESS)
109  break;
110 
111  if (Val == 0 && dwType == REG_DWORD)
112  {
113  pidl = _ILCreateGuidFromStrW(iid);
114  if (pidl != NULL)
115  {
116  if (!HasItemWithCLSID(pidl))
117  AddToEnumList(pidl);
118  else
119  SHFree(pidl);
120  }
121  }
122  }
123  RegCloseKey(hkey);
124  }
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
#define KEY_READ
Definition: nt_native.h:1023
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
BOOL AddToEnumList(LPITEMIDLIST pidl)
static const WCHAR ClassicStartMenuW[]
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
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:2853
smooth NULL
Definition: ftsmooth.c:416
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
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID)
Definition: pidl.c:1711
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by Initialize().

◆ Initialize()

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

Definition at line 126 of file CDesktopFolder.cpp.

127  {
128  BOOL ret = TRUE;
129  LPITEMIDLIST pidl;
130 
131  static const WCHAR MyDocumentsClassString[] = L"{450D8FBA-AD25-11D0-98A8-0800361B1103}";
132 
133  TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
134 
135  /* enumerate the root folders */
136  if (dwFlags & SHCONTF_FOLDERS)
137  {
139  if (IsNamespaceExtensionHidden(MyDocumentsClassString) < 1)
141 
142  DWORD dwFetched;
143  while((S_OK == pRegEnumerator->Next(1, &pidl, &dwFetched)) && dwFetched)
144  {
145  if (IsNamespaceExtensionHidden(pidl) < 1)
146  {
147  if (!HasItemWithCLSID(pidl))
148  AddToEnumList(pidl);
149  else
150  SHFree(pidl);
151  }
152  }
155  }
156 
157  /* Enumerate the items in the two fs folders */
158  AppendItemsFromEnumerator(pDesktopEnumerator);
159  AppendItemsFromEnumerator(pCommonDesktopEnumerator);
160 
161  return ret ? S_OK : E_FAIL;
162  }
#define TRUE
Definition: types.h:120
BOOL HasItemWithCLSID(LPITEMIDLIST pidl)
BOOL AddToEnumList(LPITEMIDLIST pidl)
#define HKEY_CURRENT_USER
Definition: winreg.h:11
void AddItemsFromClassicStartMenuKey(HKEY hKeyRoot)
#define E_FAIL
Definition: ddrawi.h:102
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
unsigned int BOOL
Definition: ntddk_ex.h:94
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1599
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
int ret
static const WCHAR L[]
Definition: oid.c:1250
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static INT IsNamespaceExtensionHidden(const WCHAR *iid)
#define S_OK
Definition: intsafe.h:59
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:331
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1605
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

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