Moved file functions to shlfileop.c
[wine/wine64.git] / dlls / shell32 / pidl.h
blob00a5ab64b312283979d2ef7cd538985cea14fb5a
1 /*
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
8 * directly.
10 * Undocumented:
11 * MS says: the abID of SHITEMID should be treated as binary data and not
12 * be interpreted by applications. Applies to everyone but MS itself.
13 * Word95 interprets the contents of abID (Filesize/Date) so we have to go
14 * for binary compatibility here.
17 #ifndef __WINE_PIDL_H
18 #define __WINE_PIDL_H
20 #include "shlobj.h"
22 /*
23 * the pidl does cache fileattributes to speed up SHGetAttributes when
24 * displaying a big number of files.
26 * a pidl of NULL means the desktop
28 * The structure of the pidl seems to be a union. The first byte of the
29 * PIDLDATA desribes the type of pidl.
31 * object ! first byte / ! format ! living space
32 * ! size
33 * ----------------------------------------------------------------
34 * my computer 0x1F/20 mycomp (2) (usual)
35 * network 0x1F mycomp
36 * bitbucket 0x1F mycomp
37 * drive 0x23/25 drive (usual)
38 * drive 0x25/25 drive (lnk/persistant)
39 * drive 0x29/25 drive
40 * shell extension 0x2E mycomp
41 * drive 0x2F drive (lnk/persistant)
42 * folder/file 0x30 folder/file (1) (lnk/persistant)
43 * folder 0x31 folder (usual)
44 * value 0x32 file (usual)
45 * workgroup 0x41 network (3)
46 * computer 0x42 network (4)
47 * whole network 0x47 network (5)
48 * MSITStore 0x61 htmlhlp (7)
49 * history/favorites 0xb1 file
50 * share 0xc3 network (6)
52 * guess: the persistant elements are non tracking
54 * (1) dummy byte is used, attributes are empty
55 * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
56 * (3) two strings "workgroup" "microsoft network"
57 * (4) one string "\\sirius"
58 * (5) one string "whole network"
59 * (6) one string "\\sirius\c"
60 * (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
61 * GUID 871C5380-42A0-1069-A2EA-08002B30309D
64 #define PT_DESKTOP 0x00 /* internal */
65 #define PT_MYCOMP 0x1F
66 #define PT_DRIVE 0x23
67 #define PT_DRIVE2 0x25
68 #define PT_DRIVE3 0x29
69 #define PT_SPECIAL 0x2E
70 #define PT_DRIVE1 0x2F
71 #define PT_FOLDER1 0x30
72 #define PT_FOLDER 0x31
73 #define PT_VALUE 0x32
74 #define PT_WORKGRP 0x41
75 #define PT_COMP 0x42
76 #define PT_NETWORK 0x47
77 #define PT_IESPECIAL 0xb1
78 #define PT_SHARE 0xc3
80 #include "pshpack1.h"
81 typedef BYTE PIDLTYPE;
83 typedef struct tagPIDLDATA
84 { PIDLTYPE type; /*00*/
85 union
86 { struct
87 { BYTE dummy; /*01*/
88 GUID guid; /*02*/
89 BYTE dummy1; /*18*/
90 } mycomp;
91 struct
92 { CHAR szDriveName[20]; /*01*/
93 DWORD dwUnknown; /*21*/
94 /* the drive seems to be 25 bytes every time */
95 } drive;
96 struct
97 { BYTE dummy; /*01 is 0x00 for files or dirs */
98 DWORD dwFileSize; /*02*/
99 WORD uFileDate; /*06*/
100 WORD uFileTime; /*08*/
101 WORD uFileAttribs; /*10*/
102 CHAR szNames[1]; /*12*/
103 /* Here are comming two strings. The first is the long name.
104 The second the dos name when needed or just 0x00 */
105 } file, folder, generic;
106 struct
107 { WORD dummy; /*01*/
108 CHAR szNames[1]; /*03*/
109 } network;
110 struct
111 { WORD dummy; /*01*/
112 DWORD dummy1; /*02*/
113 CHAR szName[1]; /*06*/ /* teminated by 0x00 0x00 */
114 } htmlhelp;
116 } PIDLDATA, *LPPIDLDATA;
117 #include "poppack.h"
120 * getting special values from simple pidls
122 DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
123 BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
124 DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
125 BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
126 void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
127 DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
129 BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft);
130 DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT16);
133 * testing simple pidls
135 BOOL _ILIsDesktop (LPCITEMIDLIST pidl);
136 BOOL _ILIsMyComputer (LPCITEMIDLIST pidl);
137 BOOL _ILIsDrive (LPCITEMIDLIST pidl);
138 BOOL _ILIsFolder (LPCITEMIDLIST pidl);
139 BOOL _ILIsValue (LPCITEMIDLIST pidl);
140 BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl);
141 BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl);
144 * simple pidls from strings
146 LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT16);
148 LPITEMIDLIST _ILCreateDesktop (void);
149 LPITEMIDLIST _ILCreateMyComputer (void);
150 LPITEMIDLIST _ILCreateIExplore (void);
151 LPITEMIDLIST _ILCreateControl (void);
152 LPITEMIDLIST _ILCreatePrinter (void);
153 LPITEMIDLIST _ILCreateNetwork (void);
154 LPITEMIDLIST _ILCreateBitBucket (void);
155 LPITEMIDLIST _ILCreateDrive (LPCSTR);
156 LPITEMIDLIST _ILCreateFolder (WIN32_FIND_DATAA * stffile);
157 LPITEMIDLIST _ILCreateValue (WIN32_FIND_DATAA * stffile);
158 LPITEMIDLIST _ILCreateSpecial (LPCSTR szGUID);
161 * helper functions (getting struct-pointer)
163 LPPIDLDATA _ILGetDataPointer (LPCITEMIDLIST);
164 LPSTR _ILGetTextPointer (LPCITEMIDLIST);
165 LPSTR _ILGetSTextPointer (LPCITEMIDLIST);
166 REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl);
169 * debug helper
171 void pdump (LPCITEMIDLIST pidl);
172 BOOL pcheck (LPCITEMIDLIST pidl);
175 * aPidl helper
177 void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl);
178 LPITEMIDLIST * _ILCopyaPidl(LPITEMIDLIST * apidlsrc, UINT cidl);
179 LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, LPCIDA cida);
181 #endif