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 * first byte - my Computer 0x1F
29 * control/printer 0x2E
32 * drive: the second byte is the start of a string
35 * file: see the PIDLDATA structure
38 #define PT_DESKTOP 0x00 /* internal */
39 #define PT_MYCOMP 0x1F
40 #define PT_SPECIAL 0x2E
42 #define PT_FOLDER 0x31
46 typedef BYTE PIDLTYPE
;
48 typedef struct tagPIDLDATA
49 { PIDLTYPE type
; /*00*/
52 { CHAR szDriveName
[4]; /*01*/
53 /* end of MS compatible*/
55 /* the drive seems to be 19 bytes every time */
58 { BYTE dummy
; /*01 is 0x00 for files or dirs */
59 DWORD dwFileSize
; /*02*/
60 WORD uFileDate
; /*06*/
61 WORD uFileTime
; /*08*/
62 WORD uFileAttribs
; /*10*/
63 CHAR szNames
[1]; /*12*/
64 /* Here are comming two strings. The first is the long name.
65 The second the dos name when needed or just 0x00 */
66 } file
, folder
, generic
;
68 } PIDLDATA
, *LPPIDLDATA
;
72 * getting string values from pidls
74 * return value is strlen()
76 DWORD WINAPI
_ILGetDrive(LPCITEMIDLIST
,LPSTR
,UINT16
);
77 DWORD WINAPI
_ILGetItemText(LPCITEMIDLIST
,LPSTR
,UINT16
);
78 DWORD WINAPI
_ILGetFolderText(LPCITEMIDLIST
,LPSTR
,DWORD
);
79 DWORD WINAPI
_ILGetValueText(LPCITEMIDLIST
,LPSTR
,DWORD
);
80 DWORD WINAPI
_ILGetPidlPath(LPCITEMIDLIST
,LPSTR
,DWORD
);
83 * getting special values from simple pidls
85 BOOL WINAPI
_ILGetFileDate (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
86 BOOL WINAPI
_ILGetFileSize (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
87 BOOL WINAPI
_ILGetExtension (LPCITEMIDLIST pidl
, LPSTR pOut
, UINT uOutSize
);
91 * testing simple pidls
93 BOOL WINAPI
_ILIsDesktop(LPCITEMIDLIST
);
94 BOOL WINAPI
_ILIsMyComputer(LPCITEMIDLIST
);
95 BOOL WINAPI
_ILIsDrive(LPCITEMIDLIST
);
96 BOOL WINAPI
_ILIsFolder(LPCITEMIDLIST
);
97 BOOL WINAPI
_ILIsValue(LPCITEMIDLIST
);
100 * simple pidls from strings
102 LPITEMIDLIST WINAPI
_ILCreateDesktop(void);
103 LPITEMIDLIST WINAPI
_ILCreateMyComputer(void);
104 LPITEMIDLIST WINAPI
_ILCreateDrive(LPCSTR
);
105 LPITEMIDLIST WINAPI
_ILCreateFolder(LPCSTR
, LPCSTR
);
106 LPITEMIDLIST WINAPI
_ILCreateValue(LPCSTR
, LPCSTR
);
109 * raw pidl handling (binary)
111 * data is binary / sizes are bytes
113 DWORD WINAPI
_ILGetData(PIDLTYPE
,LPCITEMIDLIST
,LPVOID
,UINT
);
114 LPITEMIDLIST WINAPI
_ILCreate(PIDLTYPE
,LPVOID
,UINT16
);
117 * helper functions (getting struct-pointer)
119 LPPIDLDATA WINAPI
_ILGetDataPointer(LPCITEMIDLIST
);
120 LPSTR WINAPI
_ILGetTextPointer(PIDLTYPE type
, LPPIDLDATA pidldata
);
121 LPSTR WINAPI
_ILGetSTextPointer(PIDLTYPE type
, LPPIDLDATA pidldata
);
123 void pdump (LPCITEMIDLIST pidl
);