Fixed a number of warnings concerning the matching of the printf
[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 * first byte -  my Computer     0x1F
29 *               control/printer 0x2E
30 *               drive           0x23 
31 *               folder          0x31 
32 * drive: the second byte is the start of a string
33 *         C  :  \ 
34 *        43 3A 5C
35 * file: see the PIDLDATA structure       
36 */
37
38 #define PT_DESKTOP      0x00 /* internal */
39 #define PT_MYCOMP       0x1F
40 #define PT_SPECIAL      0x2E
41 #define PT_DRIVE        0x23
42 #define PT_FOLDER       0x31
43 #define PT_VALUE        0x32
44
45 #pragma pack(1)
46 typedef BYTE PIDLTYPE;
47
48 typedef struct tagPIDLDATA
49 {       PIDLTYPE type;                  /*00*/
50         union
51         { struct
52           { CHAR szDriveName[4];        /*01*/
53             /* end of MS compatible*/
54             DWORD dwSFGAO;              /*05*/
55             /* the drive seems to be 19 bytes every time */
56           } drive;
57           struct 
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             /* end of MS compatible. Here are comming just one or two
64             strings. The first is the long name. The second the dos name
65             when needed. */
66             DWORD dwSFGAO;              /*12*/
67             CHAR  szAlternateName[14];  /* the 8.3 Name*/
68             CHAR  szText[1];            /* last entry, variable size */
69           } file, folder, generic; 
70         }u;
71 } PIDLDATA, *LPPIDLDATA;
72 #pragma pack(4)
73
74 /*
75  * getting string values from pidls
76  *
77  * return value is strlen()
78  */
79 DWORD WINAPI _ILGetDrive(LPCITEMIDLIST,LPSTR,UINT16);
80 DWORD WINAPI _ILGetItemText(LPCITEMIDLIST,LPSTR,UINT16);
81 DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST,LPSTR,DWORD);
82 DWORD WINAPI _ILGetValueText(LPCITEMIDLIST,LPSTR,DWORD);
83 DWORD WINAPI _ILGetPidlPath(LPCITEMIDLIST,LPSTR,DWORD);
84
85 /*
86  * getting special values from simple pidls
87  */
88 BOOL32 WINAPI _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT32 uOutSize);
89 BOOL32 WINAPI _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT32 uOutSize);
90 BOOL32 WINAPI _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT32 uOutSize);
91
92
93 /*
94  * testing simple pidls
95  */
96 BOOL32 WINAPI _ILIsDesktop(LPCITEMIDLIST);
97 BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST);
98 BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST);
99 BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST);
100 BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST);
101
102 /*
103  * simple pidls from strings
104  */
105 LPITEMIDLIST WINAPI _ILCreateDesktop(void);
106 LPITEMIDLIST WINAPI _ILCreateMyComputer(void);
107 LPITEMIDLIST WINAPI _ILCreateDrive(LPCSTR);
108 LPITEMIDLIST WINAPI _ILCreateFolder(LPCSTR);
109 LPITEMIDLIST WINAPI _ILCreateValue(LPCSTR);
110
111 /*
112  * raw pidl handling (binary) 
113  *
114  * data is binary / sizes are bytes
115  */
116 DWORD WINAPI _ILGetData(PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT32);
117 LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPVOID,UINT16);
118
119 /*
120  * helper functions (getting struct-pointer)
121  */
122 LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
123 LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
124
125 void pdump (LPCITEMIDLIST pidl);
126 #endif