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 | * shell extension 0x2E mycomp
|
---|
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 | * MSITStore 0x61 htmlhlp (7)
|
---|
44 | * history/favorites 0xb1 file
|
---|
45 | * share 0xc3 network (6)
|
---|
46 | *
|
---|
47 | * guess: the persistant elements are non tracking
|
---|
48 | *
|
---|
49 | * (1) dummy byte is used, attributes are empty
|
---|
50 | * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D
|
---|
51 | * (3) two strings "workgroup" "microsoft network"
|
---|
52 | * (4) one string "\\sirius"
|
---|
53 | * (5) one string "whole network"
|
---|
54 | * (6) one string "\\sirius\c"
|
---|
55 | * (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm"
|
---|
56 | * GUID 871C5380-42A0-1069-A2EA-08002B30309D
|
---|
57 | */
|
---|
58 |
|
---|
59 | #define PT_DESKTOP 0x00 /* internal */
|
---|
60 | #define PT_MYCOMP 0x1F
|
---|
61 | #define PT_DRIVE 0x23
|
---|
62 | #define PT_DRIVE2 0x25
|
---|
63 | #define PT_DRIVE3 0x29
|
---|
64 | #define PT_SPECIAL 0x2E
|
---|
65 | #define PT_DRIVE1 0x2F
|
---|
66 | #define PT_FOLDER1 0x30
|
---|
67 | #define PT_FOLDER 0x31
|
---|
68 | #define PT_VALUE 0x32
|
---|
69 | #define PT_WORKGRP 0x41
|
---|
70 | #define PT_COMP 0x42
|
---|
71 | #define PT_NETWORK 0x47
|
---|
72 | #define PT_IESPECIAL 0xb1
|
---|
73 | #define PT_SHARE 0xc3
|
---|
74 |
|
---|
75 | #include "pshpack1.h"
|
---|
76 | typedef BYTE PIDLTYPE;
|
---|
77 |
|
---|
78 | typedef struct tagPIDLDATA
|
---|
79 | { PIDLTYPE type; /*00*/
|
---|
80 | union
|
---|
81 | { struct
|
---|
82 | { BYTE dummy; /*01*/
|
---|
83 | GUID guid; /*02*/
|
---|
84 | BYTE dummy1; /*18*/
|
---|
85 | } mycomp;
|
---|
86 | struct
|
---|
87 | { CHAR szDriveName[20]; /*01*/
|
---|
88 | DWORD dwUnknown; /*21*/
|
---|
89 | /* the drive seems to be 25 bytes every time */
|
---|
90 | } drive;
|
---|
91 | struct
|
---|
92 | { BYTE dummy; /*01 is 0x00 for files or dirs */
|
---|
93 | DWORD dwFileSize; /*02*/
|
---|
94 | WORD uFileDate; /*06*/
|
---|
95 | WORD uFileTime; /*08*/
|
---|
96 | WORD uFileAttribs; /*10*/
|
---|
97 | CHAR szNames[1]; /*12*/
|
---|
98 | /* Here are comming two strings. The first is the long name.
|
---|
99 | The second the dos name when needed or just 0x00 */
|
---|
100 | } file, folder, generic;
|
---|
101 | struct
|
---|
102 | { WORD dummy; /*01*/
|
---|
103 | CHAR szNames[1]; /*03*/
|
---|
104 | } network;
|
---|
105 | struct
|
---|
106 | { WORD dummy; /*01*/
|
---|
107 | DWORD dummy1; /*02*/
|
---|
108 | CHAR szName[1]; /*06*/ /* teminated by 0x00 0x00 */
|
---|
109 | } htmlhelp;
|
---|
110 | }u;
|
---|
111 | } PIDLDATA, *LPPIDLDATA;
|
---|
112 | #include "poppack.h"
|
---|
113 |
|
---|
114 | /*
|
---|
115 | * getting string values from pidls
|
---|
116 | *
|
---|
117 | * return value is strlen()
|
---|
118 | */
|
---|
119 | DWORD WINAPI _ILGetDrive(LPCITEMIDLIST,LPSTR,UINT16);
|
---|
120 | /*
|
---|
121 | DWORD WINAPI _ILGetItemText(LPCITEMIDLIST,LPSTR,UINT16);
|
---|
122 | DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST,LPSTR,DWORD);
|
---|
123 | DWORD WINAPI _ILGetValueText(LPCITEMIDLIST,LPSTR,DWORD);
|
---|
124 | DWORD WINAPI _ILGetPidlPath(LPCITEMIDLIST,LPSTR,DWORD);
|
---|
125 | */
|
---|
126 |
|
---|
127 | /*
|
---|
128 | * getting special values from simple pidls
|
---|
129 | */
|
---|
130 | BOOL WINAPI _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
|
---|
131 | BOOL WINAPI _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
|
---|
132 | BOOL WINAPI _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize);
|
---|
133 |
|
---|
134 |
|
---|
135 | /*
|
---|
136 | * testing simple pidls
|
---|
137 | */
|
---|
138 | BOOL WINAPI _ILIsDesktop(LPCITEMIDLIST);
|
---|
139 | BOOL WINAPI _ILIsMyComputer(LPCITEMIDLIST);
|
---|
140 | BOOL WINAPI _ILIsDrive(LPCITEMIDLIST);
|
---|
141 | BOOL WINAPI _ILIsFolder(LPCITEMIDLIST);
|
---|
142 | BOOL WINAPI _ILIsValue(LPCITEMIDLIST);
|
---|
143 | BOOL WINAPI _ILIsSpecialFolder (LPCITEMIDLIST pidl);
|
---|
144 | BOOL WINAPI _ILIsPidlSimple ( LPCITEMIDLIST pidl);
|
---|
145 |
|
---|
146 | /*
|
---|
147 | * simple pidls from strings
|
---|
148 | */
|
---|
149 | LPITEMIDLIST WINAPI _ILCreateDesktop(void);
|
---|
150 | LPITEMIDLIST WINAPI _ILCreateMyComputer(void);
|
---|
151 | LPITEMIDLIST WINAPI _ILCreateIExplore(void);
|
---|
152 | LPITEMIDLIST WINAPI _ILCreateDrive(LPCSTR);
|
---|
153 | LPITEMIDLIST WINAPI _ILCreateFolder(WIN32_FIND_DATAA * stffile);
|
---|
154 | LPITEMIDLIST WINAPI _ILCreateValue(WIN32_FIND_DATAA * stffile);
|
---|
155 | LPITEMIDLIST WINAPI _ILCreateSpecial(LPCSTR szGUID);
|
---|
156 |
|
---|
157 | DWORD WINAPI _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize);
|
---|
158 |
|
---|
159 | LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE,LPCVOID,UINT16);
|
---|
160 |
|
---|
161 | /*
|
---|
162 | * helper functions (getting struct-pointer)
|
---|
163 | */
|
---|
164 | LPPIDLDATA WINAPI _ILGetDataPointer(LPCITEMIDLIST);
|
---|
165 | LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
|
---|
166 | LPSTR WINAPI _ILGetSTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
|
---|
167 | REFIID WINAPI _ILGetGUIDPointer(LPCITEMIDLIST pidl);
|
---|
168 |
|
---|
169 | void pdump (LPCITEMIDLIST pidl);
|
---|
170 | BOOL pcheck (LPCITEMIDLIST pidl);
|
---|
171 | #endif
|
---|