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