vfs_catia: add my copyright
[Samba.git] / source3 / include / ntioctl.h
blob925a06f38f5a90fac4785cbddbe673f854c25218
1 /*
2 Unix SMB/CIFS implementation.
3 NT ioctl code constants
4 Copyright (C) Andrew Tridgell 2002
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 I'm guessing we will need to support a bunch of these eventually. For now
22 we only need the sparse flag
25 #ifndef _NTIOCTL_H
26 #define _NTIOCTL_H
28 /* IOCTL information */
29 /* List of ioctl function codes that look to be of interest to remote clients like this. */
30 /* Need to do some experimentation to make sure they all work remotely. */
31 /* Some of the following such as the encryption/compression ones would be */
32 /* invoked from tools via a specialized hook into the VFS rather than via the */
33 /* standard vfs entry points */
34 #define FSCTL_LOCK_VOLUME 0x00090018
35 #define FSCTL_UNLOCK_VOLUME 0x0009001C
36 #define FSCTL_GET_COMPRESSION 0x0009003C
37 #define FSCTL_SET_COMPRESSION 0x0009C040
38 #define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C
39 #define FSCTL_SET_ZERO_DATA 0x000900C8
40 #define FSCTL_SET_ENCRYPTION 0x000900D7
41 #define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB
42 #define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF
43 #define FSCTL_READ_RAW_ENCRYPTED 0x000900E3
44 #define FSCTL_SIS_COPYFILE 0x00090100
45 #define FSCTL_SIS_LINK_FILES 0x0009C104
47 /* filesystem control codes */
48 #define FSCTL_METHOD_BUFFERED 0x00000000
49 #define FSCTL_METHOD_IN_DIRECT 0x00000001
50 #define FSCTL_METHOD_OUT_DIRECT 0x00000002
51 #define FSCTL_METHOD_NEITHER 0x00000003
53 #define FSCTL_ACCESS_ANY 0x00000000
54 #define FSCTL_ACCESS_READ 0x00004000
55 #define FSCTL_ACCESS_WRITE 0x00008000
57 #define FSCTL_DFS 0x00060000
58 #define FSCTL_DFS_GET_REFERRALS (FSCTL_DFS | FSCTL_ACCESS_ANY | 0x0194 | FSCTL_METHOD_BUFFERED)
59 #define FSCTL_DFS_GET_REFERRALS_EX (FSCTL_DFS | FSCTL_ACCESS_ANY | 0x01B0 | FSCTL_METHOD_BUFFERED)
61 #define FSCTL_FILESYSTEM 0x00090000
62 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0000 | FSCTL_METHOD_BUFFERED)
63 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0004 | FSCTL_METHOD_BUFFERED)
64 #define FSCTL_REQUEST_BATCH_OPLOCK (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0008 | FSCTL_METHOD_BUFFERED)
65 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x000C | FSCTL_METHOD_BUFFERED)
66 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0010 | FSCTL_METHOD_BUFFERED)
67 #define FSCTL_OPLOCK_BREAK_NOTIFY (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0014 | FSCTL_METHOD_BUFFERED)
68 #define FSCTL_FILESYS_GET_STATISTICS (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0060 | FSCTL_METHOD_BUFFERED)
69 #define FSCTL_GET_NTFS_VOLUME_DATA (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0064 | FSCTL_METHOD_BUFFERED)
70 #define FSCTL_IS_VOLUME_DIRTY (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0078 | FSCTL_METHOD_BUFFERED)
71 #define FSCTL_FIND_FILES_BY_SID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x008C | FSCTL_METHOD_NEITHER)
72 #define FSCTL_SET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0098 | FSCTL_METHOD_BUFFERED)
73 #define FSCTL_GET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x009C | FSCTL_METHOD_BUFFERED)
74 #define FSCTL_DELETE_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A0 | FSCTL_METHOD_BUFFERED)
75 #define FSCTL_SET_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A4 | FSCTL_METHOD_BUFFERED)
76 #define FSCTL_GET_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A8 | FSCTL_METHOD_BUFFERED)
77 #define FSCTL_DELETE_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00AC | FSCTL_METHOD_BUFFERED)
78 #define FSCTL_CREATE_OR_GET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00C0 | FSCTL_METHOD_BUFFERED)
79 #define FSCTL_SET_SPARSE (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00C4 | FSCTL_METHOD_BUFFERED)
80 #define FSCTL_QUERY_ALLOCATED_RANGES (FSCTL_FILESYSTEM | FSCTL_ACCESS_READ | 0x00CC | FSCTL_METHOD_NEITHER)
81 #define FSCTL_FILE_LEVEL_TRIM (FSCTL_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x0208 | FSCTL_METHOD_BUFFERED)
82 #define FSCTL_OFFLOAD_READ (FSCTL_FILESYSTEM | FSCTL_ACCESS_READ | 0x0264 | FSCTL_METHOD_BUFFERED)
83 #define FSCTL_OFFLOAD_WRITE (FSCTL_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x0268 | FSCTL_METHOD_BUFFERED)
85 #define FSCTL_NAMED_PIPE 0x00110000
86 #define FSCTL_PIPE_PEEK (FSCTL_NAMED_PIPE | FSCTL_ACCESS_READ | 0x000C | FSCTL_METHOD_BUFFERED)
87 #define FSCTL_NAMED_PIPE_READ_WRITE (FSCTL_NAMED_PIPE | FSCTL_ACCESS_READ \
88 | FSCTL_ACCESS_WRITE | 0x0014 | FSCTL_METHOD_NEITHER)
89 #define FSCTL_PIPE_TRANSCEIVE FSCTL_NAMED_PIPE_READ_WRITE /* SMB2 function name */
90 #define FSCTL_PIPE_WAIT (FSCTL_NAMED_PIPE | FSCTL_ACCESS_ANY | 0x0018 | FSCTL_METHOD_BUFFERED)
92 #define FSCTL_NETWORK_FILESYSTEM 0x00140000
93 #define FSCTL_GET_SHADOW_COPY_DATA (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ | 0x0064 | FSCTL_METHOD_BUFFERED)
94 #define FSCTL_SRV_ENUM_SNAPS FSCTL_GET_SHADOW_COPY_DATA /* SMB2 function name */
95 #define FSCTL_SRV_REQUEST_RESUME_KEY (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0078 | FSCTL_METHOD_BUFFERED)
96 #define FSCTL_SRV_COPYCHUNK (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ | 0x00F0 | FSCTL_METHOD_OUT_DIRECT)
97 #define FSCTL_SRV_COPYCHUNK_WRITE (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x00F0 | FSCTL_METHOD_OUT_DIRECT)
98 #define FSCTL_SRV_READ_HASH (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ| 0x01B8 | FSCTL_METHOD_NEITHER)
99 #define FSCTL_LMR_REQ_RESILIENCY (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x01D4 | FSCTL_METHOD_BUFFERED)
100 #define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION \
101 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00EC | FSCTL_METHOD_BUFFERED)
102 #define FSCTL_QUERY_NETWORK_INTERFACE_INFO \
103 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x01FC | FSCTL_METHOD_BUFFERED)
106 * FSCTL_VALIDATE_NEGOTIATE_INFO_224 was used used in
107 * Windows 8 server beta with SMB 2.24
109 #define FSCTL_VALIDATE_NEGOTIATE_INFO_224 \
110 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0200 | FSCTL_METHOD_BUFFERED)
111 #define FSCTL_VALIDATE_NEGOTIATE_INFO (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0204 | FSCTL_METHOD_BUFFERED)
113 #if 0
114 #define FSCTL_SECURITY_ID_CHECK
115 #define FSCTL_DISMOUNT_VOLUME
116 #define FSCTL_GET_NTFS_FILE_RECORD
117 #define FSCTL_ALLOW_EXTENDED_DASD_IO
118 #define FSCTL_RECALL_FILE
120 #endif
122 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
123 #define IO_REPARSE_TAG_HSM 0xC0000004
124 #define IO_REPARSE_TAG_SIS 0x80000007
127 /* For FSCTL_GET_SHADOW_COPY_DATA ...*/
128 typedef char SHADOW_COPY_LABEL[25];
130 struct shadow_copy_data {
131 /* Total number of shadow volumes currently mounted */
132 uint32 num_volumes;
133 /* Concatenated list of labels */
134 SHADOW_COPY_LABEL *labels;
138 #endif /* _NTIOCTL_H */