Added DebugBreak.
[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 *       ----------------------------------------------------------------
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)
41 *
42 * guess: the persistant elements are non tracking
43 *
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"
50 */
51
52 #define PT_DESKTOP      0x00 /* internal */
53 #define PT_MYCOMP       0x1F
54 #define PT_DRIVE        0x23
55 #define PT_SPECIAL      0x2E
56 #define PT_DRIVE1       0x2F
57 #define PT_FOLDER1      0x30
58 #define PT_FOLDER       0x31
59 #define PT_VALUE        0x32
60 #define PT_WORKGRP      0x41
61 #define PT_COMP         0x42
62 #define PT_NETWORK      0x47
63 #define PT_SHARE        0xc3
64
65 #include "pshpack1.h"
66 typedef BYTE PIDLTYPE;
67
68 typedef struct tagPIDLDATA
69 {       PIDLTYPE type;                  /*00*/
70         union
71         { struct
72           { BYTE dummy;
73             GUID guid;
74           } mycomp;
75           struct
76           { CHAR szDriveName[4];        /*01*/
77             /* end of MS compatible*/
78             DWORD dwSFGAO;              /*05*/
79             /* the drive seems to be 19 bytes every time */
80           } drive;
81           struct 
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; 
91           struct
92           { WORD dummy;         /*01*/
93             CHAR szNames[1];    /*03*/
94           } network;
95         }u;
96 } PIDLDATA, *LPPIDLDATA;
97 #include "poppack.h"
98
99 /*
100  * getting string values from pidls
101  *
102  * return value is strlen()
103  */
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);
109
110 /*
111  * getting special values from simple pidls
112  */
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);
116
117
118 /*
119  * testing simple pidls
120  */
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);
126
127 /*
128  * simple pidls from strings
129  */
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);
135
136 /*
137  * raw pidl handling (binary) 
138  *
139  * data is binary / sizes are bytes
140  */
141 DWORD WINAPI _ILGetData(PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT);
142 LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPCVOID,UINT16);
143
144 /*
145  * helper functions (getting struct-pointer)
146  */
147 LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
148 LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
149 LPSTR WINAPI _ILGetSTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
150
151 void pdump (LPCITEMIDLIST pidl);
152 BOOL pcheck (LPCITEMIDLIST pidl);
153 #endif