1 | /*
|
---|
2 | Unix SMB/CIFS implementation.
|
---|
3 | SMB transaction2 handling
|
---|
4 | Copyright (C) Jeremy Allison 1994-2002.
|
---|
5 | Copyright (C) Andrew Tridgell 1995-2003.
|
---|
6 | Copyright (C) James Peach 2007
|
---|
7 |
|
---|
8 | This program is free software; you can redistribute it and/or modify
|
---|
9 | it under the terms of the GNU General Public License as published by
|
---|
10 | the Free Software Foundation; either version 3 of the License, or
|
---|
11 | (at your option) any later version.
|
---|
12 |
|
---|
13 | This program is distributed in the hope that it will be useful,
|
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | GNU General Public License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License
|
---|
19 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef _TRANS2_H_
|
---|
23 | #define _TRANS2_H_
|
---|
24 |
|
---|
25 |
|
---|
26 | /* trans2 Query FS info levels */
|
---|
27 | /*
|
---|
28 | w2k3 TRANS2ALIASES:
|
---|
29 | Checking for QFSINFO aliases
|
---|
30 | Found level 1 (0x001) of size 18 (0x12)
|
---|
31 | Found level 2 (0x002) of size 12 (0x0c)
|
---|
32 | Found level 258 (0x102) of size 26 (0x1a)
|
---|
33 | Found level 259 (0x103) of size 24 (0x18)
|
---|
34 | Found level 260 (0x104) of size 8 (0x08)
|
---|
35 | Found level 261 (0x105) of size 20 (0x14)
|
---|
36 | Found level 1001 (0x3e9) of size 26 (0x1a)
|
---|
37 | Found level 1003 (0x3eb) of size 24 (0x18)
|
---|
38 | Found level 1004 (0x3ec) of size 8 (0x08)
|
---|
39 | Found level 1005 (0x3ed) of size 20 (0x14)
|
---|
40 | Found level 1006 (0x3ee) of size 48 (0x30)
|
---|
41 | Found level 1007 (0x3ef) of size 32 (0x20)
|
---|
42 | Found level 1008 (0x3f0) of size 64 (0x40)
|
---|
43 | Found 13 levels with success status
|
---|
44 | Level 261 (0x105) and level 1005 (0x3ed) are possible aliases
|
---|
45 | Level 260 (0x104) and level 1004 (0x3ec) are possible aliases
|
---|
46 | Level 259 (0x103) and level 1003 (0x3eb) are possible aliases
|
---|
47 | Level 258 (0x102) and level 1001 (0x3e9) are possible aliases
|
---|
48 | Found 4 aliased levels
|
---|
49 | */
|
---|
50 | #define SMB_QFS_ALLOCATION 1
|
---|
51 | #define SMB_QFS_VOLUME 2
|
---|
52 | #define SMB_QFS_VOLUME_INFO 0x102
|
---|
53 | #define SMB_QFS_SIZE_INFO 0x103
|
---|
54 | #define SMB_QFS_DEVICE_INFO 0x104
|
---|
55 | #define SMB_QFS_ATTRIBUTE_INFO 0x105
|
---|
56 | #define SMB_QFS_UNIX_INFO 0x200
|
---|
57 | #define SMB_QFS_POSIX_INFO 0x201
|
---|
58 | #define SMB_QFS_POSIX_WHOAMI 0x202
|
---|
59 | #define SMB_QFS_VOLUME_INFORMATION 1001
|
---|
60 | #define SMB_QFS_SIZE_INFORMATION 1003
|
---|
61 | #define SMB_QFS_DEVICE_INFORMATION 1004
|
---|
62 | #define SMB_QFS_ATTRIBUTE_INFORMATION 1005
|
---|
63 | #define SMB_QFS_QUOTA_INFORMATION 1006
|
---|
64 | #define SMB_QFS_FULL_SIZE_INFORMATION 1007
|
---|
65 | #define SMB_QFS_OBJECTID_INFORMATION 1008
|
---|
66 | #define SMB_QFS_SECTOR_SIZE_INFORMATION 1011
|
---|
67 |
|
---|
68 |
|
---|
69 | /* trans2 qfileinfo/qpathinfo */
|
---|
70 | /* w2k3 TRANS2ALIASES:
|
---|
71 | Checking for QPATHINFO aliases
|
---|
72 | setting up complex file \qpathinfo_aliases.txt
|
---|
73 | Found level 1 (0x001) of size 22 (0x16)
|
---|
74 | Found level 2 (0x002) of size 26 (0x1a)
|
---|
75 | Found level 4 (0x004) of size 41 (0x29)
|
---|
76 | Found level 6 (0x006) of size 0 (0x00)
|
---|
77 | Found level 257 (0x101) of size 40 (0x28)
|
---|
78 | Found level 258 (0x102) of size 24 (0x18)
|
---|
79 | Found level 259 (0x103) of size 4 (0x04)
|
---|
80 | Found level 260 (0x104) of size 48 (0x30)
|
---|
81 | Found level 263 (0x107) of size 126 (0x7e)
|
---|
82 | Found level 264 (0x108) of size 28 (0x1c)
|
---|
83 | Found level 265 (0x109) of size 38 (0x26)
|
---|
84 | Found level 267 (0x10b) of size 16 (0x10)
|
---|
85 | Found level 1004 (0x3ec) of size 40 (0x28)
|
---|
86 | Found level 1005 (0x3ed) of size 24 (0x18)
|
---|
87 | Found level 1006 (0x3ee) of size 8 (0x08)
|
---|
88 | Found level 1007 (0x3ef) of size 4 (0x04)
|
---|
89 | Found level 1008 (0x3f0) of size 4 (0x04)
|
---|
90 | Found level 1009 (0x3f1) of size 48 (0x30)
|
---|
91 | Found level 1014 (0x3f6) of size 8 (0x08)
|
---|
92 | Found level 1016 (0x3f8) of size 4 (0x04)
|
---|
93 | Found level 1017 (0x3f9) of size 4 (0x04)
|
---|
94 | Found level 1018 (0x3fa) of size 126 (0x7e)
|
---|
95 | Found level 1021 (0x3fd) of size 28 (0x1c)
|
---|
96 | Found level 1022 (0x3fe) of size 38 (0x26)
|
---|
97 | Found level 1028 (0x404) of size 16 (0x10)
|
---|
98 | Found level 1034 (0x40a) of size 56 (0x38)
|
---|
99 | Found level 1035 (0x40b) of size 8 (0x08)
|
---|
100 | Found 27 levels with success status
|
---|
101 | Level 267 (0x10b) and level 1028 (0x404) are possible aliases
|
---|
102 | Level 265 (0x109) and level 1022 (0x3fe) are possible aliases
|
---|
103 | Level 264 (0x108) and level 1021 (0x3fd) are possible aliases
|
---|
104 | Level 263 (0x107) and level 1018 (0x3fa) are possible aliases
|
---|
105 | Level 260 (0x104) and level 1009 (0x3f1) are possible aliases
|
---|
106 | Level 259 (0x103) and level 1007 (0x3ef) are possible aliases
|
---|
107 | Level 258 (0x102) and level 1005 (0x3ed) are possible aliases
|
---|
108 | Level 257 (0x101) and level 1004 (0x3ec) are possible aliases
|
---|
109 | Found 8 aliased levels
|
---|
110 | */
|
---|
111 | #define SMB_QFILEINFO_STANDARD 1
|
---|
112 | #define SMB_QFILEINFO_EA_SIZE 2
|
---|
113 | #define SMB_QFILEINFO_EA_LIST 3
|
---|
114 | #define SMB_QFILEINFO_ALL_EAS 4
|
---|
115 | #define SMB_QFILEINFO_IS_NAME_VALID 6 /* only for QPATHINFO */
|
---|
116 | #define SMB_QFILEINFO_BASIC_INFO 0x101
|
---|
117 | #define SMB_QFILEINFO_STANDARD_INFO 0x102
|
---|
118 | #define SMB_QFILEINFO_EA_INFO 0x103
|
---|
119 | #define SMB_QFILEINFO_NAME_INFO 0x104
|
---|
120 | #define SMB_QFILEINFO_ALL_INFO 0x107
|
---|
121 | #define SMB_QFILEINFO_ALT_NAME_INFO 0x108
|
---|
122 | #define SMB_QFILEINFO_STREAM_INFO 0x109
|
---|
123 | #define SMB_QFILEINFO_COMPRESSION_INFO 0x10b
|
---|
124 | #define SMB_QFILEINFO_UNIX_BASIC 0x200
|
---|
125 | #define SMB_QFILEINFO_UNIX_LINK 0x201
|
---|
126 | #define SMB_QFILEINFO_UNIX_INFO2 0x20b
|
---|
127 | #define SMB_QFILEINFO_BASIC_INFORMATION 1004
|
---|
128 | #define SMB_QFILEINFO_STANDARD_INFORMATION 1005
|
---|
129 | #define SMB_QFILEINFO_INTERNAL_INFORMATION 1006
|
---|
130 | #define SMB_QFILEINFO_EA_INFORMATION 1007
|
---|
131 | #define SMB_QFILEINFO_ACCESS_INFORMATION 1008
|
---|
132 | #define SMB_QFILEINFO_NAME_INFORMATION 1009
|
---|
133 | #define SMB_QFILEINFO_POSITION_INFORMATION 1014
|
---|
134 | #define SMB_QFILEINFO_MODE_INFORMATION 1016
|
---|
135 | #define SMB_QFILEINFO_ALIGNMENT_INFORMATION 1017
|
---|
136 | #define SMB_QFILEINFO_ALL_INFORMATION 1018
|
---|
137 | #define SMB_QFILEINFO_ALT_NAME_INFORMATION 1021
|
---|
138 | #define SMB_QFILEINFO_STREAM_INFORMATION 1022
|
---|
139 | #define SMB_QFILEINFO_COMPRESSION_INFORMATION 1028
|
---|
140 | #define SMB_QFILEINFO_NETWORK_OPEN_INFORMATION 1034
|
---|
141 | #define SMB_QFILEINFO_ATTRIBUTE_TAG_INFORMATION 1035
|
---|
142 |
|
---|
143 |
|
---|
144 |
|
---|
145 | /* trans2 setfileinfo/setpathinfo levels */
|
---|
146 | /*
|
---|
147 | w2k3 TRANS2ALIASES
|
---|
148 | Checking for SETFILEINFO aliases
|
---|
149 | setting up complex file \setfileinfo_aliases.txt
|
---|
150 | Found level 1 (0x001) of size 2 (0x02)
|
---|
151 | Found level 2 (0x002) of size 2 (0x02)
|
---|
152 | Found level 257 (0x101) of size 40 (0x28)
|
---|
153 | Found level 258 (0x102) of size 2 (0x02)
|
---|
154 | Found level 259 (0x103) of size 8 (0x08)
|
---|
155 | Found level 260 (0x104) of size 8 (0x08)
|
---|
156 | Found level 1004 (0x3ec) of size 40 (0x28)
|
---|
157 | Found level 1010 (0x3f2) of size 2 (0x02)
|
---|
158 | Found level 1013 (0x3f5) of size 2 (0x02)
|
---|
159 | Found level 1014 (0x3f6) of size 8 (0x08)
|
---|
160 | Found level 1016 (0x3f8) of size 4 (0x04)
|
---|
161 | Found level 1019 (0x3fb) of size 8 (0x08)
|
---|
162 | Found level 1020 (0x3fc) of size 8 (0x08)
|
---|
163 | Found level 1023 (0x3ff) of size 8 (0x08)
|
---|
164 | Found level 1025 (0x401) of size 16 (0x10)
|
---|
165 | Found level 1029 (0x405) of size 72 (0x48)
|
---|
166 | Found level 1032 (0x408) of size 56 (0x38)
|
---|
167 | Found level 1039 (0x40f) of size 8 (0x08)
|
---|
168 | Found level 1040 (0x410) of size 8 (0x08)
|
---|
169 | Found 19 valid levels
|
---|
170 |
|
---|
171 | Checking for SETPATHINFO aliases
|
---|
172 | Found level 1004 (0x3ec) of size 40 (0x28)
|
---|
173 | Found level 1010 (0x3f2) of size 2 (0x02)
|
---|
174 | Found level 1013 (0x3f5) of size 2 (0x02)
|
---|
175 | Found level 1014 (0x3f6) of size 8 (0x08)
|
---|
176 | Found level 1016 (0x3f8) of size 4 (0x04)
|
---|
177 | Found level 1019 (0x3fb) of size 8 (0x08)
|
---|
178 | Found level 1020 (0x3fc) of size 8 (0x08)
|
---|
179 | Found level 1023 (0x3ff) of size 8 (0x08)
|
---|
180 | Found level 1025 (0x401) of size 16 (0x10)
|
---|
181 | Found level 1029 (0x405) of size 72 (0x48)
|
---|
182 | Found level 1032 (0x408) of size 56 (0x38)
|
---|
183 | Found level 1039 (0x40f) of size 8 (0x08)
|
---|
184 | Found level 1040 (0x410) of size 8 (0x08)
|
---|
185 | Found 13 valid levels
|
---|
186 | */
|
---|
187 | #define SMB_SFILEINFO_STANDARD 1
|
---|
188 | #define SMB_SFILEINFO_EA_SET 2
|
---|
189 | #define SMB_SFILEINFO_BASIC_INFO 0x101
|
---|
190 | #define SMB_SFILEINFO_DISPOSITION_INFO 0x102
|
---|
191 | #define SMB_SFILEINFO_ALLOCATION_INFO 0x103
|
---|
192 | #define SMB_SFILEINFO_END_OF_FILE_INFO 0x104
|
---|
193 | #define SMB_SFILEINFO_UNIX_BASIC 0x200
|
---|
194 | #define SMB_SFILEINFO_UNIX_LINK 0x201
|
---|
195 | #define SMB_SPATHINFO_UNIX_HLINK 0x203
|
---|
196 | #define SMB_SPATHINFO_POSIX_ACL 0x204
|
---|
197 | #define SMB_SPATHINFO_XATTR 0x205
|
---|
198 | #define SMB_SFILEINFO_ATTR_FLAGS 0x206
|
---|
199 | #define SMB_SFILEINFO_UNIX_INFO2 0x20b
|
---|
200 | #define SMB_SFILEINFO_BASIC_INFORMATION 1004
|
---|
201 | #define SMB_SFILEINFO_RENAME_INFORMATION 1010
|
---|
202 | #define SMB_SFILEINFO_LINK_INFORMATION 1011
|
---|
203 | #define SMB_SFILEINFO_DISPOSITION_INFORMATION 1013
|
---|
204 | #define SMB_SFILEINFO_POSITION_INFORMATION 1014
|
---|
205 | #define SMB_SFILEINFO_FULL_EA_INFORMATION 1015
|
---|
206 | #define SMB_SFILEINFO_MODE_INFORMATION 1016
|
---|
207 | #define SMB_SFILEINFO_ALLOCATION_INFORMATION 1019
|
---|
208 | #define SMB_SFILEINFO_END_OF_FILE_INFORMATION 1020
|
---|
209 | #define SMB_SFILEINFO_PIPE_INFORMATION 1023
|
---|
210 | #define SMB_SFILEINFO_VALID_DATA_INFORMATION 1039
|
---|
211 | #define SMB_SFILEINFO_SHORT_NAME_INFORMATION 1040
|
---|
212 |
|
---|
213 | /* filemon shows FilePipeRemoteInformation */
|
---|
214 | #define SMB_SFILEINFO_1025 1025
|
---|
215 |
|
---|
216 | /* vista scan responds */
|
---|
217 | #define SMB_SFILEINFO_1027 1027
|
---|
218 |
|
---|
219 | /* filemon shows CopyOnWriteInformation */
|
---|
220 | #define SMB_SFILEINFO_1029 1029
|
---|
221 |
|
---|
222 | /* filemon shows OleClassIdInformation */
|
---|
223 | #define SMB_SFILEINFO_1032 1032
|
---|
224 |
|
---|
225 | /* vista scan responds to these */
|
---|
226 | #define SMB_SFILEINFO_1030 1030
|
---|
227 | #define SMB_SFILEINFO_1031 1031
|
---|
228 | #define SMB_SFILEINFO_1036 1036
|
---|
229 | #define SMB_SFILEINFO_1041 1041
|
---|
230 | #define SMB_SFILEINFO_1042 1042
|
---|
231 | #define SMB_SFILEINFO_1043 1043
|
---|
232 | #define SMB_SFILEINFO_1044 1044
|
---|
233 |
|
---|
234 | /* trans2 findfirst levels */
|
---|
235 | /*
|
---|
236 | w2k3 TRANS2ALIASES:
|
---|
237 | Checking for FINDFIRST aliases
|
---|
238 | Found level 1 (0x001) of size 68 (0x44)
|
---|
239 | Found level 2 (0x002) of size 70 (0x46)
|
---|
240 | Found level 257 (0x101) of size 108 (0x6c)
|
---|
241 | Found level 258 (0x102) of size 116 (0x74)
|
---|
242 | Found level 259 (0x103) of size 60 (0x3c)
|
---|
243 | Found level 260 (0x104) of size 140 (0x8c)
|
---|
244 | Found level 261 (0x105) of size 124 (0x7c)
|
---|
245 | Found level 262 (0x106) of size 148 (0x94)
|
---|
246 | Found 8 levels with success status
|
---|
247 | Found 0 aliased levels
|
---|
248 | */
|
---|
249 | #define SMB_FIND_STANDARD 1
|
---|
250 | #define SMB_FIND_EA_SIZE 2
|
---|
251 | #define SMB_FIND_EA_LIST 3
|
---|
252 | #define SMB_FIND_DIRECTORY_INFO 0x101
|
---|
253 | #define SMB_FIND_FULL_DIRECTORY_INFO 0x102
|
---|
254 | #define SMB_FIND_NAME_INFO 0x103
|
---|
255 | #define SMB_FIND_BOTH_DIRECTORY_INFO 0x104
|
---|
256 | #define SMB_FIND_ID_FULL_DIRECTORY_INFO 0x105
|
---|
257 | #define SMB_FIND_ID_BOTH_DIRECTORY_INFO 0x106
|
---|
258 | #define SMB_FIND_UNIX_INFO 0x202
|
---|
259 | #define SMB_FIND_UNIX_INFO2 0x20b
|
---|
260 |
|
---|
261 | /* flags on trans2 findfirst/findnext that control search */
|
---|
262 | #define FLAG_TRANS2_FIND_CLOSE 0x1
|
---|
263 | #define FLAG_TRANS2_FIND_CLOSE_IF_END 0x2
|
---|
264 | #define FLAG_TRANS2_FIND_REQUIRE_RESUME 0x4
|
---|
265 | #define FLAG_TRANS2_FIND_CONTINUE 0x8
|
---|
266 | #define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10
|
---|
267 |
|
---|
268 | /*
|
---|
269 | * DeviceType and Characteristics returned in a
|
---|
270 | * SMB_QFS_DEVICE_INFO call.
|
---|
271 | */
|
---|
272 | #define QFS_DEVICETYPE_CD_ROM 0x2
|
---|
273 | #define QFS_DEVICETYPE_CD_ROM_FILE_SYSTEM 0x3
|
---|
274 | #define QFS_DEVICETYPE_DISK 0x7
|
---|
275 | #define QFS_DEVICETYPE_DISK_FILE_SYSTEM 0x8
|
---|
276 | #define QFS_DEVICETYPE_FILE_SYSTEM 0x9
|
---|
277 |
|
---|
278 | /* Characteristics. */
|
---|
279 | #define QFS_TYPE_REMOVABLE_MEDIA 0x1
|
---|
280 | #define QFS_TYPE_READ_ONLY_DEVICE 0x2
|
---|
281 | #define QFS_TYPE_FLOPPY 0x4
|
---|
282 | #define QFS_TYPE_WORM 0x8
|
---|
283 | #define QFS_TYPE_REMOTE 0x10
|
---|
284 | #define QFS_TYPE_MOUNTED 0x20
|
---|
285 | #define QFS_TYPE_VIRTUAL 0x40
|
---|
286 |
|
---|
287 | /* SMB_QFS_SECTOR_SIZE_INFORMATION values */
|
---|
288 | #define QFS_SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001
|
---|
289 | #define QFS_SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002
|
---|
290 | #define QFS_SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004
|
---|
291 | #define QFS_SSINFO_FLAGS_TRIM_ENABLED 0x00000008
|
---|
292 |
|
---|
293 | #define QFS_SSINFO_OFFSET_UNKNOWN 0xffffffff
|
---|
294 |
|
---|
295 | /*
|
---|
296 | * Thursby MAC extensions....
|
---|
297 | */
|
---|
298 |
|
---|
299 | /*
|
---|
300 | * MAC CIFS Extensions have the range 0x300 - 0x2FF reserved.
|
---|
301 | * Supposedly Microsoft have agreed to this.
|
---|
302 | */
|
---|
303 |
|
---|
304 | #define MIN_MAC_INFO_LEVEL 0x300
|
---|
305 | #define MAX_MAC_INFO_LEVEL 0x3FF
|
---|
306 | #define SMB_QFS_MAC_FS_INFO 0x301
|
---|
307 |
|
---|
308 | #endif
|
---|