/* SPDX-License-Identifier: LGPL-2.1+ */
/*
* SMB , CIFS , SMB2 FSCTL definitions
*
* Copyright ( c ) International Business Machines Corp . , 2002 , 2013
* Author ( s ) : Steve French ( sfrench @ us . ibm . com )
*
*/
/* IOCTL information */
/*
* List of ioctl / fsctl function codes that are or could be useful in the
* future to remote clients like cifs or SMB2 / SMB3 client . This is probably
* a slightly larger set of fsctls that NTFS local filesystem could handle ,
* including the seven below that we do not have struct definitions for .
* Even with protocol definitions for most of these now available , we still
* need to do some experimentation to identify which are practical to do
* remotely . Some of the following , such as the encryption / compression ones
* could be invoked from tools via a specialized hook into the VFS rather
* than via the standard vfs entry points
*
* See MS - SMB2 Section 2 . 2 . 31 ( last checked September 2021 , all of that list are
* below ) . Additional detail on less common ones can be found in MS - FSCC
* section 2 . 3 .
*/
#ifndef __SMBFSCTL_H
#define __SMBFSCTL_H
/*
* FSCTL values are 32 bits and are constructed as
* < device 16 bits > < access 2 bits > < function 12 bits > < method 2 bits >
*/
/* Device */
#define FSCTL_DEVICE_DFS (0 x0006 << 16 )
#define FSCTL_DEVICE_FILE_SYSTEM (0 x0009 << 16 )
#define FSCTL_DEVICE_NAMED_PIPE (0 x0011 << 16 )
#define FSCTL_DEVICE_NETWORK_FILE_SYSTEM (0 x0014 << 16 )
#define FSCTL_DEVICE_MASK 0 xffff0000
/* Access */
#define FSCTL_DEVICE_ACCESS_FILE_ANY_ACCESS (0 x00 << 14 )
#define FSCTL_DEVICE_ACCESS_FILE_READ_ACCESS (0 x01 << 14 )
#define FSCTL_DEVICE_ACCESS_FILE_WRITE_ACCESS (0 x02 << 14 )
#define FSCTL_DEVICE_ACCESS_FILE_READ_WRITE_ACCESS (0 x03 << 14 )
#define FSCTL_DEVICE_ACCESS_MASK 0 x0000c000
/* Function */
#define FSCTL_DEVICE_FUNCTION_MASK 0 x00003ffc
/* Method */
#define FSCTL_DEVICE_METHOD_BUFFERED 0 x00
#define FSCTL_DEVICE_METHOD_IN_DIRECT 0 x01
#define FSCTL_DEVICE_METHOD_OUT_DIRECT 0 x02
#define FSCTL_DEVICE_METHOD_NEITHER 0 x03
#define FSCTL_DEVICE_METHOD_MASK 0 x00000003
#define FSCTL_DFS_GET_REFERRALS 0 x00060194
#define FSCTL_DFS_GET_REFERRALS_EX 0 x000601B0
#define FSCTL_REQUEST_OPLOCK_LEVEL_1 0 x00090000
#define FSCTL_REQUEST_OPLOCK_LEVEL_2 0 x00090004
#define FSCTL_REQUEST_BATCH_OPLOCK 0 x00090008
#define FSCTL_LOCK_VOLUME 0 x00090018
#define FSCTL_UNLOCK_VOLUME 0 x0009001C
#define FSCTL_IS_PATHNAME_VALID 0 x0009002C /* BB add struct */
#define FSCTL_GET_COMPRESSION 0 x0009003C /* BB add struct */
#define FSCTL_SET_COMPRESSION 0 x0009C040 /* BB add struct */
#define FSCTL_QUERY_FAT_BPB 0 x00090058 /* BB add struct */
/* Verify the next FSCTL number, we had it as 0x00090090 before */
#define FSCTL_FILESYSTEM_GET_STATS 0 x00090060 /* BB add struct */
#define FSCTL_GET_NTFS_VOLUME_DATA 0 x00090064 /* BB add struct */
#define FSCTL_GET_RETRIEVAL_POINTERS 0 x00090073 /* BB add struct */
#define FSCTL_IS_VOLUME_DIRTY 0 x00090078 /* BB add struct */
#define FSCTL_ALLOW_EXTENDED_DASD_IO 0 x00090083 /* BB add struct */
#define FSCTL_REQUEST_FILTER_OPLOCK 0 x0009008C
#define FSCTL_FIND_FILES_BY_SID 0 x0009008F /* BB add struct */
#define FSCTL_SET_OBJECT_ID 0 x00090098 /* BB add struct */
#define FSCTL_GET_OBJECT_ID 0 x0009009C /* BB add struct */
#define FSCTL_DELETE_OBJECT_ID 0 x000900A0 /* BB add struct */
#define FSCTL_SET_REPARSE_POINT 0 x000900A4 /* BB add struct */
#define FSCTL_GET_REPARSE_POINT 0 x000900A8 /* BB add struct */
#define FSCTL_DELETE_REPARSE_POINT 0 x000900AC /* BB add struct */
#define FSCTL_SET_OBJECT_ID_EXTENDED 0 x000900BC /* BB add struct */
#define FSCTL_CREATE_OR_GET_OBJECT_ID 0 x000900C0 /* BB add struct */
#define FSCTL_SET_SPARSE 0 x000900C4 /* BB add struct */
#define FSCTL_SET_ZERO_DATA 0 x000980C8
#define FSCTL_SET_ENCRYPTION 0 x000900D7 /* BB add struct */
#define FSCTL_ENCRYPTION_FSCTL_IO 0 x000900DB /* BB add struct */
#define FSCTL_WRITE_RAW_ENCRYPTED 0 x000900DF /* BB add struct */
#define FSCTL_READ_RAW_ENCRYPTED 0 x000900E3 /* BB add struct */
#define FSCTL_READ_FILE_USN_DATA 0 x000900EB /* BB add struct */
#define FSCTL_WRITE_USN_CLOSE_RECORD 0 x000900EF /* BB add struct */
#define FSCTL_MARK_HANDLE 0 x000900FC /* BB add struct */
#define FSCTL_SIS_COPYFILE 0 x00090100 /* BB add struct */
#define FSCTL_RECALL_FILE 0 x00090117 /* BB add struct */
#define FSCTL_QUERY_SPARING_INFO 0 x00090138 /* BB add struct */
#define FSCTL_QUERY_ON_DISK_VOLUME_INFO 0 x0009013C
#define FSCTL_SET_ZERO_ON_DEALLOC 0 x00090194 /* BB add struct */
#define FSCTL_SET_SHORT_NAME_BEHAVIOR 0 x000901B4 /* BB add struct */
#define FSCTL_GET_INTEGRITY_INFORMATION 0 x0009027C
#define FSCTL_QUERY_FILE_REGIONS 0 x00090284
#define FSCTL_GET_REFS_VOLUME_DATA 0 x000902D8 /* See MS-FSCC 2.3.24 */
#define FSCTL_SET_INTEGRITY_INFORMATION_EXT 0 x00090380
#define FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT 0 x000903d3
#define FSCTL_GET_RETRIEVAL_POINTER_COUNT 0 x0009042b
#define FSCTL_REFS_STREAM_SNAPSHOT_MANAGEMENT 0 x00090440
#define FSCTL_QUERY_ALLOCATED_RANGES 0 x000940CF
#define FSCTL_OFFLOAD_READ 0 x00094264 /* BB add struct */
#define FSCTL_OFFLOAD_WRITE 0 x00098268 /* BB add struct */
#define FSCTL_SET_DEFECT_MANAGEMENT 0 x00098134 /* BB add struct */
#define FSCTL_FILE_LEVEL_TRIM 0 x00098208 /* BB add struct */
#define FSCTL_DUPLICATE_EXTENTS_TO_FILE 0 x00098344
#define FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX 0 x000983E8
#define FSCTL_SIS_LINK_FILES 0 x0009C104
#define FSCTL_SET_INTEGRITY_INFORMATION 0 x0009C280
#define FSCTL_PIPE_PEEK 0 x0011400C /* BB add struct */
#define FSCTL_PIPE_TRANSCEIVE 0 x0011C017 /* BB add struct */
/* strange that the number for this op is not sequential with previous op */
#define FSCTL_PIPE_WAIT 0 x00110018 /* BB add struct */
/* Enumerate previous versions of a file */
#define FSCTL_SRV_ENUMERATE_SNAPSHOTS 0 x00144064
/* Retrieve an opaque file reference for server-side data movement ie copy */
#define FSCTL_SRV_REQUEST_RESUME_KEY 0 x00140078
#define FSCTL_LMR_REQUEST_RESILIENCY 0 x001401D4
#define FSCTL_LMR_GET_LINK_TRACK_INF 0 x001400E8 /* BB add struct */
#define FSCTL_LMR_SET_LINK_TRACK_INF 0 x001400EC /* BB add struct */
#define FSCTL_VALIDATE_NEGOTIATE_INFO 0 x00140204
/* Perform server-side data movement */
#define FSCTL_SRV_COPYCHUNK 0 x001440F2
#define FSCTL_SRV_COPYCHUNK_WRITE 0 x001480F2
#define FSCTL_QUERY_NETWORK_INTERFACE_INFO 0 x001401FC /* BB add struct */
#define FSCTL_SRV_READ_HASH 0 x001441BB /* BB add struct */
/* See FSCC 2.1.2.5 */
#define IO_REPARSE_TAG_MOUNT_POINT 0 xA0000003
#define IO_REPARSE_TAG_HSM 0 xC0000004
#define IO_REPARSE_TAG_SIS 0 x80000007
#define IO_REPARSE_TAG_HSM2 0 x80000006
#define IO_REPARSE_TAG_DRIVER_EXTENDER 0 x80000005
/* Used by the DFS filter. See MS-DFSC */
#define IO_REPARSE_TAG_DFS 0 x8000000A
/* Used by the DFS filter See MS-DFSC */
#define IO_REPARSE_TAG_DFSR 0 x80000012
#define IO_REPARSE_TAG_FILTER_MANAGER 0 x8000000B
/* Native SMB symlinks since Windows Vista, see MS-FSCC 2.1.2.4 */
#define IO_REPARSE_TAG_SYMLINK 0 xA000000C
#define IO_REPARSE_TAG_DEDUP 0 x80000013
#define IO_REPARSE_APPXSTREAM 0 xC0000014
/* NFS special files used by Windows NFS server since Windows Server 2012, see MS-FSCC 2.1.2.6 */
#define IO_REPARSE_TAG_NFS 0 x80000014
/*
* AzureFileSync - see
* https : //docs.microsoft.com/en-us/azure/storage/files/storage-sync-cloud-tiering
*/
#define IO_REPARSE_TAG_AZ_FILE_SYNC 0 x8000001e
/* Native Win32 AF_UNIX sockets since Windows 10 April 2018 Update, used also by WSL */
#define IO_REPARSE_TAG_AF_UNIX 0 x80000023
/* WSL reparse tags */
#define IO_REPARSE_TAG_LX_SYMLINK 0 xA000001D
#define IO_REPARSE_TAG_LX_FIFO 0 x80000024
#define IO_REPARSE_TAG_LX_CHR 0 x80000025
#define IO_REPARSE_TAG_LX_BLK 0 x80000026
/* If Name Surrogate Bit is set, the file or directory represents another named entity in the system. */
#define IS_REPARSE_TAG_NAME_SURROGATE(tag) (!!((tag) & 0 x20000000))
/* fsctl flags */
/* If Flags is set to this value, the request is an FSCTL not ioctl request */
#define SMB2_0_IOCTL_IS_FSCTL 0 x00000001
#endif /* __SMBFSCTL_H */
Messung V0.5 in Prozent C=96 H=100 G=97
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-09-27)
¤
*© Formatika GbR, Deutschland