ReactOS 0.4.16-dev-725-g22577ae
shfldr.h
Go to the documentation of this file.
1
2/*
3 * Virtual Folder
4 * common definitions
5 *
6 * Copyright 1997 Marcus Meissner
7 * Copyright 1998, 1999, 2002 Juergen Schmied
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef _SHFLDR_H_
25#define _SHFLDR_H_
26
27#define CHARS_IN_GUID 39
28
29typedef struct {
30 WORD colnameid; // Column title text resource id passed to LoadString
31 WORD colstate; // SHCOLSTATEF returned by IShellFolder2::GetDefaultColumnState
32 // HACK: SHCOLSTATEF truncated to WORD to reduce .rdata section size
33 WORD fmt; // LVCFMT_*
34 WORD cxChar; // Column width hint
35} shvheader;
36/*
37 * CFSFolder column indices. CDesktopFolder MUST use the same indices!
38 * According to the documentation for IShellFolder2::GetDetailsOf,
39 * the first 4 columns for SFGAO_FILESYSTEM items must be Name, Size, Type, Modified date
40For Details See:
41https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellfolder2-getdetailsof
42 */
43#define SHFSF_COL_NAME 0
44#define SHFSF_COL_SIZE 1
45#define SHFSF_COL_TYPE 2 // SHGFI_TYPENAME
46#define SHFSF_COL_MDATE 3 // Modified date
47#define SHFSF_COL_FATTS 4 // File attributes
48#define SHFSF_COL_COMMENT 5
49
50typedef struct _REQUIREDREGITEM
51{
54 BYTE Order; // According to Geoff Chappell, required items have a fixed sort order
56
57typedef struct _REGFOLDERINFO
58{
60 BYTE Count; // Count of required items
66
67typedef struct _REGFOLDERINITDATA
68{
72
74
75#define GET_SHGDN_FOR(dwFlags) ((DWORD)dwFlags & (DWORD)0x0000FF00)
76#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
77#define IS_SHGDN_FOR_PARSING(flags) ( ((flags) & (SHGDN_FORADDRESSBAR | SHGDN_FORPARSING)) == SHGDN_FORPARSING)
78#define IS_SHGDN_DESKTOPABSOLUTEPARSING(flags) ( ((flags) & (SHGDN_FORADDRESSBAR | SHGDN_FORPARSING | 0xFF)) == SHGDN_FORPARSING)
79
80static inline SFGAOF
82{
83 SFGAOF query = SFGAO_FOLDER | (ForRegItem ? SFGAO_NONENUMERATED : 0);
84 if (!(Flags & SHCONTF_INCLUDEHIDDEN))
85 query |= SFGAO_HIDDEN;
86 if (!(Flags & SHCONTF_INCLUDESUPERHIDDEN))
87 query |= SFGAO_HIDDEN | SFGAO_SYSTEM;
88 return query;
89}
90
93
94BOOL
96
99 _Inout_ LPWSTR *ppch,
100 _Out_ LPWSTR pszOut,
101 _In_ INT cchOut,
102 _In_ BOOL bValidate);
103
104HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
105 LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
106
108
110
112
114
115#ifdef __cplusplus
116HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
117 LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut);
118
120 int csidl, REFIID riid, LPVOID *ppvOut);
121#endif
122
123HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
124 LPCITEMIDLIST pidl, const GUID* clsid, REFIID riid, LPVOID *ppvOut);
125
126extern "C"
128
130
131HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE* ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl);
132
134{
135 return sprintf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
136 guid.Data1, guid.Data2, guid.Data3,
137 guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
138 guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
139}
140
142{
143 static const WCHAR fmtW[] =
144 { '{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
145 '%','0','2','X','%','0','2','X','-',
146 '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',
147 '%','0','2','X','%','0','2','X','}',0 };
148 return swprintf(str, fmtW,
149 guid.Data1, guid.Data2, guid.Data3,
150 guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
151 guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
152}
153
156
157void CloseRegKeyArray(HKEY* array, UINT cKeys);
158LSTATUS AddClassKeyToArray(const WCHAR* szClass, HKEY* array, UINT* cKeys);
161
162#ifdef __cplusplus
163
164struct CRegKeyHandleArray
165{
166 HKEY hKeys[16];
167 UINT cKeys;
168
169 CRegKeyHandleArray() : cKeys(0) {}
170 ~CRegKeyHandleArray() { CloseRegKeyArray(hKeys, cKeys); }
171 operator HKEY*() { return hKeys; }
172 operator UINT*() { return &cKeys; }
173 operator UINT() { return cKeys; }
174 HKEY& operator [](SIZE_T i) { return hKeys[i]; }
175};
176
177HRESULT inline SHSetStrRet(LPSTRRET pStrRet, DWORD resId)
178{
179 return SHSetStrRet(pStrRet, shell32_hInstance, resId);
180}
181
182#endif
183
184#endif /* _SHFLDR_H_ */
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:13
#define shell32_hInstance
#define __inline
Definition: _wctype.cpp:15
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
LPARAM lParam
Definition: combotst.c:139
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define SFGAO_SYSTEM
Definition: shobjidl.idl:198
#define swprintf
Definition: precomp.h:40
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
PWDFDEVICE_INIT pInit
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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID * guid
LPCWSTR szPath
Definition: env.c:37
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static LPOLESTR
Definition: stg_prop.c:27
static SHCONTF
Definition: ordinal.c:64
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
interface IBindCtx * LPBC
Definition: objfwd.h:18
BYTE PIDLTYPE
Definition: pidl.h:132
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
const WCHAR * str
HRESULT SHELL32_BindToSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidl, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: shlfolder.cpp:196
HRESULT SHELL32_GetDisplayNameOfChild(IShellFolder2 *psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: shlfolder.cpp:234
SHCONTF SHELL_GetDefaultFolderEnumSHCONTF()
Definition: shlfolder.cpp:29
HRESULT SHELL32_CompareChildren(IShellFolder2 *psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:252
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:333
static __inline int SHELL32_GUIDToStringW(REFGUID guid, LPWSTR str)
Definition: shfldr.h:141
HRESULT SHELL32_GetFSItemAttributes(IShellFolder *psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes)
Definition: CFSFolder.cpp:619
static __inline int SHELL32_GUIDToStringA(REFGUID guid, LPSTR str)
Definition: shfldr.h:133
static SFGAOF SHELL_CreateFolderEnumItemAttributeQuery(SHCONTF Flags, BOOL ForRegItem)
Definition: shfldr.h:81
LSTATUS AddClsidKeyToArray(REFCLSID clsid, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:326
struct _REQUIREDREGITEM REQUIREDREGITEM
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:311
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:275
struct _REGFOLDERINITDATA REGFOLDERINITDATA
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE *ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl)
Definition: shlfolder.cpp:402
struct _REGFOLDERINFO REGFOLDERINFO
void CloseRegKeyArray(HKEY *array, UINT cKeys)
Definition: shlfolder.cpp:305
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
Definition: classes.c:253
struct _REGFOLDERINITDATA * PREGFOLDERINITDATA
BOOL SHELL_IncludeItemInFolderEnum(IShellFolder *pSF, PCUITEMID_CHILD pidl, SFGAOF Query, SHCONTF Flags)
Definition: shlfolder.cpp:41
HRESULT CRegFolder_CreateInstance(PREGFOLDERINITDATA pInit, LPCITEMIDLIST pidlRoot, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:951
HRESULT Shell_NextElement(_Inout_ LPWSTR *ppch, _Out_ LPWSTR pszOut, _In_ INT cchOut, _In_ BOOL bValidate)
Definition: shlfolder.cpp:58
HRESULT SHELL32_ParseNextElement(IShellFolder2 *psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST *pidlInOut, LPOLESTR szNext, DWORD *pEaten, DWORD *pdwAttributes)
Definition: shlfolder.cpp:107
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags)
Definition: CFSFolder.cpp:1472
HRESULT CDefViewBckgrndMenu_CreateInstance(IShellFolder *psf, REFIID riid, void **ppv)
BOOL SHELL_FS_HideExtension(LPCWSTR pwszPath)
Definition: CFSFolder.cpp:1438
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
Definition: shtypes.idl:68
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
Definition: scsiwmi.h:51
const REQUIREDREGITEM * Items
Definition: shfldr.h:61
REFCLSID clsid
Definition: shfldr.h:62
LPCWSTR pszParsingPath
Definition: shfldr.h:63
LPCWSTR pszEnumKeyName
Definition: shfldr.h:64
BYTE Count
Definition: shfldr.h:60
PIDLTYPE PidlType
Definition: shfldr.h:59
IShellFolder * psfOuter
Definition: shfldr.h:69
const REGFOLDERINFO * pInfo
Definition: shfldr.h:70
LPCSTR pszCpl
Definition: shfldr.h:53
REFCLSID clsid
Definition: shfldr.h:52
WORD fmt
Definition: shfldr.h:33
WORD colnameid
Definition: shfldr.h:30
WORD cxChar
Definition: shfldr.h:34
WORD colstate
Definition: shfldr.h:31
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193