xref: /titanic_52/usr/src/uts/common/smbsrv/winioctl.h (revision b6c3f7863936abeae522e48a13887dddeb691a45)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 #ifndef _SMBSRV_WINIOCTL_H
26 #define	_SMBSRV_WINIOCTL_H
27 
28 #pragma ident	"%Z%%M%	%I%	%E% SMI"
29 
30 /*
31  * Standard Windows NT IOCTL/FSCTL definitions (derived from the VC++
32  * include file of the same name).
33  */
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #ifndef _DEVIOCTL_
40 #define	_DEVIOCTL_
41 
42 /*
43  * begin_ntddk begin_wdm begin_nthal begin_ntifs
44  *
45  * Define the various device type values.  Note that values used by Microsoft
46  * Corporation are in the range 0-32767, and 32768-65535 are reserved for use
47  * by customers.
48  */
49 
50 #define	DEVICE_TYPE DWORD
51 
52 #define	FILE_DEVICE_BEEP		0x00000001
53 #define	FILE_DEVICE_CD_ROM		0x00000002
54 #define	FILE_DEVICE_CD_ROM_FILE_SYSTEM	0x00000003
55 #define	FILE_DEVICE_CONTROLLER		0x00000004
56 #define	FILE_DEVICE_DATALINK		0x00000005
57 #define	FILE_DEVICE_DFS			0x00000006
58 #define	FILE_DEVICE_DISK		0x00000007
59 #define	FILE_DEVICE_DISK_FILE_SYSTEM	0x00000008
60 #define	FILE_DEVICE_FILE_SYSTEM		0x00000009
61 #define	FILE_DEVICE_INPORT_PORT		0x0000000a
62 #define	FILE_DEVICE_KEYBOARD		0x0000000b
63 #define	FILE_DEVICE_MAILSLOT		0x0000000c
64 #define	FILE_DEVICE_MIDI_IN		0x0000000d
65 #define	FILE_DEVICE_MIDI_OUT		0x0000000e
66 #define	FILE_DEVICE_MOUSE		0x0000000f
67 #define	FILE_DEVICE_MULTI_UNC_PROVIDER	0x00000010
68 #define	FILE_DEVICE_NAMED_PIPE		0x00000011
69 #define	FILE_DEVICE_NETWORK		0x00000012
70 #define	FILE_DEVICE_NETWORK_BROWSER	0x00000013
71 #define	FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
72 #define	FILE_DEVICE_NULL		0x00000015
73 #define	FILE_DEVICE_PARALLEL_PORT	0x00000016
74 #define	FILE_DEVICE_PHYSICAL_NETCARD	0x00000017
75 #define	FILE_DEVICE_PRINTER		0x00000018
76 #define	FILE_DEVICE_SCANNER		0x00000019
77 #define	FILE_DEVICE_SERIAL_MOUSE_PORT	0x0000001a
78 #define	FILE_DEVICE_SERIAL_PORT		0x0000001b
79 #define	FILE_DEVICE_SCREEN		0x0000001c
80 #define	FILE_DEVICE_SOUND		0x0000001d
81 #define	FILE_DEVICE_STREAMS		0x0000001e
82 #define	FILE_DEVICE_TAPE		0x0000001f
83 #define	FILE_DEVICE_TAPE_FILE_SYSTEM	0x00000020
84 #define	FILE_DEVICE_TRANSPORT		0x00000021
85 #define	FILE_DEVICE_UNKNOWN		0x00000022
86 #define	FILE_DEVICE_VIDEO		0x00000023
87 #define	FILE_DEVICE_VIRTUAL_DISK	0x00000024
88 #define	FILE_DEVICE_WAVE_IN		0x00000025
89 #define	FILE_DEVICE_WAVE_OUT		0x00000026
90 #define	FILE_DEVICE_8042_PORT		0x00000027
91 #define	FILE_DEVICE_NETWORK_REDIRECTOR	0x00000028
92 #define	FILE_DEVICE_BATTERY		0x00000029
93 #define	FILE_DEVICE_BUS_EXTENDER	0x0000002a
94 #define	FILE_DEVICE_MODEM		0x0000002b
95 #define	FILE_DEVICE_VDM			0x0000002c
96 #define	FILE_DEVICE_MASS_STORAGE	0x0000002d
97 #define	FILE_DEVICE_SMB			0x0000002e
98 #define	FILE_DEVICE_KS			0x0000002f
99 #define	FILE_DEVICE_CHANGER		0x00000030
100 #define	FILE_DEVICE_SMARTCARD		0x00000031
101 #define	FILE_DEVICE_ACPI		0x00000032
102 #define	FILE_DEVICE_DVD			0x00000033
103 #define	FILE_DEVICE_FULLSCREEN_VIDEO	0x00000034
104 #define	FILE_DEVICE_DFS_FILE_SYSTEM	0x00000035
105 #define	FILE_DEVICE_DFS_VOLUME		0x00000036
106 
107 /*
108  * Macro definition for defining IOCTL and FSCTL function control codes.  Note
109  * that function codes 0-2047 are reserved for Microsoft Corporation, and
110  * 2048-4095 are reserved for customers.
111  */
112 
113 #define	CTL_CODE(DeviceType, Function, Method, Access) \
114 	(((DeviceType) << 16) | ((Access) << 14) |     \
115 	((Function) << 2) | (Method))
116 
117 /*
118  * Define the method codes for how buffers are passed for I/O and FS controls
119  */
120 
121 #define	METHOD_BUFFERED			0
122 #define	METHOD_IN_DIRECT		1
123 #define	METHOD_OUT_DIRECT		2
124 #define	METHOD_NEITHER			3
125 
126 /*
127  * Define the access check value for any access
128  */
129 
130 #define	FILE_ANY_ACCESS			0
131 #define	FILE_READ_ACCESS		0x0001	/* file & pipe */
132 #define	FILE_WRITE_ACCESS		0x0002	/* file & pipe */
133 
134 /* end_ntddk end_wdm end_nthal end_ntifs */
135 
136 #endif /* _DEVIOCTL_ */
137 
138 
139 #ifndef _NTDDSTOR_H_
140 #define	_NTDDSTOR_H_
141 
142 #ifdef __cplusplus
143 extern "C" {
144 #endif
145 
146 /*
147  * IoControlCode values for storage devices
148  */
149 
150 #define	IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
151 
152 /*
153  * The following device control codes are common for all class drivers.  They
154  * should be used in place of the older IOCTL_DISK, IOCTL_CDROM and IOCTL_TAPE
155  * common codes
156  */
157 
158 #define	IOCTL_STORAGE_CHECK_VERIFY \
159 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
160 #define	IOCTL_STORAGE_MEDIA_REMOVAL \
161 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
162 #define	IOCTL_STORAGE_EJECT_MEDIA \
163 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
164 #define	IOCTL_STORAGE_LOAD_MEDIA \
165 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
166 #define	IOCTL_STORAGE_RESERVE \
167 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
168 #define	IOCTL_STORAGE_RELEASE \
169 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
170 #define	IOCTL_STORAGE_FIND_NEW_DEVICES \
171 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
172 
173 #define	IOCTL_STORAGE_GET_MEDIA_TYPES \
174 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
175 #define	IOCTL_STORAGE_GET_MEDIA_TYPES_EX \
176 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
177 
178 #define	IOCTL_STORAGE_RESET_BUS \
179 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
180 #define	IOCTL_STORAGE_RESET_DEVICE \
181 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
182 
183 #define	IOCTL_STORAGE_GET_DEVICE_NUMBER \
184 	CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
185 
186 
187 #ifdef __cplusplus
188 }
189 #endif
190 #endif /* _NTDDSTOR_H_ */
191 
192 /*
193  * IoControlCode values for disk devices.
194  */
195 
196 #define	IOCTL_DISK_BASE			FILE_DEVICE_DISK
197 #define	IOCTL_DISK_GET_DRIVE_GEOMETRY \
198 	CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
199 #define	IOCTL_DISK_GET_PARTITION_INFO \
200 	CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
201 #define	IOCTL_DISK_SET_PARTITION_INFO \
202 	CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, \
203 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
204 #define	IOCTL_DISK_GET_DRIVE_LAYOUT \
205 	CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
206 #define	IOCTL_DISK_SET_DRIVE_LAYOUT \
207 	CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, \
208 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
209 #define	IOCTL_DISK_VERIFY \
210 	CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
211 #define	IOCTL_DISK_FORMAT_TRACKS \
212 	CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED,	\
213 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
214 #define	IOCTL_DISK_REASSIGN_BLOCKS \
215 	CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, \
216 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
217 #define	IOCTL_DISK_PERFORMANCE \
218 	CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
219 #define	IOCTL_DISK_IS_WRITABLE \
220 	CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
221 #define	IOCTL_DISK_LOGGING \
222 	CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
223 #define	IOCTL_DISK_FORMAT_TRACKS_EX \
224 	CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, \
225 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
226 #define	IOCTL_DISK_HISTOGRAM_STRUCTURE \
227 	CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
228 #define	IOCTL_DISK_HISTOGRAM_DATA \
229 	CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
230 #define	IOCTL_DISK_HISTOGRAM_RESET \
231 	CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
232 #define	IOCTL_DISK_REQUEST_STRUCTURE \
233 	CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
234 #define	IOCTL_DISK_REQUEST_DATA \
235 	CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
236 #define	IOCTL_DISK_CONTROLLER_NUMBER \
237 	CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS)
238 
239 /*
240  * IOCTL support for SMART drive fault prediction.
241  */
242 
243 #define	SMART_GET_VERSION \
244 	CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
245 #define	SMART_SEND_DRIVE_COMMAND \
246 	CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED,	\
247 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
248 #define	SMART_RCV_DRIVE_DATA \
249 	CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, \
250 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
251 
252 
253 /*
254  * The following device control codes are common for all class drivers.  The
255  * functions codes defined here must match all of the other class drivers.
256  *
257  * Warning: these codes will be replaced in the future by equivalent
258  * IOCTL_STORAGE codes
259  */
260 
261 #define	IOCTL_DISK_CHECK_VERIFY \
262 	CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
263 #define	IOCTL_DISK_MEDIA_REMOVAL \
264 	CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
265 #define	IOCTL_DISK_EJECT_MEDIA \
266 	CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
267 #define	IOCTL_DISK_LOAD_MEDIA \
268 	CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
269 #define	IOCTL_DISK_RESERVE \
270 	CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
271 #define	IOCTL_DISK_RELEASE \
272 	CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
273 #define	IOCTL_DISK_FIND_NEW_DEVICES \
274 	CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
275 #define	IOCTL_DISK_GET_MEDIA_TYPES \
276 	CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
277 
278 #define	IOCTL_CHANGER_BASE		FILE_DEVICE_CHANGER
279 
280 #define	IOCTL_CHANGER_GET_PARAMETERS \
281 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
282 #define	IOCTL_CHANGER_GET_STATUS \
283 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
284 #define	IOCTL_CHANGER_GET_PRODUCT_DATA \
285 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
286 #define	IOCTL_CHANGER_SET_ACCESS \
287 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, \
288 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
289 #define	IOCTL_CHANGER_GET_ELEMENT_STATUS \
290 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, \
291 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
292 #define	IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS \
293 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
294 #define	IOCTL_CHANGER_SET_POSITION \
295 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
296 #define	IOCTL_CHANGER_EXCHANGE_MEDIUM \
297 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
298 #define	IOCTL_CHANGER_MOVE_MEDIUM \
299 	CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS)
300 #define	IOCTL_CHANGER_REINITIALIZE_TRANSPORT \
301 	CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
302 #define	IOCTL_CHANGER_QUERY_VOLUME_TAGS \
303 	CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, \
304 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
305 
306 #ifndef _FILESYSTEMFSCTL_
307 #define	_FILESYSTEMFSCTL_
308 /*
309  * The following is a list of the native file system fsctls followed by
310  * additional network file system fsctls.  Some values have been
311  * decommissioned.
312  */
313 
314 #define	FSCTL_REQUEST_OPLOCK_LEVEL_1 \
315 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  0, METHOD_BUFFERED, FILE_ANY_ACCESS)
316 #define	FSCTL_REQUEST_OPLOCK_LEVEL_2 \
317 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  1, METHOD_BUFFERED, FILE_ANY_ACCESS)
318 #define	FSCTL_REQUEST_BATCH_OPLOCK \
319 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  2, METHOD_BUFFERED, FILE_ANY_ACCESS)
320 #define	FSCTL_OPLOCK_BREAK_ACKNOWLEDGE \
321 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  3, METHOD_BUFFERED, FILE_ANY_ACCESS)
322 #define	FSCTL_OPBATCH_ACK_CLOSE_PENDING \
323 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  4, METHOD_BUFFERED, FILE_ANY_ACCESS)
324 #define	FSCTL_OPLOCK_BREAK_NOTIFY \
325 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  5, METHOD_BUFFERED, FILE_ANY_ACCESS)
326 #define	FSCTL_LOCK_VOLUME \
327 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  6, METHOD_BUFFERED, FILE_ANY_ACCESS)
328 #define	FSCTL_UNLOCK_VOLUME \
329 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  7, METHOD_BUFFERED, FILE_ANY_ACCESS)
330 #define	FSCTL_DISMOUNT_VOLUME \
331 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  8, METHOD_BUFFERED, FILE_ANY_ACCESS)
332 /* decommissioned fsctl value 9 */
333 #define	FSCTL_IS_VOLUME_MOUNTED \
334 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
335 /* PATHNAME_BUFFER, */
336 #define	FSCTL_IS_PATHNAME_VALID \
337 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
338 #define	FSCTL_MARK_VOLUME_DIRTY \
339 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
340 /* decommissioned fsctl value 13 */
341 #define	FSCTL_QUERY_RETRIEVAL_POINTERS \
342 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14,  METHOD_NEITHER, FILE_ANY_ACCESS)
343 #define	FSCTL_GET_COMPRESSION \
344 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
345 #define	FSCTL_SET_COMPRESSION \
346 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, \
347 	FILE_READ_ACCESS | FILE_WRITE_ACCESS)
348 /* decommissioned fsctl value 17 */
349 /* decommissioned fsctl value 18 */
350 #define	FSCTL_MARK_AS_SYSTEM_HIVE \
351 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19,  METHOD_NEITHER, FILE_ANY_ACCESS)
352 #define	FSCTL_OPLOCK_BREAK_ACK_NO_2 \
353 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
354 #define	FSCTL_INVALIDATE_VOLUMES \
355 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
356 
357 /* FSCTL_QUERY_FAT_BPB_BUFFER */
358 #define	FSCTL_QUERY_FAT_BPB \
359 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
360 #define	FSCTL_REQUEST_FILTER_OPLOCK \
361 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
362 
363 /* FILESYSTEM_STATISTICS */
364 #define	FSCTL_FILESYSTEM_GET_STATISTICS \
365 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
366 
367 /* NTFS_VOLUME_DATA_BUFFER */
368 #define	FSCTL_GET_NTFS_VOLUME_DATA \
369 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
370 /* NTFS_FILE_RECORD_INPUT_BUFFER, NTFS_FILE_RECORD_OUTPUT_BUFFER */
371 #define	FSCTL_GET_NTFS_FILE_RECORD \
372 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
373 /* STARTING_LCN_INPUT_BUFFER, VOLUME_BITMAP_BUFFER */
374 #define	FSCTL_GET_VOLUME_BITMAP \
375 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27,  METHOD_NEITHER, FILE_ANY_ACCESS)
376 /* STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTERS_BUFFER */
377 #define	FSCTL_GET_RETRIEVAL_POINTERS \
378 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28,  METHOD_NEITHER, FILE_ANY_ACCESS)
379 /* MOVE_FILE_DATA, */
380 #define	FSCTL_MOVE_FILE \
381 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
382 #define	FSCTL_IS_VOLUME_DIRTY \
383 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
384 #define	FSCTL_GET_HFS_INFORMATION \
385 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
386 #define	FSCTL_ALLOW_EXTENDED_DASD_IO \
387 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER,  FILE_ANY_ACCESS)
388 #define	FSCTL_READ_PROPERTY_DATA \
389 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS)
390 #define	FSCTL_WRITE_PROPERTY_DATA \
391 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS)
392 #define	FSCTL_FIND_FILES_BY_SID \
393 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
394 /* decommissioned fsctl value 36 */
395 #define	FSCTL_DUMP_PROPERTY_DATA \
396 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37,  METHOD_NEITHER, FILE_ANY_ACCESS)
397 /* FILE_OBJECTID_BUFFER */
398 #define	FSCTL_SET_OBJECT_ID \
399 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, \
400 	FILE_WRITE_ACCESS)
401 /* FILE_OBJECTID_BUFFER */
402 #define	FSCTL_GET_OBJECT_ID \
403 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
404 #define	FSCTL_DELETE_OBJECT_ID \
405 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, \
406 	FILE_WRITE_ACCESS)
407 /* REPARSE_DATA_BUFFER, */
408 #define	FSCTL_SET_REPARSE_POINT \
409 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, \
410 	    FILE_WRITE_ACCESS)
411 /* REPARSE_DATA_BUFFER */
412 #define	FSCTL_GET_REPARSE_POINT \
413 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
414 /* REPARSE_DATA_BUFFER, */
415 #define	FSCTL_DELETE_REPARSE_POINT \
416 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, \
417 	FILE_WRITE_ACCESS)
418 /* MFT_ENUM_DATA, */
419 #define	FSCTL_ENUM_USN_DATA \
420 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44,  METHOD_NEITHER, FILE_READ_ACCESS)
421 /* BULK_SECURITY_TEST_DATA, */
422 #define	FSCTL_SECURITY_ID_CHECK \
423 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45,  METHOD_NEITHER, FILE_READ_ACCESS)
424 /* READ_USN_JOURNAL_DATA, USN */
425 #define	FSCTL_READ_USN_JOURNAL \
426 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46,  METHOD_NEITHER, FILE_READ_ACCESS)
427 #define	FSCTL_SET_OBJECT_ID_EXTENDED \
428 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, \
429 	FILE_WRITE_ACCESS)
430 /* FILE_OBJECTID_BUFFER */
431 #define	FSCTL_CREATE_OR_GET_OBJECT_ID \
432 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
433 #define	FSCTL_SET_SPARSE \
434 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, \
435 	FILE_WRITE_ACCESS)
436 /* FILE_ZERO_DATA_INFORMATION, */
437 #define	FSCTL_SET_ZERO_DATA \
438 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, \
439 	FILE_WRITE_ACCESS)
440 /* FILE_ALLOCATED_RANGE_BUFFER, FILE_ALLOCATED_RANGE_BUFFER */
441 #define	FSCTL_QUERY_ALLOCATED_RANGES \
442 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51,  METHOD_NEITHER, FILE_READ_ACCESS)
443 #define	FSCTL_ENABLE_UPGRADE \
444 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, \
445 	FILE_WRITE_ACCESS)
446 /* ENCRYPTION_BUFFER, */
447 #define	FSCTL_SET_ENCRYPTION \
448 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
449 #define	FSCTL_ENCRYPTION_FSCTL_IO \
450 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54,  METHOD_NEITHER, FILE_ANY_ACCESS)
451 /* ENCRYPTED_DATA_INFO, */
452 #define	FSCTL_WRITE_RAW_ENCRYPTED \
453 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55,  METHOD_NEITHER, FILE_ANY_ACCESS)
454 /* REQUEST_RAW_ENCRYPTED_DATA, ENCRYPTED_DATA_INFO */
455 #define	FSCTL_READ_RAW_ENCRYPTED \
456 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56,  METHOD_NEITHER, FILE_ANY_ACCESS)
457 /* CREATE_USN_JOUNRAL_DATA, */
458 #define	FSCTL_CREATE_USN_JOURNAL \
459 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57,  METHOD_NEITHER, FILE_READ_ACCESS)
460 /* Read the Usn Record for a file */
461 #define	FSCTL_READ_FILE_USN_DATA \
462 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58,  METHOD_NEITHER, FILE_READ_ACCESS)
463 /* Generate Close Usn Record */
464 #define	FSCTL_WRITE_USN_CLOSE_RECORD \
465 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59,  METHOD_NEITHER, FILE_READ_ACCESS)
466 #define	FSCTL_EXTEND_VOLUME \
467 	CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
468 
469 #endif /* _FILESYSTEMFSCTL_ */
470 
471 #ifdef __cplusplus
472 }
473 #endif
474 
475 #endif /* _SMBSRV_WINIOCTL_H */
476