ReactOS 0.4.16-dev-257-g6aa11ac
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_DESKTOP_REGITEM 0x1F // => SHDID_ROOT_REGITEM
109#define PT_COMPUTER_REGITEM 0x2E // => SHDID_COMPUTER_OTHER
110#define PT_FS 0x30 // Win95 SHSimpleIDListFromPath
111#define PT_FS_FOLDER_FLAG 0x01
112#define PT_FS_FILE_FLAG 0x02
113#define PT_FS_UNICODE_FLAG 0x04
114// PT_NET_REGITEM 0x4? // => SHDID_NET_OTHER
115#define PT_CONTROLS_OLDREGITEM 0x70
116#define PT_CONTROLS_NEWREGITEM 0x71
117#endif
118
119#include "pshpack1.h"
121
123{
124 BYTE dummy; /*01 is 0x00 */
125 DWORD iconIdx; /*02 negative icon ID */
128 WCHAR szName[1]; /*10*/ /* terminated by 0x00, followed by display name and comment string */
130
131#ifdef __REACTOS__
132
133typedef struct tagPIDLFontStruct
134{
135 BYTE dummy;
136 WORD offsFile;
137 WCHAR szName[1];
138} PIDLFontStruct;
139
140typedef struct tagPIDLPrinterStruct
141{
142 BYTE dummy;
144 WORD offsServer;
145 WCHAR szName[1];
146} PIDLPrinterStruct;
147
148typedef struct tagPIDLRecycleStruct
149{
150 FILETIME LastModification;
151 FILETIME DeletionTime;
153 ULARGE_INTEGER PhysicalFileSize;
155 WCHAR szName[1];
156} PIDLRecycleStruct;
157
158#endif /* !__REACTOS__ */
159
160typedef struct tagGUIDStruct
161{
162 BYTE dummy; /* offset 01 is unknown */
163 GUID guid; /* offset 02 */
165
166typedef struct tagDriveStruct
167{
168 CHAR szDriveName[20]; /*01*/
169 WORD unknown; /*21*/
171
172typedef struct tagFileStruct
173{
174 BYTE dummy; /*01 is 0x00 for files or dirs */
179 CHAR szNames[1]; /*12*/
180 /* Here are coming two strings. The first is the long name.
181 The second the dos name when needed or just 0x00 */
183
184/* At least on WinXP, this struct is appended with 2-byte-alignment to FileStruct. There follows
185 * a WORD member after the wszName string, which gives the offset from the beginning of the PIDL
186 * to the FileStructW member. */
187typedef struct tagFileStructW {
197
198typedef struct tagValueW
199{
202
203typedef struct tagPIDLDATA
204{ PIDLTYPE type; /*00*/
205 union
206 {
210 struct
211 { WORD dummy; /*01*/
212 CHAR szNames[1]; /*03*/
214 struct
215 { WORD dummy; /*01*/
216 DWORD dummy1; /*02*/
217 CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
221#ifdef __REACTOS__
222 struct tagPIDLFontStruct cfont;
223 struct tagPIDLPrinterStruct cprinter;
224 struct tagPIDLRecycleStruct crecycle;
225#endif
228#include "poppack.h"
229
230/*
231 * getting special values from simple pidls
232 */
237void _ILGetFileType (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN;
241
242/*
243 * testing simple pidls
244 */
248#ifdef __REACTOS__
253#endif
260static inline
262{
263 return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) ||
264 (!pidlA->mkid.cb && !pidlB->mkid.cb);
265}
266static inline
268
269/*
270 * simple pidls
271 */
272
273/* Creates a PIDL with guid format and type type, which must be one of PT_GUID,
274 * PT_SHELLEXT, or PT_YAGUID.
275 */
277
278#ifndef __REACTOS__
279/* Like _ILCreateGuid, but using the string szGUID. */
282#endif
283
284/* Commonly used PIDLs representing file system objects. */
288
289/* Other helpers */
297#ifdef __REACTOS__
299#endif
303
304/*
305 * helper functions (getting struct-pointer)
306 */
311
312/*
313 * debug helper
314 */
317
318/*
319 * aPidl helper
320 */
324
326
327#ifdef __cplusplus
328} /* extern "C" */
329#endif
330
331#endif /* __WINE_PIDL_H */
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#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
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const GUID * guid
LPCWSTR szPath
Definition: env.c:37
unsigned int UINT
Definition: ndis.h:50
BOOL _ILIsMyDocuments(LPCITEMIDLIST pidl)
Definition: pidl.c:1943
BOOL _ILIsBitBucket(LPCITEMIDLIST pidl)
Definition: pidl.c:1987
BOOL _ILIsNetHood(LPCITEMIDLIST pidl)
Definition: pidl.c:1954
BOOL _ILIsControlPanel(LPCITEMIDLIST pidl)
Definition: pidl.c:1965
LPITEMIDLIST _ILCreateAdminTools(void)
Definition: pidl.c:1728
LPITEMIDLIST _ILCreatePrinters(void) DECLSPEC_HIDDEN
Definition: pidl.c:1689
LPITEMIDLIST _ILCreateDesktop(void) DECLSPEC_HIDDEN
Definition: pidl.c:1641
void pdump(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: debughlp.cpp:311
struct tagPIDLDATA PIDLDATA
BOOL _ILIsCPanelStruct(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2039
LPITEMIDLIST _ILCreateDrive(LPCWSTR) DECLSPEC_HIDDEN
Definition: pidl.c:1855
BOOL pcheck(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: debughlp.cpp:349
LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST *pidl, const CIDA *cida) DECLSPEC_HIDDEN
Definition: pidl.c:2638
DWORD _ILSimpleGetTextW(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2080
LPITEMIDLIST _ILCreateNetwork(void) DECLSPEC_HIDDEN
Definition: pidl.c:1716
LPITEMIDLIST _ILCreateEntireNetwork(void) DECLSPEC_HIDDEN
Definition: pidl.c:1875
void _ILGetFileType(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2506
IID * _ILGetGUIDPointer(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2298
struct tagPIDLCPanelStruct PIDLCPanelStruct
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl) DECLSPEC_HIDDEN
Definition: pidl.c:2600
BOOL _ILIsDrive(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2009
BYTE PIDLTYPE
Definition: pidl.h:120
LPITEMIDLIST _ILCreateMyDocuments(void) DECLSPEC_HIDDEN
Definition: pidl.c:1658
struct tagDriveStruct DriveStruct
BOOL _ILGetExtension(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2460
struct tagFileStruct FileStruct
LPITEMIDLIST _ILCreateNetHood(void) DECLSPEC_HIDDEN
DWORD _ILGetFileSize(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2439
HRESULT _ILCreateFromPathW(LPCWSTR szPath, LPITEMIDLIST *ppidl) DECLSPEC_HIDDEN
Definition: pidl.c:1836
DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2560
BOOL _ILIsDesktop(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: CBandSite.h:24
LPITEMIDLIST _ILCreateGuidFromStrA(LPCSTR szGUID) DECLSPEC_HIDDEN
Definition: pidl.c:1759
BOOL _ILIsUnicode(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:1927
static BOOL _ILIsEqualSimple(LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
Definition: pidl.h:261
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:1976
PITEMID_CHILD * _ILCopyaPidl(PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl) DECLSPEC_HIDDEN
Definition: pidl.c:2617
LPSTR _ILGetTextPointer(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: pidl.c:2227
LPITEMIDLIST _ILCreateGuidFromStrW(LPCWSTR szGUID) DECLSPEC_HIDDEN
Definition: pidl.c:1771
BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:1998
LPITEMIDLIST _ILCreateControlPanel(void) DECLSPEC_HIDDEN
Definition: pidl.c:1670
LPITEMIDLIST _ILCreateBitBucket(void) DECLSPEC_HIDDEN
Definition: pidl.c:1722
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST) DECLSPEC_HIDDEN
Definition: pidl.c:2160
struct tagFileStructW FileStructW
BOOL _ILGetFileDate(LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize) DECLSPEC_HIDDEN
Definition: pidl.c:2395
BOOL _ILIsFolder(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2021
LPITEMIDLIST _ILCreateFromFindDataW(const WIN32_FIND_DATAW *stffile) DECLSPEC_HIDDEN
Definition: pidl.c:1788
DWORD _ILGetDrive(LPCITEMIDLIST, LPWSTR, UINT) DECLSPEC_HIDDEN
Definition: pidl.c:1900
BOOL _ILIsPidlSimple(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *ft) DECLSPEC_HIDDEN
Definition: pidl.c:2376
LPITEMIDLIST _ILCreateIExplore(void) DECLSPEC_HIDDEN
Definition: pidl.c:1664
struct tagValueW ValueWStruct
BOOL _ILIsValue(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2030
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
Definition: pidl.h:267
FileStructW * _ILGetFileStructW(LPCITEMIDLIST pidl) DECLSPEC_HIDDEN
Definition: pidl.c:2334
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:1734
LPITEMIDLIST _ILCreateMyComputer(void) DECLSPEC_HIDDEN
Definition: pidl.c:1652
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:572
Definition: fci.c:127
Definition: name.c:39
WORD unknown
Definition: pidl.h:169
CHAR szDriveName[20]
Definition: pidl.h:168
WCHAR wszName[1]
Definition: pidl.h:195
BYTE dummy2[4]
Definition: pidl.h:194
WORD uCreationTime
Definition: pidl.h:191
WORD uLastAccessTime
Definition: pidl.h:193
BYTE dummy1[6]
Definition: pidl.h:189
WORD uCreationDate
Definition: pidl.h:190
WORD uLastAccessDate
Definition: pidl.h:192
WORD cbLen
Definition: pidl.h:188
WORD uFileDate
Definition: pidl.h:176
WORD uFileAttribs
Definition: pidl.h:178
WORD uFileTime
Definition: pidl.h:177
DWORD dwFileSize
Definition: pidl.h:175
BYTE dummy
Definition: pidl.h:174
CHAR szNames[1]
Definition: pidl.h:179
GUID guid
Definition: pidl.h:163
BYTE dummy
Definition: pidl.h:162
WORD offsComment
Definition: pidl.h:127
WCHAR szName[1]
Definition: pidl.h:128
WORD offsDispName
Definition: pidl.h:126
PIDLTYPE type
Definition: pidl.h:204
CHAR szNames[1]
Definition: pidl.h:212
struct tagPIDLDATA::@557::@559 htmlhelp
DWORD dummy1
Definition: pidl.h:216
struct tagPIDLDATA::@557::@558 network
struct tagGUIDStruct guid
Definition: pidl.h:207
union tagPIDLDATA::@557 u
WORD dummy
Definition: pidl.h:211
struct tagValueW valueW
Definition: pidl.h:220
CHAR szName[1]
Definition: pidl.h:217
struct tagPIDLCPanelStruct cpanel
Definition: pidl.h:219
_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