Author: akhaldi
Date: Tue Mar 9 16:06:29 2010
New Revision: 46034
URL:
http://svn.reactos.org/svn/reactos?rev=46034&view=rev
Log:
[NTIFS]
- Group related definitions
- Add CSV_NAMESPACE_INFO, FSCTL_QUERY_FAT_BPB_BUFFER and several missing FS related
structures and definitions
- Add a bunch of FSCTL_* macros
Modified:
branches/header-work/include/ddk/ntifs.h
Modified: branches/header-work/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntifs.h…
==============================================================================
--- branches/header-work/include/ddk/ntifs.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/ntifs.h [iso-8859-1] Tue Mar 9 16:06:29 2010
@@ -825,6 +825,149 @@
IN ULONG InputBufferLength,
OUT PVOID OutputBuffer OPTIONAL,
IN ULONG OutputBufferLength);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtLockFile(
+ IN HANDLE FileHandle,
+ IN HANDLE Event OPTIONAL,
+ IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
+ IN PVOID ApcContext OPTIONAL,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PLARGE_INTEGER ByteOffset,
+ IN PLARGE_INTEGER Length,
+ IN ULONG Key,
+ IN BOOLEAN FailImmediately,
+ IN BOOLEAN ExclusiveLock);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtOpenFile(
+ OUT PHANDLE FileHandle,
+ IN ACCESS_MASK DesiredAccess,
+ IN POBJECT_ATTRIBUTES ObjectAttributes,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN ULONG ShareAccess,
+ IN ULONG OpenOptions);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtQueryDirectoryFile(
+ IN HANDLE FileHandle,
+ IN HANDLE Event OPTIONAL,
+ IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
+ IN PVOID ApcContext OPTIONAL,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ OUT PVOID FileInformation,
+ IN ULONG Length,
+ IN FILE_INFORMATION_CLASS FileInformationClass,
+ IN BOOLEAN ReturnSingleEntry,
+ IN PUNICODE_STRING FileName OPTIONAL,
+ IN BOOLEAN RestartScan);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtQueryInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ OUT PVOID FileInformation,
+ IN ULONG Length,
+ IN FILE_INFORMATION_CLASS FileInformationClass);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtQueryQuotaInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ OUT PVOID Buffer,
+ IN ULONG Length,
+ IN BOOLEAN ReturnSingleEntry,
+ IN PVOID SidList,
+ IN ULONG SidListLength,
+ IN PSID StartSid OPTIONAL,
+ IN BOOLEAN RestartScan);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtQueryVolumeInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ OUT PVOID FsInformation,
+ IN ULONG Length,
+ IN FS_INFORMATION_CLASS FsInformationClass);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtReadFile(
+ IN HANDLE FileHandle,
+ IN HANDLE Event OPTIONAL,
+ IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
+ IN PVOID ApcContext OPTIONAL,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ OUT PVOID Buffer,
+ IN ULONG Length,
+ IN PLARGE_INTEGER ByteOffset OPTIONAL,
+ IN PULONG Key OPTIONAL);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtSetInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PVOID FileInformation,
+ IN ULONG Length,
+ IN FILE_INFORMATION_CLASS FileInformationClass);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtSetQuotaInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PVOID Buffer,
+ IN ULONG Length);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtSetVolumeInformationFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PVOID FsInformation,
+ IN ULONG Length,
+ IN FS_INFORMATION_CLASS FsInformationClass);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtWriteFile(
+ IN HANDLE FileHandle,
+ IN HANDLE Event OPTIONAL,
+ IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
+ IN PVOID ApcContext OPTIONAL,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PVOID Buffer,
+ IN ULONG Length,
+ IN PLARGE_INTEGER ByteOffset OPTIONAL,
+ IN PULONG Key OPTIONAL);
+
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtUnlockFile(
+ IN HANDLE FileHandle,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PLARGE_INTEGER ByteOffset,
+ IN PLARGE_INTEGER Length,
+ IN ULONG Key);
#endif
@@ -3218,184 +3361,8 @@
ULONG FileSystemControlFlags;
} FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#pragma pack(push,4)
-
-#ifndef VER_PRODUCTBUILD
-#define VER_PRODUCTBUILD 10000
-#endif
-
-#define EX_PUSH_LOCK ULONG_PTR
-#define PEX_PUSH_LOCK PULONG_PTR
-
-#include "csq.h"
-
-#ifdef _NTOSKRNL_
-extern PUCHAR FsRtlLegalAnsiCharacterArray;
-#else
-extern DECLSPEC_IMPORT PUCHAR FsRtlLegalAnsiCharacterArray;
-#endif
-extern PACL SePublicDefaultDacl;
-extern PACL SeSystemDefaultDacl;
-
-extern KSPIN_LOCK IoStatisticsLock;
-extern ULONG IoReadOperationCount;
-extern ULONG IoWriteOperationCount;
-extern ULONG IoOtherOperationCount;
-extern LARGE_INTEGER IoReadTransferCount;
-extern LARGE_INTEGER IoWriteTransferCount;
-extern LARGE_INTEGER IoOtherTransferCount;
-
-#define FS_LFN_APIS 0x00004000
-
-#define FILE_PIPE_READ_DATA 0x00000000
-#define FILE_PIPE_WRITE_SPACE 0x00000001
-
-#define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE |
FILE_NON_DIRECTORY_FILE */
-#define FILE_STORAGE_TYPE_DEFAULT (StorageTypeDefault <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_DIRECTORY (StorageTypeDirectory <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_FILE (StorageTypeFile <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_DOCFILE (StorageTypeDocfile <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_JUNCTION_POINT (StorageTypeJunctionPoint <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_CATALOG (StorageTypeCatalog <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_STRUCTURED_STORAGE (StorageTypeStructuredStorage <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_EMBEDDING (StorageTypeEmbedding <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_STORAGE_TYPE_STREAM (StorageTypeStream <<
FILE_STORAGE_TYPE_SHIFT)
-#define FILE_MINIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_DEFAULT
-#define FILE_MAXIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_STREAM
-#define FILE_STORAGE_TYPE_MASK 0x000f0000
-#define FILE_STORAGE_TYPE_SHIFT 16
-
-#define FILE_VC_QUOTAS_LOG_VIOLATIONS 0x00000004
-
-#define FSRTL_FLAG_FILE_MODIFIED (0x01)
-#define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02)
-#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04)
-#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08)
-#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10)
-#define FSRTL_FLAG_USER_MAPPED_FILE (0x20)
-#define FSRTL_FLAG_ADVANCED_HEADER (0x40)
-#define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80)
-
-#define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01)
-#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS (0x02)
-#define FSRTL_FLAG2_PURGE_WHEN_MAPPED (0x04)
-#define FSRTL_FLAG2_IS_PAGING_FILE (0x08)
-
-#define FSRTL_FSP_TOP_LEVEL_IRP (0x01)
-#define FSRTL_CACHE_TOP_LEVEL_IRP (0x02)
-#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03)
-#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
-#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
-
-#define FSRTL_VOLUME_DISMOUNT 1
-#define FSRTL_VOLUME_DISMOUNT_FAILED 2
-#define FSRTL_VOLUME_LOCK 3
-#define FSRTL_VOLUME_LOCK_FAILED 4
-#define FSRTL_VOLUME_UNLOCK 5
-#define FSRTL_VOLUME_MOUNT 6
-
-#define FSRTL_WILD_CHARACTER 0x08
-
-#define FSRTL_FAT_LEGAL 0x01
-#define FSRTL_HPFS_LEGAL 0x02
-#define FSRTL_NTFS_LEGAL 0x04
-#define FSRTL_WILD_CHARACTER 0x08
-#define FSRTL_OLE_LEGAL 0x10
-#define FSRTL_NTFS_STREAM_LEGAL 0x14
-
-#ifdef _X86_
-#define HARDWARE_PTE HARDWARE_PTE_X86
-#define PHARDWARE_PTE PHARDWARE_PTE_X86
-#endif
-
-#define IO_CHECK_CREATE_PARAMETERS 0x0200
-#define IO_ATTACH_DEVICE 0x0400
-
-#define IO_ATTACH_DEVICE_API 0x80000000
-
-#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
-#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
-
-#define IO_TYPE_APC 18
-#define IO_TYPE_DPC 19
-#define IO_TYPE_DEVICE_QUEUE 20
-#define IO_TYPE_EVENT_PAIR 21
-#define IO_TYPE_INTERRUPT 22
-#define IO_TYPE_PROFILE 23
-
-#define IRP_BEING_VERIFIED 0x10
-
-#define MAILSLOT_CLASS_FIRSTCLASS 1
-#define MAILSLOT_CLASS_SECONDCLASS 2
-
-#define MAILSLOT_SIZE_AUTO 0
-
-#define MEM_DOS_LIM 0x40000000
-
-#define MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE 1
-
-#define OB_TYPE_TYPE 1
-#define OB_TYPE_DIRECTORY 2
-#define OB_TYPE_SYMBOLIC_LINK 3
-#define OB_TYPE_TOKEN 4
-#define OB_TYPE_PROCESS 5
-#define OB_TYPE_THREAD 6
-#define OB_TYPE_EVENT 7
-#define OB_TYPE_EVENT_PAIR 8
-#define OB_TYPE_MUTANT 9
-#define OB_TYPE_SEMAPHORE 10
-#define OB_TYPE_TIMER 11
-#define OB_TYPE_PROFILE 12
-#define OB_TYPE_WINDOW_STATION 13
-#define OB_TYPE_DESKTOP 14
-#define OB_TYPE_SECTION 15
-#define OB_TYPE_KEY 16
-#define OB_TYPE_PORT 17
-#define OB_TYPE_ADAPTER 18
-#define OB_TYPE_CONTROLLER 19
-#define OB_TYPE_DEVICE 20
-#define OB_TYPE_DRIVER 21
-#define OB_TYPE_IO_COMPLETION 22
-#define OB_TYPE_FILE 23
-
-#define PIN_WAIT (1)
-#define PIN_EXCLUSIVE (2)
-#define PIN_NO_READ (4)
-#define PIN_IF_BCB (8)
-
-#define SEC_BASED 0x00200000
-
-#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
-#define SECURITY_WORLD_RID (0x00000000L)
-
-/* end winnt.h */
-
-#define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01
-#define TOKEN_HAS_BACKUP_PRIVILEGE 0x02
-#define TOKEN_HAS_RESTORE_PRIVILEGE 0x04
-#define TOKEN_HAS_ADMIN_GROUP 0x08
-#define TOKEN_WRITE_RESTRICTED 0x08
-#define TOKEN_IS_RESTRICTED 0x10
-#define SE_BACKUP_PRIVILEGES_CHECKED 0x0100
-
-#define VACB_MAPPING_GRANULARITY (0x40000)
-#define VACB_OFFSET_SHIFT (18)
+#ifndef _FILESYSTEMFSCTL_
+#define _FILESYSTEMFSCTL_
#define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1,
METHOD_BUFFERED, FILE_ANY_ACCESS)
@@ -3406,24 +3373,21 @@
#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8,
METHOD_BUFFERED, FILE_ANY_ACCESS)
-
#define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12,
METHOD_BUFFERED, FILE_ANY_ACCESS)
-
#define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14,
METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-
-
-#define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#define FSCTL_SET_BOOTLOADER_ACCESSED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19,
METHOD_NEITHER, FILE_ANY_ACCESS)
+
#define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24,
METHOD_BUFFERED, FILE_ANY_ACCESS)
-#if (VER_PRODUCTBUILD >= 1381)
+#if (_WIN32_WINNT >= 0x0400)
#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26,
METHOD_BUFFERED, FILE_ANY_ACCESS)
@@ -3431,18 +3395,13 @@
#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28,
METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30,
METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32,
METHOD_NEITHER, FILE_ANY_ACCESS)
-#endif /* (VER_PRODUCTBUILD >= 1381) */
-
-#if (VER_PRODUCTBUILD >= 2195)
-
-#define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33,
METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#endif
+
+#if (_WIN32_WINNT >= 0x0500)
+
#define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35,
METHOD_NEITHER, FILE_ANY_ACCESS)
-
-#define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37,
METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38,
METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40,
METHOD_BUFFERED, FILE_WRITE_DATA)
@@ -3471,14 +3430,725 @@
#define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
+#define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71,
METHOD_OUT_DIRECT, FILE_READ_DATA)
+#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72,
METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+
+#endif
+
+#if (_WIN32_WINNT >= 0x0600)
+
+#define FSCTL_MAKE_MEDIA_COMPATIBLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_SET_DEFECT_MANAGEMENT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_QUERY_SPARING_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_QUERY_ON_DISK_VOLUME_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_SET_VOLUME_COMPRESSION_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80,
METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+#define FSCTL_TXFS_MODIFY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_QUERY_RM_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_TXFS_ROLLFORWARD_REDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_ROLLFORWARD_UNDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_START_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_SHUTDOWN_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_READ_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_CREATE_SECONDARY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_GET_METADATA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_TXFS_GET_TRANSACTED_VERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_TXFS_SAVEPOINT_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 94,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_CREATE_MINIVERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95,
METHOD_BUFFERED, FILE_WRITE_DATA)
+#define FSCTL_TXFS_TRANSACTION_ACTIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_SET_ZERO_ON_DEALLOCATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101,
METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+#define FSCTL_SET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_GET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_WAIT_FOR_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_INITIATE_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_CSC_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#define FSCTL_SHRINK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108,
METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+#define FSCTL_SET_SHORT_NAME_BEHAVIOR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_DFSR_SET_GHOST_HANDLE_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES \
+ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_TXFS_LIST_TRANSACTIONS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121,
METHOD_BUFFERED, FILE_READ_DATA)
+#define FSCTL_QUERY_PAGEFILE_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_RESET_VOLUME_ALLOCATION_HINTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 123,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_TXFS_READ_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 126,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#endif
+
+#if (_WIN32_WINNT >= 0x0601)
+
+#define FSCTL_QUERY_DEPENDENT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 124,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_SD_GLOBAL_CHANGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 125,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_LOOKUP_STREAM_FROM_CLUSTER CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 127,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 128,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_FILE_TYPE_NOTIFICATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 129,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_GET_BOOT_AREA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 140,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_GET_RETRIEVAL_POINTER_BASE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 141,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_SET_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_QUERY_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 143,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define FSCTL_REQUEST_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 144,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define FSCTL_CSV_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 145,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_IS_CSV_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 146,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define FSCTL_QUERY_FILE_SYSTEM_RECOGNITION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 147,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_CSV_GET_VOLUME_PATH_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 148,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM,
150, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define FSCTL_IS_FILE_ON_CSV_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 151,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+typedef struct _CSV_NAMESPACE_INFO {
+ ULONG Version;
+ ULONG DeviceNumber;
+ LARGE_INTEGER StartingOffset;
+ ULONG SectorSize;
+} CSV_NAMESPACE_INFO, *PCSV_NAMESPACE_INFO;
+
+#define CSV_NAMESPACE_INFO_V1 (sizeof(CSV_NAMESPACE_INFO))
+#define CSV_INVALID_DEVICE_NUMBER 0xFFFFFFFF
+
+#endif
+
+#define FSCTL_MARK_AS_SYSTEM_HIVE FSCTL_SET_BOOTLOADER_ACCESSED
+
+typedef struct _PATHNAME_BUFFER {
+ ULONG PathNameLength;
+ WCHAR Name[1];
+} PATHNAME_BUFFER, *PPATHNAME_BUFFER;
+
+typedef struct _FSCTL_QUERY_FAT_BPB_BUFFER {
+ UCHAR First0x24BytesOfBootSector[0x24];
+} FSCTL_QUERY_FAT_BPB_BUFFER, *PFSCTL_QUERY_FAT_BPB_BUFFER;
+
+#if (_WIN32_WINNT >= 0x0400)
+
+typedef struct _NTFS_VOLUME_DATA_BUFFER {
+ LARGE_INTEGER VolumeSerialNumber;
+ LARGE_INTEGER NumberSectors;
+ LARGE_INTEGER TotalClusters;
+ LARGE_INTEGER FreeClusters;
+ LARGE_INTEGER TotalReserved;
+ ULONG BytesPerSector;
+ ULONG BytesPerCluster;
+ ULONG BytesPerFileRecordSegment;
+ ULONG ClustersPerFileRecordSegment;
+ LARGE_INTEGER MftValidDataLength;
+ LARGE_INTEGER MftStartLcn;
+ LARGE_INTEGER Mft2StartLcn;
+ LARGE_INTEGER MftZoneStart;
+ LARGE_INTEGER MftZoneEnd;
+} NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
+
+typedef struct _NTFS_EXTENDED_VOLUME_DATA {
+ ULONG ByteCount;
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+} NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA;
+
+typedef struct _STARTING_LCN_INPUT_BUFFER {
+ LARGE_INTEGER StartingLcn;
+} STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER;
+
+typedef struct _VOLUME_BITMAP_BUFFER {
+ LARGE_INTEGER StartingLcn;
+ LARGE_INTEGER BitmapSize;
+ UCHAR Buffer[1];
+} VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER;
+
+typedef struct _STARTING_VCN_INPUT_BUFFER {
+ LARGE_INTEGER StartingVcn;
+} STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
+
+typedef struct _RETRIEVAL_POINTERS_BUFFER {
+ ULONG ExtentCount;
+ LARGE_INTEGER StartingVcn;
+ struct {
+ LARGE_INTEGER NextVcn;
+ LARGE_INTEGER Lcn;
+ } Extents[1];
+} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
+
+typedef struct _NTFS_FILE_RECORD_INPUT_BUFFER {
+ LARGE_INTEGER FileReferenceNumber;
+} NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER;
+
+typedef struct _NTFS_FILE_RECORD_OUTPUT_BUFFER {
+ LARGE_INTEGER FileReferenceNumber;
+ ULONG FileRecordLength;
+ UCHAR FileRecordBuffer[1];
+} NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
+
+typedef struct _MOVE_FILE_DATA {
+ HANDLE FileHandle;
+ LARGE_INTEGER StartingVcn;
+ LARGE_INTEGER StartingLcn;
+ ULONG ClusterCount;
+} MOVE_FILE_DATA, *PMOVE_FILE_DATA;
+
+typedef struct _MOVE_FILE_RECORD_DATA {
+ HANDLE FileHandle;
+ LARGE_INTEGER SourceFileRecord;
+ LARGE_INTEGER TargetFileRecord;
+} MOVE_FILE_RECORD_DATA, *PMOVE_FILE_RECORD_DATA;
+
+#if defined(_WIN64)
+typedef struct _MOVE_FILE_DATA32 {
+ UINT32 FileHandle;
+ LARGE_INTEGER StartingVcn;
+ LARGE_INTEGER StartingLcn;
+ ULONG ClusterCount;
+} MOVE_FILE_DATA32, *PMOVE_FILE_DATA32;
+#endif
+
+#endif /* (_WIN32_WINNT >= 0x0400) */
+
+#if (_WIN32_WINNT >= 0x0500)
+
+typedef struct _FIND_BY_SID_DATA {
+ ULONG Restart;
+ SID Sid;
+} FIND_BY_SID_DATA, *PFIND_BY_SID_DATA;
+
+typedef struct _FIND_BY_SID_OUTPUT {
+ ULONG NextEntryOffset;
+ ULONG FileIndex;
+ ULONG FileNameLength;
+ WCHAR FileName[1];
+} FIND_BY_SID_OUTPUT, *PFIND_BY_SID_OUTPUT;
+
+typedef struct _MFT_ENUM_DATA {
+ ULONGLONG StartFileReferenceNumber;
+ USN LowUsn;
+ USN HighUsn;
+} MFT_ENUM_DATA, *PMFT_ENUM_DATA;
+
+typedef struct _CREATE_USN_JOURNAL_DATA {
+ ULONGLONG MaximumSize;
+ ULONGLONG AllocationDelta;
+} CREATE_USN_JOURNAL_DATA, *PCREATE_USN_JOURNAL_DATA;
+
+typedef struct _READ_USN_JOURNAL_DATA {
+ USN StartUsn;
+ ULONG ReasonMask;
+ ULONG ReturnOnlyOnClose;
+ ULONGLONG Timeout;
+ ULONGLONG BytesToWaitFor;
+ ULONGLONG UsnJournalID;
+} READ_USN_JOURNAL_DATA, *PREAD_USN_JOURNAL_DATA;
+
+typedef struct _USN_RECORD {
+ ULONG RecordLength;
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+ ULONGLONG FileReferenceNumber;
+ ULONGLONG ParentFileReferenceNumber;
+ USN Usn;
+ LARGE_INTEGER TimeStamp;
+ ULONG Reason;
+ ULONG SourceInfo;
+ ULONG SecurityId;
+ ULONG FileAttributes;
+ USHORT FileNameLength;
+ USHORT FileNameOffset;
+ WCHAR FileName[1];
+} USN_RECORD, *PUSN_RECORD;
+
+#define USN_PAGE_SIZE (0x1000)
+
+#define USN_REASON_DATA_OVERWRITE (0x00000001)
+#define USN_REASON_DATA_EXTEND (0x00000002)
+#define USN_REASON_DATA_TRUNCATION (0x00000004)
+#define USN_REASON_NAMED_DATA_OVERWRITE (0x00000010)
+#define USN_REASON_NAMED_DATA_EXTEND (0x00000020)
+#define USN_REASON_NAMED_DATA_TRUNCATION (0x00000040)
+#define USN_REASON_FILE_CREATE (0x00000100)
+#define USN_REASON_FILE_DELETE (0x00000200)
+#define USN_REASON_EA_CHANGE (0x00000400)
+#define USN_REASON_SECURITY_CHANGE (0x00000800)
+#define USN_REASON_RENAME_OLD_NAME (0x00001000)
+#define USN_REASON_RENAME_NEW_NAME (0x00002000)
+#define USN_REASON_INDEXABLE_CHANGE (0x00004000)
+#define USN_REASON_BASIC_INFO_CHANGE (0x00008000)
+#define USN_REASON_HARD_LINK_CHANGE (0x00010000)
+#define USN_REASON_COMPRESSION_CHANGE (0x00020000)
+#define USN_REASON_ENCRYPTION_CHANGE (0x00040000)
+#define USN_REASON_OBJECT_ID_CHANGE (0x00080000)
+#define USN_REASON_REPARSE_POINT_CHANGE (0x00100000)
+#define USN_REASON_STREAM_CHANGE (0x00200000)
+#define USN_REASON_TRANSACTED_CHANGE (0x00400000)
+#define USN_REASON_CLOSE (0x80000000)
+
+typedef struct _USN_JOURNAL_DATA {
+ ULONGLONG UsnJournalID;
+ USN FirstUsn;
+ USN NextUsn;
+ USN LowestValidUsn;
+ USN MaxUsn;
+ ULONGLONG MaximumSize;
+ ULONGLONG AllocationDelta;
+} USN_JOURNAL_DATA, *PUSN_JOURNAL_DATA;
+
+typedef struct _DELETE_USN_JOURNAL_DATA {
+ ULONGLONG UsnJournalID;
+ ULONG DeleteFlags;
+} DELETE_USN_JOURNAL_DATA, *PDELETE_USN_JOURNAL_DATA;
+
+#define USN_DELETE_FLAG_DELETE (0x00000001)
+#define USN_DELETE_FLAG_NOTIFY (0x00000002)
+#define USN_DELETE_VALID_FLAGS (0x00000003)
+
+typedef struct _MARK_HANDLE_INFO {
+ ULONG UsnSourceInfo;
+ HANDLE VolumeHandle;
+ ULONG HandleInfo;
+} MARK_HANDLE_INFO, *PMARK_HANDLE_INFO;
+
+#if defined(_WIN64)
+typedef struct _MARK_HANDLE_INFO32 {
+ ULONG UsnSourceInfo;
+ UINT32 VolumeHandle;
+ ULONG HandleInfo;
+} MARK_HANDLE_INFO32, *PMARK_HANDLE_INFO32;
+#endif
+
+#define USN_SOURCE_DATA_MANAGEMENT (0x00000001)
+#define USN_SOURCE_AUXILIARY_DATA (0x00000002)
+#define USN_SOURCE_REPLICATION_MANAGEMENT (0x00000004)
+
+#define MARK_HANDLE_PROTECT_CLUSTERS (0x00000001)
+#define MARK_HANDLE_TXF_SYSTEM_LOG (0x00000004)
+#define MARK_HANDLE_NOT_TXF_SYSTEM_LOG (0x00000008)
+
+typedef struct _BULK_SECURITY_TEST_DATA {
+ ACCESS_MASK DesiredAccess;
+ ULONG SecurityIds[1];
+} BULK_SECURITY_TEST_DATA, *PBULK_SECURITY_TEST_DATA;
+
+#define VOLUME_IS_DIRTY (0x00000001)
+#define VOLUME_UPGRADE_SCHEDULED (0x00000002)
+#define VOLUME_SESSION_OPEN (0x00000004)
+
+typedef struct _FILE_PREFETCH {
+ ULONG Type;
+ ULONG Count;
+ ULONGLONG Prefetch[1];
+} FILE_PREFETCH, *PFILE_PREFETCH;
+
+typedef struct _FILE_PREFETCH_EX {
+ ULONG Type;
+ ULONG Count;
+ PVOID Context;
+ ULONGLONG Prefetch[1];
+} FILE_PREFETCH_EX, *PFILE_PREFETCH_EX;
+
+#define FILE_PREFETCH_TYPE_FOR_CREATE 0x1
+#define FILE_PREFETCH_TYPE_FOR_DIRENUM 0x2
+#define FILE_PREFETCH_TYPE_FOR_CREATE_EX 0x3
+#define FILE_PREFETCH_TYPE_FOR_DIRENUM_EX 0x4
+
+#define FILE_PREFETCH_TYPE_MAX 0x4
+
+typedef struct _FILE_OBJECTID_BUFFER {
+ UCHAR ObjectId[16];
+ union {
+ struct {
+ UCHAR BirthVolumeId[16];
+ UCHAR BirthObjectId[16];
+ UCHAR DomainId[16];
+ } DUMMYSTRUCTNAME;
+ UCHAR ExtendedInfo[48];
+ } DUMMYUNIONNAME;
+} FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
+
+typedef struct _FILE_SET_SPARSE_BUFFER {
+ BOOLEAN SetSparse;
+} FILE_SET_SPARSE_BUFFER, *PFILE_SET_SPARSE_BUFFER;
+
+typedef struct _FILE_ZERO_DATA_INFORMATION {
+ LARGE_INTEGER FileOffset;
+ LARGE_INTEGER BeyondFinalZero;
+} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
+
+typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
+ LARGE_INTEGER FileOffset;
+ LARGE_INTEGER Length;
+} FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
+
+typedef struct _ENCRYPTION_BUFFER {
+ ULONG EncryptionOperation;
+ UCHAR Private[1];
+} ENCRYPTION_BUFFER, *PENCRYPTION_BUFFER;
+
+#define FILE_SET_ENCRYPTION 0x00000001
+#define FILE_CLEAR_ENCRYPTION 0x00000002
+#define STREAM_SET_ENCRYPTION 0x00000003
+#define STREAM_CLEAR_ENCRYPTION 0x00000004
+
+#define MAXIMUM_ENCRYPTION_VALUE 0x00000004
+
+typedef struct _DECRYPTION_STATUS_BUFFER {
+ BOOLEAN NoEncryptedStreams;
+} DECRYPTION_STATUS_BUFFER, *PDECRYPTION_STATUS_BUFFER;
+
+#define ENCRYPTION_FORMAT_DEFAULT (0x01)
+
+#define COMPRESSION_FORMAT_SPARSE (0x4000)
+
+typedef struct _REQUEST_RAW_ENCRYPTED_DATA {
+ LONGLONG FileOffset;
+ ULONG Length;
+} REQUEST_RAW_ENCRYPTED_DATA, *PREQUEST_RAW_ENCRYPTED_DATA;
+
+typedef struct _ENCRYPTED_DATA_INFO {
+ ULONGLONG StartingFileOffset;
+ ULONG OutputBufferOffset;
+ ULONG BytesWithinFileSize;
+ ULONG BytesWithinValidDataLength;
+ USHORT CompressionFormat;
+ UCHAR DataUnitShift;
+ UCHAR ChunkShift;
+ UCHAR ClusterShift;
+ UCHAR EncryptionFormat;
+ USHORT NumberOfDataBlocks;
+ ULONG DataBlockSize[ANYSIZE_ARRAY];
+} ENCRYPTED_DATA_INFO, *PENCRYPTED_DATA_INFO;
+
+typedef struct _PLEX_READ_DATA_REQUEST {
+ LARGE_INTEGER ByteOffset;
+ ULONG ByteLength;
+ ULONG PlexNumber;
+} PLEX_READ_DATA_REQUEST, *PPLEX_READ_DATA_REQUEST;
+
+typedef struct _SI_COPYFILE {
+ ULONG SourceFileNameLength;
+ ULONG DestinationFileNameLength;
+ ULONG Flags;
+ WCHAR FileNameBuffer[1];
+} SI_COPYFILE, *PSI_COPYFILE;
+
+#define COPYFILE_SIS_LINK 0x0001
+#define COPYFILE_SIS_REPLACE 0x0002
+#define COPYFILE_SIS_FLAGS 0x0003
+
+#endif /* (_WIN32_WINNT >= 0x0500) */
+
+#if (_WIN32_WINNT >= 0x0601)
+
+#define MARK_HANDLE_REALTIME (0x00000020)
+#define MARK_HANDLE_NOT_REALTIME (0x00000040)
+
+#define NO_8DOT3_NAME_PRESENT (0x00000001)
+#define REMOVED_8DOT3_NAME (0x00000002)
+
+#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED (0x00000001)
+
+#endif /* (_WIN32_WINNT >= 0x0601) */
+
+typedef struct _FILESYSTEM_STATISTICS {
+ USHORT FileSystemType;
+ USHORT Version;
+ ULONG SizeOfCompleteStructure;
+ ULONG UserFileReads;
+ ULONG UserFileReadBytes;
+ ULONG UserDiskReads;
+ ULONG UserFileWrites;
+ ULONG UserFileWriteBytes;
+ ULONG UserDiskWrites;
+ ULONG MetaDataReads;
+ ULONG MetaDataReadBytes;
+ ULONG MetaDataDiskReads;
+ ULONG MetaDataWrites;
+ ULONG MetaDataWriteBytes;
+ ULONG MetaDataDiskWrites;
+} FILESYSTEM_STATISTICS, *PFILESYSTEM_STATISTICS;
+
+#define FILESYSTEM_STATISTICS_TYPE_NTFS 1
+#define FILESYSTEM_STATISTICS_TYPE_FAT 2
+#define FILESYSTEM_STATISTICS_TYPE_EXFAT 3
+
+typedef struct _FAT_STATISTICS {
+ ULONG CreateHits;
+ ULONG SuccessfulCreates;
+ ULONG FailedCreates;
+ ULONG NonCachedReads;
+ ULONG NonCachedReadBytes;
+ ULONG NonCachedWrites;
+ ULONG NonCachedWriteBytes;
+ ULONG NonCachedDiskReads;
+ ULONG NonCachedDiskWrites;
+} FAT_STATISTICS, *PFAT_STATISTICS;
+
+typedef struct _EXFAT_STATISTICS {
+ ULONG CreateHits;
+ ULONG SuccessfulCreates;
+ ULONG FailedCreates;
+ ULONG NonCachedReads;
+ ULONG NonCachedReadBytes;
+ ULONG NonCachedWrites;
+ ULONG NonCachedWriteBytes;
+ ULONG NonCachedDiskReads;
+ ULONG NonCachedDiskWrites;
+} EXFAT_STATISTICS, *PEXFAT_STATISTICS;
+
+typedef struct _NTFS_STATISTICS {
+ ULONG LogFileFullExceptions;
+ ULONG OtherExceptions;
+ ULONG MftReads;
+ ULONG MftReadBytes;
+ ULONG MftWrites;
+ ULONG MftWriteBytes;
+ struct {
+ USHORT Write;
+ USHORT Create;
+ USHORT SetInfo;
+ USHORT Flush;
+ } MftWritesUserLevel;
+ USHORT MftWritesFlushForLogFileFull;
+ USHORT MftWritesLazyWriter;
+ USHORT MftWritesUserRequest;
+ ULONG Mft2Writes;
+ ULONG Mft2WriteBytes;
+ struct {
+ USHORT Write;
+ USHORT Create;
+ USHORT SetInfo;
+ USHORT Flush;
+ } Mft2WritesUserLevel;
+ USHORT Mft2WritesFlushForLogFileFull;
+ USHORT Mft2WritesLazyWriter;
+ USHORT Mft2WritesUserRequest;
+ ULONG RootIndexReads;
+ ULONG RootIndexReadBytes;
+ ULONG RootIndexWrites;
+ ULONG RootIndexWriteBytes;
+ ULONG BitmapReads;
+ ULONG BitmapReadBytes;
+ ULONG BitmapWrites;
+ ULONG BitmapWriteBytes;
+ USHORT BitmapWritesFlushForLogFileFull;
+ USHORT BitmapWritesLazyWriter;
+ USHORT BitmapWritesUserRequest;
+ struct {
+ USHORT Write;
+ USHORT Create;
+ USHORT SetInfo;
+ } BitmapWritesUserLevel;
+ ULONG MftBitmapReads;
+ ULONG MftBitmapReadBytes;
+ ULONG MftBitmapWrites;
+ ULONG MftBitmapWriteBytes;
+ USHORT MftBitmapWritesFlushForLogFileFull;
+ USHORT MftBitmapWritesLazyWriter;
+ USHORT MftBitmapWritesUserRequest;
+ struct {
+ USHORT Write;
+ USHORT Create;
+ USHORT SetInfo;
+ USHORT Flush;
+ } MftBitmapWritesUserLevel;
+ ULONG UserIndexReads;
+ ULONG UserIndexReadBytes;
+ ULONG UserIndexWrites;
+ ULONG UserIndexWriteBytes;
+ ULONG LogFileReads;
+ ULONG LogFileReadBytes;
+ ULONG LogFileWrites;
+ ULONG LogFileWriteBytes;
+ struct {
+ ULONG Calls;
+ ULONG Clusters;
+ ULONG Hints;
+ ULONG RunsReturned;
+ ULONG HintsHonored;
+ ULONG HintsClusters;
+ ULONG Cache;
+ ULONG CacheClusters;
+ ULONG CacheMiss;
+ ULONG CacheMissClusters;
+ } Allocate;
+} NTFS_STATISTICS, *PNTFS_STATISTICS;
+
+#pragma pack(push,4)
+
+#ifndef VER_PRODUCTBUILD
+#define VER_PRODUCTBUILD 10000
+#endif
+
+#define EX_PUSH_LOCK ULONG_PTR
+#define PEX_PUSH_LOCK PULONG_PTR
+
+#include "csq.h"
+
+#ifdef _NTOSKRNL_
+extern PUCHAR FsRtlLegalAnsiCharacterArray;
+#else
+extern DECLSPEC_IMPORT PUCHAR FsRtlLegalAnsiCharacterArray;
+#endif
+extern PACL SePublicDefaultDacl;
+extern PACL SeSystemDefaultDacl;
+
+extern KSPIN_LOCK IoStatisticsLock;
+extern ULONG IoReadOperationCount;
+extern ULONG IoWriteOperationCount;
+extern ULONG IoOtherOperationCount;
+extern LARGE_INTEGER IoReadTransferCount;
+extern LARGE_INTEGER IoWriteTransferCount;
+extern LARGE_INTEGER IoOtherTransferCount;
+
+#define FS_LFN_APIS 0x00004000
+
+#define FILE_PIPE_READ_DATA 0x00000000
+#define FILE_PIPE_WRITE_SPACE 0x00000001
+
+#define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE |
FILE_NON_DIRECTORY_FILE */
+#define FILE_STORAGE_TYPE_DEFAULT (StorageTypeDefault <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_DIRECTORY (StorageTypeDirectory <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_FILE (StorageTypeFile <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_DOCFILE (StorageTypeDocfile <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_JUNCTION_POINT (StorageTypeJunctionPoint <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_CATALOG (StorageTypeCatalog <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_STRUCTURED_STORAGE (StorageTypeStructuredStorage <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_EMBEDDING (StorageTypeEmbedding <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_STORAGE_TYPE_STREAM (StorageTypeStream <<
FILE_STORAGE_TYPE_SHIFT)
+#define FILE_MINIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_DEFAULT
+#define FILE_MAXIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_STREAM
+#define FILE_STORAGE_TYPE_MASK 0x000f0000
+#define FILE_STORAGE_TYPE_SHIFT 16
+
+#define FILE_VC_QUOTAS_LOG_VIOLATIONS 0x00000004
+
+#define FSRTL_FLAG_FILE_MODIFIED (0x01)
+#define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02)
+#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04)
+#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08)
+#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10)
+#define FSRTL_FLAG_USER_MAPPED_FILE (0x20)
+#define FSRTL_FLAG_ADVANCED_HEADER (0x40)
+#define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80)
+
+#define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01)
+#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS (0x02)
+#define FSRTL_FLAG2_PURGE_WHEN_MAPPED (0x04)
+#define FSRTL_FLAG2_IS_PAGING_FILE (0x08)
+
+#define FSRTL_FSP_TOP_LEVEL_IRP (0x01)
+#define FSRTL_CACHE_TOP_LEVEL_IRP (0x02)
+#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03)
+#define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
+#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
+
+#define FSRTL_VOLUME_DISMOUNT 1
+#define FSRTL_VOLUME_DISMOUNT_FAILED 2
+#define FSRTL_VOLUME_LOCK 3
+#define FSRTL_VOLUME_LOCK_FAILED 4
+#define FSRTL_VOLUME_UNLOCK 5
+#define FSRTL_VOLUME_MOUNT 6
+
+#define FSRTL_WILD_CHARACTER 0x08
+
+#define FSRTL_FAT_LEGAL 0x01
+#define FSRTL_HPFS_LEGAL 0x02
+#define FSRTL_NTFS_LEGAL 0x04
+#define FSRTL_WILD_CHARACTER 0x08
+#define FSRTL_OLE_LEGAL 0x10
+#define FSRTL_NTFS_STREAM_LEGAL 0x14
+
+#ifdef _X86_
+#define HARDWARE_PTE HARDWARE_PTE_X86
+#define PHARDWARE_PTE PHARDWARE_PTE_X86
+#endif
+
+#define IO_CHECK_CREATE_PARAMETERS 0x0200
+#define IO_ATTACH_DEVICE 0x0400
+
+#define IO_ATTACH_DEVICE_API 0x80000000
+
+#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
+#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
+
+#define IO_TYPE_APC 18
+#define IO_TYPE_DPC 19
+#define IO_TYPE_DEVICE_QUEUE 20
+#define IO_TYPE_EVENT_PAIR 21
+#define IO_TYPE_INTERRUPT 22
+#define IO_TYPE_PROFILE 23
+
+#define IRP_BEING_VERIFIED 0x10
+
+#define MAILSLOT_CLASS_FIRSTCLASS 1
+#define MAILSLOT_CLASS_SECONDCLASS 2
+
+#define MAILSLOT_SIZE_AUTO 0
+
+#define MEM_DOS_LIM 0x40000000
+
+#define MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE 1
+
+#define OB_TYPE_TYPE 1
+#define OB_TYPE_DIRECTORY 2
+#define OB_TYPE_SYMBOLIC_LINK 3
+#define OB_TYPE_TOKEN 4
+#define OB_TYPE_PROCESS 5
+#define OB_TYPE_THREAD 6
+#define OB_TYPE_EVENT 7
+#define OB_TYPE_EVENT_PAIR 8
+#define OB_TYPE_MUTANT 9
+#define OB_TYPE_SEMAPHORE 10
+#define OB_TYPE_TIMER 11
+#define OB_TYPE_PROFILE 12
+#define OB_TYPE_WINDOW_STATION 13
+#define OB_TYPE_DESKTOP 14
+#define OB_TYPE_SECTION 15
+#define OB_TYPE_KEY 16
+#define OB_TYPE_PORT 17
+#define OB_TYPE_ADAPTER 18
+#define OB_TYPE_CONTROLLER 19
+#define OB_TYPE_DEVICE 20
+#define OB_TYPE_DRIVER 21
+#define OB_TYPE_IO_COMPLETION 22
+#define OB_TYPE_FILE 23
+
+#define PIN_WAIT (1)
+#define PIN_EXCLUSIVE (2)
+#define PIN_NO_READ (4)
+#define PIN_IF_BCB (8)
+
+#define SEC_BASED 0x00200000
+
+#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
+#define SECURITY_WORLD_RID (0x00000000L)
+
+/* end winnt.h */
+
+#define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01
+#define TOKEN_HAS_BACKUP_PRIVILEGE 0x02
+#define TOKEN_HAS_RESTORE_PRIVILEGE 0x04
+#define TOKEN_HAS_ADMIN_GROUP 0x08
+#define TOKEN_WRITE_RESTRICTED 0x08
+#define TOKEN_IS_RESTRICTED 0x10
+#define SE_BACKUP_PRIVILEGES_CHECKED 0x0100
+
+#define VACB_MAPPING_GRANULARITY (0x40000)
+#define VACB_OFFSET_SHIFT (18)
+
+#if (VER_PRODUCTBUILD >= 1381)
+#define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31,
METHOD_BUFFERED, FILE_ANY_ACCESS)
+#endif /* (VER_PRODUCTBUILD >= 1381) */
+
+#if (VER_PRODUCTBUILD >= 2195)
+
+#define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33,
METHOD_NEITHER, FILE_ANY_ACCESS)
+#define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34,
METHOD_NEITHER, FILE_ANY_ACCESS)
+
+#define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37,
METHOD_NEITHER, FILE_ANY_ACCESS)
+
#define FSCTL_HSM_MSG CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_NSS_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 67,
METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_HSM_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68,
METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69,
METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_NSS_RCONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 70,
METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71,
METHOD_OUT_DIRECT, FILE_READ_DATA)
-#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72,
METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-
#endif /* (VER_PRODUCTBUILD >= 2195) */
#define FSCTL_MAILSLOT_PEEK CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER,
FILE_READ_DATA)
@@ -3866,11 +4536,6 @@
} FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
#if (VER_PRODUCTBUILD >= 2195)
-typedef struct _FILE_ZERO_DATA_INFORMATION {
- LARGE_INTEGER FileOffset;
- LARGE_INTEGER BeyondFinalZero;
-} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
-
typedef struct FILE_ALLOCATED_RANGE_BUFFER {
LARGE_INTEGER FileOffset;
LARGE_INTEGER Length;
@@ -4049,11 +4714,6 @@
OBJECT_TYPE_INFO ObjectsTypeInfo[1];
} OBJECT_ALL_TYPES_INFO, *POBJECT_ALL_TYPES_INFO;
-typedef struct _PATHNAME_BUFFER {
- ULONG PathNameLength;
- WCHAR Name[1];
-} PATHNAME_BUFFER, *PPATHNAME_BUFFER;
-
typedef enum _RTL_GENERIC_COMPARE_RESULTS
{
GenericLessThan,
@@ -4130,15 +4790,6 @@
typedef struct _QUERY_PATH_RESPONSE {
ULONG LengthAccepted;
} QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE;
-
-typedef struct _RETRIEVAL_POINTERS_BUFFER {
- ULONG ExtentCount;
- LARGE_INTEGER StartingVcn;
- struct {
- LARGE_INTEGER NextVcn;
- LARGE_INTEGER Lcn;
- } Extents[1];
-} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
typedef struct _RTL_SPLAY_LINKS {
struct _RTL_SPLAY_LINKS *Parent;
@@ -4376,15 +5027,6 @@
extern PSE_EXPORTS SeExports;
-typedef struct
-{
- LARGE_INTEGER StartingLcn;
-} STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER;
-
-typedef struct _STARTING_VCN_INPUT_BUFFER {
- LARGE_INTEGER StartingVcn;
-} STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
-
typedef struct _SECURITY_CLIENT_CONTEXT {
SECURITY_QUALITY_OF_SERVICE SecurityQos;
PACCESS_TOKEN ClientToken;
@@ -4414,13 +5056,6 @@
ULONG Unknown;
LIST_ENTRY Secured;
} VAD_HEADER, *PVAD_HEADER;
-
-typedef struct
-{
- LARGE_INTEGER StartingLcn;
- LARGE_INTEGER BitmapSize;
- UCHAR Buffer[1];
-} VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER;
#if (VER_PRODUCTBUILD >= 2600)