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
29 * ----------------------------------------------------------------
30 * my computer 0x1F mycomp (2) (usual)
31 * drive 0x23 drive (usual)
32 * control/printer 0x2E
33 * drive 0x2F drive (lnk/persistant)
34 * folder/file 0x30 folder/file (1) (lnk/persistant)
35 * folder 0x31 folder (usual)
36 * value 0x32 file (usual)
37 * workgroup 0x41 network (3)
38 * computer 0x42 network (4)
39 * whole network 0x47 network (5)
40 * share 0xc3 metwork (6)
42 * guess: the persistant elements are non tracking
44 * (1) dummy byte is used, attributes are empty
45 * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
46 * (3) two strings "workgroup" "microsoft network"
47 * (4) one string "\\sirius"
48 * (5) one string "whole network"
49 * (6) one string "\\sirius\c"
52 #define PT_DESKTOP 0x00 /* internal */
53 #define PT_MYCOMP 0x1F
55 #define PT_SPECIAL 0x2E
56 #define PT_DRIVE1 0x2F
57 #define PT_FOLDER1 0x30
58 #define PT_FOLDER 0x31
60 #define PT_WORKGRP 0x41
62 #define PT_NETWORK 0x47
66 typedef BYTE PIDLTYPE
;
68 typedef struct tagPIDLDATA
69 { PIDLTYPE type
; /*00*/
76 { CHAR szDriveName
[4]; /*01*/
77 /* end of MS compatible*/
79 /* the drive seems to be 19 bytes every time */
82 { BYTE dummy
; /*01 is 0x00 for files or dirs */
83 DWORD dwFileSize
; /*02*/
84 WORD uFileDate
; /*06*/
85 WORD uFileTime
; /*08*/
86 WORD uFileAttribs
; /*10*/
87 CHAR szNames
[1]; /*12*/
88 /* Here are comming two strings. The first is the long name.
89 The second the dos name when needed or just 0x00 */
90 } file
, folder
, generic
;
93 CHAR szNames
[1]; /*03*/
96 } PIDLDATA
, *LPPIDLDATA
;
100 * getting string values from pidls
102 * return value is strlen()
104 DWORD WINAPI
_ILGetDrive(LPCITEMIDLIST
,LPSTR
,UINT16
);
105 DWORD WINAPI
_ILGetItemText(LPCITEMIDLIST
,LPSTR
,UINT16
);
106 DWORD WINAPI
_ILGetFolderText(LPCITEMIDLIST
,LPSTR
,DWORD
);
107 DWORD WINAPI
_ILGetValueText(LPCITEMIDLIST
,LPSTR
,DWORD
);
108 DWORD WINAPI
_ILGetPidlPath(LPCITEMIDLIST
,LPSTR
,DWORD
);
111 * getting special values from simple pidls
113 BOOL WINAPI
_ILGetFileDate (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
114 BOOL WINAPI
_ILGetFileSize (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
115 BOOL WINAPI
_ILGetExtension (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
119 * testing simple pidls
121 BOOL WINAPI
_ILIsDesktop(LPCITEMIDLIST
);
122 BOOL WINAPI
_ILIsMyComputer(LPCITEMIDLIST
);
123 BOOL WINAPI
_ILIsDrive(LPCITEMIDLIST
);
124 BOOL WINAPI
_ILIsFolder(LPCITEMIDLIST
);
125 BOOL WINAPI
_ILIsValue(LPCITEMIDLIST
);
128 * simple pidls from strings
130 LPITEMIDLIST WINAPI
_ILCreateDesktop(void);
131 LPITEMIDLIST WINAPI
_ILCreateMyComputer(void);
132 LPITEMIDLIST WINAPI
_ILCreateDrive(LPCSTR
);
133 LPITEMIDLIST WINAPI
_ILCreateFolder(LPCSTR
, LPCSTR
);
134 LPITEMIDLIST WINAPI
_ILCreateValue(LPCSTR
, LPCSTR
);
137 * raw pidl handling (binary)
139 * data is binary / sizes are bytes
141 DWORD WINAPI
_ILGetData(PIDLTYPE
,LPCITEMIDLIST
,LPVOID
,UINT
);
142 LPITEMIDLIST WINAPI
_ILCreate(PIDLTYPE
,LPCVOID
,UINT16
);
145 * helper functions (getting struct-pointer)
147 LPPIDLDATA WINAPI
_ILGetDataPointer(LPCITEMIDLIST
);
148 LPSTR WINAPI
_ILGetTextPointer(PIDLTYPE type
, LPPIDLDATA pidldata
);
149 LPSTR WINAPI
_ILGetSTextPointer(PIDLTYPE type
, LPPIDLDATA pidldata
);
151 void pdump (LPCITEMIDLIST pidl
);
152 BOOL
pcheck (LPCITEMIDLIST pidl
);