Compiler warnings fix.
[wine] / dlls / shell32 / pidl.h
1 /*
2  * internal pidl functions
3  * 1998 <juergen.schmied@metronet.de>
4  *
5  * DO NOT use this definitions outside the shell32.dll !
6  *
7  * The contents of a pidl should never used from a application
8  * directly. 
9  *
10  * This stuff is used from SHGetFileAttributes, ShellFolder 
11  * EnumIDList and ShellView.
12  */
13  
14 #ifndef __WINE_PIDL_H
15 #define __WINE_PIDL_H
16
17 #include "shlobj.h"
18
19 /* 
20 * the pidl does cache fileattributes to speed up SHGetAttributes when
21 * displaying a big number of files.
22 *
23 * a pidl of NULL means the desktop
24 *
25 * The structure of the pidl seems to be a union. The first byte of the
26 * PIDLDATA desribes the type of pidl.
27 *
28 *       object        ! first byte /  ! format       ! living space
29 *                     ! size
30 *       ----------------------------------------------------------------
31 *       my computer     0x1F/20         mycomp (2)      (usual)
32 *       drive           0x23/25         drive           (usual)
33 *       drive           0x25/25         drive           (lnk/persistant)
34 *       drive           0x29/25         drive
35 *       control/printer 0x2E
36 *       drive           0x2F            drive           (lnk/persistant)
37 *       folder/file     0x30            folder/file (1) (lnk/persistant)
38 *       folder          0x31            folder          (usual)
39 *       value           0x32            file            (usual)
40 *       workgroup       0x41            network (3)
41 *       computer        0x42            network (4)
42 *       whole network   0x47            network (5)
43 *       history/favorites 0xb1          file
44 *       share           0xc3            metwork (6)
45 *
46 * guess: the persistant elements are non tracking
47 *
48 * (1) dummy byte is used, attributes are empty
49 * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
50 * (3) two strings       "workgroup" "microsoft network"
51 * (4) one string        "\\sirius"
52 * (5) one string        "whole network" 
53 * (6) one string        "\\sirius\c"
54 */
55
56 #define PT_DESKTOP      0x00 /* internal */
57 #define PT_MYCOMP       0x1F
58 #define PT_DRIVE        0x23
59 #define PT_DRIVE2       0x25
60 #define PT_DRIVE3       0x29
61 #define PT_SPECIAL      0x2E
62 #define PT_DRIVE1       0x2F
63 #define PT_FOLDER1      0x30
64 #define PT_FOLDER       0x31
65 #define PT_VALUE        0x32
66 #define PT_WORKGRP      0x41
67 #define PT_COMP         0x42
68 #define PT_NETWORK      0x47
69 #define PT_IESPECIAL    0xb1
70 #define PT_SHARE        0xc3
71
72 #include "pshpack1.h"
73 typedef BYTE PIDLTYPE;
74
75 typedef struct tagPIDLDATA
76 {       PIDLTYPE type;                  /*00*/
77         union
78         { struct
79           { BYTE dummy;
80             GUID guid;
81           } mycomp;
82           struct
83           { CHAR szDriveName[20];       /*01*/
84             DWORD dwUnknown;            /*21*/
85             /* the drive seems to be 25 bytes every time */
86           } drive;
87           struct 
88           { BYTE dummy;                 /*01 is 0x00 for files or dirs */
89             DWORD dwFileSize;           /*02*/
90             WORD uFileDate;             /*06*/
91             WORD uFileTime;             /*08*/
92             WORD uFileAttribs;          /*10*/
93             CHAR szNames[1];            /*12*/
94             /* Here are comming two strings. The first is the long name. 
95             The second the dos name when needed or just 0x00 */
96           } file, folder, generic; 
97           struct
98           { WORD dummy;         /*01*/
99             CHAR szNames[1];    /*03*/
100           } network;
101         }u;
102 } PIDLDATA, *LPPIDLDATA;
103 #include "poppack.h"
104
105 /*
106  * getting string values from pidls
107  *
108  * return value is strlen()
109  */
110 DWORD WINAPI _ILGetDrive(LPCITEMIDLIST,LPSTR,UINT16);
111 DWORD WINAPI _ILGetItemText(LPCITEMIDLIST,LPSTR,UINT16);
112 DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST,LPSTR,DWORD);
113 DWORD WINAPI _ILGetValueText(LPCITEMIDLIST,LPSTR,DWORD);
114 DWORD WINAPI _ILGetPidlPath(LPCITEMIDLIST,LPSTR,DWORD);
115
116 /*
117  * getting special values from simple pidls
118  */
119 BOOL WINAPI _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
120 BOOL WINAPI _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
121 BOOL WINAPI _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
122
123
124 /*
125  * testing simple pidls
126  */
127 BOOL WINAPI _ILIsDesktop(LPCITEMIDLIST);
128 BOOL WINAPI _ILIsMyComputer(LPCITEMIDLIST);
129 BOOL WINAPI _ILIsDrive(LPCITEMIDLIST);
130 BOOL WINAPI _ILIsFolder(LPCITEMIDLIST);
131 BOOL WINAPI _ILIsValue(LPCITEMIDLIST);
132
133 /*
134  * simple pidls from strings
135  */
136 LPITEMIDLIST WINAPI _ILCreateDesktop(void);
137 LPITEMIDLIST WINAPI _ILCreateMyComputer(void);
138 LPITEMIDLIST WINAPI _ILCreateDrive(LPCSTR);
139 LPITEMIDLIST WINAPI _ILCreateFolder(LPCSTR, LPCSTR);
140 LPITEMIDLIST WINAPI _ILCreateValue(LPCSTR, LPCSTR);
141
142 /*
143  * raw pidl handling (binary) 
144  *
145  * data is binary / sizes are bytes
146  */
147 DWORD WINAPI _ILGetData(PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT);
148 LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPCVOID,UINT16);
149
150 /*
151  * helper functions (getting struct-pointer)
152  */
153 LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
154 LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
155 LPSTR WINAPI _ILGetSTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
156
157 void pdump (LPCITEMIDLIST pidl);
158 BOOL pcheck (LPCITEMIDLIST pidl);
159 #endif