2 * internal pidl functions
3 * 1998 <juergen.schmied@metronet.de>
5 * DO NOT use this definitions outside the shell32.dll !
7 * The contents of a pidl should never used from a application
10 * This stuff is used from SHGetFileAttributes, ShellFolder
11 * EnumIDList and ShellView.
20 * the pidl does cache fileattributes to speed up SHGetAttributes when
21 * displaying a big number of files.
23 * a pidl of NULL means the desktop
25 * The structure of the pidl seems to be a union. The first byte of the
26 * PIDLDATA desribes the type of pidl.
28 * object ! first byte / ! format ! living space
30 * ----------------------------------------------------------------
31 * my computer 0x1F/20 mycomp (2) (usual)
33 * bitbucket 0x1F mycomp
34 * drive 0x23/25 drive (usual)
35 * drive 0x25/25 drive (lnk/persistant)
37 * shell extension 0x2E mycomp
38 * drive 0x2F drive (lnk/persistant)
39 * folder/file 0x30 folder/file (1) (lnk/persistant)
40 * folder 0x31 folder (usual)
41 * value 0x32 file (usual)
42 * workgroup 0x41 network (3)
43 * computer 0x42 network (4)
44 * whole network 0x47 network (5)
45 * MSITStore 0x61 htmlhlp (7)
46 * history/favorites 0xb1 file
47 * share 0xc3 network (6)
49 * guess: the persistant elements are non tracking
51 * (1) dummy byte is used, attributes are empty
52 * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
53 * (3) two strings "workgroup" "microsoft network"
54 * (4) one string "\\sirius"
55 * (5) one string "whole network"
56 * (6) one string "\\sirius\c"
57 * (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
58 * GUID 871C5380-42A0-1069-A2EA-08002B30309D
61 #define PT_DESKTOP 0x00 /* internal */
62 #define PT_MYCOMP 0x1F
64 #define PT_DRIVE2 0x25
65 #define PT_DRIVE3 0x29
66 #define PT_SPECIAL 0x2E
67 #define PT_DRIVE1 0x2F
68 #define PT_FOLDER1 0x30
69 #define PT_FOLDER 0x31
71 #define PT_WORKGRP 0x41
73 #define PT_NETWORK 0x47
74 #define PT_IESPECIAL 0xb1
78 typedef BYTE PIDLTYPE;
80 typedef struct tagPIDLDATA
81 { PIDLTYPE type; /*00*/
89 { CHAR szDriveName[20]; /*01*/
90 DWORD dwUnknown; /*21*/
91 /* the drive seems to be 25 bytes every time */
94 { BYTE dummy; /*01 is 0x00 for files or dirs */
95 DWORD dwFileSize; /*02*/
96 WORD uFileDate; /*06*/
97 WORD uFileTime; /*08*/
98 WORD uFileAttribs; /*10*/
99 CHAR szNames[1]; /*12*/
100 /* Here are comming two strings. The first is the long name.
101 The second the dos name when needed or just 0x00 */
102 } file, folder, generic;
105 CHAR szNames[1]; /*03*/
110 CHAR szName[1]; /*06*/ /* teminated by 0x00 0x00 */
113 } PIDLDATA, *LPPIDLDATA;
117 * getting special values from simple pidls
119 DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
120 BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
121 DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
122 BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
123 void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
124 DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
126 BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft);
127 DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT16);
130 * testing simple pidls
132 BOOL _ILIsDesktop (LPCITEMIDLIST pidl);
133 BOOL _ILIsMyComputer (LPCITEMIDLIST pidl);
134 BOOL _ILIsDrive (LPCITEMIDLIST pidl);
135 BOOL _ILIsFolder (LPCITEMIDLIST pidl);
136 BOOL _ILIsValue (LPCITEMIDLIST pidl);
137 BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl);
138 BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
141 * simple pidls from strings
143 LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT16);
145 LPITEMIDLIST _ILCreateDesktop (void);
146 LPITEMIDLIST _ILCreateMyComputer (void);
147 LPITEMIDLIST _ILCreateIExplore (void);
148 LPITEMIDLIST _ILCreateControl (void);
149 LPITEMIDLIST _ILCreatePrinter (void);
150 LPITEMIDLIST _ILCreateNetwork (void);
151 LPITEMIDLIST _ILCreateBitBucket (void);
152 LPITEMIDLIST _ILCreateDrive (LPCSTR);
153 LPITEMIDLIST _ILCreateFolder (WIN32_FIND_DATAA * stffile);
154 LPITEMIDLIST _ILCreateValue (WIN32_FIND_DATAA * stffile);
155 LPITEMIDLIST _ILCreateSpecial (LPCSTR szGUID);
158 * helper functions (getting struct-pointer)
160 LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST);
161 LPSTR _ILGetTextPointer (LPCITEMIDLIST);
162 LPSTR _ILGetSTextPointer (LPCITEMIDLIST);
163 REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl);
168 void pdump (LPCITEMIDLIST pidl);
169 BOOL pcheck (LPCITEMIDLIST pidl);