ReactOS 0.4.16-dev-1020-gf135cab
pidl.h
Go to the documentation of this file.
1/*
2 * internal pidl functions
3 *
4 * Copyright 1998 Juergen Schmied
5 * Copyright 2004 Juan Lang
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 *
21 * NOTES:
22 *
23 * DO NOT use these definitions outside the shell32.dll!
24 *
25 * The contents of a pidl should never be used directly from an application.
26 *
27 * Undocumented:
28 * MS says: the abID of SHITEMID should be treated as binary data and not
29 * be interpreted by applications. Applies to everyone but MS itself.
30 * Word95 interprets the contents of abID (Filesize/Date) so we have to go
31 * for binary compatibility here.
32 */
33
34#ifndef __WINE_PIDL_H
35#define __WINE_PIDL_H
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/*
42* the pidl does cache fileattributes to speed up SHGetAttributes when
43* displaying a big number of files.
44*
45* a pidl of NULL means the desktop
46*
47* The structure of the pidl seems to be a union. The first byte of the
48* PIDLDATA describes the type of pidl.
49*
50* object ! first byte / ! format ! living space
51* ! size
52* ----------------------------------------------------------------
53* my computer 0x1F/20 guid (2) (usual)
54* network 0x1F guid
55* bitbucket 0x1F guid
56* drive 0x23/25 drive (usual)
57* drive 0x25/25 drive (lnk/persistent)
58* drive 0x29/25 drive
59* shell extension 0x2E guid
60* drive 0x2F drive (lnk/persistent)
61* folder/file 0x30 folder/file (1) (lnk/persistent)
62* folder 0x31 folder (usual)
63* valueA 0x32 file (ANSI file name)
64* valueW 0x34 file (Unicode file name)
65* workgroup 0x41 network (3)
66* computer 0x42 network (4)
67* net provider 0x46 network
68* whole network 0x47 network (5)
69* MSITStore 0x61 htmlhlp (7)
70* printers/ras connections 0x70 guid
71* history/favorites 0xb1 file
72* share 0xc3 network (6)
73*
74* guess: the persistent elements are non tracking
75*
76* (1) dummy byte is used, attributes are empty
77* (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
78* (3) two strings "workgroup" "Microsoft Network"
79* (4) two strings "\\sirius" "Microsoft Network"
80* (5) one string "Entire Network"
81* (6) two strings "\\sirius\c" "Microsoft Network"
82* (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
83* GUID 871C5380-42A0-1069-A2EA-08002B30309D
84*/
85
86#define PT_CPLAPPLET 0x00
87#define PT_GUID 0x1F
88#define PT_DRIVE 0x23
89#define PT_DRIVE2 0x25
90#define PT_DRIVE3 0x29
91#define PT_SHELLEXT 0x2E
92#define PT_DRIVE1 0x2F
93#define PT_FOLDER1 0x30
94#define PT_FOLDER 0x31
95#define PT_VALUE 0x32
96#define PT_VALUEW 0x34
97#define PT_FOLDERW 0x35
98#define PT_WORKGRP 0x41
99#define PT_COMP 0x42
100#define PT_NETPROVIDER 0x46
101#define PT_NETWORK 0x47
102#define PT_IESPECIAL1 0x61
103#define PT_YAGUID 0x70 /* yet another guid.. */
104#define PT_IESPECIAL2 0xb1
105#define PT_SHARE 0xc3
106
107#ifdef __REACTOS__
108#define PT_FOLDERTYPEMASK 0x70
109#define PT_DESKTOP_REGITEM 0x1F // => SHDID_ROOT_REGITEM
110#define PT_COMPUTER_REGITEM 0x2E // => SHDID_COMPUTER_?
111#define PT_COMPUTER_DRIVE 0x2F
112#define PT_FS 0x30 // Win95 SHSimpleIDListFromPath
113#define PT_FS_FOLDER_FLAG 0x01
114#define PT_FS_FILE_FLAG 0x02
115#define PT_FS_UNICODE_FLAG 0x04
116#define PT_FS_COMMON_FLAG 0x08
117// PT_NET_REGITEM 0x4? // => SHDID_NET_OTHER
118#define PT_INTERNET 0x60
119#define PT_INTERNET_URL 0x61
120#define PT_CONTROLS_OLDREGITEM 0x70
121#define PT_CONTROLS_NEWREGITEM 0x71
122#endif
123
124static inline BYTE _ILGetType(LPCITEMIDLIST pidl)
125{
126 return pidl && pidl->mkid.cb >= 3 ? pidl->mkid.abID[0] : 0;
127}
128
129static inline BYTE _ILGetFSType(LPCITEMIDLIST pidl)
130{
131 const BYTE type = _ILGetType(pidl);
132 return (type & PT_FOLDERTYPEMASK) == PT_FS ? type : 0;
133}
134
135#include "pshpack1.h"
137
139{
140 BYTE dummy; /*01 is 0x00 */
141 DWORD iconIdx; /*02 negative icon ID */
144 WCHAR szName[1]; /*10*/ /* terminated by 0x00, followed by display name and comment string */
146
147#ifdef __REACTOS__
148
149typedef struct tagPIDLFontStruct
150{
151 BYTE dummy;
152 WORD offsFile;
153 WCHAR szName[1];
154} PIDLFontStruct;
155
156typedef struct tagPIDLPrinterStruct
157{
158 BYTE dummy;
160 WORD offsServer;
161 WCHAR szName[1];
162} PIDLPrinterStruct;
163
164#endif /* !__REACTOS__ */
165
166typedef struct tagGUIDStruct
167{
168 BYTE dummy; /* offset 01 is unknown */
169 GUID guid; /* offset 02 */
171
172typedef struct tagDriveStruct
173{
174 CHAR szDriveName[20]; /*01*/
175 WORD unknown; /*21*/
177
178typedef struct tagFileStruct
179{
180 BYTE dummy; /*01 is 0x00 for files or dirs */
185 CHAR szNames[1]; /*12*/
186 /* Here are coming two strings. The first is the long name.
187 The second the dos name when needed or just 0x00 */
189
190/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There follows
191 * a WORD member after the wszName string, which gives the offset from the beginning of the PIDL
192 * to the FileStructW member. */
193typedef struct tagFileStructW {
203
204typedef struct tagValueW
205{
208
209typedef struct tagPIDLDATA
210{ PIDLTYPE type; /*00*/
211 union
212 {
216 struct
217 { WORD dummy; /*01*/
218 CHAR szNames[1]; /*03*/
220 struct
221 { WORD dummy; /*01*/
222 DWORD dummy1; /*02*/
223 CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
227#ifdef __REACTOS__
228 struct tagPIDLFontStruct cfont;
229 struct tagPIDLPrinterStruct cprinter;
230#endif
233#include "poppack.h"
234
235/*
236 * getting special values from simple pidls
237 */
244
245/*
246 * testing simple pidls
247 */
251#ifdef __REACTOS__
254#define _ILIsFolderOrFile _ILGetFSType
255#endif
262static inline BOOL _ILIsEmpty(LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); }
264
265/*
266 * simple pidls
267 */
268
269/* Creates a PIDL with guid format and type type, which must be one of PT_GUID,
270 * PT_SHELLEXT, or PT_YAGUID.
271 */
273
274#ifndef __REACTOS__
275/* Like _ILCreateGuid, but using the string szGUID. */
278#endif
279
280/* Commonly used PIDLs representing file system objects. */
285
286/* Other helpers */
294#ifdef __REACTOS__
296#endif
300
301/*
302 * helper functions (getting struct-pointer)
303 */
308
309/*
310 * debug helper
311 */
314
315/*
316 * aPidl helper
317 */
321
323
324#ifdef __cplusplus
325} /* extern "C" */
326#endif
327
328#endif /* __WINE_PIDL_H */
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PT_FS
Definition: lnktool.cpp:40
const GUID * guid
LPCWSTR szPath
Definition: env.c:37
unsigned int UINT
Definition: ndis.h:50
BOOL _ILIsMyDocuments(LPCITEMIDLIST pidl)
Definition: pidl.c:2051
BOOL _ILIsBitBucket(LPCITEMIDLIST pidl)
Definition: pidl.c:2073
LPITEMIDLIST _ILCreateAdminTools(void)
Definition: pidl.c:1838
LPITEMIDLIST _ILCreatePrinters(void) DECLSPEC_HIDDEN
Definition: pidl.c:1799
LPITEMIDLIST _ILCreateDesktop(void) DECLSPEC_HIDDEN
Definition: pidl.c:1752
void pdump(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: debughlp.cpp:322
struct tagPIDLDATA PIDLDATA
BOOL _ILIsCPanelStruct(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2115
LPITEMIDLIST _ILCreateDrive(LPCWSTR) DECLSPEC_HIDDEN
Definition: pidl.c:1965
BOOL pcheck(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: debughlp.cpp:360
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST *pidl, const CIDA *cida) DECLSPEC_HIDDEN
Definition: pidl.c:2610
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2156
LPITEMIDLIST _ILCreateNetwork(void) DECLSPEC_HIDDEN
Definition: pidl.c:1826
LPITEMIDLIST _ILCreateEntireNetwork(void) DECLSPEC_HIDDEN
Definition: pidl.c:1985
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2372
struct tagPIDLCPanelStruct PIDLCPanelStruct
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: pidl.c:2572
BOOL _ILIsDrive(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2095
BYTE PIDLTYPE
Definition: pidl.h:136
LPITEMIDLIST _ILCreateMyDocuments(void) DECLSPEC_HIDDEN
Definition: pidl.c:1769
struct tagDriveStruct DriveStruct
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2496
struct tagFileStruct FileStruct
LPITEMIDLIST _ILCreateNetHood(void) DECLSPEC_HIDDEN
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2477
HRESULT _ILCreateFromPathW(LPCWSTR szPath, LPITEMIDLIST *ppidl) DECLSPEC_HIDDEN
Definition: pidl.c:1946
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2543
BOOL _ILIsDesktop(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: CBandSite.h:24
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID) DECLSPEC_HIDDEN
Definition: pidl.c:1869
BOOL _ILIsUnicode(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2037
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2062
PITEMID_CHILD * _ILCopyaPidl(PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl) DECLSPEC_HIDDEN
Definition: pidl.c:2589
LPSTR _ILGetTextPointer(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: pidl.c:2300
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID) DECLSPEC_HIDDEN
Definition: pidl.c:1881
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2084
LPITEMIDLIST _ILCreateControlPanel(void) DECLSPEC_HIDDEN
Definition: pidl.c:1781
LPITEMIDLIST _ILCreateBitBucket(void) DECLSPEC_HIDDEN
Definition: pidl.c:1832
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: pidl.c:2236
struct tagFileStructW FileStructW
BOOL _ILIsFolder(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2102
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *stffile) DECLSPEC_HIDDEN
Definition: pidl.c:1898
DWORD _ILGetDrive(LPCITEMIDLIST, LPWSTR, UINT) DECLSPEC_HIDDEN
Definition: pidl.c:2010
BOOL _ILIsPidlSimple(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
static BYTE _ILGetType(LPCITEMIDLIST pidl)
Definition: pidl.h:124
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *ft) DECLSPEC_HIDDEN
Definition: pidl.c:2450
LPITEMIDLIST _ILCreateIExplore(void) DECLSPEC_HIDDEN
Definition: pidl.c:1775
struct tagValueW ValueWStruct
LPITEMIDLIST SHELL32_CreateSimpleIDListFromPath(LPCWSTR pszPath, DWORD dwAttributes)
Definition: pidl.c:1188
static BYTE _ILGetFSType(LPCITEMIDLIST pidl)
Definition: pidl.h:129
BOOL _ILIsValue(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2109
UINT _ILGetDepth(LPCITEMIDLIST pidl)
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:262
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2408
struct tagGUIDStruct GUIDStruct
struct tagPIDLDATA * LPPIDLDATA
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type) DECLSPEC_HIDDEN
Definition: pidl.c:100
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid) DECLSPEC_HIDDEN
Definition: pidl.c:1844
LPITEMIDLIST _ILCreateMyComputer(void) DECLSPEC_HIDDEN
Definition: pidl.c:1763
static const WCHAR szName[]
Definition: powrprof.c:45
#define REFIID
Definition: guiddef.h:118
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
Definition: shlobj.h:580
Definition: fci.c:127
Definition: name.c:39
WORD unknown
Definition: pidl.h:175
CHAR szDriveName[20]
Definition: pidl.h:174
WCHAR wszName[1]
Definition: pidl.h:201
BYTE dummy2[4]
Definition: pidl.h:200
WORD uCreationTime
Definition: pidl.h:197
WORD uLastAccessTime
Definition: pidl.h:199
BYTE dummy1[6]
Definition: pidl.h:195
WORD uCreationDate
Definition: pidl.h:196
WORD uLastAccessDate
Definition: pidl.h:198
WORD cbLen
Definition: pidl.h:194
WORD uFileDate
Definition: pidl.h:182
WORD uFileAttribs
Definition: pidl.h:184
WORD uFileTime
Definition: pidl.h:183
DWORD dwFileSize
Definition: pidl.h:181
BYTE dummy
Definition: pidl.h:180
CHAR szNames[1]
Definition: pidl.h:185
GUID guid
Definition: pidl.h:169
BYTE dummy
Definition: pidl.h:168
WORD offsComment
Definition: pidl.h:143
WCHAR szName[1]
Definition: pidl.h:144
WORD offsDispName
Definition: pidl.h:142
struct tagPIDLDATA::@594::@595 network
union tagPIDLDATA::@594 u
PIDLTYPE type
Definition: pidl.h:210
CHAR szNames[1]
Definition: pidl.h:218
DWORD dummy1
Definition: pidl.h:222
struct tagPIDLDATA::@594::@596 htmlhelp
struct tagGUIDStruct guid
Definition: pidl.h:213
WORD dummy
Definition: pidl.h:217
struct tagValueW valueW
Definition: pidl.h:226
CHAR szName[1]
Definition: pidl.h:223
struct tagPIDLCPanelStruct cpanel
Definition: pidl.h:225
DWORD dwAttributes
Definition: vdmdbg.h:34
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
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
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193