diff --git a/PInvoke/Kernel32/IoApiSet.cs b/PInvoke/Kernel32/IoApiSet.cs index 848a7dc5..a77e0ea0 100644 --- a/PInvoke/Kernel32/IoApiSet.cs +++ b/PInvoke/Kernel32/IoApiSet.cs @@ -9,123 +9,6 @@ namespace Vanara.PInvoke { public static partial class Kernel32 { - /// Device types defined by the system. - [PInvokeData("WinIOCtl.h")] - public enum DEVICE_TYPE : ushort - { - FILE_DEVICE_BEEP = 0x00000001, - FILE_DEVICE_CD_ROM = 0x00000002, - FILE_DEVICE_CD_ROM_FILE_SYSTEM = 0x00000003, - FILE_DEVICE_CONTROLLER = 0x00000004, - FILE_DEVICE_DATALINK = 0x00000005, - FILE_DEVICE_DFS = 0x00000006, - FILE_DEVICE_DISK = 0x00000007, - FILE_DEVICE_DISK_FILE_SYSTEM = 0x00000008, - FILE_DEVICE_FILE_SYSTEM = 0x00000009, - FILE_DEVICE_INPORT_PORT = 0x0000000a, - FILE_DEVICE_KEYBOARD = 0x0000000b, - FILE_DEVICE_MAILSLOT = 0x0000000c, - FILE_DEVICE_MIDI_IN = 0x0000000d, - FILE_DEVICE_MIDI_OUT = 0x0000000e, - FILE_DEVICE_MOUSE = 0x0000000f, - FILE_DEVICE_MULTI_UNC_PROVIDER = 0x00000010, - FILE_DEVICE_NAMED_PIPE = 0x00000011, - FILE_DEVICE_NETWORK = 0x00000012, - FILE_DEVICE_NETWORK_BROWSER = 0x00000013, - FILE_DEVICE_NETWORK_FILE_SYSTEM = 0x00000014, - FILE_DEVICE_NULL = 0x00000015, - FILE_DEVICE_PARALLEL_PORT = 0x00000016, - FILE_DEVICE_PHYSICAL_NETCARD = 0x00000017, - FILE_DEVICE_PRINTER = 0x00000018, - FILE_DEVICE_SCANNER = 0x00000019, - FILE_DEVICE_SERIAL_MOUSE_PORT = 0x0000001a, - FILE_DEVICE_SERIAL_PORT = 0x0000001b, - FILE_DEVICE_SCREEN = 0x0000001c, - FILE_DEVICE_SOUND = 0x0000001d, - FILE_DEVICE_STREAMS = 0x0000001e, - FILE_DEVICE_TAPE = 0x0000001f, - FILE_DEVICE_TAPE_FILE_SYSTEM = 0x00000020, - FILE_DEVICE_TRANSPORT = 0x00000021, - FILE_DEVICE_UNKNOWN = 0x00000022, - FILE_DEVICE_VIDEO = 0x00000023, - FILE_DEVICE_VIRTUAL_DISK = 0x00000024, - FILE_DEVICE_WAVE_IN = 0x00000025, - FILE_DEVICE_WAVE_OUT = 0x00000026, - FILE_DEVICE_8042_PORT = 0x00000027, - FILE_DEVICE_NETWORK_REDIRECTOR = 0x00000028, - FILE_DEVICE_BATTERY = 0x00000029, - FILE_DEVICE_BUS_EXTENDER = 0x0000002a, - FILE_DEVICE_MODEM = 0x0000002b, - FILE_DEVICE_VDM = 0x0000002c, - FILE_DEVICE_MASS_STORAGE = 0x0000002d, - FILE_DEVICE_SMB = 0x0000002e, - FILE_DEVICE_KS = 0x0000002f, - FILE_DEVICE_CHANGER = 0x00000030, - FILE_DEVICE_SMARTCARD = 0x00000031, - FILE_DEVICE_ACPI = 0x00000032, - FILE_DEVICE_DVD = 0x00000033, - FILE_DEVICE_FULLSCREEN_VIDEO = 0x00000034, - FILE_DEVICE_DFS_FILE_SYSTEM = 0x00000035, - FILE_DEVICE_DFS_VOLUME = 0x00000036, - FILE_DEVICE_SERENUM = 0x00000037, - FILE_DEVICE_TERMSRV = 0x00000038, - FILE_DEVICE_KSEC = 0x00000039, - FILE_DEVICE_FIPS = 0x0000003A, - FILE_DEVICE_INFINIBAND = 0x0000003B, - FILE_DEVICE_VMBUS = 0x0000003E, - FILE_DEVICE_CRYPT_PROVIDER = 0x0000003F, - FILE_DEVICE_WPD = 0x00000040, - FILE_DEVICE_BLUETOOTH = 0x00000041, - FILE_DEVICE_MT_COMPOSITE = 0x00000042, - FILE_DEVICE_MT_TRANSPORT = 0x00000043, - FILE_DEVICE_BIOMETRIC = 0x00000044, - FILE_DEVICE_PMI = 0x00000045, - FILE_DEVICE_EHSTOR = 0x00000046, - FILE_DEVICE_DEVAPI = 0x00000047, - FILE_DEVICE_GPIO = 0x00000048, - FILE_DEVICE_USBEX = 0x00000049, - FILE_DEVICE_CONSOLE = 0x00000050, - FILE_DEVICE_NFP = 0x00000051, - FILE_DEVICE_SYSENV = 0x00000052, - FILE_DEVICE_VIRTUAL_BLOCK = 0x00000053, - FILE_DEVICE_POINT_OF_SERVICE = 0x00000054, - FILE_DEVICE_STORAGE_REPLICATION = 0x00000055, - FILE_DEVICE_TRUST_ENV = 0x00000056, - FILE_DEVICE_UCM = 0x00000057, - FILE_DEVICE_UCMTCPCI = 0x00000058, - IOCTL_STORAGE_BASE = FILE_DEVICE_MASS_STORAGE, - } - - /// - /// Defined access check value for any access within an I/O control code (IOCTL). The FILE_ACCESS_ANY is generally the correct value. - /// - [Flags] - [PInvokeData("WinIOCtl.h")] - public enum IOAccess : byte - { - /// Request all access. - FILE_ANY_ACCESS = 0, - - /// Request read access. Can be used with FILE_WRITE_ACCESS. - FILE_READ_ACCESS = 1, - - /// Request write access. Can be used with FILE_READ_ACCESS. - FILE_WRITE_ACCESS = 2, - - /// Request read and write access. This value is equivalent to (FILE_READ_ACCESS | FILE_WRITE_ACCESS). - FILE_READ_WRITE_ACCESS = 3, - } - - /// Defined method codes for how buffers are passed for I/O and file system controls within an I/O control code (IOCTL). - [PInvokeData("WinIOCtl.h")] - public enum IOMethod : byte - { - METHOD_BUFFERED = 0, - METHOD_IN_DIRECT = 1, - METHOD_OUT_DIRECT = 2, - METHOD_NEITHER = 3, - } - /// /// Starts the asynchronous operation of sending a control code directly to a specified device driver, causing the corresponding /// device to perform the corresponding operation. @@ -1196,177 +1079,5 @@ namespace Vanara.PInvoke /// Receives the number of bytes transferred during the I/O operation that has completed. public uint dwNumberOfBytesTransferred; } - - /// - /// Represents IO control codes. - /// - [PInvokeData("WinIOCtl.h")] - public static class IOControlCode - { - public static uint FSCTL_GET_COMPRESSION - => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 15, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint FSCTL_SET_COMPRESSION - => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 16, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_ALLOCATE_BC_STREAM - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0601, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_ATTRIBUTE_MANAGEMENT - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0727, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_BREAK_RESERVATION - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0405, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0620, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_CHECK_VERIFY - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0200, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_CHECK_VERIFY2 - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0200, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_DEVICE_POWER_CAP - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0725, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_DEVICE_TELEMETRY_NOTIFY - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0471, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_DEVICE_TELEMETRY_QUERY_CAPS - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0472, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_EJECT_MEDIA - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0202, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_EJECTION_CONTROL - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0250, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_ENABLE_IDLE_POWER - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0720, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_EVENT_NOTIFICATION - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0724, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_FAILURE_PREDICTION_CONFIG - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0441, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_FIND_NEW_DEVICES - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0206, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_FIRMWARE_ACTIVATE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0702, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_FIRMWARE_DOWNLOAD - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0701, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_FIRMWARE_GET_INFO - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0700, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_FREE_BC_STREAM - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0602, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_GET_BC_PROPERTIES - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0600, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_GET_COUNTERS - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x442, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_DEVICE_NUMBER - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0420, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_DEVICE_TELEMETRY - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0470, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_GET_DEVICE_TELEMETRY_RAW - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0473, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_GET_HOTPLUG_INFO - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0305, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_IDLE_POWERUP_REASON - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0721, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_LB_PROVISIONING_MAP_RESOURCES - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0502, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0304, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_MEDIA_TYPES - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0300, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_GET_MEDIA_TYPES_EX - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0301, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_LOAD_MEDIA - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0203, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_LOAD_MEDIA2 - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0203, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0501, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_MCN_CONTROL - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0251, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_MEDIA_REMOVAL - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0201, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_PERSISTENT_RESERVE_IN - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0406, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_PERSISTENT_RESERVE_OUT - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0407, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_POWER_ACTIVE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0722, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_POWER_IDLE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0723, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_PREDICT_FAILURE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0440, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_PROTOCOL_COMMAND - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x04F0, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_QUERY_PROPERTY - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0500, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_READ_CAPACITY - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0450, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_REINITIALIZE_MEDIA - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0590, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_RELEASE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0205, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_RESERVE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0204, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_RESET_BUS - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0400, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_RESET_DEVICE - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0401, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); - - public static uint IOCTL_STORAGE_RPMB_COMMAND - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0726, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); - - public static uint IOCTL_STORAGE_SET_HOTPLUG_INFO - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0306, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_SET_TEMPERATURE_THRESHOLD - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0480, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_START_DATA_INTEGRITY_CHECK - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0621, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - - public static uint IOCTL_STORAGE_STOP_DATA_INTEGRITY_CHECK - => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0622, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); - } } } \ No newline at end of file diff --git a/PInvoke/Kernel32/WinIOCtl.Enums.cs b/PInvoke/Kernel32/WinIOCtl.Enums.cs new file mode 100644 index 00000000..28bf57a3 --- /dev/null +++ b/PInvoke/Kernel32/WinIOCtl.Enums.cs @@ -0,0 +1,1049 @@ +namespace Vanara.PInvoke +{ + public static partial class Kernel32 + { + /// Specifies the type of CSV control operation to use with the FSCTL_CSV_CONTROL control code. + /// + /// An alternative to calling the FSCTL_CSV_CONTROL control code with this enumeration is to use the CSV_CONTROL_PARAM structure, + /// which encapsulates a member of this enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-csv_control_op typedef enum _CSV_CONTROL_OP { + // CsvControlStartRedirectFile, CsvControlStopRedirectFile, CsvControlQueryRedirectState, CsvControlQueryFileRevision, + // CsvControlQueryMdsPath, CsvControlQueryFileRevisionFileId128, CsvControlQueryVolumeRedirectState, + // CsvControlEnableUSNRangeModificationTracking, CsvControlMarkHandleLocalVolumeMount, CsvControlUnmarkHandleLocalVolumeMount, + // CsvControlGetCsvFsMdsPathV2, CsvControlDisableCaching, CsvControlEnableCaching } CSV_CONTROL_OP, *PCSV_CONTROL_OP; + [PInvokeData("winioctl.h", MSDNShortId = "77A2106F-2C07-4A30-BA46-651F74032609")] + public enum CSV_CONTROL_OP + { + /// Start file redirection. + CsvControlStartRedirectFile = 0x02, + + /// Stop file redirection. + CsvControlStopRedirectFile, + + /// + /// Search for state redirection. When this value is specified, the CSV_QUERY_REDIRECT_STATE structure must also be used. + /// + CsvControlQueryRedirectState, + + /// Search for file revision. When this value is specified, the CSV_QUERY_FILE_REVISION structure must also be used. + CsvControlQueryFileRevision = 0x06, + + /// + CsvControlQueryMdsPath = 0x08, + + /// + CsvControlQueryFileRevisionFileId128, + + /// + CsvControlQueryVolumeRedirectState, + + /// + CsvControlEnableUSNRangeModificationTracking = 0x0d, + + /// + CsvControlMarkHandleLocalVolumeMount, + + /// + CsvControlUnmarkHandleLocalVolumeMount, + + /// + CsvControlGetCsvFsMdsPathV2 = 0x12, + + /// + CsvControlDisableCaching, + + /// + CsvControlEnableCaching, + } + + /// Specifies the element type of a changer device. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-element_type typedef enum _ELEMENT_TYPE { AllElements, + // ChangerTransport, ChangerSlot, ChangerIEPort, ChangerDrive, ChangerDoor, ChangerKeypad, ChangerMaxElement } ELEMENT_TYPE, *PELEMENT_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "b026d0f5-133d-4138-a727-80bf4480bb74")] + public enum ELEMENT_TYPE + { + /// + /// All elements of a changer, including its robotic transport, drives, slots, and insert/eject ports. This value is valid only + /// with IOCTL_CHANGER_GET_ELEMENT_STATUS or IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS. + /// + AllElements, + + /// Robotic transport element, which is used to move media between insert/eject ports, slots, and drives. + ChangerTransport, + + /// Storage element, which is a slot in the changer in which media is stored when not mounted in a drive. + ChangerSlot, + + /// + /// Insert/eject port, which is a single- or multiple-cartridge access port in some changers. An element is an insert/eject port + /// only if it is possible to move a piece of media from a slot to the insert/eject port. + /// + ChangerIEPort, + + /// Data transfer element where data can be read from and written to media. + ChangerDrive, + + /// + /// Mechanism that provides access to all media in a changer at one time (as compared to an IEport that provides access to one or + /// more, but not all, media). For example, a large front door or a magazine that contains all media in the changer is an element + /// of this type. This value is valid only with IOCTL_CHANGER_SET_ACCESS. + /// + ChangerDoor, + + /// Keypad or other input control on the front panel of a changer. This value is valid only with IOCTL_CHANGER_SET_ACCESS. + ChangerKeypad, + } + + /// Specifies the storage media type. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-file_storage_tier_media_type typedef enum + // _FILE_STORAGE_TIER_MEDIA_TYPE { FileStorageTierMediaTypeUnspecified, FileStorageTierMediaTypeDisk, FileStorageTierMediaTypeSsd, + // FileStorageTierMediaTypeScm, FileStorageTierMediaTypeMax } FILE_STORAGE_TIER_MEDIA_TYPE, *PFILE_STORAGE_TIER_MEDIA_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "6D580AC6-5E3C-4F0B-A922-E81E6B8D8658")] + public enum FILE_STORAGE_TIER_MEDIA_TYPE + { + /// Media type is unspecified. + FileStorageTierMediaTypeUnspecified = 0, + + /// Media type is an HDD (hard disk drive). + FileStorageTierMediaTypeDisk, + + /// Media type is an SSD (solid state drive). + FileStorageTierMediaTypeSsd, + + /// + FileStorageTierMediaTypeScm = 4, + } + + /// Defines values for the type of desired storage class. + // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntifs/ne-ntifs-_file_storage_tier_class typedef enum + // _FILE_STORAGE_TIER_CLASS { FileStorageTierClassUnspecified, FileStorageTierClassCapacity, FileStorageTierClassPerformance, + // FileStorageTierClassMax } FILE_STORAGE_TIER_CLASS, *PFILE_STORAGE_TIER_CLASS; + [PInvokeData("ntifs.h", MSDNShortId = "d969fc78-2517-4b9c-b2ce-489af3ff4e5f")] + // public enum FILE_STORAGE_TIER_CLASS{FileStorageTierClassUnspecified, FileStorageTierClassCapacity, + // FileStorageTierClassPerformance, FileStorageTierClassMax, FILE_STORAGE_TIER_CLASS, *PFILE_STORAGE_TIER_CLASS} + public enum FILE_STORAGE_TIER_CLASS + { + /// Unspecified class type. + FileStorageTierClassUnspecified, + + /// Class capacity. + FileStorageTierClassCapacity, + + /// Class performance. + FileStorageTierClassPerformance, + } + + /// Represents the various forms of device media. + /// + /// The MediaType member of the DISK_GEOMETRY data structure is of type MEDIA_TYPE. The DeviceIoControl function + /// receives a DISK_GEOMETRY structure in response to an IOCTL_DISK_GET_DRIVE_GEOMETRY control code. The + /// DeviceIoControl function receives an array of DISK_GEOMETRY structures in response to an + /// IOCTL_STORAGE_GET_MEDIA_TYPES control code. The STORAGE_MEDIA_TYPE enumeration type extends this enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-media_type typedef enum _MEDIA_TYPE { Unknown, + // F5_1Pt2_512, F3_1Pt44_512, F3_2Pt88_512, F3_20Pt8_512, F3_720_512, F5_360_512, F5_320_512, F5_320_1024, F5_180_512, F5_160_512, + // RemovableMedia, FixedMedia, F3_120M_512, F3_640_512, F5_640_512, F5_720_512, F3_1Pt2_512, F3_1Pt23_1024, F5_1Pt23_1024, + // F3_128Mb_512, F3_230Mb_512, F8_256_128, F3_200Mb_512, F3_240M_512, F3_32M_512 } MEDIA_TYPE, *PMEDIA_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "183cf8fc-c17b-4def-b590-0aa4b67488f6")] + public enum MEDIA_TYPE + { + /// Format is unknown + Unknown, + + /// A 5.25" floppy, with 1.2MB and 512 bytes/sector. + F5_1Pt2_512, + + /// A 3.5" floppy, with 1.44MB and 512 bytes/sector. + F3_1Pt44_512, + + /// A 3.5" floppy, with 2.88MB and 512 bytes/sector. + F3_2Pt88_512, + + /// A 3.5" floppy, with 20.8MB and 512 bytes/sector. + F3_20Pt8_512, + + /// A 3.5" floppy, with 720KB and 512 bytes/sector. + F3_720_512, + + /// A 5.25" floppy, with 360KB and 512 bytes/sector. + F5_360_512, + + /// A 5.25" floppy, with 320KB and 512 bytes/sector. + F5_320_512, + + /// A 5.25" floppy, with 320KB and 1024 bytes/sector. + F5_320_1024, + + /// A 5.25" floppy, with 180KB and 512 bytes/sector. + F5_180_512, + + /// A 5.25" floppy, with 160KB and 512 bytes/sector. + F5_160_512, + + /// Removable media other than floppy. + RemovableMedia, + + /// Fixed hard disk media. + FixedMedia, + + /// A 3.5" floppy, with 120MB and 512 bytes/sector. + F3_120M_512, + + /// A 3.5" floppy, with 640KB and 512 bytes/sector. + F3_640_512, + + /// A 5.25" floppy, with 640KB and 512 bytes/sector. + F5_640_512, + + /// A 5.25" floppy, with 720KB and 512 bytes/sector. + F5_720_512, + + /// A 3.5" floppy, with 1.2MB and 512 bytes/sector. + F3_1Pt2_512, + + /// A 3.5" floppy, with 1.23MB and 1024 bytes/sector. + F3_1Pt23_1024, + + /// A 5.25" floppy, with 1.23MB and 1024 bytes/sector. + F5_1Pt23_1024, + + /// A 3.5" floppy, with 128MB and 512 bytes/sector. + F3_128Mb_512, + + /// A 3.5" floppy, with 230MB and 512 bytes/sector. + F3_230Mb_512, + + /// An 8" floppy, with 256KB and 128 bytes/sector. + F8_256_128, + + /// A 3.5" floppy, with 200MB and 512 bytes/sector. (HiFD). + F3_200Mb_512, + + /// A 3.5" floppy, with 240MB and 512 bytes/sector. (HiFD). + F3_240M_512, + + /// A 3.5" floppy, with 32MB and 512 bytes/sector. + F3_32M_512, + } + + /// Represents the format of a partition. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-partition_style typedef enum _PARTITION_STYLE { + // PARTITION_STYLE_MBR, PARTITION_STYLE_GPT, PARTITION_STYLE_RAW } PARTITION_STYLE; + [PInvokeData("winioctl.h", MSDNShortId = "254e4ea1-d0c8-4033-b8af-e5dbfb7c7da8")] + public enum PARTITION_STYLE + { + /// Master boot record (MBR) format. This corresponds to standard AT-style MBR partitions. + PARTITION_STYLE_MBR, + + /// GUID Partition Table (GPT) format. + PARTITION_STYLE_GPT, + + /// Partition not formatted in either of the recognized formats—MBR or GPT. + PARTITION_STYLE_RAW, + } + + /// Specifies the various types of storage buses. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_bus_type typedef enum _STORAGE_BUS_TYPE { + // BusTypeUnknown, BusTypeScsi, BusTypeAtapi, BusTypeAta, BusType1394, BusTypeSsa, BusTypeFibre, BusTypeUsb, BusTypeRAID, + // BusTypeiScsi, BusTypeSas, BusTypeSata, BusTypeSd, BusTypeMmc, BusTypeVirtual, BusTypeFileBackedVirtual, BusTypeSpaces, + // BusTypeNvme, BusTypeSCM, BusTypeUfs, BusTypeMax, BusTypeMaxReserved } STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "fb5a17f7-8ddb-4738-83e1-f00abc3555d2")] + public enum STORAGE_BUS_TYPE + { + /// Unknown bus type. + BusTypeUnknown, + + /// SCSI bus. + BusTypeScsi, + + /// ATAPI bus. + BusTypeAtapi, + + /// ATA bus. + BusTypeAta, + + /// IEEE-1394 bus. + BusType1394, + + /// SSA bus. + BusTypeSsa, + + /// Fibre Channel bus. + BusTypeFibre, + + /// USB bus. + BusTypeUsb, + + /// RAID bus. + BusTypeRAID, + + /// + BusTypeiScsi, + + /// Serial Attached SCSI (SAS) bus. Windows Server 2003: This is not supported before Windows Server 2003 with SP1. + BusTypeSas, + + /// SATA bus. Windows Server 2003: This is not supported before Windows Server 2003 with SP1. + BusTypeSata, + + /// + BusTypeSd, + + /// + BusTypeMmc, + + /// + BusTypeVirtual, + + /// + BusTypeFileBackedVirtual, + + /// + BusTypeSpaces, + + /// + BusTypeNvme, + + /// + BusTypeSCM, + + /// + BusTypeUfs, + + /// + BusTypeMaxReserved = 0x7f, + } + + /// Specifies the health status of a storage component. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_component_health_status typedef enum + // _STORAGE_COMPONENT_HEALTH_STATUS { HealthStatusUnknown, HealthStatusNormal, HealthStatusThrottled, HealthStatusWarning, + // HealthStatusDisabled, HealthStatusFailed } STORAGE_COMPONENT_HEALTH_STATUS, *PSTORAGE_COMPONENT_HEALTH_STATUS; + [PInvokeData("winioctl.h", MSDNShortId = "ECC5A745-EA8B-4FBE-840D-0D959C9ED5BA")] + public enum STORAGE_COMPONENT_HEALTH_STATUS + { + /// + HealthStatusUnknown, + + /// + HealthStatusNormal, + + /// + HealthStatusThrottled, + + /// + HealthStatusWarning, + + /// + HealthStatusDisabled, + + /// + HealthStatusFailed, + } + + /// Specifies the form factor of a device. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_device_form_factor typedef enum + // _STORAGE_DEVICE_FORM_FACTOR { FormFactorUnknown, FormFactor3_5, FormFactor2_5, FormFactor1_8, FormFactor1_8Less, + // FormFactorEmbedded, FormFactorMemoryCard, FormFactormSata, FormFactorM_2, FormFactorPCIeBoard, FormFactorDimm } + // STORAGE_DEVICE_FORM_FACTOR, *PSTORAGE_DEVICE_FORM_FACTOR; + [PInvokeData("winioctl.h", MSDNShortId = "B8FCDC58-D599-4EEE-8096-818345FCD75F")] + public enum STORAGE_DEVICE_FORM_FACTOR + { + /// + FormFactorUnknown, + + /// 3.5-inch nominal form factor. + FormFactor3_5, + + /// 2.5-inch nominal form factor. + FormFactor2_5, + + /// 1.8-inch nominal form factor. + FormFactor1_8, + + /// Less than 1.8-inch nominal form factor. + FormFactor1_8Less, + + /// Embedded on board. + FormFactorEmbedded, + + /// Memory card such as SD, CF. + FormFactorMemoryCard, + + /// mSATA + FormFactormSata, + + /// M.2 + FormFactorM_2, + + /// PCIe card plug into slot. + FormFactorPCIeBoard, + + /// DIMM slot. + FormFactorDimm, + } + + /// The units of the maximum power threshold. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_device_power_cap_units typedef enum + // _STORAGE_DEVICE_POWER_CAP_UNITS { StorageDevicePowerCapUnitsPercent, StorageDevicePowerCapUnitsMilliwatts } + // STORAGE_DEVICE_POWER_CAP_UNITS, *PSTORAGE_DEVICE_POWER_CAP_UNITS; + [PInvokeData("winioctl.h", MSDNShortId = "A6C48765-9A18-4F77-8B0F-9653CE6FDE23")] + public enum STORAGE_DEVICE_POWER_CAP_UNITS + { + /// Units in percent. + StorageDevicePowerCapUnitsPercent, + + /// Units in milliwatts. + StorageDevicePowerCapUnitsMilliwatts, + } + + /// + /// Specifies various types of storage media. Parameters and members of type STORAGE_MEDIA_TYPE also accept values from the + /// MEDIA_TYPE enumeration type. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_media_type typedef enum _STORAGE_MEDIA_TYPE { + // DDS_4mm, MiniQic, Travan, QIC, MP_8mm, AME_8mm, AIT1_8mm, DLT, NCTP, IBM_3480, IBM_3490E, IBM_Magstar_3590, IBM_Magstar_MP, + // STK_DATA_D3, SONY_DTF, DV_6mm, DMI, SONY_D2, CLEANER_CARTRIDGE, CD_ROM, CD_R, CD_RW, DVD_ROM, DVD_R, DVD_RW, MO_3_RW, MO_5_WO, + // MO_5_RW, MO_5_LIMDOW, PC_5_WO, PC_5_RW, PD_5_RW, ABL_5_WO, PINNACLE_APEX_5_RW, SONY_12_WO, PHILIPS_12_WO, HITACHI_12_WO, + // CYGNET_12_WO, KODAK_14_WO, MO_NFR_525, NIKON_12_RW, IOMEGA_ZIP, IOMEGA_JAZ, SYQUEST_EZ135, SYQUEST_EZFLYER, SYQUEST_SYJET, + // AVATAR_F2, MP2_8mm, DST_S, DST_M, DST_L, VXATape_1, VXATape_2, STK_EAGLE, LTO_Ultrium, LTO_Accelis, DVD_RAM, AIT_8mm, ADR_1, + // ADR_2, STK_9940, SAIT, VXATape } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "f584d766-0d4d-49b8-b58a-09556c494270")] + public enum STORAGE_MEDIA_TYPE + { + /// One of the following tape types: DAT, DDS1, DDS2, and so on. + DDS_4mm = 0x20, + + /// MiniQIC tape. + MiniQic, + + /// Travan tape (TR-1, TR-2, TR-3, and so on). + Travan, + + /// QIC tape. + QIC, + + /// An 8mm Exabyte metal particle tape. + MP_8mm, + + /// An 8mm Exabyte advanced metal evaporative tape. + AME_8mm, + + /// An 8mm Sony AIT1 tape. + AIT1_8mm, + + /// DLT compact tape (IIIxt or IV). + DLT, + + /// Philips NCTP tape. + NCTP, + + /// IBM 3480 tape. + IBM_3480, + + /// IBM 3490E tape. + IBM_3490E, + + /// IBM Magstar 3590 tape. + IBM_Magstar_3590, + + /// IBM Magstar MP tape. + IBM_Magstar_MP, + + /// STK data D3 tape. + STK_DATA_D3, + + /// Sony DTF tape. + SONY_DTF, + + /// A 6mm digital videotape. + DV_6mm, + + /// Exabyte DMI tape (or compatible). + DMI, + + /// Sony D2S or D2L tape. + SONY_D2, + + /// Cleaner (all drive types that support cleaners). + CLEANER_CARTRIDGE, + + /// CD. + CD_ROM, + + /// CD (write once). + CD_R, + + /// CD (rewritable). + CD_RW, + + /// DVD. + DVD_ROM, + + /// DVD (write once). + DVD_R, + + /// DVD (rewritable). + DVD_RW, + + /// Magneto-optical 3.5" (rewritable). + MO_3_RW, + + /// Magneto-optical 5.25" (write once). + MO_5_WO, + + /// Magneto-optical 5.25" (rewritable; not LIMDOW). + MO_5_RW, + + /// Magneto-optical 5.25" (rewritable; LIMDOW). + MO_5_LIMDOW, + + /// Phase change 5.25" (write once) + PC_5_WO, + + /// Phase change 5.25" (rewritable) + PC_5_RW, + + /// Phase change dual (rewritable) + PD_5_RW, + + /// Ablative 5.25" (write once). + ABL_5_WO, + + /// Pinnacle Apex 4.6GB (rewritable) + PINNACLE_APEX_5_RW, + + /// Sony 12" (write once). + SONY_12_WO, + + /// Philips/LMS 12" (write once). + PHILIPS_12_WO, + + /// Hitachi 12" (write once) + HITACHI_12_WO, + + /// Cygnet/ATG 12" (write once) + CYGNET_12_WO, + + /// Kodak 14" (write once) + KODAK_14_WO, + + /// MO near field recording (Terastor) + MO_NFR_525, + + /// Nikon 12" (rewritable). + NIKON_12_RW, + + /// Iomega Zip. + IOMEGA_ZIP, + + /// Iomega Jaz. + IOMEGA_JAZ, + + /// Syquest EZ135. + SYQUEST_EZ135, + + /// Syquest EzFlyer. + SYQUEST_EZFLYER, + + /// Syquest SyJet. + SYQUEST_SYJET, + + /// Avatar 2.5" floppy. + AVATAR_F2, + + /// An 8mm Hitachi tape. + MP2_8mm, + + /// Ampex DST small tape. + DST_S, + + /// Ampex DST medium tape. + DST_M, + + /// Ampex DST large tape. + DST_L, + + /// Ecrix 8mm tape. + VXATape_1, + + /// Ecrix 8mm tape. + VXATape_2, + + /// + STK_EAGLE, + + /// LTO Ultrium (IBM, HP, Seagate). + LTO_Ultrium, + + /// LTO Accelis (IBM, HP, Seagate). + LTO_Accelis, + + /// DVD-RAM. + DVD_RAM, + + /// AIT tape (AIT2 or higher). + AIT_8mm, + + /// OnStream ADR1. + ADR_1, + + /// OnStream ADR2. + ADR_2, + + /// STK 9940. + STK_9940, + + /// SAIT tape. Windows Server 2003: This is not supported before Windows Server 2003 with SP1. + SAIT, + + /// Exabyte VXA tape. Windows Server 2008: This is not supported before Windows Server 2008. + VXATape, + } + + /// Reserved for system use. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_port_code_set typedef enum _STORAGE_PORT_CODE_SET + // { StoragePortCodeSetReserved, StoragePortCodeSetStorport, StoragePortCodeSetSCSIport, StoragePortCodeSetSpaceport, + // StoragePortCodeSetATAport, StoragePortCodeSetUSBport, StoragePortCodeSetSBP2port, StoragePortCodeSetSDport } + // STORAGE_PORT_CODE_SET, *PSTORAGE_PORT_CODE_SET; + [PInvokeData("winioctl.h", MSDNShortId = "1c1032e8-30b8-45ad-973a-c7616139b26e")] + public enum STORAGE_PORT_CODE_SET + { + /// Indicates an unknown storage adapter driver type. + StoragePortCodeSetReserved, + + /// Storage adapter driver is a Storport-miniport driver. + StoragePortCodeSetStorport, + + /// Storage adapter driver is a SCSI Port-miniport driver. + StoragePortCodeSetSCSIport, + + /// Storage adapter driver is the Spaceport driver. + StoragePortCodeSetSpaceport, + + /// Storage adapter driver is an ATA-port miniport driver. + StoragePortCodeSetATAport, + + /// Storage adapter driver is the USB-storage port driver. + StoragePortCodeSetUSBport, + + /// Storage adapter driver is the SBP2 port driver. + StoragePortCodeSetSBP2port, + + /// Storage adapter driver is an SD-port miniport driver. + StoragePortCodeSetSDport, + } + + /// + /// Enumerates the possible values of the PropertyId member of the STORAGE_PROPERTY_QUERY structure passed as input to the + /// IOCTL_STORAGE_QUERY_PROPERTY request to retrieve the properties of a storage device or adapter. + /// + /// + /// The optional output buffer returned through the lpOutBuffer parameter of the IOCTL_STORAGE_QUERY_PROPERTY control code request + /// can be one of several structures depending on the value of the PropertyId member of the STORAGE_PROPERTY_QUERY structure + /// pointed to by the lpInBuffer parameter. If the QueryType member of the STORAGE_PROPERTY_QUERY is set to + /// PropertyExistsQuery, then no structure is returned. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_property_id typedef enum _STORAGE_PROPERTY_ID { + // StorageDeviceProperty, StorageAdapterProperty, StorageDeviceIdProperty, StorageDeviceUniqueIdProperty, + // StorageDeviceWriteCacheProperty, StorageMiniportProperty, StorageAccessAlignmentProperty, StorageDeviceSeekPenaltyProperty, + // StorageDeviceTrimProperty, StorageDeviceWriteAggregationProperty, StorageDeviceDeviceTelemetryProperty, + // StorageDeviceLBProvisioningProperty, StorageDevicePowerProperty, StorageDeviceCopyOffloadProperty, + // StorageDeviceResiliencyProperty, StorageDeviceMediumProductType, StorageAdapterRpmbProperty, StorageAdapterCryptoProperty, + // StorageDeviceIoCapabilityProperty, StorageAdapterProtocolSpecificProperty, StorageDeviceProtocolSpecificProperty, + // StorageAdapterTemperatureProperty, StorageDeviceTemperatureProperty, StorageAdapterPhysicalTopologyProperty, + // StorageDevicePhysicalTopologyProperty, StorageDeviceAttributesProperty, StorageDeviceManagementStatus, + // StorageAdapterSerialNumberProperty, StorageDeviceLocationProperty, StorageDeviceNumaProperty, StorageDeviceZonedDeviceProperty, + // StorageDeviceUnsafeShutdownCount, StorageDeviceEnduranceProperty } STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID; + [PInvokeData("winioctl.h", MSDNShortId = "9747be01-7c70-4697-97f7-e3830b54ba0a")] + public enum STORAGE_PROPERTY_ID + { + /// Indicates that the caller is querying for the device descriptor, STORAGE_DEVICE_DESCRIPTOR. + StorageDeviceProperty, + + /// Indicates that the caller is querying for the adapter descriptor, STORAGE_ADAPTER_DESCRIPTOR. + StorageAdapterProperty, + + /// + /// Indicates that the caller is querying for the device identifiers provided with the SCSI vital product data pages. Data is + /// returned using the STORAGE_DEVICE_ID_DESCRIPTOR structure. + /// + StorageDeviceIdProperty, + + /// + /// Intended for driver usage. Indicates that the caller is querying for the unique device identifiers. Data is returned using + /// the STORAGE_DEVICE_UNIQUE_IDENTIFIER structure (see the storduid.h header in the DDK). Windows Server 2003 and Windows XP: + /// This value is not supported before Windows Vista and Windows Server 2008. + /// + StorageDeviceUniqueIdProperty, + + /// + /// Indicates that the caller is querying for the write cache property. Data is returned using the STORAGE_WRITE_CACHE_PROPERTY + /// structure. Windows Server 2003 and Windows XP: This value is not supported before Windows Vista and Windows Server 2008. + /// + StorageDeviceWriteCacheProperty, + + /// Reserved for system use. + StorageMiniportProperty, + + /// + /// Indicates that the caller is querying for the access alignment descriptor, STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR. Windows + /// Server 2003 and Windows XP: This value is not supported before Windows Vista and Windows Server 2008. + /// + StorageAccessAlignmentProperty, + + /// + /// Indicates that the caller is querying for the trim descriptor, DEVICE_TRIM_DESCRIPTOR. Windows Server 2008, Windows Vista, + /// Windows Server 2003 and Windows XP: This value is not supported before Windows 7 and Windows Server 2008 R2. + /// + StorageDeviceTrimProperty, + + /// + /// Indicates that the caller is querying for the device power descriptor. Data is returned using the DEVICE_POWER_DESCRIPTOR + /// structure. Windows 7, Windows Server 2008 R2, Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This + /// value is not supported before Windows 8 and Windows Server 2012. + /// + StorageDevicePowerProperty, + + /// Reserved for system use. + StorageDeviceResiliencyProperty, + + /// + /// Indicates that the caller is querying for the medium product type. Data is returned using the + /// STORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR structure. + /// + StorageDeviceMediumProductType, + + /// + /// Indicates that the caller is querying for RPMB support and properties. Data is returned using the STORAGE_RPMB_DESCRIPTOR structure. + /// + StorageAdapterRpmbProperty, + + /// + StorageAdapterCryptoProperty, + + /// + /// Indicates that the caller is querying for the device I/O capability property. Data is returned using the + /// DEVICE_IO_CAPABILITY_DESCRIPTOR structure. + /// + StorageDeviceIoCapabilityProperty, + + /// + /// Indicates that the caller is querying for protocol-specific data from the adapter. Data is returned using the + /// STORAGE_PROTOCOL_DATA_DESCRIPTOR structure. See the remarks for more info. + /// + StorageAdapterProtocolSpecificProperty, + + /// + /// Indicates that the caller is querying for protocol-specific data from the device. Data is returned using the + /// STORAGE_PROTOCOL_DATA_DESCRIPTOR structure. See the remarks for more info. + /// + StorageDeviceProtocolSpecificProperty, + + /// + /// Indicates that the caller is querying temperature data from the adapter. Data is returned using the + /// STORAGE_TEMPERATURE_DATA_DESCRIPTOR structure. + /// + StorageAdapterTemperatureProperty, + + /// + /// Indicates that the caller is querying for temperature data from the device. Data is returned using the + /// STORAGE_TEMPERATURE_DATA_DESCRIPTOR structure. + /// + StorageDeviceTemperatureProperty, + + /// + /// Indicates that the caller is querying for topology information from the adapter. Data is returned using the + /// STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR structure. + /// + StorageAdapterPhysicalTopologyProperty, + + /// + /// Indicates that the caller is querying for topology information from the device. Data is returned using the + /// STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR structure. + /// + StorageDevicePhysicalTopologyProperty, + + /// Reserved for future use. + StorageDeviceAttributesProperty, + + /// + StorageDeviceManagementStatus, + + /// + StorageAdapterSerialNumberProperty, + + /// + StorageDeviceLocationProperty, + + /// + StorageDeviceNumaProperty, + + /// + StorageDeviceZonedDeviceProperty, + + /// + StorageDeviceUnsafeShutdownCount, + + /// + StorageDeviceEnduranceProperty, + } + + /// + /// + /// [Some information relates to pre-released product which may be substantially modified before it's commercially released. + /// Microsoft makes no warranties, express or implied, with respect to the information provided here.] + /// + /// The ATA protocol data type. + /// + /// + /// + /// When using IOCTL_STORAGE_QUERY_PROPERTY to retrieve protocol-specific information in the STORAGE_PROTOCOL_DATA_DESCRIPTOR, + /// configure the STORAGE_PROPERTY_QUERY structure as follows: + /// + /// + /// + /// Allocate a buffer that can contains both a STORAGE_PROPERTY_QUERY and a STORAGE_PROTOCOL_SPECIFIC_DATA structure. + /// + /// + /// + /// Set the PropertyID field to StorageAdapterProtocolSpecificProperty or StorageDeviceProtocolSpecificProperty + /// for a controller or device/namespace request, respectively. + /// + /// + /// + /// Set the QueryType field to PropertyStandardQuery. + /// + /// + /// + /// Fill the STORAGE_PROTOCOL_SPECIFIC_DATA structure with the desired values. The start of the STORAGE_PROTOCOL_SPECIFIC_DATA + /// is the AdditionalParameters field of STORAGE_PROPERTY_QUERY. + /// + /// + /// + /// To specify a type of ATA protocol-specific information, configure the STORAGE_PROTOCOL_SPECIFIC_DATA structure as follows: + /// + /// + /// Set the ProtocolType field to ProtocolTypeAta. + /// + /// + /// Set the DataType field to an enumeration value defined by STORAGE_PROTOCOL_ATA_DATA_TYPE: + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_protocol_ata_data_type typedef enum + // _STORAGE_PROTOCOL_ATA_DATA_TYPE { AtaDataTypeUnknown, AtaDataTypeIdentify, AtaDataTypeLogPage } STORAGE_PROTOCOL_ATA_DATA_TYPE, *PSTORAGE_PROTOCOL_ATA_DATA_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "999CB5EB-9D19-41B9-B4ED-001B63C1A7EA")] + public enum STORAGE_PROTOCOL_ATA_DATA_TYPE + { + /// Unknown data type. + AtaDataTypeUnknown, + + /// Identify device data type. + AtaDataTypeIdentify, + + /// Log page data type. + AtaDataTypeLogPage, + } + + /// Describes the type of NVMe protocol-specific data that's to be queried during an IOCTL_STORAGE_QUERY_PROPERTY request. + /// + /// + /// When using IOCTL_STORAGE_QUERY_PROPERTY to retrieve protocol-specific information in the STORAGE_PROTOCOL_DATA_DESCRIPTOR, + /// configure the STORAGE_PROPERTY_QUERY structure as follows: + /// + /// + /// + /// Allocate a buffer that can contains both a STORAGE_PROPERTY_QUERY and a STORAGE_PROTOCOL_SPECIFIC_DATA structure. + /// + /// + /// + /// Set the PropertyID field to StorageAdapterProtocolSpecificProperty or StorageDeviceProtocolSpecificProperty + /// for a controller or device/namespace request, respectively. + /// + /// + /// + /// Set the QueryType field to PropertyStandardQuery. + /// + /// + /// + /// Fill the STORAGE_PROTOCOL_SPECIFIC_DATA structure with the desired values. The start of the STORAGE_PROTOCOL_SPECIFIC_DATA + /// is the AdditionalParameters field of STORAGE_PROPERTY_QUERY. + /// + /// + /// + /// To specify a type of NVMe protocol-specific information, configure the STORAGE_PROTOCOL_SPECIFIC_DATA structure as follows: + /// + /// + /// Set the ProtocolType field to ProtocolTypeNVMe. + /// + /// + /// Set the DataType field to an enumeration value defined by STORAGE_PROTOCOL_NVME_DATA_TYPE: + /// + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_protocol_nvme_data_type typedef enum + // _STORAGE_PROTOCOL_NVME_DATA_TYPE { NVMeDataTypeUnknown, NVMeDataTypeIdentify, NVMeDataTypeLogPage, NVMeDataTypeFeature } + // STORAGE_PROTOCOL_NVME_DATA_TYPE, *PSTORAGE_PROTOCOL_NVME_DATA_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "BB171CEE-1CB7-44AC-9F39-87394EFAFAEC")] + public enum STORAGE_PROTOCOL_NVME_DATA_TYPE + { + /// Unknown data type. + NVMeDataTypeUnknown, + + /// + /// Identify data type. This can be either Identify Controller data or Identify Namespace data. When this type of data is being + /// queried, the ProtocolDataRequestValue field of STORAGE_PROTOCOL_SPECIFIC_DATA will have a value of + /// NVME_IDENTIFY_CNS_CONTROLLER for adapter or NVME_IDENTIFY_CNS_SPECIFIC_NAMESPACE for namespace. If the + /// ProtocolDataRequestValue is NVME_IDENTIFY_CNS_SPECIFIC_NAMESPACE, the ProtocolDataRequestSubValue field from the + /// STORAGE_PROTOCOL_SPECIFIC_DATA structure will have a value of the namespace ID. + /// + NVMeDataTypeIdentify, + + /// Log page data type. + NVMeDataTypeLogPage, + + /// Feature data type. + NVMeDataTypeFeature, + } + + /// Specifies the protocol of a storage device. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_protocol_type typedef enum _STORAGE_PROTOCOL_TYPE + // { ProtocolTypeUnknown, ProtocolTypeScsi, ProtocolTypeAta, ProtocolTypeNvme, ProtocolTypeSd, ProtocolTypeUfs, + // ProtocolTypeProprietary, ProtocolTypeMaxReserved } STORAGE_PROTOCOL_TYPE, *PSTORAGE_PROTOCOL_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "8055B633-99EF-4AAE-AA80-FC09F357BEAB")] + public enum STORAGE_PROTOCOL_TYPE + { + /// Unknown protocol type. + ProtocolTypeUnknown, + + /// SCSI protocol type. + ProtocolTypeScsi, + + /// ATA protocol type. + ProtocolTypeAta, + + /// NVMe protocol type. + ProtocolTypeNvme, + + /// SD protocol type. + ProtocolTypeSd, + + /// + ProtocolTypeUfs, + + /// Vendor-specific protocol type. + ProtocolTypeProprietary = 0x7E, + + /// Reserved. + ProtocolTypeMaxReserved = 0x7F, + } + + /// + /// Used by the STORAGE_PROPERTY_QUERY structure passed to the IOCTL_STORAGE_QUERY_PROPERTY control code to indicate what information + /// is returned about a property of a storage device or adapter. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-storage_query_type typedef enum _STORAGE_QUERY_TYPE { + // PropertyStandardQuery, PropertyExistsQuery, PropertyMaskQuery, PropertyQueryMaxDefined } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "0bce42d2-9d42-4881-9e33-4b3858a40353")] + public enum STORAGE_QUERY_TYPE + { + /// Instructs the driver to return an appropriate descriptor. + PropertyStandardQuery, + + /// Instructs the driver to report whether the descriptor is supported. + PropertyExistsQuery, + + /// Not currently supported. Do not use. + PropertyMaskQuery, + + /// Specifies the upper limit of the list of query types. This is used to validate the query type. + PropertyQueryMaxDefined, + } + + /// Indicates whether the write cache features of a device are changeable. + /// + /// The IOCTL_STORAGE_QUERY_PROPERTY request returns a WRITE_CACHE_CHANGE value in the STORAGE_WRITE_CACHE_PROPERTY structure. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-write_cache_change typedef enum _WRITE_CACHE_CHANGE { + // WriteCacheChangeUnknown, WriteCacheNotChangeable, WriteCacheChangeable } WRITE_CACHE_CHANGE; + [PInvokeData("winioctl.h", MSDNShortId = "a6974092-fa4f-4524-96ec-b4fad0b8c5ea")] + public enum WRITE_CACHE_CHANGE + { + /// The system cannot report the write cache change capability of the device. + WriteCacheChangeUnknown, + + /// Host software cannot change the characteristics of the device's write cache. + WriteCacheNotChangeable, + + /// Host software can change the characteristics of the device's write cache. + WriteCacheChangeable, + } + + /// Indicates whether the write cache is enabled or disabled. + /// + /// The IOCTL_STORAGE_QUERY_PROPERTY control code reports a WRITE_CACHE_ENABLE value in the STORAGE_WRITE_CACHE_PROPERTY structure. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-write_cache_enable typedef enum _WRITE_CACHE_ENABLE { + // WriteCacheEnableUnknown, WriteCacheDisabled, WriteCacheEnabled } WRITE_CACHE_ENABLE; + [PInvokeData("winioctl.h", MSDNShortId = "3ed8bc79-d8f9-4a57-a37c-46202d639a63")] + public enum WRITE_CACHE_ENABLE + { + /// The system cannot report whether the device's write cache is enabled or disabled. + WriteCacheEnableUnknown, + + /// The device's write cache is disabled. + WriteCacheDisabled, + + /// The device's write cache is enabled. + WriteCacheEnabled, + } + + /// Specifies the cache type. + /// + /// + /// There are two main types of write cache: write back and write through. With a write-back cache, the device does not copy cache + /// data to nonvolatile media until absolutely necessary. This type of operation improves the performance of write operations. With a + /// write-through cache, the device writes data to the cache and the media in parallel. This type of operation does not improve write + /// performance, but it makes subsequent read operations faster. + /// + /// + /// The IOCTL_STORAGE_QUERY_PROPERTY control code reports a WRITE_CACHE_TYPE value in the STORAGE_WRITE_CACHE_PROPERTY structure. + /// + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-write_cache_type typedef enum _WRITE_CACHE_TYPE { + // WriteCacheTypeUnknown, WriteCacheTypeNone, WriteCacheTypeWriteBack, WriteCacheTypeWriteThrough } WRITE_CACHE_TYPE; + [PInvokeData("winioctl.h", MSDNShortId = "fb861a65-5207-4af3-b994-0883febcbb0a")] + public enum WRITE_CACHE_TYPE + { + /// The system cannot report the type of the write cache. + WriteCacheTypeUnknown, + + /// The device does not have a write cache. + WriteCacheTypeNone, + + /// The device has a write-back cache. + WriteCacheTypeWriteBack, + + /// The device has a write-through cache. + WriteCacheTypeWriteThrough, + } + + /// Specifies whether a storage device supports write-through caching. + /// The IOCTL_STORAGE_QUERY_PROPERTY control code reports this value in the STORAGE_WRITE_CACHE_PROPERTY structure. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ne-winioctl-write_through typedef enum _WRITE_THROUGH { + // WriteThroughUnknown, WriteThroughNotSupported, WriteThroughSupported } WRITE_THROUGH; + [PInvokeData("winioctl.h", MSDNShortId = "8bb26be1-ad02-4cf0-8505-021f922f34bf")] + public enum WRITE_THROUGH + { + /// Indicates that no information is available about the write-through capabilities of the device. + WriteThroughUnknown, + + /// Indicates that the device does not support write-through caching. + WriteThroughNotSupported, + + /// Indicates that the device supports write-through caching. + WriteThroughSupported, + } + } +} \ No newline at end of file diff --git a/PInvoke/Kernel32/WinIOCtl.Structs.cs b/PInvoke/Kernel32/WinIOCtl.Structs.cs new file mode 100644 index 00000000..5a380ed6 --- /dev/null +++ b/PInvoke/Kernel32/WinIOCtl.Structs.cs @@ -0,0 +1,1705 @@ +using System; +using System.Runtime.InteropServices; +using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; + +namespace Vanara.PInvoke +{ + public static partial class Kernel32 + { + /// + /// + /// The flags that identify reasons for changes that have accumulated in this file or directory journal record since the file or + /// directory opened. + /// + /// + /// When a file or directory closes, then a final USN record is generated with the USN_REASON_CLOSE flag set. The next change + /// (for example, after the next open operation or deletion) starts a new record with a new set of reason flags. + /// + /// + /// A rename or move operation generates two USN records, one that records the old parent directory for the item, and one that + /// records a new parent. + /// + /// + [PInvokeData("winioctl.h", MSDNShortId = "1747453d-fd18-4853-a953-47131f3067ae")] + [Flags] + public enum USN_REASON : uint + { + /// + /// A user has either changed one or more file or directory attributes (for example, the read-only, hidden, system, archive, or + /// sparse attribute), or one or more time stamps. + /// + USN_REASON_BASIC_INFO_CHANGE = 0x00008000, + + /// The file or directory is closed. + USN_REASON_CLOSE = 0x80000000, + + /// The compression state of the file or directory is changed from or to compressed. + USN_REASON_COMPRESSION_CHANGE = 0x00020000, + + /// The file or directory is extended (added to). + USN_REASON_DATA_EXTEND = 0x00000002, + + /// The data in the file or directory is overwritten. + USN_REASON_DATA_OVERWRITE = 0x00000001, + + /// The file or directory is truncated. + USN_REASON_DATA_TRUNCATION = 0x00000004, + + /// + /// The user made a change to the extended attributes of a file or directory. + /// These NTFS file system attributes are not accessible to Windows-based applications. + /// + USN_REASON_EA_CHANGE = 0x00000400, + + /// The file or directory is encrypted or decrypted. + USN_REASON_ENCRYPTION_CHANGE = 0x00040000, + + /// The file or directory is created for the first time. + USN_REASON_FILE_CREATE = 0x00000100, + + /// The file or directory is deleted. + USN_REASON_FILE_DELETE = 0x00000200, + + /// + /// An NTFS file system hard link is added to or removed from the file or directory. + /// + /// An NTFS file system hard link, similar to a POSIX hard link, is one of several directory entries that see the same file or directory. + /// + /// + USN_REASON_HARD_LINK_CHANGE = 0x00010000, + + /// + /// A user changes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. + /// + /// That is, the user changes the file or directory from one where content can be indexed to one where content cannot be indexed, + /// or vice versa. Content indexing permits rapid searching of data by building a database of selected content. + /// + /// + USN_REASON_INDEXABLE_CHANGE = 0x00004000, + + /// + /// A user changed the state of the FILE_ATTRIBUTE_INTEGRITY_STREAM attribute for the given stream. + /// + /// On the ReFS file system, integrity streams maintain a checksum of all data for that stream, so that the contents of the file + /// can be validated during read or write operations. + /// + /// + USN_REASON_INTEGRITY_CHANGE = 0x00800000, + + /// The one or more named data streams for a file are extended (added to). + USN_REASON_NAMED_DATA_EXTEND = 0x00000020, + + /// The data in one or more named data streams for a file is overwritten. + USN_REASON_NAMED_DATA_OVERWRITE = 0x00000010, + + /// The one or more named data streams for a file is truncated. + USN_REASON_NAMED_DATA_TRUNCATION = 0x00000040, + + /// The object identifier of a file or directory is changed. + USN_REASON_OBJECT_ID_CHANGE = 0x00080000, + + /// A file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the new name. + USN_REASON_RENAME_NEW_NAME = 0x00002000, + + /// The file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the previous name. + USN_REASON_RENAME_OLD_NAME = 0x00001000, + + /// + /// The reparse point that is contained in a file or directory is changed, or a reparse point is added to or deleted from a file + /// or directory. + /// + USN_REASON_REPARSE_POINT_CHANGE = 0x00100000, + + /// A change is made in the access rights to a file or directory. + USN_REASON_SECURITY_CHANGE = 0x00000800, + + /// A named stream is added to or removed from a file, or a named stream is renamed. + USN_REASON_STREAM_CHANGE = 0x00200000, + + /// The given stream is modified through a TxF transaction. + USN_REASON_TRANSACTED_CHANGE = 0x00400000, + } + + /// + /// Additional information about the source of the change, set by the FSCTL_MARK_HANDLE of the DeviceIoControl operation. + /// + /// When a thread writes a new USN record, the source information flags in the prior record continues to be present only if the + /// thread also sets those flags. Therefore, the source information structure allows applications to filter out USN records that are + /// set only by a known source, for example, an antivirus filter. + /// + /// + [PInvokeData("winioctl.h", MSDNShortId = "1747453d-fd18-4853-a953-47131f3067ae")] + [Flags] + public enum USN_SOURCE + { + /// + /// The operation adds a private data stream to a file or directory. + /// + /// An example might be a virus detector adding checksum information. As the virus detector modifies the item, the system + /// generates USN records. USN_SOURCE_AUXILIARY_DATA indicates that the modifications did not change the application data. + /// + /// + USN_SOURCE_AUXILIARY_DATA = 0x00000002, + + /// + /// The operation provides information about a change to the file or directory made by the operating system. + /// + /// A typical use is when the Remote Storage system moves data from external to local storage. Remote Storage is the hierarchical + /// storage management software. Such a move usually at a minimum adds the USN_REASON_DATA_OVERWRITE flag to a USN record. + /// However, the data has not changed from the user's point of view. By noting USN_SOURCE_DATA_MANAGEMENT in the SourceInfo + /// member, you can determine that although a write operation is performed on the item, data has not changed. + /// + /// + USN_SOURCE_DATA_MANAGEMENT = 0x00000001, + + /// + /// The operation is modifying a file to match the contents of the same file which exists in another member of the replica set. + /// + USN_SOURCE_REPLICATION_MANAGEMENT = 0x00000004, + + /// + /// The operation is modifying a file on client systems to match the contents of the same file that exists in the cloud. + /// + USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT = 0x00000008, + } + + /// Contains the output for the FSCTL_GET_BOOT_AREA_INFO control code. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-boot_area_info typedef struct _BOOT_AREA_INFO { DWORD + // BootSectorCount; struct { LARGE_INTEGER Offset; } BootSectors[2]; } BOOT_AREA_INFO, *PBOOT_AREA_INFO; + [PInvokeData("winioctl.h", MSDNShortId = "e6ec156d-6a20-4b00-89fb-a27421fffbc0")] + [StructLayout(LayoutKind.Sequential, Pack = 8)] + public struct BOOT_AREA_INFO + { + /// Number of elements in the BootSectors array. + public uint BootSectorCount; + + /// + /// A variable length array of structures each containing the following member. + /// Offset + /// The location of a boot sector or a copy of a boot sector. + /// + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public long[] BootSectors; + } + + /// Represents a changer element. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-changer_element typedef struct _CHANGER_ELEMENT { + // ELEMENT_TYPE ElementType; DWORD ElementAddress; } CHANGER_ELEMENT, *PCHANGER_ELEMENT; + [PInvokeData("winioctl.h", MSDNShortId = "96e9803b-16c4-415c-940a-f5df3edff3b3")] + [StructLayout(LayoutKind.Sequential)] + public struct CHANGER_ELEMENT + { + /// The element type. This parameter can be one of the values from the ELEMENT_TYPE enumeration type. + public ELEMENT_TYPE ElementType; + + /// The zero-based address of the element. + public uint ElementAddress; + } + + /// + /// Represents a range of elements of a single type, typically for an operation such as getting or initializing the status of + /// multiple elements. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-changer_element_list typedef struct _CHANGER_ELEMENT_LIST + // { CHANGER_ELEMENT Element; DWORD NumberOfElements; } CHANGER_ELEMENT_LIST, *PCHANGER_ELEMENT_LIST; + [PInvokeData("winioctl.h", MSDNShortId = "cb1fcf78-b36a-4551-8eeb-da58edc80890")] + [StructLayout(LayoutKind.Sequential)] + public struct CHANGER_ELEMENT_LIST + { + /// A CHANGER_ELEMENT structure that represent the first element in the range. + public CHANGER_ELEMENT Element; + + /// The number of elements in the range. + public uint NumberOfElements; + } + + /// + /// Contains information defining the boundaries for and starting place of an enumeration of update sequence number (USN) change + /// journal records. It is used as the input buffer for the FSCTL_ENUM_USN_DATA control code. Prior to Windows Server 2012 this + /// structure was named MFT_ENUM_DATA. Use that name to compile with older SDKs and compilers. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-mft_enum_data_v0 typedef struct { DWORDLONG + // StartFileReferenceNumber; USN LowUsn; USN HighUsn; } MFT_ENUM_DATA_V0, *PMFT_ENUM_DATA_V0; + [PInvokeData("winioctl.h", MSDNShortId = "bd098d10-b30f-44b0-a379-2d57e33fe1c9")] + [StructLayout(LayoutKind.Sequential)] + public struct MFT_ENUM_DATA_V0 + { + /// + /// The ordinal position within the files on the current volume at which the enumeration is to begin. + /// + /// The first call to FSCTL_ENUM_USN_DATA during an enumeration must have the StartFileReferenceNumber member set to . + /// Each call to FSCTL_ENUM_USN_DATA retrieves the starting point for the subsequent call as the first entry in the output + /// buffer. Subsequent calls must be made with StartFileReferenceNumber set to this value. For more information, see FSCTL_ENUM_USN_DATA. + /// + /// + public ulong StartFileReferenceNumber; + + /// + /// The lower boundary of the range of USN values used to filter which records are returned. Only records whose last change + /// journal USN is between or equal to the LowUsn and HighUsn member values are returned. + /// + public long LowUsn; + + /// The upper boundary of the range of USN values used to filter which files are returned. + public long HighUsn; + } + + /// + /// Contains information defining the boundaries for and starting place of an enumeration of update sequence number (USN) change + /// journal records for ReFS volumes. It is used as the input buffer for the FSCTL_ENUM_USN_DATA control code. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-mft_enum_data_v1 typedef struct { DWORDLONG + // StartFileReferenceNumber; USN LowUsn; USN HighUsn; WORD MinMajorVersion; WORD MaxMajorVersion; } MFT_ENUM_DATA_V1, *PMFT_ENUM_DATA_V1; + [PInvokeData("winioctl.h", MSDNShortId = "6d7b50e3-60cf-4eaf-9d22-fbb20c7e0bba")] + [StructLayout(LayoutKind.Sequential, Size = 32)] + public struct MFT_ENUM_DATA_V1 + { + /// + /// The ordinal position within the files on the current volume at which the enumeration is to begin. + /// + /// The first call to FSCTL_ENUM_USN_DATA during an enumeration must have the StartFileReferenceNumber member set to . + /// Each call to FSCTL_ENUM_USN_DATA retrieves the starting point for the subsequent call as the first entry in the output + /// buffer. Subsequent calls must be made with StartFileReferenceNumber set to this value. For more information, see FSCTL_ENUM_USN_DATA. + /// + /// + public ulong StartFileReferenceNumber; + + /// + /// The lower boundary of the range of USN values used to filter which records are returned. Only records whose last change + /// journal USN is between or equal to the LowUsn and HighUsn member values are returned. + /// + public long LowUsn; + + /// The upper boundary of the range of USN values used to filter which files are returned. + public long HighUsn; + + /// Indicates the minimum supported major version for the USN change journal. + public ushort MinMajorVersion; + + /// + /// Indicates the maximum supported major version for the USN change journal. + /// + /// + /// Value + /// Meaning + /// + /// + /// 2 + /// The data returned from the FSCTL_ENUM_USN_DATA control code will contain USN_RECORD_V2 structures. + /// + /// + /// 3 + /// The data returned from the FSCTL_ENUM_USN_DATA control code will contain USN_RECORD_V2 or USN_RECORD_V3 structures. + /// + /// + /// + public ushort MaxMajorVersion; + } + + /// + /// Represents an update sequence number (USN) change journal, its records, and its capacity. This structure is the output buffer for + /// the FSCTL_QUERY_USN_JOURNAL control code. Prior to Windows 8 and Windows Server 2012 this structure was named + /// USN_JOURNAL_DATA. Use that name to compile with older SDKs and compilers. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_journal_data_v0 typedef struct { DWORDLONG + // UsnJournalID; USN FirstUsn; USN NextUsn; USN LowestValidUsn; USN MaxUsn; DWORDLONG MaximumSize; DWORDLONG AllocationDelta; } + // USN_JOURNAL_DATA_V0, *PUSN_JOURNAL_DATA_V0; + [PInvokeData("winioctl.h", MSDNShortId = "6b75eab2-aa10-4b48-8918-e4b03b5d8564")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_JOURNAL_DATA_V0 + { + /// + /// The current journal identifier. A journal is assigned a new identifier on creation and can be stamped with a new identifier + /// in the course of its existence. The NTFS file system uses this identifier for an integrity check. + /// + public ulong UsnJournalID; + + /// The number of first record that can be read from the journal. + public long FirstUsn; + + /// The number of next record to be written to the journal. + public long NextUsn; + + /// + /// The first record that was written into the journal for this journal instance. Enumerating the files or directories on a + /// volume can return a USN lower than this value (in other words, a FirstUsn member value less than the + /// LowestValidUsn member value). If it does, the journal has been stamped with a new identifier since the last USN was + /// written. In this case, LowestValidUsn may indicate a discontinuity in the journal, in which changes to some or all + /// files or directories on the volume may have occurred that are not recorded in the change journal. + /// + public long LowestValidUsn; + + /// + /// The largest USN that the change journal supports. An administrator must delete the change journal as the value of + /// NextUsn approaches this value. + /// + public long MaxUsn; + + /// + /// The target maximum size for the change journal, in bytes. The change journal can grow larger than this value, but it is then + /// truncated at the next NTFS file system checkpoint to less than this value. + /// + public ulong MaximumSize; + + /// + /// The number of bytes of disk memory added to the end and removed from the beginning of the change journal each time memory is + /// allocated or deallocated. In other words, allocation and deallocation take place in units of this size. An integer multiple + /// of a cluster size is a reasonable value for this member. + /// + public ulong AllocationDelta; + } + + /// + /// Represents an update sequence number (USN) change journal, its records, and its capacity. This structure is the output buffer for + /// the FSCTL_QUERY_USN_JOURNAL control code. Prior to Windows 8 and Windows Server 2012 this structure was named + /// USN_JOURNAL_DATA. Use that name to compile with older SDKs and compilers. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_journal_data_v1 typedef struct { DWORDLONG + // UsnJournalID; USN FirstUsn; USN NextUsn; USN LowestValidUsn; USN MaxUsn; DWORDLONG MaximumSize; DWORDLONG AllocationDelta; WORD + // MinSupportedMajorVersion; WORD MaxSupportedMajorVersion; } USN_JOURNAL_DATA_V1, *PUSN_JOURNAL_DATA_V1; + [PInvokeData("winioctl.h", MSDNShortId = "6b75eab2-aa10-4b48-8918-e4b03b5d8564")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_JOURNAL_DATA_V1 + { + /// + /// The current journal identifier. A journal is assigned a new identifier on creation and can be stamped with a new identifier + /// in the course of its existence. The NTFS file system uses this identifier for an integrity check. + /// + public ulong UsnJournalID; + + /// The number of first record that can be read from the journal. + public long FirstUsn; + + /// The number of next record to be written to the journal. + public long NextUsn; + + /// + /// The first record that was written into the journal for this journal instance. Enumerating the files or directories on a + /// volume can return a USN lower than this value (in other words, a FirstUsn member value less than the + /// LowestValidUsn member value). If it does, the journal has been stamped with a new identifier since the last USN was + /// written. In this case, LowestValidUsn may indicate a discontinuity in the journal, in which changes to some or all + /// files or directories on the volume may have occurred that are not recorded in the change journal. + /// + public long LowestValidUsn; + + /// + /// The largest USN that the change journal supports. An administrator must delete the change journal as the value of + /// NextUsn approaches this value. + /// + public long MaxUsn; + + /// + /// The target maximum size for the change journal, in bytes. The change journal can grow larger than this value, but it is then + /// truncated at the next NTFS file system checkpoint to less than this value. + /// + public ulong MaximumSize; + + /// + /// The number of bytes of disk memory added to the end and removed from the beginning of the change journal each time memory is + /// allocated or deallocated. In other words, allocation and deallocation take place in units of this size. An integer multiple + /// of a cluster size is a reasonable value for this member. + /// + public ulong AllocationDelta; + + /// + public ushort MinSupportedMajorVersion; + + /// + public ushort MaxSupportedMajorVersion; + } + + /// + /// Represents an update sequence number (USN) change journal, its records, and its capacity. This structure is the output buffer for + /// the FSCTL_QUERY_USN_JOURNAL control code. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_journal_data_v2 typedef struct { DWORDLONG + // UsnJournalID; USN FirstUsn; USN NextUsn; USN LowestValidUsn; USN MaxUsn; DWORDLONG MaximumSize; DWORDLONG AllocationDelta; WORD + // MinSupportedMajorVersion; WORD MaxSupportedMajorVersion; DWORD Flags; DWORDLONG RangeTrackChunkSize; LONGLONG + // RangeTrackFileSizeThreshold; } USN_JOURNAL_DATA_V2, *PUSN_JOURNAL_DATA_V2; + [PInvokeData("winioctl.h", MSDNShortId = "BBFA6D14-1423-45B0-83A0-62019D08507F")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_JOURNAL_DATA_V2 + { + /// + /// The current journal identifier. A journal is assigned a new identifier on creation and can be stamped with a new identifier + /// in the course of its existence. The NTFS file system uses this identifier for an integrity check. + /// + public ulong UsnJournalID; + + /// The number of first record that can be read from the journal. + public long FirstUsn; + + /// The number of next record to be written to the journal. + public long NextUsn; + + /// + /// The first record that was written into the journal for this journal instance. Enumerating the files or directories on a + /// volume can return a USN lower than this value (in other words, a FirstUsn member value less than the + /// LowestValidUsn member value). If it does, the journal has been stamped with a new identifier since the last USN was + /// written. In this case, LowestValidUsn may indicate a discontinuity in the journal, in which changes to some or all + /// files or directories on the volume may have occurred that are not recorded in the change journal. + /// + public long LowestValidUsn; + + /// + /// The largest USN that the change journal supports. An administrator must delete the change journal as the value of + /// NextUsn approaches this value. + /// + public long MaxUsn; + + /// + /// The target maximum size for the change journal, in bytes. The change journal can grow larger than this value, but it is then + /// truncated at the next NTFS file system checkpoint to less than this value. + /// + public long MaximumSize; + + /// + /// The number of bytes of disk memory added to the end and removed from the beginning of the change journal each time memory is + /// allocated or deallocated. In other words, allocation and deallocation take place in units of this size. An integer multiple + /// of a cluster size is a reasonable value for this member. + /// + public ulong AllocationDelta; + + /// The minimum version of the USN change journal that the file system supports. + public ushort MinSupportedMajorVersion; + + /// The maximum version of the USN change journal that the file system supports. + public ushort MaxSupportedMajorVersion; + + /// + /// Whether or not range tracking is turned on. The following are the possible values for the Flags member. + /// + /// + /// Value + /// Meaning + /// + /// + /// 0x00000000 + /// Range tracking is not turned on for the volume. + /// + /// + /// FLAG_USN_TRACK_MODIFIED_RANGES_ENABLE 0x00000001 + /// Range tracking is turned on for the volume. + /// + /// + /// + public uint Flags; + + /// The granularity of tracked ranges. Valid only when you also set the Flags member to FLAG_USN_TRACK_MODIFIED_RANGES_ENABLE. + public ulong RangeTrackChunkSize; + + /// + /// File size threshold to start tracking range for files with equal or larger size. Valid only when you also set the + /// Flags member to FLAG_USN_TRACK_MODIFIED_RANGES_ENABLE. + /// + public long RangeTrackFileSizeThreshold; + } + + /// Contains returned update sequence number (USN) from FSCTL_USN_TRACK_MODIFIED_RANGES control code. + /// This structure is optional. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_range_track_output typedef struct { USN Usn; } + // USN_RANGE_TRACK_OUTPUT, *PUSN_RANGE_TRACK_OUTPUT; + [PInvokeData("winioctl.h", MSDNShortId = "E10ECB50-A506-4836-81D2-3073FBB844CA")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_RANGE_TRACK_OUTPUT + { + /// + /// Returned update sequence number (USN) that identifies at what point in the USN Journal that range tracking was enabled. + /// + public long Usn; + } + + /// + /// Contains the information for an update sequence number (USN) common header which is common through USN_RECORD_V2, USN_RECORD_V3 + /// and USN_RECORD_V4. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_record_common_header typedef struct { DWORD + // RecordLength; WORD MajorVersion; WORD MinorVersion; } USN_RECORD_COMMON_HEADER, *PUSN_RECORD_COMMON_HEADER; + [PInvokeData("winioctl.h", MSDNShortId = "7B193D8E-FEED-4289-B40F-33BC27889F15")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_RECORD_COMMON_HEADER + { + /// + /// The total length of a record, in bytes. + /// + /// Because USN record is a variable size, the RecordLength member should be used when calculating the address of the next + /// record in an output buffer, for example, a buffer that is returned from operations for the DeviceIoControl function that work + /// with different USN record types. + /// + /// + /// For USN_RECORD_V4, the size in bytes of any change journal record is at most the size of the structure, plus + /// (NumberOfExtents-1) times size of the USN_RECORD_EXTENT. + /// + /// + public uint RecordLength; + + /// + /// The major version number of the change journal software for this record. + /// For example, if the change journal software is version 4.0, the major version number is 4. + /// + /// + /// Value + /// Description + /// + /// + /// 2 + /// The structure is a USN_RECORD_V2 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 3 + /// The structure is a USN_RECORD_V3 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 4 + /// The structure is a USN_RECORD_V4 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// + public ushort MajorVersion; + + /// + /// The minor version number of the change journal software for this record. For example, if the change journal software is + /// version 4.0, the minor version number is zero. + /// + public ushort MinorVersion; + } + + /// Contains the offset and length for an update sequence number (USN) record extent. + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_record_extent typedef struct { LONGLONG Offset; + // LONGLONG Length; } USN_RECORD_EXTENT, *PUSN_RECORD_EXTENT; + [PInvokeData("winioctl.h", MSDNShortId = "7D569FCB-06D4-4348-B75A-D087D1D37851")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_RECORD_EXTENT + { + /// The offset of the extent, in bytes. + public long Offset; + + /// The length of the extent, in bytes. + public long Length; + } + + /// + /// Contains the information for an update sequence number (USN) change journal version 2.0 record. Applications should not attempt + /// to work with change journal versions earlier than 2.0. Prior to Windows 8 and Windows Server 2012 this structure was named + /// USN_RECORD. Use that name to compile with older SDKs and compilers. + /// + /// + /// + /// In output buffers returned from DeviceIoControl operations that work with USN_RECORD_V2, all records are aligned on 64-bit + /// boundaries from the start of the buffer. + /// + /// + /// To provide a path for upward compatibility in change journal clients, Microsoft provides a major and minor version number of the + /// change journal software in the USN_RECORD_V2 structure. Your code should examine these values, detect its own + /// compatibility with the change journal software, and if necessary gracefully handle any incompatibility. + /// + /// + /// A change in the minor version number indicates that the existing USN_RECORD_V2 structure members are still valid, but that + /// new members may have been added between the penultimate member and the last, which is a variable-length string. + /// + /// + /// To handle such a change gracefully, your code should not do any compile-time pointer arithmetic that relies on the location of + /// the last member. For example, this makes the C code unreliable. Instead, rely on run-time calculations by using the + /// RecordLength member. + /// + /// + /// An increase in the major version number of the change journal software indicates that the USN_RECORD_V2 structure may have + /// undergone major changes, and that the current definition may not be reliable. If your code detects a change in the major version + /// number of the change journal software, it should not work with the change journal. + /// + /// For more information, see Creating, Modifying, and Deleting a Change Journal. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_record_v2 typedef struct { DWORD RecordLength; WORD + // MajorVersion; WORD MinorVersion; DWORDLONG FileReferenceNumber; DWORDLONG ParentFileReferenceNumber; USN Usn; LARGE_INTEGER + // TimeStamp; DWORD Reason; DWORD SourceInfo; DWORD SecurityId; DWORD FileAttributes; WORD FileNameLength; WORD FileNameOffset; WCHAR + // FileName[1]; } USN_RECORD_V2, *PUSN_RECORD_V2; + [PInvokeData("winioctl.h", MSDNShortId = "1747453d-fd18-4853-a953-47131f3067ae")] + [StructLayout(LayoutKind.Sequential, Size = 64)] + public struct USN_RECORD_V2 + { + /// + /// The total length of a record, in bytes. + /// + /// Because USN_RECORD_V2 is a variable size, the RecordLength member should be used when calculating the address + /// of the next record in an output buffer, for example, a buffer that is returned from operations for the DeviceIoControl + /// function that work with USN_RECORD_V2. + /// + /// + /// The size in bytes of any change journal record is at most the size of the USN_RECORD_V2 structure, plus + /// MaximumComponentLength characters minus 1 (for the character declared in the structure) times the size of a wide character. + /// The value of MaximumComponentLength may be determined by calling the GetVolumeInformation function. In C, you can determine a + /// record size by using the following code example. + /// + /// + /// To maintain compatibility across version changes of the change journal software, use a run-time calculation to determine the + /// size of the + /// + /// USN_RECORD_V2 + /// structure. For more information about compatibility across version changes, see the Remarks section in this topic. + /// + public uint RecordLength; + + /// + /// The major version number of the change journal software for this record. + /// For example, if the change journal software is version 2.0, the major version number is 2. + /// + /// + /// Value + /// Meaning + /// + /// + /// 2 + /// The structure is a USN_RECORD_V2 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 3 + /// The structure is a USN_RECORD_V3 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 4 + /// The structure is a USN_RECORD_V4 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// + public ushort MajorVersion; + + /// + /// The minor version number of the change journal software for this record. For example, if the change journal software is + /// version 2.0, the minor version number is zero. + /// + public ushort MinorVersion; + + /// + /// The ordinal number of the file or directory for which this record notes changes. + /// This is an arbitrarily assigned value that associates a journal record with a file. + /// + public ulong FileReferenceNumber; + + /// + /// The ordinal number of the directory where the file or directory that is associated with this record is located. + /// This is an arbitrarily assigned value that associates a journal record with a parent directory. + /// + public ulong ParentFileReferenceNumber; + + /// The USN of this record. + public long Usn; + + /// The standard UTC time stamp (FILETIME) of this record, in 64-bit format. + public FILETIME TimeStamp; + + /// + /// + /// The flags that identify reasons for changes that have accumulated in this file or directory journal record since the file or + /// directory opened. + /// + /// + /// When a file or directory closes, then a final USN record is generated with the USN_REASON_CLOSE flag set. The next + /// change (for example, after the next open operation or deletion) starts a new record with a new set of reason flags. + /// + /// + /// A rename or move operation generates two USN records, one that records the old parent directory for the item, and one that + /// records a new parent. + /// + /// The following table identifies the possible flags. + /// Note Unused bits are reserved. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_REASON_BASIC_INFO_CHANGE 0x00008000 + /// + /// A user has either changed one or more file or directory attributes (for example, the read-only, hidden, system, archive, or + /// sparse attribute), or one or more time stamps. + /// + /// + /// + /// USN_REASON_CLOSE 0x80000000 + /// The file or directory is closed. + /// + /// + /// USN_REASON_COMPRESSION_CHANGE 0x00020000 + /// The compression state of the file or directory is changed from or to compressed. + /// + /// + /// USN_REASON_DATA_EXTEND 0x00000002 + /// The file or directory is extended (added to). + /// + /// + /// USN_REASON_DATA_OVERWRITE 0x00000001 + /// The data in the file or directory is overwritten. + /// + /// + /// USN_REASON_DATA_TRUNCATION 0x00000004 + /// The file or directory is truncated. + /// + /// + /// USN_REASON_EA_CHANGE 0x00000400 + /// + /// The user made a change to the extended attributes of a file or directory. These NTFS file system attributes are not + /// accessible to Windows-based applications. + /// + /// + /// + /// USN_REASON_ENCRYPTION_CHANGE 0x00040000 + /// The file or directory is encrypted or decrypted. + /// + /// + /// USN_REASON_FILE_CREATE 0x00000100 + /// The file or directory is created for the first time. + /// + /// + /// USN_REASON_FILE_DELETE 0x00000200 + /// The file or directory is deleted. + /// + /// + /// USN_REASON_HARD_LINK_CHANGE 0x00010000 + /// + /// An NTFS file system hard link is added to or removed from the file or directory. An NTFS file system hard link, similar to a + /// POSIX hard link, is one of several directory entries that see the same file or directory. + /// + /// + /// + /// USN_REASON_INDEXABLE_CHANGE 0x00004000 + /// + /// A user changes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. That is, the user changes the file or directory from one + /// where content can be indexed to one where content cannot be indexed, or vice versa. Content indexing permits rapid searching + /// of data by building a database of selected content. + /// + /// + /// + /// USN_REASON_INTEGRITY_CHANGE 0x00800000 + /// + /// A user changed the state of the FILE_ATTRIBUTE_INTEGRITY_STREAM attribute for the given stream. On the ReFS file system, + /// integrity streams maintain a checksum of all data for that stream, so that the contents of the file can be validated during + /// read or write operations. + /// + /// + /// + /// USN_REASON_NAMED_DATA_EXTEND 0x00000020 + /// The one or more named data streams for a file are extended (added to). + /// + /// + /// USN_REASON_NAMED_DATA_OVERWRITE 0x00000010 + /// The data in one or more named data streams for a file is overwritten. + /// + /// + /// USN_REASON_NAMED_DATA_TRUNCATION 0x00000040 + /// The one or more named data streams for a file is truncated. + /// + /// + /// USN_REASON_OBJECT_ID_CHANGE 0x00080000 + /// The object identifier of a file or directory is changed. + /// + /// + /// USN_REASON_RENAME_NEW_NAME 0x00002000 + /// A file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the new name. + /// + /// + /// USN_REASON_RENAME_OLD_NAME 0x00001000 + /// The file or directory is renamed, and the file name in the USN_RECORD_V2 structure is the previous name. + /// + /// + /// USN_REASON_REPARSE_POINT_CHANGE 0x00100000 + /// + /// The reparse point that is contained in a file or directory is changed, or a reparse point is added to or deleted from a file + /// or directory. + /// + /// + /// + /// USN_REASON_SECURITY_CHANGE 0x00000800 + /// A change is made in the access rights to a file or directory. + /// + /// + /// USN_REASON_STREAM_CHANGE 0x00200000 + /// A named stream is added to or removed from a file, or a named stream is renamed. + /// + /// + /// USN_REASON_TRANSACTED_CHANGE 0x00400000 + /// The given stream is modified through a TxF transaction. + /// + /// + /// + public USN_REASON Reason; + + /// + /// Additional information about the source of the change, set by the FSCTL_MARK_HANDLE of the DeviceIoControl operation. + /// + /// When a thread writes a new USN record, the source information flags in the prior record continues to be present only if the + /// thread also sets those flags. Therefore, the source information structure allows applications to filter out USN records that + /// are set only by a known source, for example, an antivirus filter. + /// + /// One of the two following values can be set. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_SOURCE_AUXILIARY_DATA 0x00000002 + /// + /// The operation adds a private data stream to a file or directory. An example might be a virus detector adding checksum + /// information. As the virus detector modifies the item, the system generates USN records. USN_SOURCE_AUXILIARY_DATA indicates + /// that the modifications did not change the application data. + /// + /// + /// + /// USN_SOURCE_DATA_MANAGEMENT 0x00000001 + /// + /// The operation provides information about a change to the file or directory made by the operating system. A typical use is + /// when the Remote Storage system moves data from external to local storage. Remote Storage is the hierarchical storage + /// management software. Such a move usually at a minimum adds the USN_REASON_DATA_OVERWRITE flag to a USN record. However, the + /// data has not changed from the user's point of view. By noting USN_SOURCE_DATA_MANAGEMENT in the SourceInfo member, you can + /// determine that although a write operation is performed on the item, data has not changed. + /// + /// + /// + /// USN_SOURCE_REPLICATION_MANAGEMENT 0x00000004 + /// + /// The operation is modifying a file to match the contents of the same file which exists in another member of the replica set. + /// + /// + /// + /// USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT 0x00000008 + /// The operation is modifying a file on client systems to match the contents of the same file that exists in the cloud. + /// + /// + /// + public USN_SOURCE SourceInfo; + + /// The unique security identifier assigned to the file or directory associated with this record. + public uint SecurityId; + + /// + /// The attributes for the file or directory associated with this record, as returned by the GetFileAttributes function. + /// Attributes of streams associated with the file or directory are excluded. + /// + public uint FileAttributes; + + /// + /// The length of the name of the file or directory associated with this record, in bytes. The FileName member contains + /// this name. Use this member to determine file name length, rather than depending on a trailing '\0' to delimit the file name + /// in FileName. + /// + public ushort FileNameLength; + + /// The offset of the FileName member from the beginning of the structure. + public ushort FileNameOffset; + + /// + /// + /// The name of the file or directory associated with this record in Unicode format. This file or directory name is of variable length. + /// + /// + /// When working with FileName, do not count on the file name that contains a trailing '\0' delimiter, but instead + /// determine the length of the file name by using FileNameLength. + /// + /// + /// Do not perform any compile-time pointer arithmetic using FileName. Instead, make necessary calculations at run time by + /// using the value of the FileNameOffset member. Doing so helps make your code compatible with any future versions of USN_RECORD_V2. + /// + /// + [MarshalAs(UnmanagedType.LPWStr)] + public char FileName; + } + + /// + /// Contains the information for an update sequence number (USN) change journal version 3.0 record. The version 2.0 record is defined + /// by the USN_RECORD_V2 structure (also called USN_RECORD structure). + /// + /// + /// + /// In output buffers returned from DeviceIoControl operations that work with USN_RECORD_V3, all records are aligned on 64-bit + /// boundaries from the start of the buffer. + /// + /// When range tracking is turned on, NTFS switches to producing only USN_RECORD_V3 records as output. + /// + /// To provide a path for upward compatibility in change journal clients, Microsoft provides a major and minor version number of the + /// change journal software in the USN_RECORD_V3 structure. Your code should examine these values, detect its own + /// compatibility with the change journal software, and if necessary gracefully handle any incompatibility. + /// + /// + /// A change in the minor version number indicates that the existing USN_RECORD_V3 structure members are still valid, but that + /// new members may have been added between the penultimate member and the last, which is a variable-length string. + /// + /// + /// To handle such a change gracefully, your code should not do any compile-time pointer arithmetic that relies on the location of + /// the last member. For example, this makes the C code unreliable. Instead, rely on run-time calculations by using the + /// RecordLength member. + /// + /// + /// An increase in the major version number of the change journal software indicates that the USN_RECORD_V3 structure may have + /// undergone major changes, and that the current definition may not be reliable. If your code detects a change in the major version + /// number of the change journal software, it should not work with the change journal. + /// + /// For more information, see Creating, Modifying, and Deleting a Change Journal. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_record_v3 typedef struct { DWORD RecordLength; WORD + // MajorVersion; WORD MinorVersion; FILE_ID_128 FileReferenceNumber; FILE_ID_128 ParentFileReferenceNumber; USN Usn; LARGE_INTEGER + // TimeStamp; DWORD Reason; DWORD SourceInfo; DWORD SecurityId; DWORD FileAttributes; WORD FileNameLength; WORD FileNameOffset; WCHAR + // FileName[1]; } USN_RECORD_V3, *PUSN_RECORD_V3; + [PInvokeData("winioctl.h", MSDNShortId = "6d95c5d1-6c6b-498f-a00d-eaa540e8b15b")] + [StructLayout(LayoutKind.Sequential, Size = 80)] + public struct USN_RECORD_V3 + { + /// + /// The total length of a record, in bytes. + /// + /// Because USN_RECORD_V3 is a variable size, the RecordLength member should be used when calculating the address + /// of the next record in an output buffer, for example, a buffer that is returned from operations for the DeviceIoControl + /// function that work with USN_RECORD_V3. + /// + /// + /// The size in bytes of any change journal record is at most the size of the USN_RECORD_V3 structure, plus + /// MaximumComponentLength characters minus 1 (for the character declared in the structure) times the size of a wide character. + /// The value of MaximumComponentLength may be determined by calling the GetVolumeInformation function. In C, you can determine a + /// record size by using the following code example. + /// + /// + /// To maintain compatibility across version changes of the change journal software, use a run-time calculation to determine the + /// size of the + /// + /// USN_RECORD_V3 + /// structure. For more information about compatibility across version changes, see the Remarks section in this topic. + /// + public uint RecordLength; + + /// + /// The major version number of the change journal software for this record. + /// For example, if the change journal software is version 3.0, the major version number is 3. + /// + /// + /// Value + /// Meaning + /// + /// + /// 2 + /// The structure is a USN_RECORD_V2 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 3 + /// The structure is a USN_RECORD_V3 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// 4 + /// The structure is a USN_RECORD_V4 structure and the remainder of the structure should be parsed using that layout. + /// + /// + /// + public ushort MajorVersion; + + /// + /// The minor version number of the change journal software for this record. For example, if the change journal software is + /// version 3.0, the minor version number is zero. + /// + public ushort MinorVersion; + + /// + /// The 128-bit ordinal number of the file or directory for which this record notes changes. + /// This is an arbitrarily assigned value that associates a journal record with a file. + /// + public FILE_ID_128 FileReferenceNumber; + + /// + /// The 128-bit ordinal number of the directory where the file or directory that is associated with this record is located. + /// This is an arbitrarily assigned value that associates a journal record with a parent directory. + /// + public FILE_ID_128 ParentFileReferenceNumber; + + /// The USN of this record. + public long Usn; + + /// The standard UTC time stamp (FILETIME) of this record, in 64-bit format. + public FILETIME TimeStamp; + + /// + /// + /// The flags that identify reasons for changes that have accumulated in this file or directory journal record since the file or + /// directory opened. + /// + /// + /// When a file or directory closes, then a final USN record is generated with the USN_REASON_CLOSE flag set. The next + /// change (for example, after the next open operation or deletion) starts a new record with a new set of reason flags. + /// + /// + /// A rename or move operation generates two USN records, one that records the old parent directory for the item, and one that + /// records a new parent. + /// + /// The following table identifies the possible flags. + /// Note Unused bits are reserved. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_REASON_BASIC_INFO_CHANGE 0x00008000 + /// + /// A user has either changed one or more file or directory attributes (for example, the read-only, hidden, system, archive, or + /// sparse attribute), or one or more time stamps. + /// + /// + /// + /// USN_REASON_CLOSE 0x80000000 + /// The file or directory is closed. + /// + /// + /// USN_REASON_COMPRESSION_CHANGE 0x00020000 + /// The compression state of the file or directory is changed from or to compressed. + /// + /// + /// USN_REASON_DATA_EXTEND 0x00000002 + /// The file or directory is extended (added to). + /// + /// + /// USN_REASON_DATA_OVERWRITE 0x00000001 + /// The data in the file or directory is overwritten. + /// + /// + /// USN_REASON_DATA_TRUNCATION 0x00000004 + /// The file or directory is truncated. + /// + /// + /// USN_REASON_EA_CHANGE 0x00000400 + /// + /// The user made a change to the extended attributes of a file or directory. These NTFS file system attributes are not + /// accessible to Windows-based applications. + /// + /// + /// + /// USN_REASON_ENCRYPTION_CHANGE 0x00040000 + /// The file or directory is encrypted or decrypted. + /// + /// + /// USN_REASON_FILE_CREATE 0x00000100 + /// The file or directory is created for the first time. + /// + /// + /// USN_REASON_FILE_DELETE 0x00000200 + /// The file or directory is deleted. + /// + /// + /// USN_REASON_HARD_LINK_CHANGE 0x00010000 + /// + /// An NTFS file system hard link is added to or removed from the file or directory. An NTFS file system hard link, similar to a + /// POSIX hard link, is one of several directory entries that see the same file or directory. + /// + /// + /// + /// USN_REASON_INDEXABLE_CHANGE 0x00004000 + /// + /// A user changes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. That is, the user changes the file or directory from one + /// where content can be indexed to one where content cannot be indexed, or vice versa. Content indexing permits rapid searching + /// of data by building a database of selected content. + /// + /// + /// + /// USN_REASON_INTEGRITY_CHANGE 0x00800000 + /// + /// A user changed the state of the FILE_ATTRIBUTE_INTEGRITY_STREAM attribute for the given stream. On the ReFS file system, + /// integrity streams maintain a checksum of all data for that stream, so that the contents of the file can be validated during + /// read or write operations. + /// + /// + /// + /// USN_REASON_NAMED_DATA_EXTEND 0x00000020 + /// The one or more named data streams for a file are extended (added to). + /// + /// + /// USN_REASON_NAMED_DATA_OVERWRITE 0x00000010 + /// The data in one or more named data streams for a file is overwritten. + /// + /// + /// USN_REASON_NAMED_DATA_TRUNCATION 0x00000040 + /// The one or more named data streams for a file is truncated. + /// + /// + /// USN_REASON_OBJECT_ID_CHANGE 0x00080000 + /// The object identifier of a file or directory is changed. + /// + /// + /// USN_REASON_RENAME_NEW_NAME 0x00002000 + /// A file or directory is renamed, and the file name in the USN_RECORD_V3 structure is the new name. + /// + /// + /// USN_REASON_RENAME_OLD_NAME 0x00001000 + /// The file or directory is renamed, and the file name in the USN_RECORD_V3 structure is the previous name. + /// + /// + /// USN_REASON_REPARSE_POINT_CHANGE 0x00100000 + /// + /// The reparse point that is contained in a file or directory is changed, or a reparse point is added to or deleted from a file + /// or directory. + /// + /// + /// + /// USN_REASON_SECURITY_CHANGE 0x00000800 + /// A change is made in the access rights to a file or directory. + /// + /// + /// USN_REASON_STREAM_CHANGE 0x00200000 + /// A named stream is added to or removed from a file, or a named stream is renamed. + /// + /// + /// USN_REASON_TRANSACTED_CHANGE 0x00400000 + /// The given stream is modified through a TxF transaction. + /// + /// + /// + public USN_REASON Reason; + + /// + /// Additional information about the source of the change, set by the FSCTL_MARK_HANDLE of the DeviceIoControl operation. + /// + /// When a thread writes a new USN record, the source information flags in the prior record continues to be present only if the + /// thread also sets those flags. Therefore, the source information structure allows applications to filter out USN records that + /// are set only by a known source, for example, an antivirus filter. + /// + /// One of the two following values can be set. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_SOURCE_AUXILIARY_DATA 0x00000002 + /// + /// The operation adds a private data stream to a file or directory. An example might be a virus detector adding checksum + /// information. As the virus detector modifies the item, the system generates USN records. USN_SOURCE_AUXILIARY_DATA indicates + /// that the modifications did not change the application data. + /// + /// + /// + /// USN_SOURCE_DATA_MANAGEMENT 0x00000001 + /// + /// The operation provides information about a change to the file or directory made by the operating system. A typical use is + /// when the Remote Storage system moves data from external to local storage. Remote Storage is the hierarchical storage + /// management software. Such a move usually at a minimum adds the USN_REASON_DATA_OVERWRITE flag to a USN record. However, the + /// data has not changed from the user's point of view. By noting USN_SOURCE_DATA_MANAGEMENT in the SourceInfo member, you can + /// determine that although a write operation is performed on the item, data has not changed. + /// + /// + /// + /// USN_SOURCE_REPLICATION_MANAGEMENT 0x00000004 + /// + /// The operation is modifying a file to match the contents of the same file which exists in another member of the replica set. + /// + /// + /// + /// USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT 0x00000008 + /// The operation is modifying a file on client systems to match the contents of the same file that exists in the cloud. + /// + /// + /// + public USN_SOURCE SourceInfo; + + /// The unique security identifier assigned to the file or directory associated with this record. + public uint SecurityId; + + /// + /// The attributes for the file or directory associated with this record, as returned by the GetFileAttributes function. + /// Attributes of streams associated with the file or directory are excluded. + /// + public uint FileAttributes; + + /// + /// The length of the name of the file or directory associated with this record, in bytes. The FileName member contains + /// this name. Use this member to determine file name length, rather than depending on a trailing '\0' to delimit the file name + /// in FileName. + /// + public ushort FileNameLength; + + /// The offset of the FileName member from the beginning of the structure. + public ushort FileNameOffset; + + /// + /// + /// The name of the file or directory associated with this record in Unicode format. This file or directory name is of variable length. + /// + /// + /// When working with FileName, do not count on the file name that contains a trailing '\0' delimiter, but instead + /// determine the length of the file name by using FileNameLength. + /// + /// + /// Do not perform any compile-time pointer arithmetic using FileName. Instead, make necessary calculations at run time by + /// using the value of the FileNameOffset member. Doing so helps make your code compatible with any future versions of USN_RECORD_V3. + /// + /// + [MarshalAs(UnmanagedType.LPWStr)] + public char FileName; + } + + /// + /// Contains the information for an update sequence number (USN) change journal version 4.0 record. The version 2.0 and 3.0 records + /// are defined by the USN_RECORD_V2 (also called USN_RECORD) and USN_RECORD_V3 structures respectively. + /// + /// + /// + /// A USN_RECORD_V4 record is only output when range tracking is turned on and the file size is equal or larger than the value + /// of the RangeTrackFileSizeThreshold member. The user always receives one or more USN_RECORD_V4 records followed by + /// one USN_RECORD_V3 record. + /// + /// + /// To provide a path forward compatibility in change journal clients, Microsoft provides a major and minor version number of the + /// change journal software in the USN_RECORD_V4 structure. Your code should examine these values, examine its own + /// compatibility with the change journal software, and gracefully handle any incompatibility if necessary. + /// + /// + /// A change in the minor version number indicates that the existing USN_RECORD_V4 structure members are still valid, but that + /// new members may have been added between the penultimate member and the last, which is a variable-length string. + /// + /// + /// To handle such a change gracefully, your code should not do any compile-time pointer arithmetic that relies on the location of + /// the last member. For example, a change in the minor version number makes the call unreliable. Instead, rely on run-time + /// calculations that use the RecordLength member. + /// + /// + /// An increase in the major version number of the change journal software indicates that the USN_RECORD_V4 structure may have + /// undergone major changes, and that the current definition may not be reliable. If your code detects a change in the major version + /// number of the change journal software, the code should not work with the change journal. + /// + /// For more information, see Creating, Modifying, and Deleting a Change Journal. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_record_v4 typedef struct { USN_RECORD_COMMON_HEADER + // Header; FILE_ID_128 FileReferenceNumber; FILE_ID_128 ParentFileReferenceNumber; USN Usn; DWORD Reason; DWORD SourceInfo; DWORD + // RemainingExtents; WORD NumberOfExtents; WORD ExtentSize; USN_RECORD_EXTENT Extents[1]; } USN_RECORD_V4, *PUSN_RECORD_V4; + [PInvokeData("winioctl.h", MSDNShortId = "2636D1A1-6FD1-4F84-954C-499DCCE6E390")] + [StructLayout(LayoutKind.Sequential, Size = 80)] + public struct USN_RECORD_V4 + { + /// + /// A USN_RECORD_COMMON_HEADER structure that describes the record length, major version, and minor version for the record. + /// + public USN_RECORD_COMMON_HEADER Header; + + /// + /// The 128-bit ordinal number of the file or directory for which this record notes changes. + /// This value is an arbitrarily assigned value that associates a journal record with a file. + /// + public FILE_ID_128 FileReferenceNumber; + + /// + /// The 128-bit ordinal number of the directory where the file or directory that is associated with this record is located. + /// This value is an arbitrarily assigned value that associates a journal record with a parent directory. + /// + public FILE_ID_128 ParentFileReferenceNumber; + + /// The USN of this record. + public long Usn; + + /// + /// + /// The flags that identify reasons for changes that have accumulated in this file or directory journal record since the file or + /// directory opened. + /// + /// + /// When a file or directory closes, then a final USN record is generated with the USN_REASON_CLOSE flag set. The next + /// change (for example, after the next open operation or deletion) starts a new record with a new set of reason flags. + /// + /// + /// A rename or move operation generates two USN records, one that records the old parent directory for the item, and one that + /// records a new parent. + /// + /// The following table identifies the possible flags. + /// Note Unused bits are reserved. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_REASON_BASIC_INFO_CHANGE 0x00008000 + /// + /// A user has either changed one or more file or directory attributes (for example, the read-only, hidden, system, archive, or + /// sparse attribute), or one or more time stamps. + /// + /// + /// + /// USN_REASON_CLOSE 0x80000000 + /// The file or directory is closed. + /// + /// + /// USN_REASON_COMPRESSION_CHANGE 0x00020000 + /// The compression state of the file or directory is changed from or to compressed. + /// + /// + /// USN_REASON_DATA_EXTEND 0x00000002 + /// The file or directory is extended (added to). + /// + /// + /// USN_REASON_DATA_OVERWRITE 0x00000001 + /// The data in the file or directory is overwritten. + /// + /// + /// USN_REASON_DATA_TRUNCATION 0x00000004 + /// The file or directory is truncated. + /// + /// + /// USN_REASON_EA_CHANGE 0x00000400 + /// + /// The user made a change to the extended attributes of a file or directory. These NTFS file system attributes are not + /// accessible to Windows-based applications. + /// + /// + /// + /// USN_REASON_ENCRYPTION_CHANGE 0x00040000 + /// The file or directory is encrypted or decrypted. + /// + /// + /// USN_REASON_FILE_CREATE 0x00000100 + /// The file or directory is created for the first time. + /// + /// + /// USN_REASON_FILE_DELETE 0x00000200 + /// The file or directory is deleted. + /// + /// + /// USN_REASON_HARD_LINK_CHANGE 0x00010000 + /// + /// An NTFS file system hard link is added to or removed from the file or directory. An NTFS file system hard link, similar to a + /// POSIX hard link, is one of several directory entries that see the same file or directory. + /// + /// + /// + /// USN_REASON_INDEXABLE_CHANGE 0x00004000 + /// + /// A user changes the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute. That is, the user changes the file or directory from one + /// where content can be indexed to one where content cannot be indexed, or vice versa. Content indexing permits rapid searching + /// of data by building a database of selected content. + /// + /// + /// + /// USN_REASON_INTEGRITY_CHANGE 0x00800000 + /// + /// A user changed the state of the FILE_ATTRIBUTE_INTEGRITY_STREAM attribute for the given stream. On the ReFS file system, + /// integrity streams maintain a checksum of all data for that stream, so that the contents of the file can be validated during + /// read or write operations. + /// + /// + /// + /// USN_REASON_NAMED_DATA_EXTEND 0x00000020 + /// The one or more named data streams for a file are extended (added to). + /// + /// + /// USN_REASON_NAMED_DATA_OVERWRITE 0x00000010 + /// The data in one or more named data streams for a file is overwritten. + /// + /// + /// USN_REASON_NAMED_DATA_TRUNCATION 0x00000040 + /// The one or more named data streams for a file is truncated. + /// + /// + /// USN_REASON_OBJECT_ID_CHANGE 0x00080000 + /// The object identifier of a file or directory is changed. + /// + /// + /// USN_REASON_RENAME_NEW_NAME 0x00002000 + /// A file or directory is renamed, and the file name in the USN_RECORD_V4 structure is the new name. + /// + /// + /// USN_REASON_RENAME_OLD_NAME 0x00001000 + /// The file or directory is renamed, and the file name in the USN_RECORD_V4 structure is the previous name. + /// + /// + /// USN_REASON_REPARSE_POINT_CHANGE 0x00100000 + /// + /// The reparse point that is contained in a file or directory is changed, or a reparse point is added to or deleted from a file + /// or directory. + /// + /// + /// + /// USN_REASON_SECURITY_CHANGE 0x00000800 + /// A change is made in the access rights to a file or directory. + /// + /// + /// USN_REASON_STREAM_CHANGE 0x00200000 + /// A named stream is added to or removed from a file, or a named stream is renamed. + /// + /// + /// USN_REASON_TRANSACTED_CHANGE 0x00400000 + /// The given stream is modified through a committed TxF transaction. + /// + /// + /// + public USN_REASON Reason; + + /// + /// Additional information about the source of the change, set by the FSCTL_MARK_HANDLE of the DeviceIoControl operation. + /// + /// When a thread writes a new USN record, the source information flags in the prior record continue to be present only if the + /// thread also sets those flags. Therefore, the source information structure allows applications to filter out USN records that + /// are set only by a known source, for example, an antivirus filter. + /// + /// One of the following values can be set. + /// + /// + /// Value + /// Meaning + /// + /// + /// USN_SOURCE_AUXILIARY_DATA 0x00000002 + /// + /// The operation adds a private data stream to a file or directory. One example is a virus detector adding checksum information. + /// As the virus detector modifies the item, the system generates USN records. USN_SOURCE_AUXILIARY_DATA indicates that the + /// modifications did not change the application data. + /// + /// + /// + /// USN_SOURCE_DATA_MANAGEMENT 0x00000001 + /// + /// The operation provides information about a change to the file or directory made by the operating system. A typical use is + /// when the Remote Storage system moves data from external to local storage. Remote Storage is the hierarchical storage + /// management software. Such a move usually at a minimum adds the USN_REASON_DATA_OVERWRITE flag to a USN record. However, the + /// data has not changed from the user's point of view. By noting USN_SOURCE_DATA_MANAGEMENT in the SourceInfo member, you can + /// determine that although a write operation is performed on the item, data has not changed. + /// + /// + /// + /// USN_SOURCE_REPLICATION_MANAGEMENT 0x00000004 + /// + /// The operation is modifying a file to match the contents of the same file which exists in another member of the replica set. + /// + /// + /// + /// USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT 0x00000008 + /// The operation is modifying a file on client systems to match the contents of the same file that exists in the cloud. + /// + /// + /// + public USN_SOURCE SourceInfo; + + /// + /// The number of extents that remain after the current USN_RECORD_V4 record. Multiple version 4.0 records may be required + /// to describe all of the modified extents for a given file. When the RemainingExtents member is 0, the current + /// USN_RECORD_V4 record is the last USN_RECORD_V4 record for the file. The last USN_RECORD_V4 entry for a + /// given file is always followed by a USN_RECORD_V3 record with at least the USN_REASON_CLOSE flag set. + /// + public uint RemainingExtents; + + /// The number of extents in current USN_RECORD_V4 entry. + public ushort NumberOfExtents; + + /// The size of each USN_RECORD_EXTENT structure in the Extents member, in bytes. + public ushort ExtentSize; + + /// An array of USN_RECORD_EXTENT structures that represent the extents in the USN_RECORD_V4 entry. + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + public USN_RECORD_EXTENT[] Extents; + } + + /// + /// Contains information on range tracking parameters for an update sequence number (USN) change journal using the + /// FSCTL_USN_TRACK_MODIFIED_RANGES control code. + /// + /// + /// Once range tracking is enabled for a given volume it cannot be disabled except by deleting the USN Journal and recreating it. + /// + // https://docs.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-usn_track_modified_ranges typedef struct { DWORD Flags; + // DWORD Unused; DWORDLONG ChunkSize; LONGLONG FileSizeThreshold; } USN_TRACK_MODIFIED_RANGES, *PUSN_TRACK_MODIFIED_RANGES; + [PInvokeData("winioctl.h", MSDNShortId = "00254BBD-8F38-46AB-8B0A-3094020A48C5")] + [StructLayout(LayoutKind.Sequential)] + public struct USN_TRACK_MODIFIED_RANGES + { + /// + /// Indicates enabling range tracking. + /// + /// + /// Value + /// Description + /// + /// + /// FLAG_USN_TRACK_MODIFIED_RANGES_ENABLE 0x00000001 + /// This flag is mandatory with FSCTL_USN_TRACK_MODIFIED_RANGES and is used to enable range tracking on the volume. + /// + /// + /// + public uint Flags; + + /// Reserved. + public uint Unused; + + /// Chunk size for tracking ranges. A single byte modification will be reflected as the whole chunk being modified. + public ulong ChunkSize; + + /// + /// File size threshold to start outputting USN_RECORD_V4 record(s) for modified file, i.e. if the modified file size is less + /// than this threshold, then no USN_RECORD_V4 record will be output. + /// + public long FileSizeThreshold; + } + + /* + +winioctl_CHANGER_ELEMENT_STATUS Represents the status of the specified element. +winioctl_CHANGER_ELEMENT_STATUS_EX Represents the status of the specified element. +winioctl_CHANGER_EXCHANGE_MEDIUM Contains information the IOCTL_CHANGER_EXCHANGE_MEDIUM control code uses to move a piece of media to a destination, and the piece of media originally in the first destination to a second destination. +winioctl_CHANGER_INITIALIZE_ELEMENT_STATUS Represents the status of all media changer elements or the specified elements of a particular type. +winioctl_CHANGER_MOVE_MEDIUM Contains information that the IOCTL_CHANGER_MOVE_MEDIUM control code uses to move a piece of media to a destination. +winioctl_CHANGER_PRODUCT_DATA Represents product data for a changer device. It is used by the IOCTL_CHANGER_GET_PRODUCT_DATA control code. +winioctl_CHANGER_READ_ELEMENT_STATUS Contains information that the IOCTL_CHANGER_GET_ELEMENT_STATUS control code needs to determine the elements whose status is to be retrieved. +winioctl_CHANGER_SEND_VOLUME_TAG_INFORMATION Contains information that the IOCTL_CHANGER_QUERY_VOLUME_TAGS control code uses to determine the volume information to be retrieved. +winioctl_CHANGER_SET_ACCESS Contains information that the IOCTL_CHANGER_SET_ACCESS control code needs to set the state of the device's insert/eject port, door, or keypad. +winioctl_CHANGER_SET_POSITION Contains information needed by the IOCTL_CHANGER_SET_POSITION control code to set the changer's robotic transport mechanism to the specified element address. +winioctl_CLASS_MEDIA_CHANGE_CONTEXT Contains information associated with a media change event. +winioctl_CREATE_DISK Contains information that the IOCTL_DISK_CREATE_DISK control code uses to initialize GUID partition table (GPT), master boot record (MBR), or raw disks. +winioctl_CREATE_DISK_GPT Contains information used by the IOCTL_DISK_CREATE_DISK control code to initialize GUID partition table (GPT) disks. +winioctl_CREATE_DISK_MBR Contains information that the IOCTL_DISK_CREATE_DISK control code uses to initialize master boot record (MBR) disks. +winioctl_CREATE_USN_JOURNAL_DATA Contains information that describes an update sequence number (USN) change journal. +winioctl_CSV_CONTROL_PARAM Represents a type of CSV control operation. +winioctl_CSV_IS_OWNED_BY_CSVFS Contains the output for the FSCTL_IS_VOLUME_OWNED_BYCSVFS control code that determines whether a volume is owned by CSVFS. +winioctl_CSV_NAMESPACE_INFO Contains the output for the FSCTL_IS_CSV_FILE control code that retrieves namespace information for a file. +winioctl_CSV_QUERY_FILE_REVISION Contains information about whether files in a stream have been modified. +winioctl_CSV_QUERY_MDS_PATH Contains the path that is used by CSV to communicate to the MDS. +winioctl_CSV_QUERY_REDIRECT_STATE Contains information about whether files in a stream have been redirected. +winioctl_CSV_QUERY_VETO_FILE_DIRECT_IO_OUTPUT Contains troubleshooting information about why a volume is in redirected mode. +winioctl_DELETE_USN_JOURNAL_DATA Contains information on the deletion of an update sequence number (USN) change journal using the FSCTL_DELETE_USN_JOURNAL control code. +winioctl_DEVICE_COPY_OFFLOAD_DESCRIPTOR Contains the copy offload capabilities for a storage device. +winioctl_DEVICE_DATA_SET_LB_PROVISIONING_STATE Output structure for the DeviceDsmAction_Allocation action of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_DATA_SET_RANGE Provides data set range information for use with the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_DATA_SET_REPAIR_PARAMETERS Specifies parameters for the repair operation. +winioctl_DEVICE_DSM_NOTIFICATION_PARAMETERS Contains parameters for the DeviceDsmAction_Notification action for the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_DSM_OFFLOAD_READ_PARAMETERS Contains parameters for the DeviceDsmAction_OffloadRead action for the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS Specifies parameters for the offload write operation. +winioctl_DEVICE_LB_PROVISIONING_DESCRIPTOR Contains the thin provisioning capabilities for a storage device. +winioctl_DEVICE_MANAGE_DATA_SET_ATTRIBUTES Input structure for the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT Output structure for the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_DEVICE_MEDIA_INFO Provides information about the media supported by a device. +winioctl_DEVICE_POWER_DESCRIPTOR The DEVICE_POWER_DESCRIPTOR structure describes the power capabilities of a storage device. +winioctl_DEVICE_SEEK_PENALTY_DESCRIPTOR Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY request to retrieve the seek penalty descriptor data for a device. +winioctl_DEVICE_TRIM_DESCRIPTOR Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY request to retrieve the trim descriptor data for a device. +winioctl_DEVICE_WRITE_AGGREGATION_DESCRIPTOR Reserved for system use. +winioctl_DISK_CACHE_INFORMATION Provides information about the disk cache. +winioctl_DISK_DETECTION_INFO Contains detected drive parameters. +winioctl_DISK_EX_INT13_INFO Contains extended Int13 drive parameters. +winioctl_DISK_EXTENT Represents a disk extent. +winioctl_DISK_GEOMETRY Describes the geometry of disk devices and media. +winioctl_DISK_GEOMETRY_EX Describes the extended geometry of disk devices and media. +winioctl_DISK_GROW_PARTITION Contains information used to increase the size of a partition. +winioctl_DISK_INT13_INFO Contains standard Int13 drive geometry parameters. +winioctl_DISK_PARTITION_INFO Contains the disk partition information. +winioctl_DISK_PERFORMANCE Provides disk performance information. +winioctl_DRIVE_LAYOUT_INFORMATION Contains information about the partitions of a drive. +winioctl_DRIVE_LAYOUT_INFORMATION_EX Contains extended information about a drive's partitions. +winioctl_DRIVE_LAYOUT_INFORMATION_GPT Contains information about a drive's GUID partition table (GPT) partitions. +winioctl_DRIVE_LAYOUT_INFORMATION_MBR Provides information about a drive's master boot record (MBR) partitions. +winioctl_DUPLICATE_EXTENTS_DATA Contains parameters for the FSCTL_DUPLICATE_EXTENTS control code that performs the Block Cloning operation. +winioctl_EXFAT_STATISTICS Contains statistical information from the exFAT file system. +winioctl_FAT_STATISTICS Contains statistical information from the FAT file system. +winioctl_FILE_ALLOCATED_RANGE_BUFFER Indicates a range of bytes in a file. +winioctl_FILE_LEVEL_TRIM Used as input to the FSCTL_FILE_LEVEL_TRIM control code. +winioctl_FILE_LEVEL_TRIM_OUTPUT Used as output to the FSCTL_FILE_LEVEL_TRIM control code. +winioctl_FILE_LEVEL_TRIM_RANGE Specifies a range of a file that is to be trimmed. +winioctl_FILE_MAKE_COMPATIBLE_BUFFER Specifies the disc to close the current session for. This control code is used for UDF file systems. This structure is used for input when calling FSCTL_MAKE_MEDIA_COMPATIBLE. +winioctl_FILE_OBJECTID_BUFFER Contains an object identifier and user-defined metadata associated with the object identifier. +winioctl_FILE_QUERY_ON_DISK_VOL_INFO_BUFFER Receives the volume information from a call to FSCTL_QUERY_ON_DISK_VOLUME_INFO. +winioctl_FILE_QUERY_SPARING_BUFFER Contains defect management properties. +winioctl_FILE_SET_DEFECT_MGMT_BUFFER Specifies the defect management state to be set. +winioctl_FILE_SET_SPARSE_BUFFER Specifies the sparse state to be set. +winioctl_FILE_STORAGE_TIER Represents an identifier for the storage tier relative to the volume. +winioctl_FILE_STORAGE_TIER_REGION Describes a single storage tier region. +winioctl_FILE_SYSTEM_RECOGNITION_INFORMATION Contains file system recognition information retrieved by the FSCTL_QUERY_FILE_SYSTEM_RECOGNITION control code. +winioctl_FILE_ZERO_DATA_INFORMATION Contains a range of a file to set to zeros. +winioctl_FILESYSTEM_STATISTICS Contains statistical information from the file system. +winioctl_FILESYSTEM_STATISTICS_EX Contains statistical information from the file system.Support for this structure started with Windows 10. +winioctl_FIND_BY_SID_DATA Contains data for the FSCTL_FIND_FILES_BY_SID control code. +winioctl_FIND_BY_SID_OUTPUT Represents a file name. +winioctl_FORMAT_EX_PARAMETERS Contains information used in formatting a contiguous set of disk tracks. It is used by the IOCTL_DISK_FORMAT_TRACKS_EX control code. +winioctl_FORMAT_PARAMETERS Contains information used in formatting a contiguous set of disk tracks. +winioctl_FSCTL_GET_INTEGRITY_INFORMATION_BUFFER Contains the integrity information for a file or directory. +winioctl_FSCTL_QUERY_REGION_INFO_INPUT Contains the storage tier regions from the storage stack for a particular volume. +winioctl_FSCTL_QUERY_REGION_INFO_OUTPUT Contains information for one or more regions. +winioctl_FSCTL_QUERY_STORAGE_CLASSES_OUTPUT Contains information for all tiers of a specific volume. +winioctl_FSCTL_SET_INTEGRITY_INFORMATION_BUFFER Input buffer passed with the FSCTL_SET_INTEGRITY_INFORMATION control code. +winioctl_GET_CHANGER_PARAMETERS Represents the parameters of a changer. +winioctl_GET_DISK_ATTRIBUTES Contains the attributes of a disk device. +winioctl_GET_LENGTH_INFORMATION Contains disk, volume, or partition length information used by the IOCTL_DISK_GET_LENGTH_INFO control code. +winioctl_GET_MEDIA_TYPES Contains information about the media types supported by a device. +winioctl_LOOKUP_STREAM_FROM_CLUSTER_ENTRY Returned from the FSCTL_LOOKUP_STREAM_FROM_CLUSTER control code. +winioctl_LOOKUP_STREAM_FROM_CLUSTER_INPUT Passed as input to the FSCTL_LOOKUP_STREAM_FROM_CLUSTER control code. +winioctl_LOOKUP_STREAM_FROM_CLUSTER_OUTPUT Received as output from the FSCTL_LOOKUP_STREAM_FROM_CLUSTER control code. +winioctl_MARK_HANDLE_INFO Contains information that is used to mark a specified file or directory, and its update sequence number (USN) change journal record with data about changes. +winioctl_MARK_HANDLE_INFO32 Contains information that is used to mark a specified file or directory, and its update sequence number (USN) change journal record with data about changes. +winioctl_MOVE_FILE_DATA Contains input data for the FSCTL_MOVE_FILE control code. +winioctl_NTFS_EXTENDED_VOLUME_DATA Represents volume data. +winioctl_NTFS_FILE_RECORD_INPUT_BUFFER Contains data for the FSCTL_GET_NTFS_FILE_RECORD control code. +winioctl_NTFS_FILE_RECORD_OUTPUT_BUFFER Receives output data from the FSCTL_GET_NTFS_FILE_RECORD control code. +winioctl_NTFS_STATISTICS Contains statistical information from the NTFS file system. +winioctl_NTFS_STATISTICS_EX Contains statistical information from the NTFS file system.Support for this structure started with Windows 10. +winioctl_NTFS_VOLUME_DATA_BUFFER Represents volume data. +winioctl_PARTITION_INFORMATION Contains information about a disk partition. +winioctl_PARTITION_INFORMATION_EX Contains partition information for standard AT-style master boot record (MBR) and Extensible Firmware Interface (EFI) disks. +winioctl_PARTITION_INFORMATION_GPT Contains GUID partition table (GPT) partition information. +winioctl_PARTITION_INFORMATION_MBR Contains partition information specific to master boot record (MBR) disks. +winioctl_PLEX_READ_DATA_REQUEST Indicates the range of the read operation to perform and the plex from which to read. +winioctl_PREVENT_MEDIA_REMOVAL Provides removable media locking data. It is used by the IOCTL_STORAGE_MEDIA_REMOVAL control code. +winioctl_READ_ELEMENT_ADDRESS_INFO Represents the volume tag information. It is used by the IOCTL_CHANGER_QUERY_VOLUME_TAGS control code. +winioctl_READ_FILE_USN_DATA Specifies the versions of the update sequence number (USN) change journal supported by the application. +winioctl_READ_USN_JOURNAL_DATA_V0 Contains information defining a set of update sequence number (USN) change journal records to return to the calling process. +winioctl_READ_USN_JOURNAL_DATA_V1 Contains information defining a set of update sequence number (USN) change journal records to return to the calling process. +winioctl_REASSIGN_BLOCKS Contains disk block reassignment data. +winioctl_REASSIGN_BLOCKS_EX Contains disk block reassignment data. +winioctl_REPAIR_COPIES_INPUT Input structure for the FSCTL_REPAIR_COPIES control code. +winioctl_REPAIR_COPIES_OUTPUT Contains output of a repair copies operation returned from the FSCTL_REPAIR_COPIES control code. +winioctl_REQUEST_OPLOCK_INPUT_BUFFER Contains the information to request an opportunistic lock (oplock) or to acknowledge an oplock break with the FSCTL_REQUEST_OPLOCK control code. +winioctl_REQUEST_OPLOCK_OUTPUT_BUFFER Contains the opportunistic lock (oplock) information returned by the FSCTL_REQUEST_OPLOCK control code. +winioctl_RETRIEVAL_POINTER_BASE Contains the output for the FSCTL_GET_RETRIEVAL_POINTER_BASE control code. +winioctl_RETRIEVAL_POINTERS_BUFFER Contains the output for the FSCTL_GET_RETRIEVAL_POINTERS control code. +winioctl_SET_DISK_ATTRIBUTES Specifies the attributes to be set on a disk device. +winioctl_SET_PARTITION_INFORMATION Contains information used to set a disk partition's type. +winioctl_SHRINK_VOLUME_INFORMATION Specifies the volume shrink operation to perform. +winioctl_STARTING_LCN_INPUT_BUFFER Contains the starting LCN to the FSCTL_GET_VOLUME_BITMAP control code. +winioctl_STARTING_VCN_INPUT_BUFFER Contains the starting VCN to the FSCTL_GET_RETRIEVAL_POINTERS control code. +winioctl_STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve the storage access alignment descriptor data for a device. +winioctl_STORAGE_ADAPTER_DESCRIPTOR Used with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve the storage adapter descriptor data for a device. +winioctl_STORAGE_DESCRIPTOR_HEADER Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve the properties of a storage device or adapter. +winioctl_STORAGE_DEVICE_ATTRIBUTES_DESCRIPTOR Reserved for future use. +winioctl_STORAGE_DEVICE_DESCRIPTOR Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve the storage device descriptor data for a device. +winioctl_STORAGE_DEVICE_ID_DESCRIPTOR Used with the IOCTL_STORAGE_QUERY_PROPERTY control code request to retrieve the device ID descriptor data for a device. +winioctl_STORAGE_DEVICE_IO_CAPABILITY_DESCRIPTOR The output buffer for the StorageDeviceIoCapabilityProperty as defined in STORAGE_PROPERTY_ID. +winioctl_STORAGE_DEVICE_NUMBER Contains information about a device. This structure is used by the IOCTL_STORAGE_GET_DEVICE_NUMBER control code. +winioctl_STORAGE_DEVICE_POWER_CAP This structure is used as an input and output buffer for the IOCTL_STORAGE_DEVICE_POWER_CAP. +winioctl_STORAGE_DEVICE_RESILIENCY_DESCRIPTOR Reserved for system use. +winioctl_STORAGE_HOTPLUG_INFO Provides information about the hotplug information of a device. +winioctl_STORAGE_HW_FIRMWARE_ACTIVATE This structure contains information about the downloaded firmware to activate. +winioctl_STORAGE_HW_FIRMWARE_DOWNLOAD This structure contains a firmware image payload to be downloaded to the target. +winioctl_STORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY request to describe the product type of a storage device. +winioctl_STORAGE_MINIPORT_DESCRIPTOR Reserved for system use. +winioctl_STORAGE_OFFLOAD_READ_OUTPUT Output structure for the DeviceDsmAction_OffloadRead action of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_STORAGE_OFFLOAD_TOKEN The token used to represent a portion of a file used in by offload read and write operations. +winioctl_STORAGE_OFFLOAD_WRITE_OUTPUT Output structure for the DeviceDsmAction_OffloadWrite action of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code. +winioctl_STORAGE_PHYSICAL_ADAPTER_DATA Describes a physical storage adapter. +winioctl_STORAGE_PHYSICAL_DEVICE_DATA Describes a physical storage device. +winioctl_STORAGE_PHYSICAL_NODE_DATA Specifies the physical device data of a storage node. +winioctl_STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR The STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR structure is one of the query result structures returned from an IOCTL_STORAGE_QUERY_PROPERTY request. +winioctl_STORAGE_PROPERTY_QUERY Indicates the properties of a storage device or adapter to retrieve as the input buffer passed to the IOCTL_STORAGE_QUERY_PROPERTY control code. +winioctl_STORAGE_PROTOCOL_COMMAND This structure is used as an input buffer when using the pass-through mechanism to issue a vendor-specific command to a storage device (via IOCTL_STORAGE_PROTOCOL_COMMAND). +winioctl_STORAGE_PROTOCOL_DATA_DESCRIPTOR This structure is used in conjunction with IOCTL_STORAGE_QUERY_PROPERTY to return protocol-specific data from a storage device or adapter. +winioctl_STORAGE_PROTOCOL_SPECIFIC_DATA Describes protocol-specific device data, provided in the input and output buffer of an IOCTL_STORAGE_QUERY_PROPERTY request. +winioctl_STORAGE_RPMB_DATA_FRAME +winioctl_STORAGE_RPMB_DESCRIPTOR +winioctl_STORAGE_SPEC_VERSION Storage specification version. +winioctl_STORAGE_TEMPERATURE_DATA_DESCRIPTOR This structure is used in conjunction with IOCTL_STORAGE_QUERY_PROPERTY to return temperature data from a storage device or adapter. +winioctl_STORAGE_TEMPERATURE_INFO Describes device temperature data. Returned as part of STORAGE_TEMPERATURE_DATA_DESCRIPTOR when querying for temperature data with an IOCTL_STORAGE_QUERY_PROPERTY request. +winioctl_STORAGE_TEMPERATURE_THRESHOLD This structure is used to set the over or under temperature threshold of a storage device (via IOCTL_STORAGE_SET_TEMPERATURE_THRESHOLD). +winioctl_STORAGE_WRITE_CACHE_PROPERTY Used with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve information about a device's write cache property. +winioctl_TXFS_CREATE_MINIVERSION_INFO Contains the version information about the miniversion created by FSCTL_TXFS_CREATE_MINIVERSION. +winioctl_TXFS_GET_METADATA_INFO_OUT Contains the version information about the miniversion that is created. +winioctl_TXFS_GET_TRANSACTED_VERSION Contains the information about the base and latest versions of the specified file. +winioctl_TXFS_LIST_TRANSACTION_LOCKED_FILES Contains a list of files locked by a transacted writer. +winioctl_TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY Contains information about a locked transaction. +winioctl_TXFS_LIST_TRANSACTIONS Contains a list of transactions. +winioctl_TXFS_LIST_TRANSACTIONS_ENTRY Contains information about a transaction. +winioctl_TXFS_MODIFY_RM Contains the information required when modifying log parameters and logging mode for a secondary resource manager. +winioctl_TXFS_QUERY_RM_INFORMATION Contains information about the resource manager (RM). +winioctl_TXFS_READ_BACKUP_INFORMATION_OUT Contains a Transactional NTFS (TxF) specific structure. This information should only be used when calling TXFS_WRITE_BACKUP_INFORMATION. +winioctl_TXFS_SAVEPOINT_INFORMATION The FSCTL_TXFS_SAVEPOINT_INFORMATION structure specifies the action to perform, and on which transaction. +winioctl_TXFS_TRANSACTION_ACTIVE_INFO Contains the flag that indicates whether transactions were active or not when a snapshot was taken. +winioctl_TXFS_WRITE_BACKUP_INFORMATION Contains a Transactional NTFS (TxF) specific structure. This information should only be used when calling TXFS_WRITE_BACKUP_INFORMATION. +winioctl_VERIFY_INFORMATION Contains information used to verify a disk extent. +winioctl_VOLUME_BITMAP_BUFFER Represents the occupied and available clusters on a disk. +winioctl_VOLUME_DISK_EXTENTS Represents a physical location on a disk. +winioctl_VOLUME_GET_GPT_ATTRIBUTES_INFORMATION Contains volume attributes retrieved with the IOCTL_VOLUME_GET_GPT_ATTRIBUTES control code. +*/ + } +} \ No newline at end of file diff --git a/PInvoke/Kernel32/WinIOCtl.cs b/PInvoke/Kernel32/WinIOCtl.cs new file mode 100644 index 00000000..3c52b575 --- /dev/null +++ b/PInvoke/Kernel32/WinIOCtl.cs @@ -0,0 +1,598 @@ +using System; + +namespace Vanara.PInvoke +{ + public static partial class Kernel32 + { + /// Device types defined by the system. + [PInvokeData("WinIOCtl.h")] + public enum DEVICE_TYPE : ushort + { + FILE_DEVICE_BEEP = 0x00000001, + FILE_DEVICE_CD_ROM = 0x00000002, + FILE_DEVICE_CD_ROM_FILE_SYSTEM = 0x00000003, + FILE_DEVICE_CONTROLLER = 0x00000004, + FILE_DEVICE_DATALINK = 0x00000005, + FILE_DEVICE_DFS = 0x00000006, + FILE_DEVICE_DISK = 0x00000007, + FILE_DEVICE_DISK_FILE_SYSTEM = 0x00000008, + FILE_DEVICE_FILE_SYSTEM = 0x00000009, + FILE_DEVICE_INPORT_PORT = 0x0000000a, + FILE_DEVICE_KEYBOARD = 0x0000000b, + FILE_DEVICE_MAILSLOT = 0x0000000c, + FILE_DEVICE_MIDI_IN = 0x0000000d, + FILE_DEVICE_MIDI_OUT = 0x0000000e, + FILE_DEVICE_MOUSE = 0x0000000f, + FILE_DEVICE_MULTI_UNC_PROVIDER = 0x00000010, + FILE_DEVICE_NAMED_PIPE = 0x00000011, + FILE_DEVICE_NETWORK = 0x00000012, + FILE_DEVICE_NETWORK_BROWSER = 0x00000013, + FILE_DEVICE_NETWORK_FILE_SYSTEM = 0x00000014, + FILE_DEVICE_NULL = 0x00000015, + FILE_DEVICE_PARALLEL_PORT = 0x00000016, + FILE_DEVICE_PHYSICAL_NETCARD = 0x00000017, + FILE_DEVICE_PRINTER = 0x00000018, + FILE_DEVICE_SCANNER = 0x00000019, + FILE_DEVICE_SERIAL_MOUSE_PORT = 0x0000001a, + FILE_DEVICE_SERIAL_PORT = 0x0000001b, + FILE_DEVICE_SCREEN = 0x0000001c, + FILE_DEVICE_SOUND = 0x0000001d, + FILE_DEVICE_STREAMS = 0x0000001e, + FILE_DEVICE_TAPE = 0x0000001f, + FILE_DEVICE_TAPE_FILE_SYSTEM = 0x00000020, + FILE_DEVICE_TRANSPORT = 0x00000021, + FILE_DEVICE_UNKNOWN = 0x00000022, + FILE_DEVICE_VIDEO = 0x00000023, + FILE_DEVICE_VIRTUAL_DISK = 0x00000024, + FILE_DEVICE_WAVE_IN = 0x00000025, + FILE_DEVICE_WAVE_OUT = 0x00000026, + FILE_DEVICE_8042_PORT = 0x00000027, + FILE_DEVICE_NETWORK_REDIRECTOR = 0x00000028, + FILE_DEVICE_BATTERY = 0x00000029, + FILE_DEVICE_BUS_EXTENDER = 0x0000002a, + FILE_DEVICE_MODEM = 0x0000002b, + FILE_DEVICE_VDM = 0x0000002c, + FILE_DEVICE_MASS_STORAGE = 0x0000002d, + FILE_DEVICE_SMB = 0x0000002e, + FILE_DEVICE_KS = 0x0000002f, + FILE_DEVICE_CHANGER = 0x00000030, + FILE_DEVICE_SMARTCARD = 0x00000031, + FILE_DEVICE_ACPI = 0x00000032, + FILE_DEVICE_DVD = 0x00000033, + FILE_DEVICE_FULLSCREEN_VIDEO = 0x00000034, + FILE_DEVICE_DFS_FILE_SYSTEM = 0x00000035, + FILE_DEVICE_DFS_VOLUME = 0x00000036, + FILE_DEVICE_SERENUM = 0x00000037, + FILE_DEVICE_TERMSRV = 0x00000038, + FILE_DEVICE_KSEC = 0x00000039, + FILE_DEVICE_FIPS = 0x0000003A, + FILE_DEVICE_INFINIBAND = 0x0000003B, + FILE_DEVICE_AVIO = 0x0000003C, + FILE_DEVICE_VMBUS = 0x0000003E, + FILE_DEVICE_CRYPT_PROVIDER = 0x0000003F, + FILE_DEVICE_WPD = 0x00000040, + FILE_DEVICE_BLUETOOTH = 0x00000041, + FILE_DEVICE_MT_COMPOSITE = 0x00000042, + FILE_DEVICE_MT_TRANSPORT = 0x00000043, + FILE_DEVICE_BIOMETRIC = 0x00000044, + FILE_DEVICE_PMI = 0x00000045, + FILE_DEVICE_EHSTOR = 0x00000046, + FILE_DEVICE_DEVAPI = 0x00000047, + FILE_DEVICE_GPIO = 0x00000048, + FILE_DEVICE_USBEX = 0x00000049, + FILE_DEVICE_CONSOLE = 0x00000050, + FILE_DEVICE_NFP = 0x00000051, + FILE_DEVICE_SYSENV = 0x00000052, + FILE_DEVICE_VIRTUAL_BLOCK = 0x00000053, + FILE_DEVICE_POINT_OF_SERVICE = 0x00000054, + FILE_DEVICE_STORAGE_REPLICATION = 0x00000055, + FILE_DEVICE_TRUST_ENV = 0x00000056, + FILE_DEVICE_UCM = 0x00000057, + FILE_DEVICE_UCMTCPCI = 0x00000058, + FILE_DEVICE_PERSISTENT_MEMORY = 0x00000059, + FILE_DEVICE_NVDIMM = 0x0000005a, + FILE_DEVICE_HOLOGRAPHIC = 0x0000005b, + FILE_DEVICE_SDFXHCI = 0x0000005c, + FILE_DEVICE_UCMUCSI = 0x0000005d, + IOCTL_STORAGE_BASE = FILE_DEVICE_MASS_STORAGE, + IOCTL_CHANGER_BASE = FILE_DEVICE_CHANGER, + IOCTL_VOLUME_BASE = 0x00000056, + } + + /// + /// Defined access check value for any access within an I/O control code (IOCTL). The FILE_ACCESS_ANY is generally the correct value. + /// + [Flags] + [PInvokeData("WinIOCtl.h")] + public enum IOAccess : byte + { + /// Request all access. + FILE_ANY_ACCESS = 0, + + /// Request read access. Can be used with FILE_WRITE_ACCESS. + FILE_READ_ACCESS = 1, + + /// Request write access. Can be used with FILE_READ_ACCESS. + FILE_WRITE_ACCESS = 2, + + /// Request read and write access. This value is equivalent to (FILE_READ_ACCESS | FILE_WRITE_ACCESS). + FILE_READ_WRITE_ACCESS = 3, + } + + /// Defined method codes for how buffers are passed for I/O and file system controls within an I/O control code (IOCTL). + [PInvokeData("WinIOCtl.h")] + public enum IOMethod : byte + { + METHOD_BUFFERED = 0, + METHOD_IN_DIRECT = 1, + METHOD_OUT_DIRECT = 2, + METHOD_NEITHER = 3, + } + + /// + /// Represents IO control codes. + /// + [PInvokeData("WinIOCtl.h")] + public static class IOControlCode + { + public static uint FSCTL_GET_COMPRESSION + => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 15, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint FSCTL_SET_COMPRESSION + => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 16, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_ALLOCATE_BC_STREAM + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0601, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_ATTRIBUTE_MANAGEMENT + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0727, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_BREAK_RESERVATION + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0405, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0620, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_CHECK_VERIFY + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0200, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_CHECK_VERIFY2 + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0200, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_DEVICE_POWER_CAP + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0725, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_DEVICE_TELEMETRY_NOTIFY + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0471, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_DEVICE_TELEMETRY_QUERY_CAPS + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0472, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_EJECT_MEDIA + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0202, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_EJECTION_CONTROL + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0250, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_ENABLE_IDLE_POWER + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0720, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_EVENT_NOTIFICATION + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0724, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_FAILURE_PREDICTION_CONFIG + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0441, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_FIND_NEW_DEVICES + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0206, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_FIRMWARE_ACTIVATE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0702, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_FIRMWARE_DOWNLOAD + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0701, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_FIRMWARE_GET_INFO + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0700, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_FREE_BC_STREAM + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0602, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_GET_BC_PROPERTIES + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0600, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_GET_COUNTERS + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x442, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_DEVICE_NUMBER + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0420, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_DEVICE_TELEMETRY + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0470, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_GET_DEVICE_TELEMETRY_RAW + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0473, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_GET_HOTPLUG_INFO + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0305, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_IDLE_POWERUP_REASON + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0721, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_LB_PROVISIONING_MAP_RESOURCES + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0502, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0304, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_MEDIA_TYPES + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0300, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_GET_MEDIA_TYPES_EX + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0301, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_LOAD_MEDIA + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0203, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_LOAD_MEDIA2 + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0203, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0501, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_MCN_CONTROL + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0251, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_MEDIA_REMOVAL + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0201, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_PERSISTENT_RESERVE_IN + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0406, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_PERSISTENT_RESERVE_OUT + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0407, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_POWER_ACTIVE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0722, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_POWER_IDLE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0723, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_PREDICT_FAILURE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0440, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_PROTOCOL_COMMAND + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x04F0, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_QUERY_PROPERTY + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0500, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_READ_CAPACITY + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0450, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_REINITIALIZE_MEDIA + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0590, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_RELEASE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0205, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_RESERVE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0204, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_RESET_BUS + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0400, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_RESET_DEVICE + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0401, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + + public static uint IOCTL_STORAGE_RPMB_COMMAND + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0726, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + public static uint IOCTL_STORAGE_SET_HOTPLUG_INFO + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0306, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_SET_TEMPERATURE_THRESHOLD + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0480, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_START_DATA_INTEGRITY_CHECK + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0621, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint IOCTL_STORAGE_STOP_DATA_INTEGRITY_CHECK + => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0622, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_WRITE_ACCESS); + + public static uint FSCTL_REQUEST_OPLOCK_LEVEL_1 => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 0, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REQUEST_OPLOCK_LEVEL_2 => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 1, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REQUEST_BATCH_OPLOCK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 2, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_OPLOCK_BREAK_ACKNOWLEDGE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 3, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_OPBATCH_ACK_CLOSE_PENDING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 4, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_OPLOCK_BREAK_NOTIFY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 5, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_LOCK_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 6, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_UNLOCK_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 7, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DISMOUNT_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 8, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_VOLUME_MOUNTED => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 10, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_PATHNAME_VALID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 11, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_MARK_VOLUME_DIRTY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 12, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_RETRIEVAL_POINTERS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 14, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_BOOTLOADER_ACCESSED => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 19, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_OPLOCK_BREAK_ACK_NO_2 => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 20, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_INVALIDATE_VOLUMES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 21, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_FAT_BPB => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 22, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REQUEST_FILTER_OPLOCK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 23, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_FILESYSTEM_GET_STATISTICS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 24, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_NTFS_VOLUME_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 25, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_NTFS_FILE_RECORD => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 26, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_VOLUME_BITMAP => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 27, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_RETRIEVAL_POINTERS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 28, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_MOVE_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 29, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_VOLUME_DIRTY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 30, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ALLOW_EXTENDED_DASD_IO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 32, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_FIND_FILES_BY_SID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 35, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_OBJECT_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 38, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_OBJECT_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 39, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DELETE_OBJECT_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 40, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_REPARSE_POINT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 41, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_REPARSE_POINT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 42, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DELETE_REPARSE_POINT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 43, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENUM_USN_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 44, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SECURITY_ID_CHECK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 45, IOMethod.METHOD_NEITHER, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_READ_USN_JOURNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 46, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_OBJECT_ID_EXTENDED => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 47, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CREATE_OR_GET_OBJECT_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 48, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_SPARSE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 49, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_ZERO_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 50, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_QUERY_ALLOCATED_RANGES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 51, IOMethod.METHOD_NEITHER, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_ENABLE_UPGRADE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 52, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_SET_ENCRYPTION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 53, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENCRYPTION_FSCTL_IO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 54, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_WRITE_RAW_ENCRYPTED => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 55, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_READ_RAW_ENCRYPTED => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 56, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CREATE_USN_JOURNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 57, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_READ_FILE_USN_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 58, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_WRITE_USN_CLOSE_RECORD => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 59, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_EXTEND_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 60, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_USN_JOURNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 61, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DELETE_USN_JOURNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 62, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_MARK_HANDLE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 63, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SIS_COPYFILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 64, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SIS_LINK_FILES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 65, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_RECALL_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 69, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_READ_FROM_PLEX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 71, IOMethod.METHOD_OUT_DIRECT, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_FILE_PREFETCH => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 72, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_MAKE_MEDIA_COMPATIBLE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 76, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_SET_DEFECT_MANAGEMENT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 77, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_QUERY_SPARING_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 78, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_ON_DISK_VOLUME_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 79, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_VOLUME_COMPRESSION_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 80, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_TXFS_MODIFY_RM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 81, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_QUERY_RM_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 82, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_TXFS_ROLLFORWARD_REDO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 84, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_ROLLFORWARD_UNDO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 85, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_START_RM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 86, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_SHUTDOWN_RM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 87, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_READ_BACKUP_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 88, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_TXFS_WRITE_BACKUP_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 89, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_CREATE_SECONDARY_RM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 90, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_GET_METADATA_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 91, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_TXFS_GET_TRANSACTED_VERSION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 92, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_TXFS_SAVEPOINT_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 94, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_CREATE_MINIVERSION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 95, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_TXFS_TRANSACTION_ACTIVE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 99, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_SET_ZERO_ON_DEALLOCATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 101, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_REPAIR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 102, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_REPAIR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 103, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_WAIT_FOR_REPAIR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 104, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_INITIATE_REPAIR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 106, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSC_INTERNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 107, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SHRINK_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 108, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_SHORT_NAME_BEHAVIOR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 109, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DFSR_SET_GHOST_HANDLE_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 110, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 120, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_TXFS_LIST_TRANSACTIONS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 121, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_QUERY_PAGEFILE_ENCRYPTION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 122, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_RESET_VOLUME_ALLOCATION_HINTS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 123, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_DEPENDENT_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 124, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SD_GLOBAL_CHANGE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 125, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_TXFS_READ_BACKUP_INFORMATION2 => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 126, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_LOOKUP_STREAM_FROM_CLUSTER => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 127, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 128, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_FILE_TYPE_NOTIFICATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 129, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_FILE_LEVEL_TRIM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 130, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_GET_BOOT_AREA_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 140, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_RETRIEVAL_POINTER_BASE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 141, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_PERSISTENT_VOLUME_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 142, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_PERSISTENT_VOLUME_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 143, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REQUEST_OPLOCK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 144, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 145, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_CSV_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 146, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_FILE_SYSTEM_RECOGNITION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 147, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_GET_VOLUME_PATH_NAME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 148, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 149, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 150, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_FILE_ON_CSV_VOLUME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 151, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CORRUPTION_HANDLING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 152, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_OFFLOAD_READ => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 153, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint FSCTL_OFFLOAD_WRITE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 154, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_CSV_INTERNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 155, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_PURGE_FAILURE_MODE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 156, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_FILE_LAYOUT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 157, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_IS_VOLUME_OWNED_BYCSVFS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 158, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_INTEGRITY_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 159, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_INTEGRITY_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 160, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_QUERY_FILE_REGIONS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 161, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_RKF_INTERNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 171, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SCRUB_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 172, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REPAIR_COPIES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 173, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_DISABLE_LOCAL_BUFFERING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 174, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_MGMT_LOCK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 175, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 176, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ADVANCE_FILE_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 177, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_SYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 178, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 179, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_WRITE_USN_REASON => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 180, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_CONTROL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 181, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_REFS_VOLUME_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 182, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CSV_H_BREAKING_SYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 185, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_STORAGE_CLASSES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 187, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_REGION_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 188, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_USN_TRACK_MODIFIED_RANGES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 189, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 192, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SVHDX_SYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 193, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SVHDX_SET_INITIATOR_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 194, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_EXTERNAL_BACKING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 195, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_EXTERNAL_BACKING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 196, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DELETE_EXTERNAL_BACKING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 197, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENUM_EXTERNAL_BACKING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 198, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENUM_OVERLAY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 199, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ADD_OVERLAY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 204, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_REMOVE_OVERLAY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 205, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_UPDATE_OVERLAY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 206, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_SHUFFLE_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 208, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_DUPLICATE_EXTENTS_TO_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 209, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_SPARSE_OVERALLOCATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 211, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_STORAGE_QOS_CONTROL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 212, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_INITIATE_FILE_METADATA_OPTIMIZATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 215, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_FILE_METADATA_OPTIMIZATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 216, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SVHDX_ASYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 217, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_WOF_VERSION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 218, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_HCS_SYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 219, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_HCS_ASYNC_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 220, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_EXTENT_READ_CACHE_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 221, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_REFS_VOLUME_COUNTER_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 222, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_CLEAN_VOLUME_METADATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 223, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_INTEGRITY_INFORMATION_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 224, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SUSPEND_OVERLAY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 225, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_VIRTUAL_STORAGE_QUERY_PROPERTY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 226, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_FILESYSTEM_GET_STATISTICS_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 227, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_VOLUME_CONTAINER_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 228, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_LAYER_ROOT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 229, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_DIRECT_ACCESS_EXTENTS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 230, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_NOTIFY_STORAGE_SPACE_ALLOCATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 231, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SSDI_STORAGE_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 232, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_DIRECT_IMAGE_ORIGINAL_BASE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 233, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_READ_UNPRIVILEGED_USN_JOURNAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 234, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GHOST_FILE_EXTENTS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 235, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_QUERY_GHOSTED_FILE_EXTENTS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 236, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_UNMAP_SPACE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 237, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_HCS_SYNC_NO_WRITE_TUNNEL_REQUEST => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 238, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_STREAMS_QUERY_PARAMETERS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 241, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_STREAMS_ASSOCIATE_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 242, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_STREAMS_QUERY_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 243, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 244, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_VOLUME_NUMA_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 245, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REFS_DEALLOCATE_RANGES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 246, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_QUERY_REFS_SMR_VOLUME_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 247, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_REFS_SMR_VOLUME_GC_PARAMETERS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 248, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_REFS_FILE_STRICTLY_SEQUENTIAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 249, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 250, IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_QUERY_BAD_RANGES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 251, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_DAX_ALLOC_ALIGNMENT_HINT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 252, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_DELETE_CORRUPTED_REFS_CONTAINER => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 253, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SCRUB_UNDISCOVERABLE_ID => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 254, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_NOTIFY_DATA_CHANGE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 255, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_START_VIRTUALIZATION_INSTANCE_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 256, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENCRYPTION_KEY_CONTROL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 257, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_VIRTUAL_STORAGE_SET_BEHAVIOR => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 258, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_SET_REPARSE_POINT_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 259, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_REARRANGE_FILE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 264, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint FSCTL_VIRTUAL_STORAGE_PASSTHROUGH => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 265, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_GET_RETRIEVAL_POINTER_COUNT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 266, IOMethod.METHOD_NEITHER, IOAccess.FILE_ANY_ACCESS); + public static uint FSCTL_ENABLE_PER_IO_FLAGS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_FILE_SYSTEM, 267, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_AVIO_ALLOCATE_STREAM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_AVIO, 1, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_AVIO_FREE_STREAM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_AVIO, 2, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_AVIO_MODIFY_STREAM => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_AVIO, 3, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_STORAGE_DIAGNOSTIC => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0728, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_STORAGE_GET_PHYSICAL_ELEMENT_STATUS => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0729, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_STORAGE_REMOVE_ELEMENT_AND_TRUNCATE => CTL_CODE(DEVICE_TYPE.IOCTL_STORAGE_BASE, 0x0730, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_BUS_GET_LOGICAL_DEVICES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCMBUS_FUNCTION(0x00), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_BUS_GET_PHYSICAL_DEVICES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCMBUS_FUNCTION(0x01), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_BUS_GET_REGIONS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCMBUS_FUNCTION(0x02), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_LD_GET_INTERLEAVE_SET => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_LOGICAL_DEVICE_FUNCTION(0x00), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_PD_QUERY_PROPERTY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x00), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_PD_FIRMWARE_DOWNLOAD => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x01), IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_SCM_PD_FIRMWARE_ACTIVATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x02), IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_SCM_PD_PASSTHROUGH => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x03), IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_SCM_PD_UPDATE_MANAGEMENT_STATUS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x04), IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SCM_PD_REINITIALIZE_MEDIA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_PERSISTENT_MEMORY, SCM_PHYSICAL_DEVICE_FUNCTION(0x05), IOMethod.METHOD_BUFFERED, IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_DRIVE_GEOMETRY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0000, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_GET_PARTITION_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0001, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_SET_PARTITION_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0002, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_DRIVE_LAYOUT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0003, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_SET_DRIVE_LAYOUT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0004, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_VERIFY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0005, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_FORMAT_TRACKS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0006, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_REASSIGN_BLOCKS => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0007, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_PERFORMANCE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0008, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_IS_WRITABLE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0009, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_LOGGING => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000a, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_FORMAT_TRACKS_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000b, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_HISTOGRAM_STRUCTURE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000c, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_HISTOGRAM_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000d, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_HISTOGRAM_RESET => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000e, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_REQUEST_STRUCTURE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x000f, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_REQUEST_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0010, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_PERFORMANCE_OFF => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0018, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_CONTROLLER_NUMBER => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0011, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint SMART_GET_VERSION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0020, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint SMART_SEND_DRIVE_COMMAND => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0021, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint SMART_RCV_DRIVE_DATA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0022, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_PARTITION_INFO_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0012, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_SET_PARTITION_INFO_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0013, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_DRIVE_LAYOUT_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0014, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_SET_DRIVE_LAYOUT_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0015, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_CREATE_DISK => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0016, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_LENGTH_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0017, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_GET_DRIVE_GEOMETRY_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0028, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_REASSIGN_BLOCKS_EX => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0029, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_UPDATE_DRIVE_SIZE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0032, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GROW_PARTITION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0034, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_CACHE_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0035, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_SET_CACHE_INFORMATION => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0036, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_GET_WRITE_CACHE_STATE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0037, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_DELETE_DRIVE_LAYOUT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0040, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_UPDATE_PROPERTIES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0050, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_FORMAT_DRIVE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x00f3, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_SENSE_DEVICE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x00f8, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_CHECK_VERIFY => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0200, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_MEDIA_REMOVAL => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0201, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_EJECT_MEDIA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0202, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_LOAD_MEDIA => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0203, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_RESERVE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0204, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_RELEASE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0205, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_FIND_NEW_DEVICES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0206, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_DISK_GET_MEDIA_TYPES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0300, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_GET_DISK_ATTRIBUTES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x003c, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_DISK_SET_DISK_ATTRIBUTES => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x003d, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_DISK_RESET_SNAPSHOT_INFO => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_DISK, 0x0084, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_CHANGER_GET_PARAMETERS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0000, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_GET_STATUS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0001, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_GET_PRODUCT_DATA => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0002, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_SET_ACCESS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0004, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_CHANGER_GET_ELEMENT_STATUS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0005, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0006, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_SET_POSITION => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0007, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_EXCHANGE_MEDIUM => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0008, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_MOVE_MEDIUM => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x0009, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_REINITIALIZE_TRANSPORT => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x000A, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS); + public static uint IOCTL_CHANGER_QUERY_VOLUME_TAGS => CTL_CODE(DEVICE_TYPE.IOCTL_CHANGER_BASE, 0x000B, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_SERIAL_LSRMST_INSERT => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_SERIAL_PORT, 31, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SERENUM_EXPOSE_HARDWARE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_SERENUM, 128, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SERENUM_REMOVE_HARDWARE => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_SERENUM, 129, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SERENUM_PORT_DESC => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_SERENUM, 130, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_SERENUM_GET_PORT_NAME => CTL_CODE(DEVICE_TYPE.FILE_DEVICE_SERENUM, 131, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS => CTL_CODE(DEVICE_TYPE.IOCTL_VOLUME_BASE, 0, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_VOLUME_ONLINE => CTL_CODE(DEVICE_TYPE.IOCTL_VOLUME_BASE, 2, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_VOLUME_OFFLINE => CTL_CODE(DEVICE_TYPE.IOCTL_VOLUME_BASE, 3, IOMethod.METHOD_BUFFERED, IOAccess.FILE_READ_ACCESS | IOAccess.FILE_WRITE_ACCESS); + public static uint IOCTL_VOLUME_IS_CLUSTERED => CTL_CODE(DEVICE_TYPE.IOCTL_VOLUME_BASE, 12, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + public static uint IOCTL_VOLUME_GET_GPT_ATTRIBUTES => CTL_CODE(DEVICE_TYPE.IOCTL_VOLUME_BASE, 14, IOMethod.METHOD_BUFFERED, IOAccess.FILE_ANY_ACCESS); + + private const ushort IOCTL_SCMBUS_DEVICE_FUNCTION_BASE = 0x0; + private const ushort IOCTL_SCM_LOGICAL_DEVICE_FUNCTION_BASE = 0x300; + private const ushort IOCTL_SCM_PHYSICAL_DEVICE_FUNCTION_BASE = 0x600; + + private static ushort SCMBUS_FUNCTION(ushort x) => (ushort)(IOCTL_SCMBUS_DEVICE_FUNCTION_BASE + x); + private static ushort SCM_LOGICAL_DEVICE_FUNCTION(ushort x) => (ushort)(IOCTL_SCM_LOGICAL_DEVICE_FUNCTION_BASE + x); + private static ushort SCM_PHYSICAL_DEVICE_FUNCTION(ushort x) => (ushort)(IOCTL_SCM_PHYSICAL_DEVICE_FUNCTION_BASE + x); + + } + } +} \ No newline at end of file