#ifdef DEFINE_GUID
#ifndef FAR
#ifdef _WIN32
#define FAR
#else
#define FAR _far
#endif
#endif
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
DEFINE_GUID(GUID_DEVINTERFACE_DISK, 0x53f56307L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_CDROM, 0x53f56308L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_PARTITION, 0x53f5630aL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
extern
"C"
const
GUID_DEVINTERFACE_PARTITION
;
DEFINE_GUID(GUID_DEVINTERFACE_TAPE, 0x53f5630bL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_WRITEONCEDISK, 0x53f5630cL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
extern
"C"
const
GUID_DEVINTERFACE_WRITEONCEDISK
;
DEFINE_GUID(GUID_DEVINTERFACE_VOLUME, 0x53f5630dL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_MEDIUMCHANGER, 0x53f56310L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
extern
"C"
const
GUID_DEVINTERFACE_MEDIUMCHANGER
;
DEFINE_GUID(GUID_DEVINTERFACE_FLOPPY, 0x53f56311L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_CDCHANGER, 0x53f56312L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
extern
"C"
const
GUID_DEVINTERFACE_CDCHANGER
;
DEFINE_GUID(GUID_DEVINTERFACE_STORAGEPORT, 0x2accfe60L, 0xc130, 0x11d2, 0xb0, 0x82, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
extern
"C"
const
GUID_DEVINTERFACE_STORAGEPORT
;
DEFINE_GUID(GUID_DEVINTERFACE_VMLUN, 0x6f416619L, 0x9f29, 0x42a5, 0xb2, 0x0b, 0x37, 0xe2, 0x19, 0xca, 0x02, 0xb0);
DEFINE_GUID(GUID_DEVINTERFACE_SES, 0x1790c9ecL, 0x47d5, 0x4df3, 0xb5, 0xaf, 0x9a, 0xdf, 0x3c, 0xf2, 0x3e, 0x48);
#define WDI_STORAGE_PREDICT_FAILURE_DPS_GUID {0xe9f2d03aL, 0x747c, 0x41c2, {0xbb, 0x9a, 0x02, 0xc6, 0x2b, 0x6d, 0x5f, 0xcb}};
DEFINE_GUID(GUID_DEVINTERFACE_SERVICE_VOLUME, 0x6ead3d82L, 0x25ec, 0x46bc, 0xb7, 0xfd, 0xc1, 0xf0, 0xdf, 0x8f, 0x50, 0x37);
extern
"C"
const
GUID_DEVINTERFACE_SERVICE_VOLUME
;
DEFINE_GUID(GUID_DEVINTERFACE_HIDDEN_VOLUME, 0x7f108a28L, 0x9833, 0x4b3b, 0xb7, 0x80, 0x2c, 0x6b, 0x5f, 0xa5, 0xc0, 0x62);
extern
"C"
const
GUID_DEVINTERFACE_HIDDEN_VOLUME
;
DEFINE_GUID(GUID_DEVINTERFACE_UNIFIED_ACCESS_RPMB, 0x27447c21L, 0xbcc3, 0x4d07, 0xa0, 0x5b, 0xa3, 0x39, 0x5b, 0xb4, 0xee, 0xe7);
extern
"C"
const
GUID_DEVINTERFACE_UNIFIED_ACCESS_RPMB
;
DEFINE_GUID(GUID_DEVINTERFACE_SCM_PHYSICAL_DEVICE, 0x4283609d, 0x4dc2, 0x43be, 0xbb, 0xb4, 0x4f, 0x15, 0xdf, 0xce, 0x2c, 0x61);
extern
"C"
const
GUID_DEVINTERFACE_SCM_PHYSICAL_DEVICE
;
DEFINE_GUID(GUID_SCM_PD_HEALTH_NOTIFICATION, 0x9da2d386, 0x72f5, 0x4ee3, 0x81, 0x55, 0xec, 0xa0, 0x67, 0x8e, 0x3b, 0x6);
extern
"C"
const
GUID_SCM_PD_HEALTH_NOTIFICATION
;
DEFINE_GUID(GUID_SCM_PD_PASSTHROUGH_INVDIMM, 0x4309AC30, 0x0D11, 0x11E4, 0x91, 0x91, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66);
extern
"C"
const
GUID_SCM_PD_PASSTHROUGH_INVDIMM
;
DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0X86E0D1E0L, 0X8089, 0X11D0, 0X9C, 0XE4, 0X08, 0X00, 0X3E, 0X30, 0X1F, 0X73);
extern
"C"
const
GUID_DEVINTERFACE_COMPORT
;
DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
extern
"C"
const
GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
;
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
#define DiskClassGuid GUID_DEVINTERFACE_DISK
#define CdRomClassGuid GUID_DEVINTERFACE_CDROM
#define PartitionClassGuid GUID_DEVINTERFACE_PARTITION
#define TapeClassGuid GUID_DEVINTERFACE_TAPE
#define WriteOnceDiskClassGuid GUID_DEVINTERFACE_WRITEONCEDISK
#define VolumeClassGuid GUID_DEVINTERFACE_VOLUME
#define MediumChangerClassGuid GUID_DEVINTERFACE_MEDIUMCHANGER
#define FloppyClassGuid GUID_DEVINTERFACE_FLOPPY
#define CdChangerClassGuid GUID_DEVINTERFACE_CDCHANGER
#define StoragePortClassGuid GUID_DEVINTERFACE_STORAGEPORT
#define HiddenVolumeClassGuid GUID_DEVINTERFACE_HIDDEN_VOLUME
#define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT
#define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
#endif // DEFINE_GUID
#ifdef DEFINE_DEVPROPKEY
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
//
// Properties associated with the volume interface.
//
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Portable, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 2); // DEVPROP_TYPE_BOOLEAN
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Removable_Media, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 3); // DEVPROP_TYPE_BOOLEAN
DEFINE_DEVPROPKEY(DEVPKEY_Storage_System_Critical, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 4); // DEVPROP_TYPE_BOOLEAN
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Disk_Number, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 5); // DEVPROP_TYPE_UINT32
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Partition_Number, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 6); // DEVPROP_TYPE_UINT32
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Mbr_Type, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 7); // DEVPROP_TYPE_BYTE
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Gpt_Type, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 8); // DEVPROP_TYPE_GUID
DEFINE_DEVPROPKEY(DEVPKEY_Storage_Gpt_Name, 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 9); // DEVPROP_TYPE_STRING
#endif // DEFINE_DEVPROPKEY
#ifndef _WINIOCTL_
#define _WINIOCTL_
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable:
4201
)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#ifndef _DEVIOCTL_
#define _DEVIOCTL_
#define DEVICE_TYPE DWORD
#define FILE_DEVICE_BEEP 0x00000001
#define FILE_DEVICE_CD_ROM 0x00000002
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
#define FILE_DEVICE_CONTROLLER 0x00000004
#define FILE_DEVICE_DATALINK 0x00000005
#define FILE_DEVICE_DFS 0x00000006
#define FILE_DEVICE_DISK 0x00000007
#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
#define FILE_DEVICE_FILE_SYSTEM 0x00000009
#define FILE_DEVICE_INPORT_PORT 0x0000000a
#define FILE_DEVICE_KEYBOARD 0x0000000b
#define FILE_DEVICE_MAILSLOT 0x0000000c
#define FILE_DEVICE_MIDI_IN 0x0000000d
#define FILE_DEVICE_MIDI_OUT 0x0000000e
#define FILE_DEVICE_MOUSE 0x0000000f
#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
#define FILE_DEVICE_NAMED_PIPE 0x00000011
#define FILE_DEVICE_NETWORK 0x00000012
#define FILE_DEVICE_NETWORK_BROWSER 0x00000013
#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
#define FILE_DEVICE_NULL 0x00000015
#define FILE_DEVICE_PARALLEL_PORT 0x00000016
#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
#define FILE_DEVICE_PRINTER 0x00000018
#define FILE_DEVICE_SCANNER 0x00000019
#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
#define FILE_DEVICE_SERIAL_PORT 0x0000001b
#define FILE_DEVICE_SCREEN 0x0000001c
#define FILE_DEVICE_SOUND 0x0000001d
#define FILE_DEVICE_STREAMS 0x0000001e
#define FILE_DEVICE_TAPE 0x0000001f
#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
#define FILE_DEVICE_TRANSPORT 0x00000021
#define FILE_DEVICE_UNKNOWN 0x00000022
#define FILE_DEVICE_VIDEO 0x00000023
#define FILE_DEVICE_VIRTUAL_DISK 0x00000024
#define FILE_DEVICE_WAVE_IN 0x00000025
#define FILE_DEVICE_WAVE_OUT 0x00000026
#define FILE_DEVICE_8042_PORT 0x00000027
#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
#define FILE_DEVICE_BATTERY 0x00000029
#define FILE_DEVICE_BUS_EXTENDER 0x0000002a
#define FILE_DEVICE_MODEM 0x0000002b
#define FILE_DEVICE_VDM 0x0000002c
#define FILE_DEVICE_MASS_STORAGE 0x0000002d
#define FILE_DEVICE_SMB 0x0000002e
#define FILE_DEVICE_KS 0x0000002f
#define FILE_DEVICE_CHANGER 0x00000030
#define FILE_DEVICE_SMARTCARD 0x00000031
#define FILE_DEVICE_ACPI 0x00000032
#define FILE_DEVICE_DVD 0x00000033
#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
#define FILE_DEVICE_DFS_VOLUME 0x00000036
#define FILE_DEVICE_SERENUM 0x00000037
#define FILE_DEVICE_TERMSRV 0x00000038
#define FILE_DEVICE_KSEC 0x00000039
#define FILE_DEVICE_FIPS 0x0000003A
#define FILE_DEVICE_INFINIBAND 0x0000003B
#define FILE_DEVICE_VMBUS 0x0000003E
#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F
#define FILE_DEVICE_WPD 0x00000040
#define FILE_DEVICE_BLUETOOTH 0x00000041
#define FILE_DEVICE_MT_COMPOSITE 0x00000042
#define FILE_DEVICE_MT_TRANSPORT 0x00000043
#define FILE_DEVICE_BIOMETRIC 0x00000044
#define FILE_DEVICE_PMI 0x00000045
#define FILE_DEVICE_EHSTOR 0x00000046
#define FILE_DEVICE_DEVAPI 0x00000047
#define FILE_DEVICE_GPIO 0x00000048
#define FILE_DEVICE_USBEX 0x00000049
#define FILE_DEVICE_CONSOLE 0x00000050
#define FILE_DEVICE_NFP 0x00000051
#define FILE_DEVICE_SYSENV 0x00000052
#define FILE_DEVICE_VIRTUAL_BLOCK 0x00000053
#define FILE_DEVICE_POINT_OF_SERVICE 0x00000054
#define FILE_DEVICE_STORAGE_REPLICATION 0x00000055
#define FILE_DEVICE_TRUST_ENV 0x00000056
#define FILE_DEVICE_UCM 0x00000057
#define FILE_DEVICE_UCMTCPCI 0x00000058
#define FILE_DEVICE_PERSISTENT_MEMORY 0x00000059
#define FILE_DEVICE_NVDIMM 0x0000005a
#define FILE_DEVICE_HOLOGRAPHIC 0x0000005b
#define FILE_DEVICE_SDFXHCI 0x0000005c
#define FILE_DEVICE_UCMUCSI 0x0000005d
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((DWORD)(ctrlCode & 0xffff0000)) >> 16)
#define METHOD_FROM_CTL_CODE(ctrlCode) ((DWORD)(ctrlCode & 3))
#define METHOD_BUFFERED 0
#define METHOD_IN_DIRECT 1
#define METHOD_OUT_DIRECT 2
#define METHOD_NEITHER 3
#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT
#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT
#define FILE_ANY_ACCESS 0
#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS)
#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe
#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe
#endif // _DEVIOCTL_
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
#ifndef _NTDDSTOR_H_
#define _NTDDSTOR_H_
#if defined __cplusplus && !defined __ALT_GENERATOR__
extern
"C"
{
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
#define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_CHECK_VERIFY2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_LOAD_MEDIA2 CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_SET_HOTPLUG_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_BREAK_RESERVATION CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_PERSISTENT_RESERVE_IN CTL_CODE(IOCTL_STORAGE_BASE, 0x0406, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT CTL_CODE(IOCTL_STORAGE_BASE, 0x0407, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0421, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_PREDICT_FAILURE CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_FAILURE_PREDICTION_CONFIG CTL_CODE(IOCTL_STORAGE_BASE, 0x0441, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_COUNTERS CTL_CODE(IOCTL_STORAGE_BASE, 0x442, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_READ_CAPACITY CTL_CODE(IOCTL_STORAGE_BASE, 0x0450, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_TELEMETRY CTL_CODE(IOCTL_STORAGE_BASE, 0x0470, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_DEVICE_TELEMETRY_NOTIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0471, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_DEVICE_TELEMETRY_QUERY_CAPS CTL_CODE(IOCTL_STORAGE_BASE, 0x0472, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_TELEMETRY_RAW CTL_CODE(IOCTL_STORAGE_BASE, 0x0473, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_SET_TEMPERATURE_THRESHOLD CTL_CODE(IOCTL_STORAGE_BASE, 0x0480, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_PROTOCOL_COMMAND CTL_CODE(IOCTL_STORAGE_BASE, 0x04F0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES CTL_CODE(IOCTL_STORAGE_BASE, 0x0501, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_LB_PROVISIONING_MAP_RESOURCES CTL_CODE(IOCTL_STORAGE_BASE, 0x0502, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_SET_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0503, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_REINITIALIZE_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0590, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_GET_BC_PROPERTIES CTL_CODE(IOCTL_STORAGE_BASE, 0x0600, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_ALLOCATE_BC_STREAM CTL_CODE(IOCTL_STORAGE_BASE, 0x0601, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_FREE_BC_STREAM CTL_CODE(IOCTL_STORAGE_BASE, 0x0602, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT CTL_CODE(IOCTL_STORAGE_BASE, 0x0620, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_START_DATA_INTEGRITY_CHECK CTL_CODE(IOCTL_STORAGE_BASE, 0x0621, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_STOP_DATA_INTEGRITY_CHECK CTL_CODE(IOCTL_STORAGE_BASE, 0x0622, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define OBSOLETE_IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_FIRMWARE_GET_INFO CTL_CODE(IOCTL_STORAGE_BASE, 0x0700, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_FIRMWARE_DOWNLOAD CTL_CODE(IOCTL_STORAGE_BASE, 0x0701, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_FIRMWARE_ACTIVATE CTL_CODE(IOCTL_STORAGE_BASE, 0x0702, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_ENABLE_IDLE_POWER CTL_CODE(IOCTL_STORAGE_BASE, 0x0720, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_IDLE_POWERUP_REASON CTL_CODE(IOCTL_STORAGE_BASE, 0x0721, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_POWER_ACTIVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0722, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_POWER_IDLE CTL_CODE(IOCTL_STORAGE_BASE, 0x0723, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_EVENT_NOTIFICATION CTL_CODE(IOCTL_STORAGE_BASE, 0x0724, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_DEVICE_POWER_CAP CTL_CODE(IOCTL_STORAGE_BASE, 0x0725, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_RPMB_COMMAND CTL_CODE(IOCTL_STORAGE_BASE, 0x0726, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_ATTRIBUTE_MANAGEMENT CTL_CODE(IOCTL_STORAGE_BASE, 0x0727, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_DIAGNOSTIC CTL_CODE(IOCTL_STORAGE_BASE, 0x0728, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_PHYSICAL_ELEMENT_STATUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0729, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_REMOVE_ELEMENT_AND_TRUNCATE CTL_CODE(IOCTL_STORAGE_BASE, 0x0730, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef
struct
{
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
STORAGE_DEVICE_NUMBER Devices[ANYSIZE_ARRAY];
}
, *
;
#define STORAGE_DEVICE_FLAGS_RANDOM_DEVICEGUID_REASON_CONFLICT 0x1
#define STORAGE_DEVICE_FLAGS_RANDOM_DEVICEGUID_REASON_NOHWID 0x2
#define STORAGE_DEVICE_FLAGS_PAGE_83_DEVICEGUID 0x4
typedef
struct
_STORAGE_DEVICE_NUMBER_EX
{
;
;
;
;
;
;
}
, *
PSTORAGE_DEVICE_NUMBER_EX
;
typedef
struct
_STORAGE_BUS_RESET_REQUEST
{
;
}
STORAGE_BUS_RESET_REQUEST
, *
PSTORAGE_BUS_RESET_REQUEST
;
typedef
struct
STORAGE_BREAK_RESERVATION_REQUEST
{
;
;
;
;
;
}
STORAGE_BREAK_RESERVATION_REQUEST
, *
PSTORAGE_BREAK_RESERVATION_REQUEST
;
typedef
struct
{
;
}
, *
;
typedef
struct
_CLASS_MEDIA_CHANGE_CONTEXT
{
;
;
}
CLASS_MEDIA_CHANGE_CONTEXT
, *
PCLASS_MEDIA_CHANGE_CONTEXT
;
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
;
#define RECOVERED_WRITES_VALID 0x00000001
#define UNRECOVERED_WRITES_VALID 0x00000002
#define RECOVERED_READS_VALID 0x00000004
#define UNRECOVERED_READS_VALID 0x00000008
#define WRITE_COMPRESSION_INFO_VALID 0x00000010
#define READ_COMPRESSION_INFO_VALID 0x00000020
typedef
struct
{
;
}
, *
;
#define TAPE_RETURN_STATISTICS 0L
#define TAPE_RETURN_ENV_INFO 1L
#define TAPE_RESET_STATISTICS 2L
typedef
enum
{
=
0x20
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
#if (NTDDI_VERSION < NTDDI_WINXP)
STK_EAGLE, // STK Eagle
#else
,
#endif
,
,
,
,
,
,
,
,
}
, *
;
#define MEDIA_ERASEABLE 0x00000001
#define MEDIA_WRITE_ONCE 0x00000002
#define MEDIA_READ_ONLY 0x00000004
#define MEDIA_READ_WRITE 0x00000008
#define MEDIA_WRITE_PROTECTED 0x00000100
#define MEDIA_CURRENTLY_MOUNTED 0x80000000
typedef enum __WRAPPED__ _STORAGE_BUS_TYPE {
=
0x00
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
=
0x7F
}
, *
;
#define SupportsDeviceSharing( BusType ) ( \
(BusType == BusTypeScsi) || \
(BusType == BusTypeFibre) || \
(BusType == BusTypeiScsi) || \
(BusType == BusTypeSas) || \
(BusType == BusTypeSpaces) )
typedef
struct
{
union
{
struct
{
;
;
;
;
;
;
;
}
;
struct
{
;
;
;
;
;
;
;
}
;
struct
{
;
;
;
;
union
{
struct
{
;
;
}
;
}
;
}
;
}
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
{
;
[
512
];
}
, *
;
typedef
struct
_STORAGE_FAILURE_PREDICTION_CONFIG
{
;
;
;
;
;
}
STORAGE_FAILURE_PREDICTION_CONFIG
, *
PSTORAGE_FAILURE_PREDICTION_CONFIG
;
#define STORAGE_FAILURE_PREDICTION_CONFIG_V1 1
typedef
enum
{
=
0
,
,
,
}
, *
;
typedef enum __WRAPPED__ _STORAGE_PROPERTY_ID {
=
0
,
,
,
StorageDeviceUniqueIdProperty
,
StorageDeviceWriteCacheProperty
,
,
StorageAccessAlignmentProperty
,
StorageDeviceSeekPenaltyProperty
,
StorageDeviceTrimProperty
,
StorageDeviceWriteAggregationProperty
,
StorageDeviceDeviceTelemetryProperty
,
StorageDeviceLBProvisioningProperty
,
StorageDevicePowerProperty
,
StorageDeviceCopyOffloadProperty
,
StorageDeviceResiliencyProperty
,
StorageDeviceMediumProductType
,
StorageAdapterRpmbProperty
,
StorageAdapterCryptoProperty
,
StorageDeviceIoCapabilityProperty
=
48
,
StorageAdapterProtocolSpecificProperty
,
StorageDeviceProtocolSpecificProperty
,
StorageAdapterTemperatureProperty
,
StorageDeviceTemperatureProperty
,
StorageAdapterPhysicalTopologyProperty
,
StorageDevicePhysicalTopologyProperty
,
StorageDeviceAttributesProperty
,
StorageDeviceManagementStatus
,
StorageAdapterSerialNumberProperty
,
StorageDeviceLocationProperty
,
StorageDeviceNumaProperty
,
StorageDeviceZonedDeviceProperty
,
StorageDeviceUnsafeShutdownCount
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DESCRIPTOR_HEADER {
__WRAPPED__
;
__WRAPPED__
;
} , *;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DEVICE_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
[
1
];
}
STORAGE_DEVICE_DESCRIPTOR
, *
PSTORAGE_DEVICE_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_ADAPTER_DESCRIPTOR {
typedef
struct
_STORAGE_ADAPTER_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
#if (NTDDI_VERSION < NTDDI_WINXP)
BOOLEAN BusType;
#else
__WRAPPED__
;
#endif
__WRAPPED__
;
__WRAPPED__
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
__WRAPPED__
;
__WRAPPED__
;
#endif
}
STORAGE_ADAPTER_DESCRIPTOR
, *
PSTORAGE_ADAPTER_DESCRIPTOR
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define NO_SRBTYPE_ADAPTER_DESCRIPTOR_SIZE \
UFIELD_OFFSET(STORAGE_ADAPTER_DESCRIPTOR, SrbType)
#if !defined(SRB_TYPE_SCSI_REQUEST_BLOCK)
#define SRB_TYPE_SCSI_REQUEST_BLOCK 0
#endif
#if !defined(SRB_TYPE_STORAGE_REQUEST_BLOCK)
#define SRB_TYPE_STORAGE_REQUEST_BLOCK 1
#endif
#if !defined(STORAGE_ADDRESS_TYPE_BTL8)
#define STORAGE_ADDRESS_TYPE_BTL8 0
#endif
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
typedef
struct
_STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
BytesOffsetForCacheAlignment
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
BytesOffsetForSectorAlignment
;
}
STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR
, *
PSTORAGE_ACCESS_ALIGNMENT_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct _STORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR {
typedef
struct
_STORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR
{
;
;
;
}
STORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR
, *
PSTORAGE_MEDIUM_PRODUCT_TYPE_DESCRIPTOR
;
typedef enum __WRAPPED__ _STORAGE_PORT_CODE_SET {
StoragePortCodeSetReserved
=
0
,
StoragePortCodeSetStorport
=
1
,
StoragePortCodeSetSCSIport
=
2
,
StoragePortCodeSetSpaceport
=
3
,
StoragePortCodeSetATAport
=
4
,
StoragePortCodeSetUSBport
=
5
,
StoragePortCodeSetSBP2port
=
6
,
=
7
}
, *
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define STORAGE_MINIPORT_DESCRIPTOR_V1_SIZE RTL_SIZEOF_THROUGH_FIELD(STORAGE_MINIPORT_DESCRIPTOR, IoTimeoutValue)
#endif
typedef struct __WRAPPED__ _STORAGE_MINIPORT_DESCRIPTOR {
typedef
struct
_STORAGE_MINIPORT_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
__WRAPPED__
;
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
__WRAPPED__
;
__WRAPPED__
[
3
];
__WRAPPED__
;
#endif
}
STORAGE_MINIPORT_DESCRIPTOR
, *
PSTORAGE_MINIPORT_DESCRIPTOR
;
typedef enum __WRAPPED__ _STORAGE_IDENTIFIER_CODE_SET {
typedef
enum
_STORAGE_IDENTIFIER_CODE_SET
{
=
0
,
=
1
,
=
2
,
=
3
}
STORAGE_IDENTIFIER_CODE_SET
, *
PSTORAGE_IDENTIFIER_CODE_SET
;
typedef enum __WRAPPED__ _STORAGE_IDENTIFIER_TYPE {
StorageIdTypeVendorSpecific
=
0
,
=
1
,
=
2
,
=
3
,
StorageIdTypePortRelative
=
4
,
StorageIdTypeTargetPortGroup
=
5
,
StorageIdTypeLogicalUnitGroup
=
6
,
StorageIdTypeMD5LogicalUnitIdentifier
=
7
,
StorageIdTypeScsiNameString
=
8
}
, *
;
#define StorageIdTypeNAA StorageIdTypeFCPHName
typedef enum __WRAPPED__ _STORAGE_ID_NAA_FORMAT {
=
2
,
=
3
,
=
5
}
, *
;
typedef enum __WRAPPED__ _STORAGE_ASSOCIATION_TYPE {
typedef
enum
_STORAGE_ASSOCIATION_TYPE
{
=
0
,
=
1
,
=
2
}
, *
PSTORAGE_ASSOCIATION_TYPE
;
typedef struct __WRAPPED__ _STORAGE_IDENTIFIER {
__WRAPPED__
STORAGE_IDENTIFIER_CODE_SET
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
[
1
];
}
, *
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DEVICE_ID_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_ID_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
[
1
];
}
STORAGE_DEVICE_ID_DESCRIPTOR
, *
PSTORAGE_DEVICE_ID_DESCRIPTOR
;
typedef struct __WRAPPED__ _DEVICE_SEEK_PENALTY_DESCRIPTOR {
typedef
struct
_DEVICE_SEEK_PENALTY_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
DEVICE_SEEK_PENALTY_DESCRIPTOR
, *
PDEVICE_SEEK_PENALTY_DESCRIPTOR
;
typedef
struct
_DEVICE_WRITE_AGGREGATION_DESCRIPTOR
{
;
;
BenefitsFromWriteAggregation
;
}
DEVICE_WRITE_AGGREGATION_DESCRIPTOR
, *
PDEVICE_WRITE_AGGREGATION_DESCRIPTOR
;
typedef struct __WRAPPED__ _DEVICE_TRIM_DESCRIPTOR {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
, *
;
#pragma warning(push)
#pragma warning(disable:4214) // bit fields other than int
#pragma warning(disable:
4214
)
typedef struct __WRAPPED__ _DEVICE_LB_PROVISIONING_DESCRIPTOR {
typedef
struct
_DEVICE_LB_PROVISIONING_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
:
1
;
__WRAPPED__
ThinProvisioningReadZeros
:
1
;
__WRAPPED__
:
3
;
__WRAPPED__
UnmapGranularityAlignmentValid
:
1
;
__WRAPPED__
:
2
;
__WRAPPED__
[
7
];
__WRAPPED__
;
__WRAPPED__
UnmapGranularityAlignment
;
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
__WRAPPED__
;
__WRAPPED__
MaxUnmapBlockDescriptorCount
;
#endif
}
DEVICE_LB_PROVISIONING_DESCRIPTOR
, *
PDEVICE_LB_PROVISIONING_DESCRIPTOR
;
#define DEVICE_LB_PROVISIONING_DESCRIPTOR_V1_SIZE RTL_SIZEOF_THROUGH_FIELD(DEVICE_LB_PROVISIONING_DESCRIPTOR, UnmapGranularityAlignment)
typedef
struct
_STORAGE_LB_PROVISIONING_MAP_RESOURCES
{
;
;
AvailableMappingResourcesValid
:
1
;
UsedMappingResourcesValid
:
1
;
:
6
;
[
3
];
AvailableMappingResourcesScope
:
2
;
UsedMappingResourcesScope
:
2
;
:
4
;
[
3
];
AvailableMappingResources
;
;
}
STORAGE_LB_PROVISIONING_MAP_RESOURCES
, *
PSTORAGE_LB_PROVISIONING_MAP_RESOURCES
;
#pragma warning(pop)
typedef
struct
{
;
;
;
AsynchronousNotificationSupported
;
IdlePowerManagementEnabled
;
;
;
;
[
2
];
;
}
, *
;
typedef
struct
_DEVICE_COPY_OFFLOAD_DESCRIPTOR
{
;
;
;
;
;
;
;
MaximumTransferLengthPerDescriptor
;
OptimalTransferLengthPerDescriptor
;
OptimalTransferLengthGranularity
;
[
2
];
}
DEVICE_COPY_OFFLOAD_DESCRIPTOR
, *
PDEVICE_COPY_OFFLOAD_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DEVICE_RESILIENCY_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_RESILIENCY_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
STORAGE_DEVICE_RESILIENCY_DESCRIPTOR
, *
PSTORAGE_DEVICE_RESILIENCY_DESCRIPTOR
;
typedef
enum
{
StorageRpmbFrameTypeUnknown
=
0
,
StorageRpmbFrameTypeStandard
,
,
}
, *
;
#define STORAGE_RPMB_DESCRIPTOR_VERSION_1 1
#define STORAGE_RPMB_MINIMUM_RELIABLE_WRITE_SIZE 512
typedef
struct
{
;
;
;
MaxReliableWriteSizeInBytes
;
;
}
, *
;
typedef
enum
_STORAGE_CRYPTO_ALGORITHM_ID
{
StorageCryptoAlgorithmUnknown
=
0
,
StorageCryptoAlgorithmXTSAES
=
1
,
StorageCryptoAlgorithmBitlockerAESCBC
,
StorageCryptoAlgorithmAESECB
,
StorageCryptoAlgorithmESSIVAESCBC
,
StorageCryptoAlgorithmMax
}
STORAGE_CRYPTO_ALGORITHM_ID
, *
PSTORAGE_CRYPTO_ALGORITHM_ID
;
typedef
enum
{
StorageCryptoKeySizeUnknown
=
0
,
StorageCryptoKeySize128Bits
=
1
,
StorageCryptoKeySize192Bits
,
StorageCryptoKeySize256Bits
,
StorageCryptoKeySize512Bits
}
, *
;
#define STORAGE_CRYPTO_CAPABILITY_VERSION_1 1
typedef
struct
_STORAGE_CRYPTO_CAPABILITY
{
;
;
;
STORAGE_CRYPTO_ALGORITHM_ID
;
;
;
}
STORAGE_CRYPTO_CAPABILITY
, *
PSTORAGE_CRYPTO_CAPABILITY
;
#define STORAGE_CRYPTO_DESCRIPTOR_VERSION_1 1
typedef
struct
_STORAGE_CRYPTO_DESCRIPTOR
{
;
;
;
;
_Field_size_(NumCryptoCapabilities) STORAGE_CRYPTO_CAPABILITY CryptoCapabilities[ANYSIZE_ARRAY];
STORAGE_CRYPTO_CAPABILITY
[
1
];
}
STORAGE_CRYPTO_DESCRIPTOR
, *
PSTORAGE_CRYPTO_DESCRIPTOR
;
#define STORAGE_TIER_NAME_LENGTH (256)
#define STORAGE_TIER_DESCRIPTION_LENGTH (512)
#define STORAGE_TIER_FLAG_NO_SEEK_PENALTY (0x00020000)
#define STORAGE_TIER_FLAG_WRITE_BACK_CACHE (0x00200000)
#define STORAGE_TIER_FLAG_READ_CACHE (0x00400000)
#define STORAGE_TIER_FLAG_PARITY (0x00800000)
#define STORAGE_TIER_FLAG_SMR (0x01000000)
typedef
enum
{
=
0
,
=
1
,
=
2
,
=
4
,
}
, *
;
typedef
enum
{
StorageTierClassUnspecified
=
0
,
,
,
}
, *
;
typedef
struct
{
;
WCHAR Name[STORAGE_TIER_NAME_LENGTH];
WCHAR Description[STORAGE_TIER_NAME_LENGTH];
;
;
;
;
}
, *
;
typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_TIERING_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_TIERING_DESCRIPTOR
{
;
;
;
;
;
_Field_size_(NumberOfTiersReturned) STORAGE_TIER Tiers[ANYSIZE_ARRAY];
}
STORAGE_DEVICE_TIERING_DESCRIPTOR
, *
PSTORAGE_DEVICE_TIERING_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DEVICE_FAULT_DOMAIN_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_FAULT_DOMAIN_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
_Field_size_(NumberOfFaultDomains)
__WRAPPED__
GUID FaultDomainIds[ANYSIZE_ARRAY];
}
STORAGE_DEVICE_FAULT_DOMAIN_DESCRIPTOR
, *
PSTORAGE_DEVICE_FAULT_DOMAIN_DESCRIPTOR
;
typedef
enum
{
=
0x00
,
,
,
,
,
,
=
0x7E
,
=
0x7F
}
, *
;
typedef
enum
_STORAGE_PROTOCOL_NVME_DATA_TYPE
{
=
0
,
,
,
,
}
STORAGE_PROTOCOL_NVME_DATA_TYPE
, *
PSTORAGE_PROTOCOL_NVME_DATA_TYPE
;
typedef
enum
_STORAGE_PROTOCOL_ATA_DATA_TYPE
{
=
0
,
,
,
}
STORAGE_PROTOCOL_ATA_DATA_TYPE
, *
PSTORAGE_PROTOCOL_ATA_DATA_TYPE
;
typedef
enum
_STORAGE_PROTOCOL_UFS_DATA_TYPE
{
=
0
,
UfsDataTypeQueryDescriptor
,
,
}
STORAGE_PROTOCOL_UFS_DATA_TYPE
, *
PSTORAGE_PROTOCOL_UFS_DATA_TYPE
;
typedef
struct
_STORAGE_PROTOCOL_SPECIFIC_DATA
{
;
;
;
ProtocolDataRequestSubValue
;
;
;
;
ProtocolDataRequestSubValue2
;
[
2
];
}
STORAGE_PROTOCOL_SPECIFIC_DATA
, *
PSTORAGE_PROTOCOL_SPECIFIC_DATA
;
typedef
struct
_STORAGE_PROTOCOL_DATA_DESCRIPTOR
{
;
;
STORAGE_PROTOCOL_SPECIFIC_DATA
;
}
STORAGE_PROTOCOL_DATA_DESCRIPTOR
, *
PSTORAGE_PROTOCOL_DATA_DESCRIPTOR
;
#define STORAGE_TEMPERATURE_VALUE_NOT_REPORTED 0x8000
typedef
struct
_STORAGE_TEMPERATURE_INFO
{
;
;
;
;
;
;
;
;
;
}
, *
PSTORAGE_TEMPERATURE_INFO
;
typedef
struct
_STORAGE_TEMPERATURE_DATA_DESCRIPTOR
{
;
;
;
;
;
[
2
];
[
2
];
STORAGE_TEMPERATURE_INFO TemperatureInfo[ANYSIZE_ARRAY];
}
STORAGE_TEMPERATURE_DATA_DESCRIPTOR
, *
PSTORAGE_TEMPERATURE_DATA_DESCRIPTOR
;
#define STORAGE_TEMPERATURE_THRESHOLD_FLAG_ADAPTER_REQUEST 0x0001
typedef
struct
_STORAGE_TEMPERATURE_THRESHOLD
{
;
;
;
;
;
;
;
}
STORAGE_TEMPERATURE_THRESHOLD
, *
PSTORAGE_TEMPERATURE_THRESHOLD
;
#define STORAGE_COMPONENT_ROLE_CACHE 0x00000001
#define STORAGE_COMPONENT_ROLE_TIERING 0x00000002
#define STORAGE_COMPONENT_ROLE_DATA 0x00000004
typedef
enum
{
=
0
,
,
,
,
,
,
,
,
,
,
,
}
, *
;
typedef
enum
_STORAGE_COMPONENT_HEALTH_STATUS
{
=
0
,
,
,
,
,
,
}
STORAGE_COMPONENT_HEALTH_STATUS
, *
PSTORAGE_COMPONENT_HEALTH_STATUS
;
#pragma warning(push)
#pragma warning(disable:4201) // nameless struct/unions
#pragma warning(disable:
4201
)
typedef
union
{
struct
{
union
{
struct
{
;
;
;
}
;
;
;
}
, *
;
#pragma warning(pop)
typedef
struct
_STORAGE_PHYSICAL_DEVICE_DATA
{
;
;
STORAGE_COMPONENT_HEALTH_STATUS
;
;
;
STORAGE_DEVICE_FORM_FACTOR
;
[
8
];
[
40
];
[
16
];
;
[
32
];
[
2
];
}
STORAGE_PHYSICAL_DEVICE_DATA
, *
PSTORAGE_PHYSICAL_DEVICE_DATA
;
typedef
struct
_STORAGE_PHYSICAL_ADAPTER_DATA
{
;
STORAGE_COMPONENT_HEALTH_STATUS
;
;
;
[
8
];
[
40
];
[
16
];
[
32
];
;
[
3
];
[
3
];
}
STORAGE_PHYSICAL_ADAPTER_DATA
, *
PSTORAGE_PHYSICAL_ADAPTER_DATA
;
typedef
struct
_STORAGE_PHYSICAL_NODE_DATA
{
;
;
;
;
;
;
;
[
3
];
}
STORAGE_PHYSICAL_NODE_DATA
, *
PSTORAGE_PHYSICAL_NODE_DATA
;
typedef
struct
_STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR
{
;
;
;
;
STORAGE_PHYSICAL_NODE_DATA Node[ANYSIZE_ARRAY];
STORAGE_PHYSICAL_NODE_DATA
[
1
];
}
STORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR
, *
PSTORAGE_PHYSICAL_TOPOLOGY_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_IO_CAPABILITY_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_IO_CAPABILITY_DESCRIPTOR
{
;
;
;
;
}
STORAGE_DEVICE_IO_CAPABILITY_DESCRIPTOR
, *
PSTORAGE_DEVICE_IO_CAPABILITY_DESCRIPTOR
;
typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_ATTRIBUTES_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_ATTRIBUTES_DESCRIPTOR
{
;
;
;
}
STORAGE_DEVICE_ATTRIBUTES_DESCRIPTOR
, *
PSTORAGE_DEVICE_ATTRIBUTES_DESCRIPTOR
;
#define STORAGE_ATTRIBUTE_BYTE_ADDRESSABLE_IO 0x01
#define STORAGE_ATTRIBUTE_BLOCK_IO 0x02
#define STORAGE_ATTRIBUTE_DYNAMIC_PERSISTENCE 0x04
#define STORAGE_ATTRIBUTE_VOLATILE 0x08
#define STORAGE_ATTRIBUTE_ASYNC_EVENT_NOTIFICATION 0x10
#define STORAGE_ATTRIBUTE_PERF_SIZE_INDEPENDENT 0x20
typedef
enum
_STORAGE_DISK_HEALTH_STATUS
{
=
0
,
,
,
,
}
STORAGE_DISK_HEALTH_STATUS
, *
PSTORAGE_DISK_HEALTH_STATUS
;
typedef
enum
_STORAGE_DISK_OPERATIONAL_STATUS
{
=
0
,
,
,
DiskOpStatusPredictingFailure
,
,
DiskOpStatusHardwareError
,
,
DiskOpStatusTransientError
,
,
}
STORAGE_DISK_OPERATIONAL_STATUS
, *
PSTORAGE_DISK_OPERATIONAL_STATUS
;
typedef
enum
_STORAGE_OPERATIONAL_STATUS_REASON
{
=
0
,
DiskOpReasonScsiSenseCode
,
,
,
DiskOpReasonThresholdExceeded
,
,
,
DiskOpReasonConfiguration
,
DiskOpReasonDeviceController
,
,
,
,
DiskOpReasonBackgroundOperation
,
DiskOpReasonInvalidFirmware
,
,
DiskOpReasonLostDataPersistence
,
,
DiskOpReasonLostWritePersistence
,
DiskOpReasonDataPersistenceLossImminent
,
DiskOpReasonWritePersistenceLossImminent
,
}
STORAGE_OPERATIONAL_STATUS_REASON
, *
PSTORAGE_OPERATIONAL_STATUS_REASON
;
typedef
struct
_STORAGE_OPERATIONAL_REASON
{
;
;
STORAGE_OPERATIONAL_STATUS_REASON
;
union
{
struct
{
;
;
;
;
}
;
struct
{
;
[
2
];
;
}
;
;
}
;
}
STORAGE_OPERATIONAL_REASON
, *
PSTORAGE_OPERATIONAL_REASON
;
#define STORAGE_DEVICE_MAX_OPERATIONAL_STATUS 16
typedef
struct
_STORAGE_DEVICE_MANAGEMENT_STATUS
{
;
;
STORAGE_DISK_HEALTH_STATUS
;
NumberOfOperationalStatus
;
NumberOfAdditionalReasons
;
STORAGE_DISK_OPERATIONAL_STATUS OperationalStatus[STORAGE_DEVICE_MAX_OPERATIONAL_STATUS];
STORAGE_DISK_OPERATIONAL_STATUS
[
16
];
STORAGE_OPERATIONAL_REASON AdditionalReasons[ANYSIZE_ARRAY];
STORAGE_OPERATIONAL_REASON
[
1
];
}
STORAGE_DEVICE_MANAGEMENT_STATUS
, *
PSTORAGE_DEVICE_MANAGEMENT_STATUS
;
#define STORAGE_ADAPTER_SERIAL_NUMBER_V1_MAX_LENGTH (128)
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_ADAPTER_SERIAL_NUMBER {
typedef
struct
_STORAGE_ADAPTER_SERIAL_NUMBER
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
WCHAR SerialNumber[STORAGE_ADAPTER_SERIAL_NUMBER_V1_MAX_LENGTH];
}
STORAGE_ADAPTER_SERIAL_NUMBER
, *
PSTORAGE_ADAPTER_SERIAL_NUMBER
;
#define STORAGE_ADAPTER_SERIAL_NUMBER_V1_VERSION (sizeof(STORAGE_ADAPTER_SERIAL_NUMBER))
#define STORAGE_ADAPTER_SERIAL_NUMBER_V1_SIZE (sizeof(STORAGE_ADAPTER_SERIAL_NUMBER))
typedef enum __WRAPPED__ _STORAGE_ZONED_DEVICE_TYPES {
typedef
enum
_STORAGE_ZONED_DEVICE_TYPES
{
=
0
,
ZonedDeviceTypeHostManaged
,
,
ZonedDeviceTypeDeviceManaged
,
}
STORAGE_ZONED_DEVICE_TYPES
, *
PSTORAGE_ZONED_DEVICE_TYPES
;
typedef enum __WRAPPED__ _STORAGE_ZONE_TYPES {
=
0
,
=
1
,
ZoneTypeSequentialWriteRequired
=
2
,
ZoneTypeSequentialWritePreferred
=
3
,
}
, *
;
typedef struct __WRAPPED__ _STORAGE_ZONE_GROUP {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
, *
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_ZONED_DEVICE_DESCRIPTOR {
typedef
struct
_STORAGE_ZONED_DEVICE_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
STORAGE_ZONED_DEVICE_TYPES
;
__WRAPPED__
;
union
{
struct
{
;
;
[
3
];
}
;
struct
{
;
;
}
;
}
;
__WRAPPED__
;
__WRAPPED__
STORAGE_ZONE_GROUP ZoneGroup[ANYSIZE_ARRAY];
}
STORAGE_ZONED_DEVICE_DESCRIPTOR
, *
PSTORAGE_ZONED_DEVICE_DESCRIPTOR
;
#pragma warning(push)
#pragma warning(disable:4201) // nameless struct/unions
#pragma warning(disable:
4201
)
typedef struct __WRAPPED__ _DEVICE_LOCATION {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
union
{
struct
{
;
;
struct
{
;
;
}
, *
;
#pragma warning(pop)
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_DEVICE_LOCATION_DESCRIPTOR {
typedef
struct
_STORAGE_DEVICE_LOCATION_DESCRIPTOR
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
STORAGE_DEVICE_LOCATION_DESCRIPTOR
, *
PSTORAGE_DEVICE_LOCATION_DESCRIPTOR
;
typedef
struct
_STORAGE_DEVICE_NUMA_PROPERTY
{
;
;
;
}
STORAGE_DEVICE_NUMA_PROPERTY
, *
PSTORAGE_DEVICE_NUMA_PROPERTY
;
#define STORAGE_DEVICE_NUMA_NODE_UNKNOWN MAXDWORD
typedef
struct
_STORAGE_DEVICE_UNSAFE_SHUTDOWN_COUNT
{
;
;
;
}
STORAGE_DEVICE_UNSAFE_SHUTDOWN_COUNT
, *
PSTORAGE_DEVICE_UNSAFE_SHUTDOWN_COUNT
;
typedef
DEVICE_DATA_MANAGEMENT_SET_ACTION
,
;
#define DeviceDsmActionFlag_NonDestructive (0x80000000)
#define IsDsmActionNonDestructive(_Action) ((BOOLEAN)((_Action & DeviceDsmActionFlag_NonDestructive) != 0))
#define DeviceDsmAction_None (0x00000000u)
#define DeviceDsmAction_Trim (0x00000001u)
#define DeviceDsmAction_Notification (0x00000002u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_OffloadRead (0x00000003u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_OffloadWrite (0x00000004u)
#define DeviceDsmAction_Allocation (0x00000005u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_Repair (0x00000006u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_Scrub (0x00000007u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_DrtQuery (0x00000008u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_DrtClear (0x00000009u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_DrtDisable (0x0000000Au | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_TieringQuery (0x0000000Bu | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_Map (0x0000000Cu | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_RegenerateParity (0x0000000Du | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_NvCache_Change_Priority (0x0000000Eu | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_NvCache_Evict (0x0000000Fu | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_TopologyIdQuery (0x00000010u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_GetPhysicalAddresses (0x00000011u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_ScopeRegen (0x00000012u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_ReportZones (0x00000013u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_OpenZone (0x00000014u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_FinishZone (0x00000015u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_CloseZone (0x00000016u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_ResetWritePointer (0x00000017u)
#define DeviceDsmAction_GetRangeErrorInfo (0x00000018u | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_WriteZeroes (0x00000019u)
#define DeviceDsmAction_LostQuery (0x0000001Au | DeviceDsmActionFlag_NonDestructive)
#define DeviceDsmAction_GetFreeSpace (0x0000001Bu | DeviceDsmActionFlag_NonDestructive)
#define DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE 0x00000001
typedef
struct
{
;
;
}
, *
,
, *
;
typedef
struct
_DEVICE_MANAGE_DATA_SET_ATTRIBUTES
{
;
;
;
;
;
;
;
}
DEVICE_MANAGE_DATA_SET_ATTRIBUTES
, *
PDEVICE_MANAGE_DATA_SET_ATTRIBUTES
,
, *
;
typedef
struct
_DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
{
;
;
;
;
;
;
;
;
;
}
DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
, *
PDEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
,
, *
;
typedef
struct
{
;
;
;
;
;
;
;
}
, *
;
#define DeviceDsmDefinition_None {DeviceDsmAction_None, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DEVICE_DSM_FLAG_TRIM_NOT_FS_ALLOCATED 0x80000000
#define DEVICE_DSM_FLAG_TRIM_BYPASS_RZAT 0x40000000
#define DeviceDsmDefinition_Trim {DeviceDsmAction_Trim, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DEVICE_DSM_NOTIFY_FLAG_BEGIN 0x00000001
#define DEVICE_DSM_NOTIFY_FLAG_END 0x00000002
typedef
struct
_DEVICE_DSM_NOTIFICATION_PARAMETERS
{
;
;
;
GUID FileTypeID[ANYSIZE_ARRAY];
}
DEVICE_DSM_NOTIFICATION_PARAMETERS
, *
PDEVICE_DSM_NOTIFICATION_PARAMETERS
;
#define DeviceDsmDefinition_Notification {DeviceDsmAction_Notification, \
FALSE, \
__alignof(DEVICE_DSM_NOTIFICATION_PARAMETERS), \
sizeof(DEVICE_DSM_NOTIFICATION_PARAMETERS), \
FALSE, \
0, \
0}
#define STORAGE_OFFLOAD_MAX_TOKEN_LENGTH 512 // Keep as DWORD multiple
#define STORAGE_OFFLOAD_TOKEN_ID_LENGTH 0x1F8
#define STORAGE_OFFLOAD_TOKEN_TYPE_ZERO_DATA 0xFFFF0001
#pragma warning(push)
#pragma warning(disable:4201) // nameless struct/unions
#pragma warning(disable:
4201
)
typedef
struct
{
[
4
];
[
2
];
[
2
];
union
{
struct
{
BYTE Reserved2[STORAGE_OFFLOAD_TOKEN_ID_LENGTH];
}
StorageOffloadZeroDataToken
;
BYTE Token[STORAGE_OFFLOAD_TOKEN_ID_LENGTH];
}
, *
;
#pragma warning(pop)
#define MAKE_ZERO_TOKEN(T) ( \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[0] = 0xFF, \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[1] = 0xFF, \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[2] = 0x00, \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[3] = 0x01, \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenIdLength[0] = 0x01, \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenIdLength[1] = 0xF8 \
)
#define IS_ZERO_TOKEN(T) ( \
(((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[0] == 0xFF && \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[1] == 0xFF && \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[2] == 0x00 && \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenType[3] == 0x01 && \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenIdLength[0] == 0x01 && \
((PSTORAGE_OFFLOAD_TOKEN)T)->TokenIdLength[1] == 0xF8) \
)
typedef
struct
_DEVICE_DSM_OFFLOAD_READ_PARAMETERS
{
;
;
[
2
];
}
DEVICE_DSM_OFFLOAD_READ_PARAMETERS
, *
PDEVICE_DSM_OFFLOAD_READ_PARAMETERS
;
#define STORAGE_OFFLOAD_READ_RANGE_TRUNCATED 0x00000001
typedef
struct
_STORAGE_OFFLOAD_READ_OUTPUT
{
;
;
;
;
;
}
STORAGE_OFFLOAD_READ_OUTPUT
, *
PSTORAGE_OFFLOAD_READ_OUTPUT
;
#define DeviceDsmDefinition_OffloadRead {DeviceDsmAction_OffloadRead, \
FALSE, \
__alignof(DEVICE_DSM_OFFLOAD_READ_PARAMETERS), \
sizeof(DEVICE_DSM_OFFLOAD_READ_PARAMETERS), \
FALSE, \
__alignof(STORAGE_OFFLOAD_READ_OUTPUT), \
sizeof(STORAGE_OFFLOAD_READ_OUTPUT)}
typedef
struct
_DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS
{
;
;
;
;
}
DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS
, *
PDEVICE_DSM_OFFLOAD_WRITE_PARAMETERS
;
#define STORAGE_OFFLOAD_WRITE_RANGE_TRUNCATED 0x0001
#define STORAGE_OFFLOAD_TOKEN_INVALID 0x0002
typedef
struct
_STORAGE_OFFLOAD_WRITE_OUTPUT
{
;
;
;
}
STORAGE_OFFLOAD_WRITE_OUTPUT
, *
PSTORAGE_OFFLOAD_WRITE_OUTPUT
;
#define DeviceDsmDefinition_OffloadWrite {DeviceDsmAction_OffloadWrite, \
FALSE, \
__alignof(DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS), \
sizeof(DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS), \
FALSE, \
__alignof(STORAGE_OFFLOAD_WRITE_OUTPUT), \
sizeof(STORAGE_OFFLOAD_WRITE_OUTPUT)}
#define DEVICE_DSM_FLAG_ALLOCATION_CONSOLIDATEABLE_ONLY 0x40000000
typedef
struct
_DEVICE_DATA_SET_LBP_STATE_PARAMETERS
{
;
;
;
;
}
DEVICE_DATA_SET_LBP_STATE_PARAMETERS
, *
PDEVICE_DATA_SET_LBP_STATE_PARAMETERS
,
DEVICE_DSM_ALLOCATION_PARAMETERS
, *
PDEVICE_DSM_ALLOCATION_PARAMETERS
;
#define DEVICE_DSM_PARAMETERS_V1 1
#define DEVICE_DATA_SET_LBP_STATE_PARAMETERS_VERSION_V1 DEVICE_DSM_PARAMETERS_V1
typedef
struct
_DEVICE_DATA_SET_LB_PROVISIONING_STATE
{
;
;
;
;
SlabAllocationBitMapBitCount
;
SlabAllocationBitMapLength
;
DWORD SlabAllocationBitMap[ANYSIZE_ARRAY];
}
DEVICE_DATA_SET_LB_PROVISIONING_STATE
, *
PDEVICE_DATA_SET_LB_PROVISIONING_STATE
,
DEVICE_DSM_ALLOCATION_OUTPUT
, *
PDEVICE_DSM_ALLOCATION_OUTPUT
;
#define DEVICE_DSM_ALLOCATION_OUTPUT_V1 (sizeof(DEVICE_DSM_ALLOCATION_OUTPUT))
#define DEVICE_DATA_SET_LB_PROVISIONING_STATE_VERSION_V1 DEVICE_DSM_ALLOCATION_OUTPUT_V1
typedef
struct
_DEVICE_DATA_SET_LB_PROVISIONING_STATE_V2
{
;
;
;
;
SlabAllocationBitMapBitCount
;
SlabAllocationBitMapLength
;
DWORD SlabAllocationBitMap[ANYSIZE_ARRAY];
}
DEVICE_DATA_SET_LB_PROVISIONING_STATE_V2
, *
PDEVICE_DATA_SET_LB_PROVISIONING_STATE_V2
,
DEVICE_DSM_ALLOCATION_OUTPUT2
, *
PDEVICE_DSM_ALLOCATION_OUTPUT2
;
#define DEVICE_DSM_ALLOCATION_OUTPUT_V2 (sizeof(DEVICE_DSM_ALLOCATION_OUTPUT2))
#define DEVICE_DATA_SET_LB_PROVISIONING_STATE_VERSION_V2 DEVICE_DSM_ALLOCATION_OUTPUT_V2
#define DeviceDsmDefinition_Allocation {DeviceDsmAction_Allocation, \
TRUE, \
__alignof(DEVICE_DSM_ALLOCATION_PARAMETERS), \
sizeof(DEVICE_DSM_ALLOCATION_PARAMETERS), \
TRUE, \
__alignof(DEVICE_DSM_ALLOCATION_OUTPUT2), \
sizeof(DEVICE_DSM_ALLOCATION_OUTPUT2)}
#define DEVICE_DSM_FLAG_REPAIR_INPUT_TOPOLOGY_ID_PRESENT 0x40000000
typedef
struct
_DEVICE_DATA_SET_REPAIR_PARAMETERS
{
;
;
DWORD RepairCopies[ANYSIZE_ARRAY];
}
DEVICE_DATA_SET_REPAIR_PARAMETERS
, *
PDEVICE_DATA_SET_REPAIR_PARAMETERS
,
DEVICE_DSM_REPAIR_PARAMETERS
, *
PDEVICE_DSM_REPAIR_PARAMETERS
;
#define GET_REPAIR_TOPOLOGY_ID(R) \
RtlOffsetToPointer(R, \
ALIGN_UP_BY(FIELD_OFFSET(DEVICE_DATA_SET_REPAIR_PARAMETERS, RepairCopies) + \
sizeof(DWORD) * R->NumberOfRepairCopies, \
8))
#define DEVICE_DSM_FLAG_REPAIR_OUTPUT_PARITY_EXTENT 0x20000000
typedef
struct
_DEVICE_DATA_SET_REPAIR_OUTPUT
{
;
}
DEVICE_DATA_SET_REPAIR_OUTPUT
, *
PDEVICE_DATA_SET_REPAIR_OUTPUT
,
, *
PDEVICE_DSM_REPAIR_OUTPUT
;
#define DeviceDsmDefinition_Repair {DeviceDsmAction_Repair, \
TRUE, \
__alignof(DEVICE_DSM_REPAIR_PARAMETERS), \
sizeof(DEVICE_DSM_REPAIR_PARAMETERS), \
TRUE, \
__alignof(DEVICE_DSM_REPAIR_OUTPUT), \
sizeof(DEVICE_DSM_REPAIR_OUTPUT)}
#define DEVICE_DSM_FLAG_SCRUB_SKIP_IN_SYNC 0x10000000
typedef
struct
_DEVICE_DATA_SET_SCRUB_OUTPUT
{
;
;
;
}
DEVICE_DATA_SET_SCRUB_OUTPUT
, *
PDEVICE_DATA_SET_SCRUB_OUTPUT
,
, *
;
#define DEVICE_DSM_FLAG_SCRUB_OUTPUT_PARITY_EXTENT 0x20000000
typedef
struct
_DEVICE_DATA_SET_SCRUB_EX_OUTPUT
{
;
;
;
;
}
DEVICE_DATA_SET_SCRUB_EX_OUTPUT
, *
PDEVICE_DATA_SET_SCRUB_EX_OUTPUT
,
, *
PDEVICE_DSM_SCRUB_OUTPUT2
;
#define DeviceDsmDefinition_Scrub {DeviceDsmAction_Scrub, \
FALSE, \
0, \
0, \
TRUE, \
__alignof(DEVICE_DSM_SCRUB_OUTPUT2), \
sizeof(DEVICE_DSM_SCRUB_OUTPUT2)}
#define DeviceDsmDefinition_DrtQuery {DeviceDsmAction_DrtQuery, \
FALSE, \
0, \
0, \
TRUE, \
0, \
0}
#define DeviceDsmDefinition_DrtClear {DeviceDsmAction_DrtClear, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_DrtDisable {DeviceDsmAction_DrtDisable, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
typedef
struct
{
;
;
;
;
GUID TierIds[ANYSIZE_ARRAY];
}
, *
,
DEVICE_DSM_TIERING_QUERY_PARAMETERS
, *
PDEVICE_DSM_TIERING_QUERY_PARAMETERS
;
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
_DEVICE_DSM_TIERING_QUERY_OUTPUT
{
;
;
;
;
;
;
;
_Field_size_(NumberOfRegionsReturned) STORAGE_TIER_REGION Regions[ANYSIZE_ARRAY];
}
DEVICE_DSM_TIERING_QUERY_OUTPUT
, *
PDEVICE_DSM_TIERING_QUERY_OUTPUT
;
#define DeviceDsmDefinition_TieringQuery {DeviceDsmAction_TieringQuery, \
TRUE, \
__alignof(DEVICE_DSM_TIERING_QUERY_PARAMETERS), \
sizeof(DEVICE_DSM_TIERING_QUERY_PARAMETERS), \
TRUE, \
__alignof(DEVICE_DSM_TIERING_QUERY_OUTPUT), \
sizeof(DEVICE_DSM_TIERING_QUERY_OUTPUT)}
#define DeviceDsmDefinition_Map {DeviceDsmAction_Map, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_RegenerateParity {DeviceDsmAction_RegenerateParity, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
typedef
struct
_DEVICE_DSM_NVCACHE_CHANGE_PRIORITY_PARAMETERS
{
;
;
[
3
];
}
DEVICE_DSM_NVCACHE_CHANGE_PRIORITY_PARAMETERS
, *
PDEVICE_DSM_NVCACHE_CHANGE_PRIORITY_PARAMETERS
;
#define DeviceDsmDefinition_NvCache_Change_Priority {DeviceDsmAction_NvCache_Change_Priority, \
FALSE, \
__alignof(DEVICE_DSM_NVCACHE_CHANGE_PRIORITY_PARAMETERS), \
sizeof(DEVICE_DSM_NVCACHE_CHANGE_PRIORITY_PARAMETERS), \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_NvCache_Evict {DeviceDsmAction_NvCache_Evict, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
typedef
struct
_DEVICE_DATA_SET_TOPOLOGY_ID_QUERY_OUTPUT
{
;
[
16
];
}
DEVICE_DATA_SET_TOPOLOGY_ID_QUERY_OUTPUT
, *
PDEVICE_DATA_SET_TOPOLOGY_ID_QUERY_OUTPUT
,
DEVICE_DSM_TOPOLOGY_ID_QUERY_OUTPUT
, *
PDEVICE_DSM_TOPOLOGY_ID_QUERY_OUTPUT
;
#define DeviceDsmDefinition_TopologyIdQuery {DeviceDsmAction_TopologyIdQuery, \
FALSE, \
0, \
0, \
TRUE, \
__alignof(DEVICE_DSM_TOPOLOGY_ID_QUERY_OUTPUT), \
sizeof(DEVICE_DSM_TOPOLOGY_ID_QUERY_OUTPUT)}
#define DEVICE_DSM_FLAG_PHYSICAL_ADDRESSES_OMIT_TOTAL_RANGES 0x10000000
typedef
struct
_DEVICE_STORAGE_ADDRESS_RANGE
{
;
;
}
DEVICE_STORAGE_ADDRESS_RANGE
, *
PDEVICE_STORAGE_ADDRESS_RANGE
;
typedef
struct
_DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT
{
;
;
;
;
DEVICE_STORAGE_ADDRESS_RANGE Ranges[ANYSIZE_ARRAY];
DEVICE_STORAGE_ADDRESS_RANGE
[
1
];
}
DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT
, *
PDEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT
;
#define DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT_V1 1
#define DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT_VERSION_V1 DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT_V1
#define DeviceDsmDefinition_GetPhysicalAddresses {DeviceDsmAction_GetPhysicalAddresses, \
FALSE, \
0, \
0, \
TRUE, \
__alignof(DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT), \
sizeof(DEVICE_DSM_PHYSICAL_ADDRESSES_OUTPUT)}
#define DeviceDsmDefinition_ScopeRegen {DeviceDsmAction_ScopeRegen, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
typedef
struct
_DEVICE_DSM_REPORT_ZONES_PARAMETERS
{
;
;
;
[
2
];
}
DEVICE_DSM_REPORT_ZONES_PARAMETERS
, *
PDEVICE_DSM_REPORT_ZONES_PARAMETERS
;
typedef
enum
_STORAGE_ZONES_ATTRIBUTES
{
ZonesAttributeTypeAndLengthMayDifferent
=
0
,
ZonesAttributeTypeSameLengthSame
=
1
,
ZonesAttributeTypeSameLastZoneLengthDifferent
=
2
,
ZonesAttributeTypeMayDifferentLengthSame
=
3
,
}
, *
PSTORAGE_ZONES_ATTRIBUTES
;
typedef
enum
{
ZoneConditionConventional
=
0x00
,
=
0x01
,
ZoneConditionImplicitlyOpened
=
0x02
,
ZoneConditionExplicitlyOpened
=
0x03
,
=
0x04
,
=
0x0D
,
=
0x0E
,
=
0x0F
,
}
, *
;
typedef
struct
{
;
;
;
ResetWritePointerRecommend
;
[
3
];
;
;
}
, *
;
typedef
struct
_DEVICE_DSM_REPORT_ZONES_DATA
{
;
;
;
;
_Field_size_(ZoneCount) STORAGE_ZONE_DESCRIPTOR ZoneDescriptors[ANYSIZE_ARRAY];
}
DEVICE_DSM_REPORT_ZONES_DATA
, *
PDEVICE_DSM_REPORT_ZONES_DATA
,
DEVICE_DSM_REPORT_ZONES_OUTPUT
, *
PDEVICE_DSM_REPORT_ZONES_OUTPUT
;
#define DeviceDsmDefinition_ReportZones {DeviceDsmAction_ReportZones, \
FALSE, \
__alignof(DEVICE_DSM_REPORT_ZONES_PARAMETERS), \
sizeof(DEVICE_DSM_REPORT_ZONES_PARAMETERS), \
TRUE, \
__alignof(DEVICE_DSM_REPORT_ZONES_OUTPUT), \
sizeof(DEVICE_DSM_REPORT_ZONES_OUTPUT)}
#define DeviceDsmDefinition_OpenZone {DeviceDsmAction_OpenZone, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_FinishZone {DeviceDsmAction_FinishZone, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_CloseZone {DeviceDsmAction_CloseZone, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#define DeviceDsmDefinition_ResetWritePointer {DeviceDsmAction_ResetWritePointer, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
#pragma warning(push)
#pragma warning(disable:4201) // nameless struct/unions
#pragma warning(disable:
4201
)
#pragma warning(disable:4214) // bit fields other than int
#pragma warning(disable:
4214
)
typedef
struct
_DEVICE_STORAGE_RANGE_ATTRIBUTES
{
;
union
{
;
struct
{
:
1
;
};
};
;
}
DEVICE_STORAGE_RANGE_ATTRIBUTES
, *
PDEVICE_STORAGE_RANGE_ATTRIBUTES
;
#pragma warning(pop)
#define DEVICE_STORAGE_NO_ERRORS 0x1
typedef
struct
_DEVICE_DSM_RANGE_ERROR_INFO
{
;
;
;
;
DEVICE_STORAGE_RANGE_ATTRIBUTES Ranges[ANYSIZE_ARRAY];
DEVICE_STORAGE_RANGE_ATTRIBUTES
[
1
];
}
DEVICE_DSM_RANGE_ERROR_INFO
, *
PDEVICE_DSM_RANGE_ERROR_INFO
,
DEVICE_DSM_RANGE_ERROR_OUTPUT
, *
PDEVICE_DSM_RANGE_ERROR_OUTPUT
;
#define DEVICE_DSM_RANGE_ERROR_OUTPUT_V1 1
#define DEVICE_DSM_RANGE_ERROR_INFO_VERSION_V1 DEVICE_DSM_RANGE_ERROR_OUTPUT_V1
#define DeviceDsmDefinition_GetRangeErrorInfo {DeviceDsmAction_GetRangeErrorInfo, \
FALSE, \
0, \
0, \
TRUE, \
__alignof(DEVICE_DSM_RANGE_ERROR_OUTPUT), \
sizeof(DEVICE_DSM_RANGE_ERROR_OUTPUT)}
#define DeviceDsmDefinition_WriteZeroes {DeviceDsmAction_WriteZeroes, \
FALSE, \
0, \
0, \
FALSE, \
0, \
0}
typedef
struct
_DEVICE_DSM_LOST_QUERY_PARAMETERS
{
;
;
}
DEVICE_DSM_LOST_QUERY_PARAMETERS
, *
PDEVICE_DSM_LOST_QUERY_PARAMETERS
;
typedef
struct
_DEVICE_DSM_LOST_QUERY_OUTPUT
{
;
;
;
;
DWORD BitMap[ANYSIZE_ARRAY];
}
DEVICE_DSM_LOST_QUERY_OUTPUT
, *
PDEVICE_DSM_LOST_QUERY_OUTPUT
;
#define DeviceDsmDefinition_LostQuery {DeviceDsmAction_LostQuery, \
TRUE, \
__alignof(DEVICE_DSM_LOST_QUERY_PARAMETERS), \
sizeof(DEVICE_DSM_LOST_QUERY_PARAMETERS), \
TRUE, \
__alignof(DEVICE_DSM_LOST_QUERY_OUTPUT), \
sizeof(DEVICE_DSM_LOST_QUERY_OUTPUT)}
typedef
struct
_DEVICE_DSM_FREE_SPACE_OUTPUT
{
;
;
}
DEVICE_DSM_FREE_SPACE_OUTPUT
, *
PDEVICE_DSM_FREE_SPACE_OUTPUT
;
#define DeviceDsmDefinition_GetFreeSpace {DeviceDsmAction_GetFreeSpace, \
FALSE, \
0, \
0, \
TRUE, \
__alignof(DEVICE_DSM_FREE_SPACE_OUTPUT), \
sizeof(DEVICE_DSM_FREE_SPACE_OUTPUT)}
#define DEVICE_DSM_ROUND_UP(_a, _b) (((_a) + ((_b) - 1)) / (_b) * (_b))
#define DEVICE_DSM_ROUND_DN(_a, _b) (((_a) ) / (_b) * (_b))
(
_In_ PDEVICE_DSM_INPUT Input
)
{
return
(
)
((
)
+
->
);
}
(
_In_ PDEVICE_DSM_INPUT Input
)
{
return
(
)
((
)
+
->
);
}
(
_In_ PDEVICE_DSM_INPUT Input
)
{
return
->
/
sizeof
(
);
}
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_In_ DWORD ParameterBlockLength,
_In_ DWORD NumberOfDataSetRanges
)
{
=
sizeof
(
);
if
(
!=
0
) {
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->ParameterBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
Bytes
+=
;
}
if
(
!=
0
) {
Bytes = DEVICE_DSM_ROUND_UP(Bytes, __alignof(DEVICE_DSM_RANGE));
Bytes
= (((
Bytes
) + ((__alignof(
)) -
1
)) / (__alignof(
)) * (__alignof(
)));
Bytes
+=
sizeof
(
) *
;
}
return
Bytes
;
}
DeviceDsmGetNumberOfDataSetRanges
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_In_ DWORD ParameterBlockLength
)
{
=
sizeof
(
);
if
(
!=
0
) {
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->ParameterBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
Bytes
+=
;
}
Bytes = DEVICE_DSM_ROUND_UP(Bytes, __alignof(DEVICE_DSM_RANGE));
Bytes
= (((
Bytes
) + ((__alignof(
)) -
1
)) / (__alignof(
)) * (__alignof(
)));
Bytes
=
-
Bytes
;
return
Bytes
/
sizeof
(
);
}
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_Out_writes_bytes_(InputLength) PDEVICE_DSM_INPUT Input,
_In_reads_bytes_opt_(ParameterBlockLength) PVOID Parameters,
_In_ DWORD ParameterBlockLength
)
{
=
sizeof
(
);
RtlZeroMemory(Input, InputLength);
->
=
Bytes
;
->
=
->
;
->
=
;
if
(
==
0
) {
goto
Cleanup;
}
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->ParameterBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
->
=
Bytes
;
->
=
;
if
(!
) {
goto
Cleanup;
}
RtlCopyMemory(DeviceDsmParameterBlock(Input),
Parameters,
Input->ParameterBlockLength);
Cleanup:
return
;
}
(
_Inout_updates_bytes_(InputLength) PDEVICE_DSM_INPUT Input,
)
{
=
0
;
=
0
;
PDEVICE_DSM_RANGE Ranges = NULL;
if (Input->Flags & DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE) {
goto
Cleanup;
}
if
(
->
==
0
) {
if
(
->
==
0
) {
Bytes
=
sizeof
(
);
}
else
{
Bytes
=
->
+
->
;
}
Bytes = DEVICE_DSM_ROUND_UP(Bytes, __alignof(DEVICE_DSM_RANGE));
Bytes
= (((
Bytes
) + ((__alignof(
)) -
1
)) / (__alignof(
)) * (__alignof(
)));
}
else
{
Bytes
=
->
+
->
;
}
if
((
-
Bytes
) <
sizeof
(
)) {
goto
Cleanup;
}
if
(
->
==
0
) {
->
=
Bytes
;
}
Ranges
=
(
);
Index
=
DeviceDsmNumberOfDataSetRanges
(
);
Ranges
[
Index
].
=
;
Ranges
[
Index
].
=
;
->
+=
sizeof
(
);
Cleanup:
return
Return
;
}
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_In_reads_bytes_(InputLength) PDEVICE_DSM_INPUT Input,
_In_ _Pre_satisfies_(InputLength >= sizeof(DEVICE_DSM_INPUT)) DWORD InputLength
)
{
=
0
;
=
0
;
if
(
->
!=
->
) {
goto
Cleanup;
}
if
(
->
!=
0
) {
Min
=
sizeof
(*
);
Max
=
;
if
(
->
<
Min
||
->
>
Max
||
->
%
->
) {
goto
Cleanup;
}
Min
=
->
;
Max
=
-
->
;
if
(
->
<
Min
||
->
>
Max
) {
goto
Cleanup;
}
}
if (!(Input->Flags & DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE)) {
if
(!(
->
&
0x00000001
)) {
Min
=
sizeof
(*
);
Max
=
;
if
(
->
<
Min
||
->
>
Max
||
->
% __alignof(
)) {
goto
Cleanup;
}
Min
=
sizeof
(
);
Max
=
-
->
;
if
(
->
<
Min
||
->
>
Max
||
->
%
Min
) {
goto
Cleanup;
}
if
(
->
&&
->
!=
Min
) {
goto
Cleanup;
}
}
else
{
if
(
->
!=
0
||
->
!=
0
) {
goto
Cleanup;
}
}
if
(
->
<
->
&&
->
+
->
>
->
) {
goto
Cleanup;
}
if
(
->
<
->
&&
->
+
->
>
->
) {
goto
Cleanup;
}
Cleanup:
return
Valid
;
}
(
_In_ PDEVICE_DSM_OUTPUT Output
)
{
return
(
)
((
)
+
->
);
}
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_In_ DWORD OutputBlockLength
)
{
=
sizeof
(
);
if
(
==
0
) {
goto
Cleanup;
}
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->OutputBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
Bytes
+=
;
Cleanup:
return
Bytes
;
}
DeviceDsmGetOutputBlockLength
(
_In_ PDEVICE_DSM_DEFINITION Definition,
)
{
=
0
;
if
(
->
==
0
) {
goto
Cleanup;
}
Bytes
=
sizeof
(
);
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->OutputBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
Bytes
=
-
Bytes
;
Cleanup:
return
Bytes
;
}
DeviceDsmInitializeOutput
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_Out_writes_bytes_(OutputLength) PDEVICE_DSM_OUTPUT Output,
)
{
=
sizeof
(
);
RtlZeroMemory(Output, OutputLength);
->
=
Bytes
;
->
=
->
;
->
=
;
if
(
->
!=
0
) {
Bytes = DEVICE_DSM_ROUND_UP(Bytes, Definition->OutputBlockAlignment);
Bytes
= (((
Bytes
) + ((
->
) -
1
)) / (
->
) * (
->
));
->
=
Bytes
;
->
=
-
Bytes
;
}
return
;
}
(
_In_ PDEVICE_DSM_DEFINITION Definition,
_In_reads_bytes_(OutputLength) PDEVICE_DSM_OUTPUT Output,
_In_ _Pre_satisfies_(OutputLength >= sizeof(DEVICE_DSM_OUTPUT)) DWORD OutputLength
)
{
=
0
;
=
0
;
if
(
->
!=
->
) {
goto
Cleanup;
}
if
(!
->
) {
goto
Cleanup;
}
if
(
->
!=
0
) {
Min
=
sizeof
(*
);
Max
=
;
if
(
->
<
Min
||
->
>
Max
||
->
%
->
) {
goto
Cleanup;
}
Min
=
->
;
Max
=
-
->
;
if
(
->
<
Min
||
->
>
Max
) {
goto
Cleanup;
}
}
else
{
if
(
->
!=
0
||
->
!=
0
) {
goto
Cleanup;
}
}
Cleanup:
return
Valid
;
}
typedef
struct
_STORAGE_GET_BC_PROPERTIES_OUTPUT
{
;
;
;
;
;
;
}
STORAGE_GET_BC_PROPERTIES_OUTPUT
, *
PSTORAGE_GET_BC_PROPERTIES_OUTPUT
;
#define IOCTL_STORAGE_BC_VERSION 1
typedef
struct
{
;
;
;
;
;
[
2
];
;
;
}
, *
;
typedef
struct
_STORAGE_ALLOCATE_BC_STREAM_OUTPUT
{
;
;
}
STORAGE_ALLOCATE_BC_STREAM_OUTPUT
, *
PSTORAGE_ALLOCATE_BC_STREAM_OUTPUT
;
#define STORAGE_PRIORITY_HINT_SUPPORTED 0x0001
typedef
struct
_STORAGE_PRIORITY_HINT_SUPPORT
{
;
}
STORAGE_PRIORITY_HINT_SUPPORT
, *
PSTORAGE_PRIORITY_HINT_SUPPORT
;
typedef
enum
_STORAGE_DIAGNOSTIC_LEVEL
{
StorageDiagnosticLevelDefault
=
0
,
StorageDiagnosticLevelMax
}
, *
PSTORAGE_DIAGNOSTIC_LEVEL
;
typedef
enum
_STORAGE_DIAGNOSTIC_TARGET_TYPE
{
StorageDiagnosticTargetTypeUndefined
=
0
,
StorageDiagnosticTargetTypePort
,
StorageDiagnosticTargetTypeMiniport
,
StorageDiagnosticTargetTypeHbaFirmware
,
StorageDiagnosticTargetTypeMax
}
STORAGE_DIAGNOSTIC_TARGET_TYPE
, *
PSTORAGE_DIAGNOSTIC_TARGET_TYPE
;
typedef
struct
_STORAGE_DIAGNOSTIC_REQUEST
{
;
;
;
STORAGE_DIAGNOSTIC_TARGET_TYPE
;
;
}
STORAGE_DIAGNOSTIC_REQUEST
, *
PSTORAGE_DIAGNOSTIC_REQUEST
;
typedef
struct
{
;
;
;
;
;
_Field_size_(BufferSize) BYTE DiagnosticDataBuffer[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
_PHYSICAL_ELEMENT_STATUS_REQUEST
{
;
;
;
;
;
[
2
];
}
PHYSICAL_ELEMENT_STATUS_REQUEST
, *
PPHYSICAL_ELEMENT_STATUS_REQUEST
;
typedef
struct
_PHYSICAL_ELEMENT_STATUS_DESCRIPTOR
{
;
;
;
;
;
[
2
];
;
[
4
];
}
PHYSICAL_ELEMENT_STATUS_DESCRIPTOR
, *
PPHYSICAL_ELEMENT_STATUS_DESCRIPTOR
;
typedef
struct
{
;
;
;
;
ElementIdentifierBeingDepoped
;
;
PHYSICAL_ELEMENT_STATUS_DESCRIPTOR Descriptors[ANYSIZE_ARRAY];
PHYSICAL_ELEMENT_STATUS_DESCRIPTOR
[
1
];
}
, *
;
typedef
struct
_REMOVE_ELEMENT_AND_TRUNCATE_REQUEST
{
;
;
;
;
;
}
REMOVE_ELEMENT_AND_TRUNCATE_REQUEST
, *
PREMOVE_ELEMENT_AND_TRUNCATE_REQUEST
;
#pragma warning(push)
#pragma warning(disable:
4200
)
#if defined(_MSC_EXTENSIONS)
typedef
struct
{
;
;
#if !defined(__midl)
[
0
];
#endif
}
, *
;
#endif /* _MSC_EXTENSIONS */
typedef _Struct_size_bytes_(Size) struct _STORAGE_READ_CAPACITY {
;
;
;
;
;
}
, *
;
#pragma warning(pop)
typedef enum __WRAPPED__ _WRITE_CACHE_TYPE {
,
,
,
WriteCacheTypeWriteThrough
}
;
typedef enum __WRAPPED__ _WRITE_CACHE_ENABLE {
,
,
}
;
typedef enum __WRAPPED__ _WRITE_CACHE_CHANGE {
,
,
}
;
typedef enum __WRAPPED__ _WRITE_THROUGH {
,
,
}
;
typedef _Struct_size_bytes_(Size) struct __WRAPPED__ _STORAGE_WRITE_CACHE_PROPERTY {
typedef
struct
_STORAGE_WRITE_CACHE_PROPERTY
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
UserDefinedPowerProtection
;
__WRAPPED__
;
}
STORAGE_WRITE_CACHE_PROPERTY
, *
PSTORAGE_WRITE_CACHE_PROPERTY
;
#pragma warning(push)
#pragma warning(disable:4200) // array[0]
#pragma warning(disable:
4200
)
#pragma warning(disable:4201) // nameless struct/unions
#pragma warning(disable:
4201
)
#pragma warning(disable:4214) // bit fields other than int
#pragma warning(disable:
4214
)
#if defined(_MSC_EXTENSIONS)
typedef
struct
_PERSISTENT_RESERVE_COMMAND
{
;
;
union
{
struct
{
:
5
;
:
3
;
;
}
;
struct
{
:
5
;
:
3
;
:
4
;
:
4
;
#if !defined(__midl)
[
0
];
#endif
}
;
}
PERSISTENT_RESERVE_COMMAND
, *
PPERSISTENT_RESERVE_COMMAND
;
#endif /* _MSC_EXTENSIONS */
#pragma warning(pop)
#pragma warning(push)
#define DEVICEDUMP_STRUCTURE_VERSION_V1 1
#define DEVICEDUMP_MAX_IDSTRING 32 // Keep proportional to sizeof (DWORD)
#define MAX_FW_BUCKET_ID_LENGTH 132 // 128 (ACS specification + 1 for zero termination + 3 to align on DWORD)
#define STORAGE_CRASH_TELEMETRY_REGKEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\CrashControl\\StorageTelemetry"
#define STORAGE_DEVICE_TELEMETRY_REGKEY L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Storage\\StorageTelemetry"
typedef
enum
_DEVICEDUMP_COLLECTION_TYPE
{
=
1
,
TCCollectionApplicationRequested
,
TCCollectionDeviceRequested
}
DEVICEDUMP_COLLECTION_TYPEIDE_NOTIFICATION_TYPE
, *
PDEVICEDUMP_COLLECTION_TYPE
;
#define DDUMP_FLAG_DATA_READ_FROM_DEVICE 0x0001
#define FW_ISSUEID_NO_ISSUE 0x00000000
#define FW_ISSUEID_UNKNOWN 0xFFFFFFFF
#include <pshpack1.h> // Structures are packed on a byte boundary , because parsers may run on separate machines and different OS flavors
typedef
struct
_DEVICEDUMP_SUBSECTION_POINTER
{
;
;
;
}
DEVICEDUMP_SUBSECTION_POINTER
,*
PDEVICEDUMP_SUBSECTION_POINTER
;
typedef
struct
_DEVICEDUMP_STRUCTURE_VERSION
{
;
;
;
}
DEVICEDUMP_STRUCTURE_VERSION
, *
PDEVICEDUMP_STRUCTURE_VERSION
;
typedef
struct
{
;
[
16
];
;
BYTE sModelNumber[DEVICEDUMP_MAX_IDSTRING];
BYTE szDeviceManufacturingID[DEVICEDUMP_MAX_IDSTRING]; // Keep the length of the field proportional to sizeof (DWORD)
;
;
;
BYTE szIssueDescriptionString[MAX_FW_BUCKET_ID_LENGTH]; // zero terminated
} , *;
#define TC_PUBLIC_DEVICEDUMP_CONTENT_SMART 0x01
#define TC_PUBLIC_DEVICEDUMP_CONTENT_GPLOG 0x02
#define TC_PUBLIC_DEVICEDUMP_CONTENT_GPLOG_MAX 16
#define TC_DEVICEDUMP_SUBSECTION_DESC_LENGTH 16
#define TC_PUBLIC_DATA_TYPE_ATAGP "ATAGPLogPages"
#define TC_PUBLIC_DATA_TYPE_ATASMART "ATASMARTPages"
typedef
struct
{
;
;
}
,*
;
typedef
struct
_DEVICEDUMP_PUBLIC_SUBSECTION
{
;
GP_LOG_PAGE_DESCRIPTOR GPLogTable[TC_PUBLIC_DEVICEDUMP_CONTENT_GPLOG_MAX];
CHAR szDescription[TC_DEVICEDUMP_SUBSECTION_DESC_LENGTH]; // Zero terminated
BYTE bData[ANYSIZE_ARRAY]; // Data byte array ANYSIZE_ARRAY
}
DEVICEDUMP_PUBLIC_SUBSECTION
, *
PDEVICEDUMP_PUBLIC_SUBSECTION
;
typedef
struct
_DEVICEDUMP_RESTRICTED_SUBSECTION
{
BYTE bData[ANYSIZE_ARRAY]; // Data byte array (ANYSIZE_ARRAY)
}
DEVICEDUMP_RESTRICTED_SUBSECTION
, *
PDEVICEDUMP_RESTRICTED_SUBSECTION
;
typedef
struct
_DEVICEDUMP_PRIVATE_SUBSECTION
{
;
;
BYTE bData[ANYSIZE_ARRAY]; // Data byte array (ANYSIZE_ARRAY)
}
DEVICEDUMP_PRIVATE_SUBSECTION
, *
PDEVICEDUMP_PRIVATE_SUBSECTION
;
typedef _Struct_size_bytes_(Descriptor.dwSize) struct _DEVICEDUMP_STORAGEDEVICE_DATA {
typedef
struct
_DEVICEDUMP_STORAGEDEVICE_DATA
{
DEVICEDUMP_STRUCTURE_VERSION
;
DEVICEDUMP_SECTION_HEADER
;
;
;
DEVICEDUMP_SUBSECTION_POINTER
;
DEVICEDUMP_SUBSECTION_POINTER
;
DEVICEDUMP_SUBSECTION_POINTER
;
}
DEVICEDUMP_STORAGEDEVICE_DATA
, *
PDEVICEDUMP_STORAGEDEVICE_DATA
;
#define CDB_SIZE 16
#define TELEMETRY_COMMAND_SIZE 16
#define TCRecordStorportSrbFunction Command[0]
typedef
struct
_DEVICEDUMP_STORAGESTACK_PUBLIC_STATE_RECORD
{
BYTE Command[TELEMETRY_COMMAND_SIZE];
;
;
;
;
union
{
struct
{
;
}
;
struct
{
;
}
;
struct
{
;
}
;
}
;
}
DEVICEDUMP_STORAGESTACK_PUBLIC_STATE_RECORD
,*
PDEVICEDUMP_STORAGESTACK_PUBLIC_STATE_RECORD
;
typedef _Struct_size_bytes_(Descriptor.dwSize) struct _DEVICEDUMP_STORAGESTACK_PUBLIC_DUMP {
typedef
struct
_DEVICEDUMP_STORAGESTACK_PUBLIC_DUMP
{
DEVICEDUMP_STRUCTURE_VERSION
;
;
[
16
];
;
DEVICEDUMP_STORAGESTACK_PUBLIC_STATE_RECORD RecordArray[ANYSIZE_ARRAY]; //ANYSIZE_ARRAY
DEVICEDUMP_STORAGESTACK_PUBLIC_STATE_RECORD
[
1
];
}
DEVICEDUMP_STORAGESTACK_PUBLIC_DUMP
,*
PDEVICEDUMP_STORAGESTACK_PUBLIC_DUMP
;
#include <poppack.h>
#define DEVICEDUMP_CAP_PRIVATE_SECTION 0x00000001 // Target supports private data
#define DEVICEDUMP_CAP_RESTRICTED_SECTION 0x00000002 // Target supports restricted data
#pragma warning(push)
#pragma warning(disable:4214) // bit fields other than int
#pragma warning(disable:
4214
)
typedef
struct
{
;
;
:
1
;
:
1
;
:
30
;
;
}
, *
;
#pragma warning(pop)
typedef
enum
_STORAGE_POWERUP_REASON_TYPE
{
=
0
,
,
StoragePowerupDeviceAttention
}
STORAGE_POWERUP_REASON_TYPE
, *
PSTORAGE_POWERUP_REASON_TYPE
;
typedef
struct
_STORAGE_IDLE_POWERUP_REASON
{
;
;
STORAGE_POWERUP_REASON_TYPE
;
}
STORAGE_IDLE_POWERUP_REASON
, *
PSTORAGE_IDLE_POWERUP_REASON
;
#define STORAGE_IDLE_POWERUP_REASON_VERSION_V1 1
typedef
enum
_STORAGE_DEVICE_POWER_CAP_UNITS
{
StorageDevicePowerCapUnitsPercent
,
StorageDevicePowerCapUnitsMilliwatts
}
STORAGE_DEVICE_POWER_CAP_UNITS
, *
PSTORAGE_DEVICE_POWER_CAP_UNITS
;
typedef
struct
_STORAGE_DEVICE_POWER_CAP
{
;
;
STORAGE_DEVICE_POWER_CAP_UNITS
;
;
}
, *
PSTORAGE_DEVICE_POWER_CAP
;
#define STORAGE_DEVICE_POWER_CAP_VERSION_V1 1
#pragma pack(push)
#pragma pack(
1
)
typedef
struct
{
[
196
];
[
32
];
[
256
];
[
16
];
[
4
];
[
2
];
[
2
];
[
2
];
[
2
];
}
, *
;
typedef
enum
_STORAGE_RPMB_COMMAND_TYPE
{
=
0x00000001
,
StorRpmbQueryWriteCounter
=
0x00000002
,
StorRpmbAuthenticatedWrite
=
0x00000003
,
StorRpmbAuthenticatedRead
=
0x00000004
,
StorRpmbReadResultRequest
=
0x00000005
,
StorRpmbAuthenticatedDeviceConfigWrite
=
0x00000006
,
StorRpmbAuthenticatedDeviceConfigRead
=
0x00000007
,
}
STORAGE_RPMB_COMMAND_TYPE
, *
PSTORAGE_RPMB_COMMAND_TYPE
;
#pragma pack(pop)
typedef
struct
_STORAGE_EVENT_NOTIFICATION
{
;
;
;
}
STORAGE_EVENT_NOTIFICATION
, *
PSTORAGE_EVENT_NOTIFICATION
;
#define STORAGE_EVENT_NOTIFICATION_VERSION_V1 1
#define STORAGE_EVENT_MEDIA_STATUS 0x0000000000000001
#define STORAGE_EVENT_DEVICE_STATUS 0x0000000000000002
#define STORAGE_EVENT_DEVICE_OPERATION 0x0000000000000004
#define STORAGE_EVENT_ALL (STORAGE_EVENT_MEDIA_STATUS | STORAGE_EVENT_DEVICE_STATUS | STORAGE_EVENT_DEVICE_OPERATION)
#pragma warning(pop)
#define READ_COPY_NUMBER_KEY 0x52434e00 // 'RCN'
#define IsKeyReadCopyNumber(_k) (((_k) & 0xFFFFFF00) == READ_COPY_NUMBER_KEY)
#define ReadCopyNumberToKey(_c) (READ_COPY_NUMBER_KEY | (BYTE )(_c))
#define ReadCopyNumberFromKey(_k) (BYTE )((_k) & 0x000000FF)
typedef
enum
{
StorageCounterTypeUnknown
=
0
,
StorageCounterTypeTemperatureCelsius
,
StorageCounterTypeTemperatureCelsiusMax
,
StorageCounterTypeReadErrorsTotal
,
StorageCounterTypeReadErrorsCorrected
,
StorageCounterTypeReadErrorsUncorrected
,
StorageCounterTypeWriteErrorsTotal
,
StorageCounterTypeWriteErrorsCorrected
,
StorageCounterTypeWriteErrorsUncorrected
,
StorageCounterTypeManufactureDate
,
StorageCounterTypeStartStopCycleCount
,
StorageCounterTypeStartStopCycleCountMax
,
StorageCounterTypeLoadUnloadCycleCount
,
StorageCounterTypeLoadUnloadCycleCountMax
,
StorageCounterTypeWearPercentage
,
StorageCounterTypeWearPercentageWarning
,
StorageCounterTypeWearPercentageMax
,
StorageCounterTypePowerOnHours
,
StorageCounterTypeReadLatency100NSMax
,
StorageCounterTypeWriteLatency100NSMax
,
StorageCounterTypeFlushLatency100NSMax
,
}
, *
;
typedef
struct
{
;
union
{
struct
{
;
;
}
;
;
}
;
}
, *
;
typedef _Struct_size_bytes_(Size) struct _STORAGE_COUNTERS {
;
;
;
_Field_size_(NumberOfCounters) STORAGE_COUNTER Counters[ANYSIZE_ARRAY];
}
, *
;
#define STORAGE_COUNTERS_VERSION_V1 sizeof(STORAGE_COUNTERS)
#define STORAGE_HW_FIRMWARE_REQUEST_FLAG_CONTROLLER 0x00000001
#define STORAGE_HW_FIRMWARE_REQUEST_FLAG_LAST_SEGMENT 0x00000002
#define STORAGE_HW_FIRMWARE_REQUEST_FLAG_FIRST_SEGMENT 0x00000004
#define STORAGE_HW_FIRMWARE_REQUEST_FLAG_SWITCH_TO_EXISTING_FIRMWARE 0x80000000
typedef
struct
_STORAGE_HW_FIRMWARE_INFO_QUERY
{
;
;
;
;
}
STORAGE_HW_FIRMWARE_INFO_QUERY
, *
PSTORAGE_HW_FIRMWARE_INFO_QUERY
;
#define STORAGE_HW_FIRMWARE_INVALID_SLOT 0xFF
#pragma warning(push)
#pragma warning(disable:4214) // bit fields other than int
#pragma warning(disable:
4214
)
#define STORAGE_HW_FIRMWARE_REVISION_LENGTH 16
typedef struct __WRAPPED__ _STORAGE_HW_FIRMWARE_SLOT_INFO {
typedef
struct
_STORAGE_HW_FIRMWARE_SLOT_INFO
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
:
1
;
__WRAPPED__
:
7
;
__WRAPPED__
[
6
];
__WRAPPED__
BYTE Revision[STORAGE_HW_FIRMWARE_REVISION_LENGTH];
}
STORAGE_HW_FIRMWARE_SLOT_INFO
, *
PSTORAGE_HW_FIRMWARE_SLOT_INFO
;
typedef struct __WRAPPED__ _STORAGE_HW_FIRMWARE_INFO {
typedef
struct
_STORAGE_HW_FIRMWARE_INFO
{
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
:
1
;
__WRAPPED__
:
7
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
[
3
];
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
STORAGE_HW_FIRMWARE_SLOT_INFO Slot[ANYSIZE_ARRAY];
STORAGE_HW_FIRMWARE_SLOT_INFO
[
1
];
}
, *
PSTORAGE_HW_FIRMWARE_INFO
;
#pragma warning(pop)
#pragma warning(push)
#pragma warning(disable:
4200
)
typedef
struct
_STORAGE_HW_FIRMWARE_DOWNLOAD
{
;
;
;
;
[
3
];
;
;
BYTE ImageBuffer[ANYSIZE_ARRAY]; // firmware image file.
}
STORAGE_HW_FIRMWARE_DOWNLOAD
, *
PSTORAGE_HW_FIRMWARE_DOWNLOAD
;
typedef
struct
_STORAGE_HW_FIRMWARE_DOWNLOAD_V2
{
;
;
;
;
[
3
];
;
;
;
;
BYTE ImageBuffer[ANYSIZE_ARRAY]; // firmware image file.
}
STORAGE_HW_FIRMWARE_DOWNLOAD_V2
, *
PSTORAGE_HW_FIRMWARE_DOWNLOAD_V2
;
#pragma warning(pop)
typedef
struct
_STORAGE_HW_FIRMWARE_ACTIVATE
{
;
;
;
;
[
3
];
}
STORAGE_HW_FIRMWARE_ACTIVATE
, *
PSTORAGE_HW_FIRMWARE_ACTIVATE
;
#define STORAGE_PROTOCOL_STRUCTURE_VERSION 0x1
typedef
struct
_STORAGE_PROTOCOL_COMMAND
{
;
;
;
;
;
;
;
;
DataToDeviceTransferLength
;
DataFromDeviceTransferLength
;
;
;
;
DataFromDeviceBufferOffset
;
;
;
;
[
3
];
_Field_size_bytes_full_(CommandLength) BYTE Command[ANYSIZE_ARRAY];
}
, *
PSTORAGE_PROTOCOL_COMMAND
;
#define STORAGE_PROTOCOL_COMMAND_FLAG_ADAPTER_REQUEST 0x80000000 // Flag indicates the request targeting to adapter instead of device.
#define STORAGE_PROTOCOL_STATUS_PENDING 0x0
#define STORAGE_PROTOCOL_STATUS_SUCCESS 0x1
#define STORAGE_PROTOCOL_STATUS_ERROR 0x2
#define STORAGE_PROTOCOL_STATUS_INVALID_REQUEST 0x3
#define STORAGE_PROTOCOL_STATUS_NO_DEVICE 0x4
#define STORAGE_PROTOCOL_STATUS_BUSY 0x5
#define STORAGE_PROTOCOL_STATUS_DATA_OVERRUN 0x6
#define STORAGE_PROTOCOL_STATUS_INSUFFICIENT_RESOURCES 0x7
#define STORAGE_PROTOCOL_STATUS_NOT_SUPPORTED 0xFF
#define STORAGE_PROTOCOL_COMMAND_LENGTH_NVME 0x40 // NVMe commands are always 64 bytes.
#define STORAGE_PROTOCOL_SPECIFIC_NVME_ADMIN_COMMAND 0x01
#define STORAGE_PROTOCOL_SPECIFIC_NVME_NVM_COMMAND 0x02
typedef
enum
_STORAGE_ATTRIBUTE_MGMT_ACTION
{
StorAttributeMgmt_ClearAttribute
=
0
,
StorAttributeMgmt_SetAttribute
=
1
,
StorAttributeMgmt_ResetAttribute
=
2
}
STORAGE_ATTRIBUTE_MGMT_ACTION
, *
PSTORAGE_ATTRIBUTE_MGMT_ACTION
;
#define STORATTRIBUTE_NONE 0
#define STORATTRIBUTE_MANAGEMENT_STATE 1
typedef
struct
{
;
;
STORAGE_ATTRIBUTE_MGMT_ACTION
;
;
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#if defined __cplusplus && !defined __ALT_GENERATOR__
}
#endif
#endif // _NTDDSTOR_H_
#ifndef _NTDDSCM_H_
#define _NTDDSCM_H_
#pragma warning(push)
#pragma warning(disable:4201) // nameless struct/union
#pragma warning(disable:
4201
)
#pragma warning(disable:4214) // bit field types other than int
#pragma warning(disable:
4214
)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS5)
#define IOCTL_SCMBUS_BASE FILE_DEVICE_PERSISTENT_MEMORY
#define IOCTL_SCMBUS_DEVICE_FUNCTION_BASE 0x0
#define IOCTL_SCM_LOGICAL_DEVICE_FUNCTION_BASE 0x300
#define IOCTL_SCM_PHYSICAL_DEVICE_FUNCTION_BASE 0x600
#define SCMBUS_FUNCTION(x) (IOCTL_SCMBUS_DEVICE_FUNCTION_BASE + x)
#define SCM_LOGICAL_DEVICE_FUNCTION(x) (IOCTL_SCM_LOGICAL_DEVICE_FUNCTION_BASE + x)
#define SCM_PHYSICAL_DEVICE_FUNCTION(x) (IOCTL_SCM_PHYSICAL_DEVICE_FUNCTION_BASE + x)
#define IOCTL_SCM_BUS_GET_LOGICAL_DEVICES CTL_CODE(IOCTL_SCMBUS_BASE, SCMBUS_FUNCTION(0x00), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_BUS_GET_PHYSICAL_DEVICES CTL_CODE(IOCTL_SCMBUS_BASE, SCMBUS_FUNCTION(0x01), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_BUS_GET_REGIONS CTL_CODE(IOCTL_SCMBUS_BASE, SCMBUS_FUNCTION(0x02), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_LD_GET_INTERLEAVE_SET CTL_CODE(IOCTL_SCMBUS_BASE, SCM_LOGICAL_DEVICE_FUNCTION(0x00), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_PD_QUERY_PROPERTY CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x00), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_PD_FIRMWARE_DOWNLOAD CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x01), METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_SCM_PD_FIRMWARE_ACTIVATE CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x02), METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_SCM_PD_PASSTHROUGH CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x03), METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_SCM_PD_UPDATE_MANAGEMENT_STATUS CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x04), METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SCM_PD_REINITIALIZE_MEDIA CTL_CODE(IOCTL_SCMBUS_BASE, SCM_PHYSICAL_DEVICE_FUNCTION(0x05), METHOD_BUFFERED, FILE_WRITE_ACCESS)
typedef
struct
_SCM_PD_HEALTH_NOTIFICATION_DATA
{
;
}
SCM_PD_HEALTH_NOTIFICATION_DATA
, *
PSCM_PD_HEALTH_NOTIFICATION_DATA
;
#define SCM_MAX_SYMLINK_LEN_IN_CHARS 256
typedef
struct
_SCM_LOGICAL_DEVICE_INSTANCE
{
;
;
;
WCHAR SymbolicLink[SCM_MAX_SYMLINK_LEN_IN_CHARS];
}
SCM_LOGICAL_DEVICE_INSTANCE
, *
PSCM_LOGICAL_DEVICE_INSTANCE
;
typedef
struct
{
;
;
;
SCM_LOGICAL_DEVICE_INSTANCE Devices[ANYSIZE_ARRAY];
SCM_LOGICAL_DEVICE_INSTANCE
[
1
];
}
, *
;
typedef
struct
_SCM_PHYSICAL_DEVICE_INSTANCE
{
;
;
;
WCHAR SymbolicLink[SCM_MAX_SYMLINK_LEN_IN_CHARS];
}
SCM_PHYSICAL_DEVICE_INSTANCE
, *
PSCM_PHYSICAL_DEVICE_INSTANCE
;
typedef
struct
{
;
;
;
SCM_PHYSICAL_DEVICE_INSTANCE Devices[ANYSIZE_ARRAY];
SCM_PHYSICAL_DEVICE_INSTANCE
[
1
];
}
, *
;
typedef
enum
{
=
0x0
,
=
0x1
}
, *
;
#define SCM_REGION_SPA_UNKNOWN MAXDWORD64
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
SCM_REGION Regions[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
_SCM_LD_INTERLEAVE_SET_INFO
{
;
;
;
SCM_INTERLEAVED_PD_INFO InterleaveSet[ANYSIZE_ARRAY];
}
SCM_LD_INTERLEAVE_SET_INFO
, *
PSCM_LD_INTERLEAVE_SET_INFO
;
typedef
enum
{
ScmPhysicalDeviceQuery_Descriptor
=
0
,
ScmPhysicalDeviceQuery_IsSupported
,
ScmPhysicalDeviceQuery_Max
}
, *
;
typedef
enum
{
ScmPhysicalDeviceProperty_DeviceInfo
=
0
,
ScmPhysicalDeviceProperty_ManagementStatus
,
ScmPhysicalDeviceProperty_FirmwareInfo
,
ScmPhysicalDeviceProperty_LocationString
,
ScmPhysicalDeviceProperty_DeviceSpecificInfo
,
ScmPhysicalDeviceProperty_DeviceHandle
,
ScmPhysicalDeviceProperty_Max
}
, *
;
typedef
struct
{
;
;
;
;
BYTE AdditionalParameters[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
{
;
;
} , *;
typedef
struct
{
;
;
;
;
}
, *
;
#define MAX_INTERFACE_CODES 8
#define SCM_PD_FIRMWARE_REVISION_LENGTH_BYTES 32
#define SCM_PD_MEMORY_SIZE_UNKNOWN MAXDWORD64
typedef
struct
{
;
;
;
;
PersistentMemorySizeInBytes
;
VolatileMemorySizeInBytes
;
;
;
;
;
;
WORD FormatInterfaceCodes[MAX_INTERFACE_CODES];
;
;
;
;
;
;
;
;
SerialNumberLengthInChars
;
_Field_size_(SerialNumberLengthInChars) CHAR SerialNumber[ANYSIZE_ARRAY];
}
, *
;
#define SCM_PD_PROPERTY_NAME_LENGTH_IN_CHARS 128
typedef
struct
_SCM_PD_DEVICE_SPECIFIC_PROPERTY
{
WCHAR Name[SCM_PD_PROPERTY_NAME_LENGTH_IN_CHARS];
;
}
SCM_PD_DEVICE_SPECIFIC_PROPERTY
, *
PSCM_PD_DEVICE_SPECIFIC_PROPERTY
;
typedef
struct
_SCM_PD_DEVICE_SPECIFIC_INFO
{
;
;
;
SCM_PD_DEVICE_SPECIFIC_PROPERTY DeviceSpecificProperties[ANYSIZE_ARRAY];
SCM_PD_DEVICE_SPECIFIC_PROPERTY
[
1
];
}
SCM_PD_DEVICE_SPECIFIC_INFO
, *
PSCM_PD_DEVICE_SPECIFIC_INFO
;
typedef
struct
_SCM_PD_FIRMWARE_SLOT_INFO
{
;
;
;
:
1
;
:
7
;
[
6
];
BYTE Revision[SCM_PD_FIRMWARE_REVISION_LENGTH_BYTES];
}
SCM_PD_FIRMWARE_SLOT_INFO
, *
PSCM_PD_FIRMWARE_SLOT_INFO
;
typedef
struct
{
;
;
;
;
;
_Field_size_(SlotCount) SCM_PD_FIRMWARE_SLOT_INFO Slots[ANYSIZE_ARRAY];
SCM_PD_FIRMWARE_SLOT_INFO
[
1
];
}
, *
;
typedef
enum
{
ScmPhysicalDeviceHealth_Unknown
=
0
,
ScmPhysicalDeviceHealth_Unhealthy
,
ScmPhysicalDeviceHealth_Warning
,
ScmPhysicalDeviceHealth_Healthy
,
ScmPhysicalDeviceHealth_Max
}
, *
;
typedef
enum
_SCM_PD_OPERATIONAL_STATUS
{
ScmPhysicalDeviceOpStatus_Unknown
=
0
,
ScmPhysicalDeviceOpStatus_Ok
,
ScmPhysicalDeviceOpStatus_PredictingFailure
,
ScmPhysicalDeviceOpStatus_InService
,
ScmPhysicalDeviceOpStatus_HardwareError
,
ScmPhysicalDeviceOpStatus_NotUsable
,
ScmPhysicalDeviceOpStatus_TransientError
,
ScmPhysicalDeviceOpStatus_Missing
,
ScmPhysicalDeviceOpStatus_Max
}
SCM_PD_OPERATIONAL_STATUS
, *
PSCM_PD_OPERATIONAL_STATUS
;
typedef
enum
_SCM_PD_OPERATIONAL_STATUS_REASON
{
ScmPhysicalDeviceOpReason_Unknown
=
0
,
,
ScmPhysicalDeviceOpReason_ThresholdExceeded
,
ScmPhysicalDeviceOpReason_LostData
,
ScmPhysicalDeviceOpReason_EnergySource
,
ScmPhysicalDeviceOpReason_Configuration
,
ScmPhysicalDeviceOpReason_DeviceController
,
,
ScmPhysicalDeviceOpReason_Component
,
ScmPhysicalDeviceOpReason_BackgroundOperation
,
ScmPhysicalDeviceOpReason_InvalidFirmware
,
ScmPhysicalDeviceOpReason_HealthCheck
,
ScmPhysicalDeviceOpReason_LostDataPersistence
,
,
ScmPhysicalDeviceOpReason_PermanentError
,
ScmPhysicalDeviceOpReason_LostWritePersistence
,
ScmPhysicalDeviceOpReason_FatalError
,
ScmPhysicalDeviceOpReason_DataPersistenceLossImminent
,
ScmPhysicalDeviceOpReason_WritePersistenceLossImminent
,
ScmPhysicalDeviceOpReason_MediaRemainingSpareBlock
,
,
ScmPhysicalDeviceOpReason_ExcessiveTemperature
,
ScmPhysicalDeviceOpReason_Max
}
SCM_PD_OPERATIONAL_STATUS_REASON
, *
PSCM_PD_OPERATIONAL_STATUS_REASON
;
#define SCM_PD_MAX_OPERATIONAL_STATUS 16
typedef
struct
_SCM_PD_MANAGEMENT_STATUS
{
;
;
;
NumberOfOperationalStatus
;
NumberOfAdditionalReasons
;
SCM_PD_OPERATIONAL_STATUS OperationalStatus[SCM_PD_MAX_OPERATIONAL_STATUS];
SCM_PD_OPERATIONAL_STATUS
[
16
];
_Field_size_(NumberOfAdditionalReasons) SCM_PD_OPERATIONAL_STATUS_REASON AdditionalReasons[ANYSIZE_ARRAY];
SCM_PD_OPERATIONAL_STATUS_REASON
[
1
];
}
, *
PSCM_PD_MANAGEMENT_STATUS
;
typedef
struct
{
;
;
WCHAR Location[ANYSIZE_ARRAY];
}
, *
;
#define SCM_PD_FIRMWARE_LAST_DOWNLOAD 0x1
typedef
struct
_SCM_PD_FIRMWARE_DOWNLOAD
{
;
;
;
;
[
3
];
;
;
BYTE FirmwareImage[ANYSIZE_ARRAY];
}
, *
PSCM_PD_FIRMWARE_DOWNLOAD
;
typedef
struct
_SCM_PD_FIRMWARE_ACTIVATE
{
;
;
;
;
}
, *
PSCM_PD_FIRMWARE_ACTIVATE
;
typedef
struct
{
;
;
;
;
BYTE Data[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
_SCM_PD_PASSTHROUGH_OUTPUT
{
;
;
;
;
BYTE Data[ANYSIZE_ARRAY];
}
SCM_PD_PASSTHROUGH_OUTPUT
, *
PSCM_PD_PASSTHROUGH_OUTPUT
;
typedef
struct
{
;
;
BYTE OpcodeParameters[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
_SCM_PD_PASSTHROUGH_INVDIMM_OUTPUT
{
;
;
;
BYTE OutputData[ANYSIZE_ARRAY];
}
SCM_PD_PASSTHROUGH_INVDIMM_OUTPUT
, *
PSCM_PD_PASSTHROUGH_INVDIMM_OUTPUT
;
typedef
struct
{
;
;
struct
{
:
1
;
}
;
}
, *
;
typedef
enum
{
=
0
,
,
,
}
, *
;
typedef
struct
{
;
;
SCM_PD_MEDIA_REINITIALIZATION_STATUS
;
}
, *
;
#pragma warning(pop)
#endif // NTDDI_WIN10_RS5
#endif // _NTDDSCM_H_
#ifndef _NTDDDISK_H_
#define _NTDDDISK_H_
#include <winapifamily.h>
#ifndef __WRAPPED__
#define __WRAPPED__
#endif
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable:
4201
)
#pragma warning(disable:4214) // nonstandard extension used : bitfield other than int
#pragma warning(disable:
4214
)
#pragma warning(disable:4820) // padding added after data member
#endif
#endif
#pragma warning(disable:
4820
)
#define IOCTL_DISK_BASE FILE_DEVICE_DISK
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_PERFORMANCE_OFF CTL_CODE(IOCTL_DISK_BASE, 0x0018, METHOD_BUFFERED, FILE_ANY_ACCESS)
#if(_WIN32_WINNT >= 0x0400)
#define IOCTL_DISK_CONTROLLER_NUMBER CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
#define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#endif /* _WIN32_WINNT >= 0x0400 */
#if (_WIN32_WINNT >= 0x500)
#define IOCTL_DISK_GET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE, 0x0012, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_SET_PARTITION_INFO_EX CTL_CODE(IOCTL_DISK_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE, 0x0014, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_SET_DRIVE_LAYOUT_EX CTL_CODE(IOCTL_DISK_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_CREATE_DISK CTL_CODE(IOCTL_DISK_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_LENGTH_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= 0x0500 */
#if (_WIN32_WINNT >= 0x0502)
#define IOCTL_DISK_REASSIGN_BLOCKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x0029, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#endif //_WIN32_WINNT >= 0x0502
#if(_WIN32_WINNT >= 0x0500)
#define IOCTL_DISK_UPDATE_DRIVE_SIZE CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GROW_PARTITION CTL_CODE(IOCTL_DISK_BASE, 0x0034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE, 0x0035, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_CACHE_INFORMATION CTL_CODE(IOCTL_DISK_BASE, 0x0036, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#if (NTDDI_VERSION < NTDDI_WS03)
#define IOCTL_DISK_GET_WRITE_CACHE_STATE CTL_CODE(IOCTL_DISK_BASE, 0x0037, METHOD_BUFFERED, FILE_READ_ACCESS)
#else
#define OBSOLETE_DISK_GET_WRITE_CACHE_STATE CTL_CODE(IOCTL_DISK_BASE, 0x0037, METHOD_BUFFERED, FILE_READ_ACCESS)
#endif
#define IOCTL_DISK_DELETE_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_UPDATE_PROPERTIES CTL_CODE(IOCTL_DISK_BASE, 0x0050, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_DRIVE CTL_CODE(IOCTL_DISK_BASE, 0x00f3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_SENSE_DEVICE CTL_CODE(IOCTL_DISK_BASE, 0x00f8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= 0x0500 */
#define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
#define PARTITION_FAT_12 0x01 // 12-bit FAT entries
#define PARTITION_XENIX_1 0x02 // Xenix
#define PARTITION_XENIX_2 0x03 // Xenix
#define PARTITION_FAT_16 0x04 // 16-bit FAT entries
#define PARTITION_EXTENDED 0x05 // Extended partition entry
#define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
#define PARTITION_IFS 0x07 // IFS Partition
#define PARTITION_OS2BOOTMGR 0x0A // OS/2 Boot Manager/OPUS/Coherent swap
#define PARTITION_FAT32 0x0B // FAT32
#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
#define PARTITION_MSFT_RECOVERY 0x27 // Microsoft recovery partition
#define PARTITION_MAIN_OS 0x28 // Main OS partition
#define PARTIITON_OS_DATA 0x29 // OS data partition
#define PARTITION_PRE_INSTALLED 0x2a // PreInstalled partition
#define PARTITION_BSP 0x2b // BSP partition
#define PARTITION_DPP 0x2c // DPP partition
#define PARTITION_WINDOWS_SYSTEM 0x2d // Windows system partition
#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
#define PARTITION_LDM 0x42 // Logical Disk Manager partition
#define PARTITION_DM 0x54 // OnTrack Disk Manager partition
#define PARTITION_EZDRIVE 0x55 // EZ-Drive partition
#define PARTITION_UNIX 0x63 // Unix
#define PARTITION_SPACES 0xE7 // Storage Spaces protective partition
#define PARTITION_GPT 0xEE // Gpt protective partition
#define PARTITION_SYSTEM 0xEF // System partition
#define VALID_NTFT 0xC0 // NTFT uses high order bits
#define PARTITION_NTFT 0x80 // NTFT partition
#if (NTDDI_VERSION < NTDDI_VISTA)
#define IsRecognizedPartition( PartitionType ) ( \
((PartitionType & PARTITION_NTFT) && (((PartitionType & ~0xC0) == PARTITION_HUGE) || \
((PartitionType & ~0xC0) == PARTITION_IFS) || \
((PartitionType & ~0xC0) == PARTITION_FAT32) || \
((PartitionType & ~0xC0) == PARTITION_FAT32_XINT13))) || \
((PartitionType) == PARTITION_FAT_12) || \
((PartitionType) == PARTITION_FAT_16) || \
((PartitionType) == PARTITION_HUGE) || \
((PartitionType) == PARTITION_IFS) || \
((PartitionType) == PARTITION_FAT32) || \
((PartitionType) == PARTITION_FAT32_XINT13) || \
((PartitionType) == PARTITION_XINT13) )
#else
#define IsRecognizedPartition( PartitionType ) ( \
((PartitionType) == PARTITION_BSP) || \
((PartitionType) == PARTITION_DPP) || \
((PartitionType) == PARTITION_FAT_12) || \
((PartitionType) == PARTITION_FAT_16) || \
((PartitionType) == PARTITION_FAT32) || \
((PartitionType) == PARTITION_FAT32_XINT13) || \
((PartitionType) == PARTITION_HUGE) || \
((PartitionType) == PARTITION_IFS) || \
((PartitionType) == PARTITION_MAIN_OS) || \
((PartitionType) == PARTITION_MSFT_RECOVERY) || \
((PartitionType) == PARTIITON_OS_DATA) || \
((PartitionType) == PARTITION_PRE_INSTALLED) || \
((PartitionType) == PARTITION_SYSTEM) || \
((PartitionType) == PARTITION_WINDOWS_SYSTEM) || \
((PartitionType) == PARTITION_XINT13) )
#endif
#define IsContainerPartition( PartitionType ) \
((PartitionType == PARTITION_EXTENDED) || (PartitionType == PARTITION_XINT13_EXTENDED))
#define IsFTPartition( PartitionType ) \
((PartitionType & PARTITION_NTFT) && (((PartitionType & ~0xC0) == PARTITION_HUGE) || \
((PartitionType & ~0xC0) == PARTITION_IFS) || \
((PartitionType & ~0xC0) == PARTITION_FAT32) || \
((PartitionType & ~0xC0) == PARTITION_FAT32_XINT13)))
typedef enum __WRAPPED__ _MEDIA_TYPE {
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
}
, *
;
typedef
struct
{
;
;
;
;
;
}
, *
;
typedef
;
typedef
*
;
typedef
struct
{
;
;
;
;
;
;
;
[
1
];
}
, *
;
typedef struct __WRAPPED__ _DISK_GEOMETRY {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
, *
;
#define WMI_DISK_GEOMETRY_GUID { 0x25007f51, 0x57c2, 0x11d1, { 0xa5, 0x28, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10 } }
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
#include <pshpack1.h>
typedef
struct
{
;
;
[
1
];
}
, *
;
#include <poppack.h>
#if(_WIN32_WINNT >= 0x500)
typedef enum __WRAPPED__ _PARTITION_STYLE {
,
,
}
;
typedef struct __WRAPPED__ _PARTITION_INFORMATION_GPT {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
[
36
];
}
, *
;
#define GPT_ATTRIBUTE_PLATFORM_REQUIRED (0x0000000000000001)
#define GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER (0x8000000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_HIDDEN (0x4000000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY (0x2000000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY (0x1000000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_OFFLINE (0x0800000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_DAX (0x0400000000000000)
#define GPT_BASIC_DATA_ATTRIBUTE_SERVICE (0x0200000000000000)
#define GPT_SPACES_ATTRIBUTE_NO_METADATA (0x8000000000000000)
typedef struct __WRAPPED__ _PARTITION_INFORMATION_MBR {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
#if (NTDDI_VERSION >= NTDDI_WINBLUE) /* ABRACADABRA_THRESHOLD */
__WRAPPED__
;
#endif
}
, *
;
typedef
SET_PARTITION_INFORMATION
;
typedef
PARTITION_INFORMATION_GPT
;
typedef
struct
{
;
union
{
SET_PARTITION_INFORMATION_MBR
;
SET_PARTITION_INFORMATION_GPT
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
union
{
;
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef struct __WRAPPED__ _PARTITION_INFORMATION_EX {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
#if (NTDDI_VERSION >= NTDDI_WIN10_RS3) /* ABRACADABRA_WIN10_RS3 */
__WRAPPED__
;
#endif
union
{
__WRAPPED__
PARTITION_INFORMATION_MBR
;
__WRAPPED__
PARTITION_INFORMATION_GPT
;
}
, *
;
typedef struct __WRAPPED__ _DRIVE_LAYOUT_INFORMATION_GPT {
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
__WRAPPED__
;
}
, *
;
typedef struct __WRAPPED__ _DRIVE_LAYOUT_INFORMATION_MBR {
__WRAPPED__
;
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1) /* ABRACADABRA_WIN10_RS1 */
;
#endif
}
, *
;
typedef struct __WRAPPED__ _DRIVE_LAYOUT_INFORMATION_EX {
__WRAPPED__
;
__WRAPPED__
;
union
{
__WRAPPED__
DRIVE_LAYOUT_INFORMATION_MBR
;
__WRAPPED__
DRIVE_LAYOUT_INFORMATION_GPT
;
__WRAPPED__
[
1
];
}
, *
;
#endif // (_WIN32_WINNT >= 0x0500)
#if(_WIN32_WINNT >= 0x0500)
typedef
enum
{
,
,
}
;
typedef
struct
{
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
;
#if (_MSC_VER >= 1200)
#pragma warning(push)
#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
#endif
#pragma warning(disable:
4201
)
typedef
struct
{
;
;
union
{
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
union
{
struct
{
;
;
}
;
struct
{
;
}
;
}
, *
;
#if (_MSC_VER >= 1200)
#pragma warning(pop)
#endif
#if (NTDDI_VERSION < NTDDI_WS03)
#define DiskGeometryGetPartition(Geometry)\
((PDISK_PARTITION_INFO)((Geometry)+1))
#define DiskGeometryGetDetect(Geometry)\
((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry)+\
DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
#else
#define DiskGeometryGetPartition(Geometry)\
((PDISK_PARTITION_INFO)((Geometry)->Data))
#define DiskGeometryGetDetect(Geometry)\
((PDISK_DETECTION_INFO)(((DWORD_PTR)DiskGeometryGetPartition(Geometry)+\
DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
#endif
typedef
struct
{
;
;
[
1
];
}
, *
;
#endif // (_WIN32_WINNT > 0x0500)
#if(_WIN32_WINNT >= 0x0400)
typedef
struct
{
;
;
}
, *
;
#endif /* _WIN32_WINNT >= 0x0400 */
#if(_WIN32_WINNT >= 0x0500)
typedef
enum
{
,
,
}
DISK_CACHE_RETENTION_PRIORITY
;
#if (OSVER(NTDDI_VERSION) == NTDDI_WINXP)
typedef enum _DISK_WRITE_CACHE_STATE {
DiskWriteCacheNormal,
DiskWriteCacheForceDisable,
DiskWriteCacheDisableNotSupported
} DISK_WRITE_CACHE_STATE, *PDISK_WRITE_CACHE_STATE;
#endif
typedef
struct
{
;
;
;
DISK_CACHE_RETENTION_PRIORITY
;
DISK_CACHE_RETENTION_PRIORITY
;
;
;
union
{
struct
{
;
;
;
}
;
struct
{
;
;
}
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
#endif /* _WIN32_WINNT >= 0x0500 */
#define HIST_NO_OF_BUCKETS 24
typedef
struct
{
;
;
}
, *
;
#define HISTOGRAM_BUCKET_SIZE sizeof(HISTOGRAM_BUCKET)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
}
, *
;
#define DISK_HISTOGRAM_SIZE sizeof(DISK_HISTOGRAM)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
[
8
];
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
#define DISK_LOGGING_START 0
#define DISK_LOGGING_STOP 1
#define DISK_LOGGING_DUMP 2
#define DISK_BINNING 3
typedef
enum
{
,
}
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
[
1
];
}
, *
;
#if(_WIN32_WINNT >= 0x0400)
#include <pshpack1.h>
typedef
struct
{
;
;
;
;
;
[
4
];
}
, *
, *
;
#include <poppack.h>
#define CAP_ATA_ID_CMD 1 // ATA ID command supported
#define CAP_ATAPI_ID_CMD 2 // ATAPI ID command supported
#define CAP_SMART_CMD 4 // SMART commannds supported
#include <pshpack1.h>
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
, *
;
#include <poppack.h>
#define ATAPI_ID_CMD 0xA1 // Returns ID sector for ATAPI.
#define ID_CMD 0xEC // Returns ID sector for ATA.
#define SMART_CMD 0xB0 // Performs SMART cmd.
#define SMART_CYL_LOW 0x4F
#define SMART_CYL_HI 0xC2
#include <pshpack1.h>
typedef
struct
{
;
;
;
[
3
];
[
4
];
[
1
];
}
, *
, *
;
#include <poppack.h>
#include <pshpack1.h>
typedef
struct
{
;
;
[
2
];
[
2
];
}
, *
, *
;
#include <poppack.h>
#define SMART_NO_ERROR 0 // No error
#define SMART_IDE_ERROR 1 // Error from IDE controller
#define SMART_INVALID_FLAG 2 // Invalid command flag
#define SMART_INVALID_COMMAND 3 // Invalid command byte
#define SMART_INVALID_BUFFER 4 // Bad buffer (null, invalid addr..)
#define SMART_INVALID_DRIVE 5 // Drive number not valid
#define SMART_INVALID_IOCTL 6 // Invalid IOCTL
#define SMART_ERROR_NO_MEM 7 // Could not lock user's buffer
#define SMART_INVALID_REGISTER 8 // Some IDE Register not valid
#define SMART_NOT_SUPPORTED 9 // Invalid cmd flag set
#define SMART_NO_IDE_DEVICE 10 // Cmd issued to device not present
#define SMART_OFFLINE_ROUTINE_OFFLINE 0
#define SMART_SHORT_SELFTEST_OFFLINE 1
#define SMART_EXTENDED_SELFTEST_OFFLINE 2
#define SMART_ABORT_OFFLINE_SELFTEST 127
#define SMART_SHORT_SELFTEST_CAPTIVE 129
#define SMART_EXTENDED_SELFTEST_CAPTIVE 130
#include <pshpack1.h>
typedef
struct
{
;
;
[
1
];
}
, *
, *
;
#include <poppack.h>
#define READ_ATTRIBUTE_BUFFER_SIZE 512
#define IDENTIFY_BUFFER_SIZE 512
#define READ_THRESHOLD_BUFFER_SIZE 512
#define SMART_LOG_SECTOR_SIZE 512
#define READ_ATTRIBUTES 0xD0
#define READ_THRESHOLDS 0xD1
#define ENABLE_DISABLE_AUTOSAVE 0xD2
#define SAVE_ATTRIBUTE_VALUES 0xD3
#define EXECUTE_OFFLINE_DIAGS 0xD4
#define SMART_READ_LOG 0xD5
#define SMART_WRITE_LOG 0xd6
#define ENABLE_SMART 0xD8
#define DISABLE_SMART 0xD9
#define RETURN_SMART_STATUS 0xDA
#define ENABLE_DISABLE_AUTO_OFFLINE 0xDB
#endif /* _WIN32_WINNT >= 0x0400 */
#define IOCTL_DISK_GET_DISK_ATTRIBUTES CTL_CODE(IOCTL_DISK_BASE, 0x003c, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_SET_DISK_ATTRIBUTES CTL_CODE(IOCTL_DISK_BASE, 0x003d, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define DISK_ATTRIBUTE_OFFLINE 0x0000000000000001
#define DISK_ATTRIBUTE_READ_ONLY 0x0000000000000002
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
;
[
3
];
;
;
[
4
];
}
, *
;
#define IOCTL_DISK_RESET_SNAPSHOT_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0084, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(pop)
#endif
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#endif // _NTDDDISK_H_
#define IOCTL_CHANGER_BASE FILE_DEVICE_CHANGER
#define IOCTL_CHANGER_GET_PARAMETERS CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_GET_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_GET_PRODUCT_DATA CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_SET_ACCESS CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_CHANGER_GET_ELEMENT_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_SET_POSITION CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_EXCHANGE_MEDIUM CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_MOVE_MEDIUM CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_REINITIALIZE_TRANSPORT CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_CHANGER_QUERY_VOLUME_TAGS CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define MAX_VOLUME_ID_SIZE 36
#define MAX_VOLUME_TEMPLATE_SIZE 40
#define VENDOR_ID_LENGTH 8
#define PRODUCT_ID_LENGTH 16
#define REVISION_LENGTH 4
#define SERIAL_NUMBER_LENGTH 32
typedef
enum
{
,
,
,
,
,
,
,
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
#define CHANGER_BAR_CODE_SCANNER_INSTALLED 0x00000001 // The medium-changer has a bar code scanner installed.
#define CHANGER_INIT_ELEM_STAT_WITH_RANGE 0x00000002 // The medium-changer has the ability to initialize elements within a specified range.
#define CHANGER_CLOSE_IEPORT 0x00000004 // The medium-changer has the ability to close the i/e port door.
#define CHANGER_OPEN_IEPORT 0x00000008 // The medium-changer can open the i/e port door.
#define CHANGER_STATUS_NON_VOLATILE 0x00000010 // The medium-changer uses non-volatile memory for element status information.
#define CHANGER_EXCHANGE_MEDIA 0x00000020 // The medium-changer supports exchange operations.
#define CHANGER_CLEANER_SLOT 0x00000040 // The medium-changer has a fixed slot designated for cleaner cartridges.
#define CHANGER_LOCK_UNLOCK 0x00000080 // The medium-changer can be (un)secured to (allow)prevent media removal.
#define CHANGER_CARTRIDGE_MAGAZINE 0x00000100 // The medium-changer uses cartridge magazines for some storage slots.
#define CHANGER_MEDIUM_FLIP 0x00000200 // The medium-changer can flip medium.
#define CHANGER_POSITION_TO_ELEMENT 0x00000400 // The medium-changer can position the transport to a particular element.
#define CHANGER_REPORT_IEPORT_STATE 0x00000800 // The medium-changer can determine whether media is present
#define CHANGER_STORAGE_DRIVE 0x00001000 // The medium-changer can use a drive as an independent storage element.
#define CHANGER_STORAGE_IEPORT 0x00002000 // The medium-changer can use a i/e port as an independent storage element.
#define CHANGER_STORAGE_SLOT 0x00004000 // The medium-changer can use a slot as an independent storage element.
#define CHANGER_STORAGE_TRANSPORT 0x00008000 // The medium-changer can use a transport as an independent storage element.
#define CHANGER_DRIVE_CLEANING_REQUIRED 0x00010000 // The drives controlled by the medium changer require periodic cleaning
#define CHANGER_PREDISMOUNT_EJECT_REQUIRED 0x00020000 // The medium-changer requires a drive eject command to be issued, before a changer
#define CHANGER_CLEANER_ACCESS_NOT_VALID 0x00040000 // The access bit in GES isn't valid for cleaner cartridges.
#define CHANGER_PREMOUNT_EJECT_REQUIRED 0x00080000 // The medium-changer requires a drive eject command to be issued
#define CHANGER_VOLUME_IDENTIFICATION 0x00100000 // The medium-changer supports volume identification.
#define CHANGER_VOLUME_SEARCH 0x00200000 // The medium-changer can search for volume information.
#define CHANGER_VOLUME_ASSERT 0x00400000 // The medium-changer can verify volume information.
#define CHANGER_VOLUME_REPLACE 0x00800000 // The medium-changer can replace volume information.
#define CHANGER_VOLUME_UNDEFINE 0x01000000 // The medium-changer can undefine volume information.
#define CHANGER_SERIAL_NUMBER_VALID 0x04000000 // The serial number reported in GetProductData is valid
#define CHANGER_DEVICE_REINITIALIZE_CAPABLE 0x08000000 // The medium-changer can be issued a ChangerReinitializeUnit.
#define CHANGER_KEYPAD_ENABLE_DISABLE 0x10000000 // Indicates that the keypad can be enabled/disabled.
#define CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS 0x20000000 // Drives must be empty before access via the door is possible.
#define CHANGER_RESERVED_BIT 0x80000000 // Will be used to indicate Features1 capability bits.
#define CHANGER_PREDISMOUNT_ALIGN_TO_SLOT 0x80000001 // The transport must be prepositioned to the slot prior to ejecting the media.
#define CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE 0x80000002 // The transport must be prepositioned to the drive prior to ejecting the media.
#define CHANGER_CLEANER_AUTODISMOUNT 0x80000004 // The device will move the cleaner cartridge back into the slot when cleaning has completed.
#define CHANGER_TRUE_EXCHANGE_CAPABLE 0x80000008 // Device can do src -> dest2 exchanges.
#define CHANGER_SLOTS_USE_TRAYS 0x80000010 // Slots have removable trays, requiring multiple moves for inject/eject.
#define CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR 0x80000020 // Media must be returned to the slot from which it originated after a move to another element.
#define CHANGER_CLEANER_OPS_NOT_SUPPORTED 0x80000040 // Automated cleaning operations are not supported on this device.
#define CHANGER_IEPORT_USER_CONTROL_OPEN 0x80000080 // Indicates that user action is necessary to open a closed ieport.
#define CHANGER_IEPORT_USER_CONTROL_CLOSE 0x80000100 // Indicates that user action is necessary to close an opened ieport.
#define CHANGER_MOVE_EXTENDS_IEPORT 0x80000200 // Indicates that a move media to the ieport extends the tray.
#define CHANGER_MOVE_RETRACTS_IEPORT 0x80000400 // Indicates that a move media from the ieport retracts the tray.
#define CHANGER_TO_TRANSPORT 0x01 // The device can carry out the operation to a transport from the specified element.
#define CHANGER_TO_SLOT 0x02 // The device can carry out the operation to a slot from the specified element.
#define CHANGER_TO_IEPORT 0x04 // The device can carry out the operation to an IE Port from the specified element.
#define CHANGER_TO_DRIVE 0x08 // The device can carry out the operation to a drive from the specified element.
#define LOCK_UNLOCK_IEPORT 0x01 // The device can lock/unlock the ieport(s).
#define LOCK_UNLOCK_DOOR 0x02 // The device can lock/unlock the door(s).
#define LOCK_UNLOCK_KEYPAD 0x04 // The device can lock/unlock the keypad.
typedef
struct
{
;
;
;
;
;
NumberDataTransferElements
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
[
2
];
[
2
];
}
, *
;
typedef
struct
{
BYTE VendorId[VENDOR_ID_LENGTH];
BYTE ProductId[PRODUCT_ID_LENGTH];
BYTE Revision[REVISION_LENGTH];
BYTE SerialNumber[SERIAL_NUMBER_LENGTH];
;
}
, *
;
#define LOCK_ELEMENT 0
#define UNLOCK_ELEMENT 1
#define EXTEND_IEPORT 2
#define RETRACT_IEPORT 3
typedef
struct
{
;
;
}
, *
;
typedef
struct
_CHANGER_READ_ELEMENT_STATUS
{
;
;
}
CHANGER_READ_ELEMENT_STATUS
, *
PCHANGER_READ_ELEMENT_STATUS
;
typedef
struct
{
;
;
;
;
;
;
;
BYTE PrimaryVolumeID[MAX_VOLUME_ID_SIZE];
BYTE AlternateVolumeID[MAX_VOLUME_ID_SIZE];
}
, *
;
typedef
struct
_CHANGER_ELEMENT_STATUS_EX
{
;
;
;
;
;
;
;
BYTE PrimaryVolumeID[MAX_VOLUME_ID_SIZE];
BYTE AlternateVolumeID[MAX_VOLUME_ID_SIZE];
BYTE VendorIdentification[VENDOR_ID_LENGTH];
BYTE ProductIdentification[PRODUCT_ID_LENGTH];
BYTE SerialNumber[SERIAL_NUMBER_LENGTH];
}
CHANGER_ELEMENT_STATUS_EX
, *
PCHANGER_ELEMENT_STATUS_EX
;
#define ELEMENT_STATUS_FULL 0x00000001 // Element contains a unit of media.
#define ELEMENT_STATUS_IMPEXP 0x00000002 // Media in i/e port was placed there by an operator.
#define ELEMENT_STATUS_EXCEPT 0x00000004 // Element is in an abnormal state; check ExceptionCode field for more information.
#define ELEMENT_STATUS_ACCESS 0x00000008 // Access to the i/e port from the medium changer is allowed.
#define ELEMENT_STATUS_EXENAB 0x00000010 // Export of media is supported.
#define ELEMENT_STATUS_INENAB 0x00000020 // Import of media is supported.
#define ELEMENT_STATUS_PRODUCT_DATA 0x00000040 // Serial number valid for the drive
#define ELEMENT_STATUS_LUN_VALID 0x00001000 // Lun information is valid.
#define ELEMENT_STATUS_ID_VALID 0x00002000 // SCSI Id information is valid.
#define ELEMENT_STATUS_NOT_BUS 0x00008000 // Lun and SCSI Id fields are not on same bus as medium changer.
#define ELEMENT_STATUS_INVERT 0x00400000 // Media in element was inverted (valid only if ELEMENT_STATUS_SVALID bit is set)
#define ELEMENT_STATUS_SVALID 0x00800000 // SourceElementAddress field and ELEMENT_STATUS_INVERT bit are valid.
#define ELEMENT_STATUS_PVOLTAG 0x10000000 // Primary volume information is valid.
#define ELEMENT_STATUS_AVOLTAG 0x20000000 // Alternate volume information is valid.
#define ERROR_LABEL_UNREADABLE 0x00000001 // Bar code scanner could not read bar code label.
#define ERROR_LABEL_QUESTIONABLE 0x00000002 // Label could be invalid due to unit attention condition.
#define ERROR_SLOT_NOT_PRESENT 0x00000004 // Slot is currently not addressable in the device.
#define ERROR_DRIVE_NOT_INSTALLED 0x00000008 // Drive is not installed.
#define ERROR_TRAY_MALFUNCTION 0x00000010 // Media tray is malfunctioning/broken.
#define ERROR_INIT_STATUS_NEEDED 0x00000011 // An Initialize Element Status command is needed.
#define ERROR_UNHANDLED_ERROR 0xFFFFFFFF // Unknown error condition
typedef
struct
_CHANGER_INITIALIZE_ELEMENT_STATUS
{
;
;
}
CHANGER_INITIALIZE_ELEMENT_STATUS
, *
PCHANGER_INITIALIZE_ELEMENT_STATUS
;
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
}
, *
;
typedef
struct
{
;
;
BYTE VolumeIDTemplate[MAX_VOLUME_TEMPLATE_SIZE];
}
, *
;
typedef
struct
_READ_ELEMENT_ADDRESS_INFO
{
;
[
1
];
}
READ_ELEMENT_ADDRESS_INFO
, *
PREAD_ELEMENT_ADDRESS_INFO
;
#define SEARCH_ALL 0x0 // Translate - search all defined volume tags.
#define SEARCH_PRIMARY 0x1 // Translate - search only primary volume tags.
#define SEARCH_ALTERNATE 0x2 // Translate - search only alternate volume tags.
#define SEARCH_ALL_NO_SEQ 0x4 // Translate - search all defined volume tags but ignore sequence numbers.
#define SEARCH_PRI_NO_SEQ 0x5 // Translate - search only primary volume tags but ignore sequence numbers.
#define SEARCH_ALT_NO_SEQ 0x6 // Translate - search only alternate volume tags but ignore sequence numbers.
#define ASSERT_PRIMARY 0x8 // Assert - as the primary volume tag - if tag now undefined.
#define ASSERT_ALTERNATE 0x9 // Assert - as the alternate volume tag - if tag now undefined.
#define REPLACE_PRIMARY 0xA // Replace - the primary volume tag - current tag ignored.
#define REPLACE_ALTERNATE 0xB // Replace - the alternate volume tag - current tag ignored.
#define UNDEFINE_PRIMARY 0xC // Undefine - the primary volume tag - current tag ignored.
#define UNDEFINE_ALTERNATE 0xD // Undefine - the alternate volume tag - current tag ignored.
typedef
enum
_CHANGER_DEVICE_PROBLEM_TYPE
{
,
,
,
,
DeviceProblemCalibrationError
,
DeviceProblemTargetFailure
,
DeviceProblemCHMMoveError
,
DeviceProblemCHMZeroError
,
DeviceProblemCartridgeInsertError
,
DeviceProblemPositionError
,
,
DeviceProblemCartridgeEjectError
,
DeviceProblemGripperError
,
}
CHANGER_DEVICE_PROBLEM_TYPE
, *
PCHANGER_DEVICE_PROBLEM_TYPE
;
#define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_SERENUM_EXPOSE_HARDWARE CTL_CODE(FILE_DEVICE_SERENUM,128,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_SERENUM_REMOVE_HARDWARE CTL_CODE(FILE_DEVICE_SERENUM,129,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_SERENUM_PORT_DESC CTL_CODE(FILE_DEVICE_SERENUM,130,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_SERENUM_GET_PORT_NAME CTL_CODE(FILE_DEVICE_SERENUM,131,METHOD_BUFFERED,FILE_ANY_ACCESS)
#define SERIAL_LSRMST_ESCAPE ((BYTE )0x00)
#define SERIAL_LSRMST_LSR_DATA ((BYTE )0x01)
#define SERIAL_LSRMST_LSR_NODATA ((BYTE )0x02)
#define SERIAL_LSRMST_MST ((BYTE )0x03)
#define SERIAL_IOC_FCR_FIFO_ENABLE ((DWORD)0x00000001)
#define SERIAL_IOC_FCR_RCVR_RESET ((DWORD)0x00000002)
#define SERIAL_IOC_FCR_XMIT_RESET ((DWORD)0x00000004)
#define SERIAL_IOC_FCR_DMA_MODE ((DWORD)0x00000008)
#define SERIAL_IOC_FCR_RES1 ((DWORD)0x00000010)
#define SERIAL_IOC_FCR_RES2 ((DWORD)0x00000020)
#define SERIAL_IOC_FCR_RCVR_TRIGGER_LSB ((DWORD)0x00000040)
#define SERIAL_IOC_FCR_RCVR_TRIGGER_MSB ((DWORD)0x00000080)
#define SERIAL_IOC_MCR_DTR ((DWORD)0x00000001)
#define SERIAL_IOC_MCR_RTS ((DWORD)0x00000002)
#define SERIAL_IOC_MCR_OUT1 ((DWORD)0x00000004)
#define SERIAL_IOC_MCR_OUT2 ((DWORD)0x00000008)
#define SERIAL_IOC_MCR_LOOP ((DWORD)0x00000010)
#ifndef _FILESYSTEMFSCTL_
#define _FILESYSTEMFSCTL_
#define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) // PATHNAME_BUFFER,
#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_SET_BOOTLOADER_ACCESSED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_MARK_AS_SYSTEM_HIVE FSCTL_SET_BOOTLOADER_ACCESSED
#define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_QUERY_FAT_BPB_BUFFER
#define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILESYSTEM_STATISTICS
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_VOLUME_DATA_BUFFER
#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_FILE_RECORD_INPUT_BUFFER, NTFS_FILE_RECORD_OUTPUT_BUFFER
#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_LCN_INPUT_BUFFER, VOLUME_BITMAP_BUFFER
#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTERS_BUFFER
#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // MOVE_FILE_DATA,
#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
#define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // FILE_OBJECTID_BUFFER
#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_OBJECTID_BUFFER
#define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER,
#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) // REPARSE_DATA_BUFFER
#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER,
#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_ANY_ACCESS) // MFT_ENUM_DATA,
#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA) // BULK_SECURITY_TEST_DATA,
#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_ANY_ACCESS) // READ_USN_JOURNAL_DATA, USN
#define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_OBJECTID_BUFFER
#define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA) // FILE_ZERO_DATA_INFORMATION,
#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA) // FILE_ALLOCATED_RANGE_BUFFER, FILE_ALLOCATED_RANGE_BUFFER
#define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_NEITHER, FILE_ANY_ACCESS) // ENCRYPTION_BUFFER, DECRYPTION_STATUS_BUFFER
#define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_SPECIAL_ACCESS) // ENCRYPTED_DATA_INFO, EXTENDED_ENCRYPTED_DATA_INFO
#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_SPECIAL_ACCESS) // REQUEST_RAW_ENCRYPTED_DATA, ENCRYPTED_DATA_INFO, EXTENDED_ENCRYPTED_DATA_INFO
#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_ANY_ACCESS) // CREATE_USN_JOURNAL_DATA,
#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_ANY_ACCESS) // Read the Usn Record for a file
#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_ANY_ACCESS) // Generate Close Usn Record
#define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // FILE_PREFETCH
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#define FSCTL_MAKE_MEDIA_COMPATIBLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76, METHOD_BUFFERED, FILE_WRITE_DATA) // UDFS R/W
#define FSCTL_SET_DEFECT_MANAGEMENT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77, METHOD_BUFFERED, FILE_WRITE_DATA) // UDFS R/W
#define FSCTL_QUERY_SPARING_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78, METHOD_BUFFERED, FILE_ANY_ACCESS) // UDFS R/W
#define FSCTL_QUERY_ON_DISK_VOLUME_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79, METHOD_BUFFERED, FILE_ANY_ACCESS) // C/UDFS
#define FSCTL_SET_VOLUME_COMPRESSION_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // VOLUME_COMPRESSION_STATE
#define FSCTL_TXFS_MODIFY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_QUERY_RM_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_TXFS_ROLLFORWARD_REDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_ROLLFORWARD_UNDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_START_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_SHUTDOWN_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_READ_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_CREATE_SECONDARY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_GET_METADATA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_TXFS_GET_TRANSACTED_VERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_TXFS_SAVEPOINT_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 94, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_CREATE_MINIVERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF
#define FSCTL_TXFS_TRANSACTION_ACTIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_SET_ZERO_ON_DEALLOCATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_SET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_WAIT_FOR_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_INITIATE_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSC_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER, FILE_ANY_ACCESS) // CSC internal implementation
#define FSCTL_SHRINK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // SHRINK_VOLUME_INFORMATION
#define FSCTL_SET_SHORT_NAME_BEHAVIOR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DFSR_SET_GHOST_HANDLE_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES \
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_TXFS_LIST_TRANSACTIONS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121, METHOD_BUFFERED, FILE_READ_DATA) // TxF
#define FSCTL_QUERY_PAGEFILE_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_VISTA */
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#define FSCTL_RESET_VOLUME_ALLOCATION_HINTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 123, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_VISTA */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_QUERY_DEPENDENT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 124, METHOD_BUFFERED, FILE_ANY_ACCESS) // Dependency File System Filter
#define FSCTL_SD_GLOBAL_CHANGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 125, METHOD_BUFFERED, FILE_ANY_ACCESS) // Query/Change NTFS Security Descriptors
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#define FSCTL_TXFS_READ_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 126, METHOD_BUFFERED, FILE_ANY_ACCESS) // TxF
#endif /* _WIN32_WINNT >= _WIN32_WINNT_VISTA */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_LOOKUP_STREAM_FROM_CLUSTER CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 127, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 128, METHOD_BUFFERED, FILE_ANY_ACCESS) // TxF
#define FSCTL_FILE_TYPE_NOTIFICATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 129, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define FSCTL_FILE_LEVEL_TRIM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 130, METHOD_BUFFERED, FILE_WRITE_DATA)
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_GET_BOOT_AREA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 140, METHOD_BUFFERED, FILE_ANY_ACCESS) // BOOT_AREA_INFO
#define FSCTL_GET_RETRIEVAL_POINTER_BASE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 141, METHOD_BUFFERED, FILE_ANY_ACCESS) // RETRIEVAL_POINTER_BASE
#define FSCTL_SET_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_FS_PERSISTENT_VOLUME_INFORMATION
#define FSCTL_QUERY_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 143, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_FS_PERSISTENT_VOLUME_INFORMATION
#define FSCTL_REQUEST_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 144, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 145, METHOD_BUFFERED, FILE_ANY_ACCESS) // CSV_TUNNEL_REQUEST
#define FSCTL_IS_CSV_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 146, METHOD_BUFFERED, FILE_ANY_ACCESS) // IS_CSV_FILE
#define FSCTL_QUERY_FILE_SYSTEM_RECOGNITION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 147, METHOD_BUFFERED, FILE_ANY_ACCESS) //
#define FSCTL_CSV_GET_VOLUME_PATH_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 148, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 150, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_FILE_ON_CSV_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 151, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define FSCTL_CORRUPTION_HANDLING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 152, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OFFLOAD_READ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 153, METHOD_BUFFERED, FILE_READ_ACCESS)
#define FSCTL_OFFLOAD_WRITE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 154, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_CSV_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 155, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define FSCTL_SET_PURGE_FAILURE_MODE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 156, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_FILE_LAYOUT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 157, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_IS_VOLUME_OWNED_BYCSVFS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 158, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_GET_INTEGRITY_INFORMATION_BUFFER
#define FSCTL_SET_INTEGRITY_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) // FSCTL_SET_INTEGRITY_INFORMATION_BUFFER
#define FSCTL_QUERY_FILE_REGIONS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 161, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define FSCTL_RKF_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 171, METHOD_NEITHER, FILE_ANY_ACCESS) // Resume Key Filter
#define FSCTL_SCRUB_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 172, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REPAIR_COPIES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 173, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_DISABLE_LOCAL_BUFFERING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 174, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_MGMT_LOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 175, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 176, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ADVANCE_FILE_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 177, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_SYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 178, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 179, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_WRITE_USN_REASON CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 180, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 181, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_REFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 182, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_CSV_H_BREAKING_SYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 185, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FSCTL_QUERY_STORAGE_CLASSES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 187, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_REGION_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 188, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_USN_TRACK_MODIFIED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 189, METHOD_BUFFERED, FILE_ANY_ACCESS) // USN_TRACK_MODIFIED_RANGES
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 192, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SVHDX_SYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 193, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SVHDX_SET_INITIATOR_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 194, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_SET_EXTERNAL_BACKING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 195, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_GET_EXTERNAL_BACKING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 196, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_EXTERNAL_BACKING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 197, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_ENUM_EXTERNAL_BACKING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 198, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ENUM_OVERLAY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 199, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_ADD_OVERLAY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 204, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_REMOVE_OVERLAY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 205, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_UPDATE_OVERLAY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 206, METHOD_BUFFERED, FILE_WRITE_DATA)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN7) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define FSCTL_SHUFFLE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 208, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) // SHUFFLE_FILE_DATA
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FSCTL_DUPLICATE_EXTENTS_TO_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 209, METHOD_BUFFERED, FILE_WRITE_DATA )
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FSCTL_SPARSE_OVERALLOCATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 211, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_STORAGE_QOS_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 212, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define FSCTL_INITIATE_FILE_METADATA_OPTIMIZATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 215, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define FSCTL_QUERY_FILE_METADATA_OPTIMIZATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 216, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FSCTL_SVHDX_ASYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 217, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_GET_WOF_VERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 218, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define FSCTL_HCS_SYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 219, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_HCS_ASYNC_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 220, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_EXTENT_READ_CACHE_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 221, METHOD_NEITHER, FILE_ANY_ACCESS) // VCN_RANGE_INPUT_BUFFER, EXTENT_READ_CACHE_INFO_BUFFER
#define FSCTL_QUERY_REFS_VOLUME_COUNTER_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 222, METHOD_NEITHER, FILE_ANY_ACCESS) // REFS_VOLUME_COUNTER_INFO_INPUT_BUFFER, VOLUME_REFS_INFO_BUFFER
#define FSCTL_CLEAN_VOLUME_METADATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 223, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_INTEGRITY_INFORMATION_EX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 224, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FSCTL_SUSPEND_OVERLAY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 225, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define FSCTL_VIRTUAL_STORAGE_QUERY_PROPERTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 226, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_FILESYSTEM_GET_STATISTICS_EX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 227, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILESYSTEM_STATISTICS_EX
#define FSCTL_QUERY_VOLUME_CONTAINER_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 228, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_LAYER_ROOT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 229, METHOD_BUFFERED, FILE_ANY_ACCESS) // CONTAINER_ROOT_INFO_INPUT CONTAINER_ROOT_INFO_OUTPUT
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_TH2)
#define FSCTL_QUERY_DIRECT_ACCESS_EXTENTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 230, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_NOTIFY_STORAGE_SPACE_ALLOCATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 231, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SSDI_STORAGE_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 232, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1)
#define FSCTL_QUERY_DIRECT_IMAGE_ORIGINAL_BASE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 233, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_READ_UNPRIVILEGED_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 234, METHOD_NEITHER, FILE_ANY_ACCESS) // READ_USN_JOURNAL_DATA, USN
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_TH2)
#define FSCTL_GHOST_FILE_EXTENTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 235, METHOD_BUFFERED, FILE_WRITE_ACCESS) // FSCTL_GHOST_FILE_EXTENTS_INPUT_BUFFER
#define FSCTL_QUERY_GHOSTED_FILE_EXTENTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 236, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_TH2)
#define FSCTL_UNMAP_SPACE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 237, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define FSCTL_HCS_SYNC_NO_WRITE_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 238, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2)
#define FSCTL_STREAMS_QUERY_PARAMETERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 241, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_STREAMS_ASSOCIATE_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 242, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_STREAMS_QUERY_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 243, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 244, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTERS_AND_REFCOUNT_BUFFER
#define FSCTL_QUERY_VOLUME_NUMA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 245, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2)
#define FSCTL_REFS_DEALLOCATE_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 246, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_TH2)
#define FSCTL_QUERY_REFS_SMR_VOLUME_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 247, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_REFS_SMR_VOLUME_GC_PARAMETERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 248, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_REFS_FILE_STRICTLY_SEQUENTIAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 249, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3)
#define FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_QUERY_BAD_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 251, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_DAX_ALLOC_ALIGNMENT_HINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 252, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_CORRUPTED_REFS_CONTAINER CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 253, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SCRUB_UNDISCOVERABLE_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 254, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4)
#define FSCTL_NOTIFY_DATA_CHANGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 255, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1)
#define FSCTL_START_VIRTUALIZATION_INSTANCE_EX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 256, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4)
#define FSCTL_ENCRYPTION_KEY_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 257, METHOD_BUFFERED, FILE_ANY_ACCESS) // protect/unprotect under DPL
#define FSCTL_VIRTUAL_STORAGE_SET_BEHAVIOR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 258, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1)
#define FSCTL_SET_REPARSE_POINT_EX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 259, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER_EX
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
#define FSCTL_REARRANGE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 264, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) // REARRANGE_FILE_DATA
#define FSCTL_VIRTUAL_STORAGE_PASSTHROUGH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 265, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_RETRIEVAL_POINTER_COUNT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 266, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTER_COUNT
#if defined(_WIN64)
#define FSCTL_ENABLE_PER_IO_FLAGS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 267, METHOD_BUFFERED, FILE_ANY_ACCESS)
#endif /* _WIN64 */
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5) */
#define IOCTL_AVIO_ALLOCATE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 1, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define IOCTL_AVIO_FREE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 2, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define IOCTL_AVIO_MODIFY_STREAM CTL_CODE(FILE_DEVICE_AVIO, 3, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
typedef
struct
{
;
[
1
];
}
, *
;
typedef
struct
_FSCTL_QUERY_FAT_BPB_BUFFER
{
First0x24BytesOfBootSector
[
0x24
];
}
FSCTL_QUERY_FAT_BPB_BUFFER
, *
PFSCTL_QUERY_FAT_BPB_BUFFER
;
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
typedef
struct
{
;
;
;
;
;
;
;
BytesPerFileRecordSegment
;
ClustersPerFileRecordSegment
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
;
;
;
;
#endif
}
NTFS_EXTENDED_VOLUME_DATA
, *
PNTFS_EXTENDED_VOLUME_DATA
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
MaximumSizeOfResidentFile
;
[
10
];
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
typedef
struct
{
;
}
, *
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define GET_VOLUME_BITMAP_FLAG_MASK_METADATA 0x00000001
typedef
struct
{
;
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD */
typedef
struct
{
;
;
[
1
];
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
typedef
struct
{
;
}
, *
;
typedef
struct
RETRIEVAL_POINTERS_BUFFER
{
;
;
struct
{
;
;
}
[
1
];
}
RETRIEVAL_POINTERS_BUFFER
, *
PRETRIEVAL_POINTERS_BUFFER
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2)
typedef
struct
RETRIEVAL_POINTERS_AND_REFCOUNT_BUFFER
{
;
;
struct
{
;
;
;
}
[
1
];
}
RETRIEVAL_POINTERS_AND_REFCOUNT_BUFFER
, *
PRETRIEVAL_POINTERS_AND_REFCOUNT_BUFFER
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
typedef
struct
{
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5 */
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
NTFS_FILE_RECORD_OUTPUT_BUFFER
, *
PNTFS_FILE_RECORD_OUTPUT_BUFFER
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_NT4)
typedef
struct
{
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
#if defined(_WIN64)
//
// 32/64 Bit thunking support structure
//
typedef struct _MOVE_FILE_DATA32 {
UINT32 FileHandle;
LARGE_INTEGER StartingVcn;
LARGE_INTEGER StartingLcn;
DWORD ClusterCount;
} MOVE_FILE_DATA32, *PMOVE_FILE_DATA32;
#endif
#endif /* _WIN32_WINNT >= _WIN32_WINNT_NT4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
;
[
1
];
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
}
, *
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
, *
;
#else
typedef MFT_ENUM_DATA_V0 MFT_ENUM_DATA, *PMFT_ENUM_DATA;
#endif
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
}
, *
PREAD_USN_JOURNAL_DATA_V0
;
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
PREAD_USN_JOURNAL_DATA_V1
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
, *
;
#else
typedef READ_USN_JOURNAL_DATA_V0 READ_USN_JOURNAL_DATA, *PREAD_USN_JOURNAL_DATA;
#endif
typedef
struct
{
;
;
;
;
}
USN_TRACK_MODIFIED_RANGES
, *
PUSN_TRACK_MODIFIED_RANGES
;
typedef
struct
{
;
}
, *
;
#define FLAG_USN_TRACK_MODIFIED_RANGES_ENABLE 0x00000001
typedef
struct
{
;
;
;
;
ParentFileReferenceNumber
;
;
;
;
;
;
;
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
;
;
ParentFileReferenceNumber
;
;
;
;
;
;
;
;
;
[
1
];
}
, *
;
typedef
, *
;
typedef
struct
{
;
;
;
} , *;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
ParentFileReferenceNumber
;
;
;
;
;
;
;
[
1
];
}
, *
;
typedef
union
{
;
;
;
;
}
, *
;
#define USN_PAGE_SIZE (0x1000)
#define USN_REASON_DATA_OVERWRITE (0x00000001)
#define USN_REASON_DATA_EXTEND (0x00000002)
#define USN_REASON_DATA_TRUNCATION (0x00000004)
#define USN_REASON_NAMED_DATA_OVERWRITE (0x00000010)
#define USN_REASON_NAMED_DATA_EXTEND (0x00000020)
#define USN_REASON_NAMED_DATA_TRUNCATION (0x00000040)
#define USN_REASON_FILE_CREATE (0x00000100)
#define USN_REASON_FILE_DELETE (0x00000200)
#define USN_REASON_EA_CHANGE (0x00000400)
#define USN_REASON_SECURITY_CHANGE (0x00000800)
#define USN_REASON_RENAME_OLD_NAME (0x00001000)
#define USN_REASON_RENAME_NEW_NAME (0x00002000)
#define USN_REASON_INDEXABLE_CHANGE (0x00004000)
#define USN_REASON_BASIC_INFO_CHANGE (0x00008000)
#define USN_REASON_HARD_LINK_CHANGE (0x00010000)
#define USN_REASON_COMPRESSION_CHANGE (0x00020000)
#define USN_REASON_ENCRYPTION_CHANGE (0x00040000)
#define USN_REASON_OBJECT_ID_CHANGE (0x00080000)
#define USN_REASON_REPARSE_POINT_CHANGE (0x00100000)
#define USN_REASON_STREAM_CHANGE (0x00200000)
#define USN_REASON_TRANSACTED_CHANGE (0x00400000)
#define USN_REASON_INTEGRITY_CHANGE (0x00800000)
#define USN_REASON_DESIRED_STORAGE_CLASS_CHANGE (0x01000000)
#define USN_REASON_CLOSE (0x80000000)
typedef
struct
{
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
RangeTrackFileSizeThreshold
;
}
, *
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
, *
;
#else
typedef USN_JOURNAL_DATA_V0 USN_JOURNAL_DATA, *PUSN_JOURNAL_DATA;
#endif
typedef
struct
{
;
;
}
, *
;
#define USN_DELETE_FLAG_DELETE (0x00000001)
#define USN_DELETE_FLAG_NOTIFY (0x00000002)
#define USN_DELETE_VALID_FLAGS (0x00000003)
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) // unnamed struct
#pragma warning(disable:
4201
)
typedef
struct
{
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
union
{
;
;
#else
DWORD UsnSourceInfo;
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
;
;
}
, *
;
#if defined(_WIN64)
//
// 32/64 Bit thunking support structure
//
typedef struct {
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
union {
DWORD UsnSourceInfo;
DWORD CopyNumber;
} DUMMYUNIONNAME;
#else
DWORD UsnSourceInfo;
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
UINT32 VolumeHandle;
DWORD HandleInfo;
} MARK_HANDLE_INFO32, *PMARK_HANDLE_INFO32;
#endif
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4201) // unnamed struct
#endif
#define USN_SOURCE_DATA_MANAGEMENT (0x00000001)
#define USN_SOURCE_AUXILIARY_DATA (0x00000002)
#define USN_SOURCE_REPLICATION_MANAGEMENT (0x00000004)
#define USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT (0x00000008)
#define USN_SOURCE_VALID_FLAGS (USN_SOURCE_DATA_MANAGEMENT | \
USN_SOURCE_AUXILIARY_DATA | \
USN_SOURCE_REPLICATION_MANAGEMENT | \
USN_SOURCE_CLIENT_REPLICATION_MANAGEMENT)
#define MARK_HANDLE_PROTECT_CLUSTERS (0x00000001)
#define MARK_HANDLE_TXF_SYSTEM_LOG (0x00000004)
#define MARK_HANDLE_NOT_TXF_SYSTEM_LOG (0x00000008)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define MARK_HANDLE_REALTIME (0x00000020)
#define MARK_HANDLE_NOT_REALTIME (0x00000040)
#define MARK_HANDLE_FILTER_METADATA (0x00000200) // 8.1 update and newer
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define MARK_HANDLE_READ_COPY (0x00000080)
#define MARK_HANDLE_NOT_READ_COPY (0x00000100)
#define MARK_HANDLE_RETURN_PURGE_FAILURE (0x00000400) // 8.1 and newer
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define MARK_HANDLE_CLOUD_SYNC (0x00000800)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define MARK_HANDLE_DISABLE_FILE_METADATA_OPTIMIZATION (0x00001000) // 9.0 and newer
#define MARK_HANDLE_ENABLE_USN_SOURCE_ON_PAGING_IO (0x00002000) // 9.0 and newer
#define MARK_HANDLE_SKIP_COHERENCY_SYNC_DISALLOW_WRITES (0x00004000) // 9.0 and newer
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4)
#define MARK_HANDLE_ENABLE_CPU_CACHE (0x10000000)
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define NO_8DOT3_NAME_PRESENT (0x00000001)
#define REMOVED_8DOT3_NAME (0x00000002)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
[
1
];
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
#define VOLUME_IS_DIRTY (0x00000001)
#define VOLUME_UPGRADE_SCHEDULED (0x00000002)
#define VOLUME_SESSION_OPEN (0x00000004)
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
;
[
1
];
}
, *
;
#define FILE_PREFETCH_TYPE_FOR_CREATE 0x1
#define FILE_PREFETCH_TYPE_FOR_DIRENUM 0x2
#define FILE_PREFETCH_TYPE_FOR_CREATE_EX 0x3
#define FILE_PREFETCH_TYPE_FOR_DIRENUM_EX 0x4
#define FILE_PREFETCH_TYPE_MAX 0x4
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
}
, *
;
#define FILESYSTEM_STATISTICS_TYPE_NTFS 1
#define FILESYSTEM_STATISTICS_TYPE_FAT 2
#define FILESYSTEM_STATISTICS_TYPE_EXFAT 3
#define FILESYSTEM_STATISTICS_TYPE_REFS 4
typedef
struct
{
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
struct
{
;
;
;
;
}
;
MftWritesFlushForLogFileFull
;
;
;
;
;
struct
{
;
;
;
;
}
;
Mft2WritesFlushForLogFileFull
;
;
;
;
;
;
;
;
;
;
;
BitmapWritesFlushForLogFileFull
;
;
;
struct
{
;
;
;
}
;
;
;
;
;
MftBitmapWritesFlushForLogFileFull
;
MftBitmapWritesLazyWriter
;
MftBitmapWritesUserRequest
;
struct
{
;
;
;
;
}
;
;
;
;
;
;
;
;
;
struct
{
;
;
;
;
;
;
;
;
;
;
}
;
;
}
, *
;
typedef
struct
_FILESYSTEM_STATISTICS_EX
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
}
, *
PFILESYSTEM_STATISTICS_EX
;
typedef
struct
{
;
;
;
;
;
;
struct
{
;
;
;
;
}
;
MftWritesFlushForLogFileFull
;
;
;
;
;
struct
{
;
;
;
;
}
;
Mft2WritesFlushForLogFileFull
;
;
;
;
;
;
;
;
;
;
;
BitmapWritesFlushForLogFileFull
;
;
;
struct
{
;
;
;
;
}
;
;
;
;
;
MftBitmapWritesFlushForLogFileFull
;
MftBitmapWritesLazyWriter
;
MftBitmapWritesUserRequest
;
struct
{
;
;
;
;
}
;
;
;
;
;
;
;
;
;
struct
{
;
;
;
;
;
;
;
;
;
;
}
;
;
;
;
;
;
;
;
;
VolumeTrimSkippedByteCount
;
NtfsFillStatInfoFromMftRecordCalledCount
;
NtfsFillStatInfoFromMftRecordBailedBecauseOfAttributeListCount
;
NtfsFillStatInfoFromMftRecordBailedBecauseOfNonResReparsePointCount
;
}
, *
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) // unnamed struct
#pragma warning(disable:
4201
)
typedef
struct
{
[
16
];
union
{
struct
{
[
16
];
[
16
];
[
16
];
[
48
];
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning( default : 4201 ) /* nonstandard extension used : nameless struct/union */
#endif
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define FILE_ZERO_DATA_INFORMATION_FLAG_PRESERVE_CACHED_DATA (0x00000001)
typedef
struct
{
;
;
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
_FILE_ALLOCATED_RANGE_BUFFER
{
;
;
}
FILE_ALLOCATED_RANGE_BUFFER
, *
PFILE_ALLOCATED_RANGE_BUFFER
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
[
1
];
}
, *
;
#define FILE_SET_ENCRYPTION 0x00000001
#define FILE_CLEAR_ENCRYPTION 0x00000002
#define STREAM_SET_ENCRYPTION 0x00000003
#define STREAM_CLEAR_ENCRYPTION 0x00000004
#define MAXIMUM_ENCRYPTION_VALUE 0x00000004
typedef
struct
_DECRYPTION_STATUS_BUFFER
{
;
}
, *
PDECRYPTION_STATUS_BUFFER
;
#define ENCRYPTION_FORMAT_DEFAULT (0x01)
typedef
struct
_REQUEST_RAW_ENCRYPTED_DATA
{
;
;
}
REQUEST_RAW_ENCRYPTED_DATA
, *
PREQUEST_RAW_ENCRYPTED_DATA
;
typedef
struct
{
;
;
;
BytesWithinValidDataLength
;
;
;
;
;
;
;
DWORD DataBlockSize[ANYSIZE_ARRAY];
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define ENCRYPTED_DATA_INFO_SPARSE_FILE 1
typedef
struct
_EXTENDED_ENCRYPTED_DATA_INFO
{
;
;
;
;
}
EXTENDED_ENCRYPTED_DATA_INFO
, *
PEXTENDED_ENCRYPTED_DATA_INFO
;
#endif /*(_WIN32_WINNT >= _WIN32_WINNT_WIN7)*/
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
;
;
}
, *
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN2K)
typedef
struct
{
;
DestinationFileNameLength
;
;
[
1
];
}
, *
;
#define COPYFILE_SIS_LINK 0x0001 // Copy only if source is SIS
#define COPYFILE_SIS_REPLACE 0x0002 // Replace destination if it exists, otherwise don't.
#define COPYFILE_SIS_FLAGS 0x0003
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN2K */
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
typedef
struct
_FILE_MAKE_COMPATIBLE_BUFFER
{
;
}
FILE_MAKE_COMPATIBLE_BUFFER
, *
PFILE_MAKE_COMPATIBLE_BUFFER
;
typedef
struct
_FILE_SET_DEFECT_MGMT_BUFFER
{
;
}
FILE_SET_DEFECT_MGMT_BUFFER
, *
PFILE_SET_DEFECT_MGMT_BUFFER
;
typedef
struct
_FILE_QUERY_SPARING_BUFFER
{
;
;
;
;
}
FILE_QUERY_SPARING_BUFFER
, *
PFILE_QUERY_SPARING_BUFFER
;
typedef
struct
_FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
{
;
;
;
;
[
12
];
;
;
[
34
];
[
34
];
[
34
];
LastModifyingImplementationInfo
[
34
];
}
FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
, *
PFILE_QUERY_ON_DISK_VOL_INFO_BUFFER
;
#define SET_REPAIR_ENABLED (0x00000001)
#define SET_REPAIR_WARN_ABOUT_DATA_LOSS (0x00000008)
#define SET_REPAIR_DISABLED_AND_BUGCHECK_ON_CORRUPT (0x00000010)
#define SET_REPAIR_VALID_MASK (0x00000019)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_NOT_IN_USE (0x0000000000000001)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_REUSED (0x0000000000000002)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_NOT_EXIST (0x0000000000000004)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_NOT_BASE_RECORD (0x0000000000000008)
#define FILE_INITIATE_REPAIR_HINT1_SYSTEM_FILE (0x0000000000000010)
#define FILE_INITIATE_REPAIR_HINT1_NOT_IMPLEMENTED (0x0000000000000020)
#define FILE_INITIATE_REPAIR_HINT1_UNABLE_TO_REPAIR (0x0000000000000040)
#define FILE_INITIATE_REPAIR_HINT1_REPAIR_DISABLED (0x0000000000000080)
#define FILE_INITIATE_REPAIR_HINT1_RECURSIVELY_CORRUPTED (0x0000000000000100)
#define FILE_INITIATE_REPAIR_HINT1_ORPHAN_GENERATED (0x0000000000000200)
#define FILE_INITIATE_REPAIR_HINT1_REPAIRED (0x0000000000000400)
#define FILE_INITIATE_REPAIR_HINT1_NOTHING_WRONG (0x0000000000000800)
#define FILE_INITIATE_REPAIR_HINT1_ATTRIBUTE_NOT_FOUND (0x0000000000001000)
#define FILE_INITIATE_REPAIR_HINT1_POTENTIAL_CROSSLINK (0x0000000000002000)
#define FILE_INITIATE_REPAIR_HINT1_STALE_INFORMATION (0x0000000000004000)
#define FILE_INITIATE_REPAIR_HINT1_CLUSTERS_ALREADY_IN_USE (0x0000000000008000)
#define FILE_INITIATE_REPAIR_HINT1_LCN_NOT_EXIST (0x0000000000010000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_RUN_LENGTH (0x0000000000020000)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_NOT_ORPHAN (0x0000000000040000)
#define FILE_INITIATE_REPAIR_HINT1_FILE_RECORD_IS_BASE_RECORD (0x0000000000080000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_ARRAY_LENGTH_COUNT (0x0000000000100000)
#define FILE_INITIATE_REPAIR_HINT1_SID_VALID (0x0000000000200000)
#define FILE_INITIATE_REPAIR_HINT1_SID_MISMATCH (0x0000000000400000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_PARENT (0x0000000000800000)
#define FILE_INITIATE_REPAIR_HINT1_PARENT_FILE_RECORD_NOT_IN_USE (0x0000000001000000)
#define FILE_INITIATE_REPAIR_HINT1_PARENT_FILE_RECORD_REUSED (0x0000000002000000)
#define FILE_INITIATE_REPAIR_HINT1_PARENT_FILE_RECORD_NOT_EXIST (0x0000000004000000)
#define FILE_INITIATE_REPAIR_HINT1_PARENT_FILE_RECORD_NOT_BASE_RECORD (0x0000000008000000)
#define FILE_INITIATE_REPAIR_HINT1_PARENT_FILE_RECORD_NOT_INDEX (0x0000000010000000)
#define FILE_INITIATE_REPAIR_HINT1_VALID_INDEX_ENTRY (0x0000000020000000)
#define FILE_INITIATE_REPAIR_HINT1_OUT_OF_GENERIC_NAMES (0x0000000040000000)
#define FILE_INITIATE_REPAIR_HINT1_OUT_OF_RESOURCE (0x0000000080000000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_LCN (0x0000000100000000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_VCN (0x0000000200000000)
#define FILE_INITIATE_REPAIR_HINT1_NAME_CONFLICT (0x0000000400000000)
#define FILE_INITIATE_REPAIR_HINT1_ORPHAN (0x0000000800000000)
#define FILE_INITIATE_REPAIR_HINT1_ATTRIBUTE_TOO_SMALL (0x0000001000000000)
#define FILE_INITIATE_REPAIR_HINT1_ATTRIBUTE_NON_RESIDENT (0x0000002000000000)
#define FILE_INITIATE_REPAIR_HINT1_DENY_DEFRAG (0x0000004000000000)
#define FILE_INITIATE_REPAIR_HINT1_PREVIOUS_PARENT_STILL_VALID (0x0000008000000000)
#define FILE_INITIATE_REPAIR_HINT1_INDEX_ENTRY_MISMATCH (0x0000010000000000)
#define FILE_INITIATE_REPAIR_HINT1_INVALID_ORPHAN_RECOVERY_NAME (0x0000020000000000)
#define FILE_INITIATE_REPAIR_HINT1_MULTIPLE_FILE_NAME_ATTRIBUTES (0x0000040000000000)
typedef
;
typedef
struct
_FILE_INITIATE_REPAIR_OUTPUT_BUFFER
{
;
;
;
;
}
FILE_INITIATE_REPAIR_OUTPUT_BUFFER
, *
PFILE_INITIATE_REPAIR_OUTPUT_BUFFER
;
typedef
enum
_SHRINK_VOLUME_REQUEST_TYPES
{
=
1
,
,
}
SHRINK_VOLUME_REQUEST_TYPES
, *
PSHRINK_VOLUME_REQUEST_TYPES
;
typedef
struct
{
SHRINK_VOLUME_REQUEST_TYPES
;
;
;
}
, *
;
#define TXFS_RM_FLAG_LOGGING_MODE 0x00000001
#define TXFS_RM_FLAG_RENAME_RM 0x00000002
#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX 0x00000004
#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN 0x00000008
#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS 0x00000010
#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT 0x00000020
#define TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE 0x00000040
#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX 0x00000080
#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN 0x00000100
#define TXFS_RM_FLAG_GROW_LOG 0x00000400
#define TXFS_RM_FLAG_SHRINK_LOG 0x00000800
#define TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE 0x00001000
#define TXFS_RM_FLAG_PRESERVE_CHANGES 0x00002000
#define TXFS_RM_FLAG_RESET_RM_AT_NEXT_START 0x00004000
#define TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START 0x00008000
#define TXFS_RM_FLAG_PREFER_CONSISTENCY 0x00010000
#define TXFS_RM_FLAG_PREFER_AVAILABILITY 0x00020000
#define TXFS_LOGGING_MODE_SIMPLE (0x0001)
#define TXFS_LOGGING_MODE_FULL (0x0002)
#define TXFS_TRANSACTION_STATE_NONE 0x00
#define TXFS_TRANSACTION_STATE_ACTIVE 0x01
#define TXFS_TRANSACTION_STATE_PREPARED 0x02
#define TXFS_TRANSACTION_STATE_NOTACTIVE 0x03
#define TXFS_MODIFY_RM_VALID_FLAGS \
(TXFS_RM_FLAG_LOGGING_MODE | \
TXFS_RM_FLAG_RENAME_RM | \
TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX | \
TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN | \
TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \
TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \
TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE | \
TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \
TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN | \
TXFS_RM_FLAG_SHRINK_LOG | \
TXFS_RM_FLAG_GROW_LOG | \
TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE | \
TXFS_RM_FLAG_PRESERVE_CHANGES | \
TXFS_RM_FLAG_RESET_RM_AT_NEXT_START | \
TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START | \
TXFS_RM_FLAG_PREFER_CONSISTENCY | \
TXFS_RM_FLAG_PREFER_AVAILABILITY)
typedef
struct
{
;
;
;
;
;
;
;
;
}
,
*
;
#define TXFS_RM_STATE_NOT_STARTED 0
#define TXFS_RM_STATE_STARTING 1
#define TXFS_RM_STATE_ACTIVE 2
#define TXFS_RM_STATE_SHUTTING_DOWN 3
#define TXFS_QUERY_RM_INFORMATION_VALID_FLAGS \
(TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \
TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \
TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \
TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN | \
TXFS_RM_FLAG_RESET_RM_AT_NEXT_START | \
TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START | \
TXFS_RM_FLAG_PREFER_CONSISTENCY | \
TXFS_RM_FLAG_PREFER_AVAILABILITY)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
}
,
*
;
#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN 0x01
#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK 0x02
#define TXFS_ROLLFORWARD_REDO_VALID_FLAGS \
(TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN | \
TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK)
typedef
struct
{
;
;
;
;
}
,
*
;
#ifdef DEPRECATE_SUPPORTED
#ifndef USE_TXF_DEPRECATED_FUNCTIONALITY
#pragma deprecated(TXFS_ROLLFORWARD_REDO_INFORMATION)
#pragma deprecated(PTXFS_ROLLFORWARD_REDO_INFORMATION)
#endif
#endif
#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX 0x00000001
#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN 0x00000002
#define TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE 0x00000004
#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS 0x00000008
#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT 0x00000010
#define TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE 0x00000020
#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX 0x00000040
#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN 0x00000080
#define TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT 0x00000200
#define TXFS_START_RM_FLAG_LOGGING_MODE 0x00000400
#define TXFS_START_RM_FLAG_PRESERVE_CHANGES 0x00000800
#define TXFS_START_RM_FLAG_PREFER_CONSISTENCY 0x00001000
#define TXFS_START_RM_FLAG_PREFER_AVAILABILITY 0x00002000
#define TXFS_START_RM_VALID_FLAGS \
(TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX | \
TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN | \
TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE | \
TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \
TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \
TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE | \
TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT | \
TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \
TXFS_START_RM_FLAG_LOGGING_MODE | \
TXFS_START_RM_FLAG_PRESERVE_CHANGES | \
TXFS_START_RM_FLAG_PREFER_CONSISTENCY | \
TXFS_START_RM_FLAG_PREFER_AVAILABILITY)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
[
1
];
}
,
*
;
#ifdef DEPRECATE_SUPPORTED
#ifndef USE_TXF_DEPRECATED_FUNCTIONALITY
#pragma deprecated(TXFS_START_RM_INFORMATION)
#pragma deprecated(PTXFS_START_RM_INFORMATION)
#endif
#endif
typedef
struct
{
struct
{
;
;
}
;
;
;
;
}
, *
;
#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_CREATED 0x00000001
#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_DELETED 0x00000002
typedef
struct
_TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY
{
;
;
;
;
;
;
[
1
];
}
TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY
, *
PTXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY
;
typedef
struct
_TXFS_LIST_TRANSACTION_LOCKED_FILES
{
;
;
;
;
}
TXFS_LIST_TRANSACTION_LOCKED_FILES
, *
PTXFS_LIST_TRANSACTION_LOCKED_FILES
;
typedef
struct
_TXFS_LIST_TRANSACTIONS_ENTRY
{
;
;
;
;
;
}
TXFS_LIST_TRANSACTIONS_ENTRY
, *
PTXFS_LIST_TRANSACTIONS_ENTRY
;
typedef
struct
{
;
;
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) // unnamed struct
#pragma warning(disable:
4201
)
typedef
struct
{
union
{
;
[
1
];
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning( default : 4201 )
#endif
typedef
struct
{
[
1
];
}
, *
;
#define TXFS_TRANSACTED_VERSION_NONTRANSACTED 0xFFFFFFFE
#define TXFS_TRANSACTED_VERSION_UNCOMMITTED 0xFFFFFFFF
typedef
struct
_TXFS_GET_TRANSACTED_VERSION
{
;
;
;
;
;
}
TXFS_GET_TRANSACTED_VERSION
, *
PTXFS_GET_TRANSACTED_VERSION
;
#define TXFS_SAVEPOINT_SET 0x00000001
#define TXFS_SAVEPOINT_ROLLBACK 0x00000002
#define TXFS_SAVEPOINT_CLEAR 0x00000004
#define TXFS_SAVEPOINT_CLEAR_ALL 0x00000010
typedef
struct
{
;
;
;
}
, *
;
#ifdef DEPRECATE_SUPPORTED
#ifndef USE_TXF_DEPRECATED_FUNCTIONALITY
#pragma deprecated(TXFS_SAVEPOINT_INFORMATION)
#pragma deprecated(PTXFS_SAVEPOINT_INFORMATION)
#endif
#endif
typedef
struct
_TXFS_CREATE_MINIVERSION_INFO
{
;
;
;
;
}
TXFS_CREATE_MINIVERSION_INFO
, *
PTXFS_CREATE_MINIVERSION_INFO
;
#ifdef DEPRECATE_SUPPORTED
#ifndef USE_TXF_DEPRECATED_FUNCTIONALITY
#pragma deprecated(TXFS_CREATE_MINIVERSION_INFO)
#pragma deprecated(PTXFS_CREATE_MINIVERSION_INFO)
#endif
#endif
typedef
struct
_TXFS_TRANSACTION_ACTIVE_INFO
{
TransactionsActiveAtSnapshot
;
}
TXFS_TRANSACTION_ACTIVE_INFO
, *
PTXFS_TRANSACTION_ACTIVE_INFO
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_VISTA */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
typedef
struct
{
;
struct
{
;
}
[
2
];
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
;
;
}
, *
;
#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED (0x00000001)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define PERSISTENT_VOLUME_STATE_VOLUME_SCRUB_DISABLED (0x00000002)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN8) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define PERSISTENT_VOLUME_STATE_GLOBAL_METADATA_NO_SEEK_PENALTY (0x00000004)
#define PERSISTENT_VOLUME_STATE_LOCAL_METADATA_NO_SEEK_PENALTY (0x00000008)
#define PERSISTENT_VOLUME_STATE_NO_HEAT_GATHERING (0x00000010)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define PERSISTENT_VOLUME_STATE_CONTAINS_BACKING_WIM (0x00000020)
#define PERSISTENT_VOLUME_STATE_BACKED_BY_WIM (0x00000040)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN7) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define PERSISTENT_VOLUME_STATE_NO_WRITE_AUTO_TIERING (0x00000080)
#endif // #if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
#define PERSISTENT_VOLUME_STATE_TXF_DISABLED (0x00000100)
#endif // #if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
typedef
struct
{
[
9
];
}
, *
;
#define OPLOCK_LEVEL_CACHE_READ (0x00000001)
#define OPLOCK_LEVEL_CACHE_HANDLE (0x00000002)
#define OPLOCK_LEVEL_CACHE_WRITE (0x00000004)
#define REQUEST_OPLOCK_INPUT_FLAG_REQUEST (0x00000001)
#define REQUEST_OPLOCK_INPUT_FLAG_ACK (0x00000002)
#define REQUEST_OPLOCK_INPUT_FLAG_COMPLETE_ACK_ON_CLOSE (0x00000004)
#define REQUEST_OPLOCK_CURRENT_VERSION 1
typedef
struct
{
;
;
;
;
}
, *
;
#define REQUEST_OPLOCK_OUTPUT_FLAG_ACK_REQUIRED (0x00000001)
#define REQUEST_OPLOCK_OUTPUT_FLAG_MODES_PROVIDED (0x00000002)
typedef
struct
_REQUEST_OPLOCK_OUTPUT_BUFFER
{
;
;
;
;
;
;
;
}
REQUEST_OPLOCK_OUTPUT_BUFFER
, *
PREQUEST_OPLOCK_OUTPUT_BUFFER
;
#ifndef _VIRTUAL_STORAGE_TYPE_DEFINED
#define _VIRTUAL_STORAGE_TYPE_DEFINED
typedef
struct
{
;
;
}
, *
;
#endif
typedef
struct
_STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST
{
;
;
}
STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST
, *
PSTORAGE_QUERY_DEPENDENT_VOLUME_REQUEST
;
#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_HOST_VOLUMES 0x1
#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_GUEST_VOLUMES 0x2
typedef
struct
_STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY
{
;
;
;
;
}
STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY
, *
PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY
;
typedef
struct
_STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY
{
;
;
;
;
;
;
;
DependentVolumeNameOffset
;
;
;
;
DependentDeviceNameOffset
;
;
}
STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY
, *
PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY
;
#ifdef _MSC_EXTENSIONS
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4200) // zero length array
#endif
#pragma warning(disable:
4200
)
typedef
struct
_STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE
{
;
;
union
{
STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY
[];
STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY
[];
}
STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE
, *
PSTORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif
#define SD_GLOBAL_CHANGE_TYPE_MACHINE_SID 1
#define SD_GLOBAL_CHANGE_TYPE_QUERY_STATS (1 << 16)
#define SD_GLOBAL_CHANGE_TYPE_ENUM_SDS (2 << 16)
typedef
struct
{
;
;
;
;
}
, *
;
typedef
struct
_SD_CHANGE_MACHINE_SID_OUTPUT
{
;
;
;
;
;
;
;
}
SD_CHANGE_MACHINE_SID_OUTPUT
, *
PSD_CHANGE_MACHINE_SID_OUTPUT
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
;
[
1
];
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) // unnamed struct
#pragma warning(disable:
4201
)
typedef
struct
{
;
;
union
{
SD_CHANGE_MACHINE_SID_INPUT
;
;
;
}
, *
;
typedef
struct
{
;
;
union
{
SD_CHANGE_MACHINE_SID_OUTPUT
;
;
;
}
, *
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning( default : 4201 ) /* nonstandard extension used : nameless struct/union */
#endif
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
_LOOKUP_STREAM_FROM_CLUSTER_OUTPUT
{
;
;
;
}
LOOKUP_STREAM_FROM_CLUSTER_OUTPUT
, *
PLOOKUP_STREAM_FROM_CLUSTER_OUTPUT
;
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_PAGE_FILE 0x00000001
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_DENY_DEFRAG_SET 0x00000002
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_FS_SYSTEM_FILE 0x00000004
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_TXF_SYSTEM_FILE 0x00000008
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_MASK 0xff000000
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_DATA 0x01000000
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_INDEX 0x02000000
#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_SYSTEM 0x03000000
typedef
struct
_LOOKUP_STREAM_FROM_CLUSTER_ENTRY
{
;
;
;
;
[
1
];
}
LOOKUP_STREAM_FROM_CLUSTER_ENTRY
, *
PLOOKUP_STREAM_FROM_CLUSTER_ENTRY
;
typedef
struct
{
;
;
[
1
];
}
, *
;
#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_BEGIN 0x00000001 //Set when adding the specified usage on the given file
#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_END 0x00000002 //Set when removing the specified usage on the given file
DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_PAGE_FILE, 0x0d0a64a1, 0x38fc, 0x4db8, 0x9f, 0xe7, 0x3f, 0x43, 0x52, 0xcd, 0x7c, 0x5c );
extern
"C"
const
FILE_TYPE_NOTIFICATION_GUID_PAGE_FILE
;
DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_HIBERNATION_FILE, 0xb7624d64, 0xb9a3, 0x4cf8, 0x80, 0x11, 0x5b, 0x86, 0xc9, 0x40, 0xe7, 0xb7 );
extern
"C"
const
FILE_TYPE_NOTIFICATION_GUID_HIBERNATION_FILE
;
DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_CRASHDUMP_FILE, 0x9d453eb7, 0xd2a6, 0x4dbd, 0xa2, 0xe3, 0xfb, 0xd0, 0xed, 0x91, 0x09, 0xa9 );
extern
"C"
const
FILE_TYPE_NOTIFICATION_GUID_CRASHDUMP_FILE
;
#define CSV_MGMTLOCK_CHECK_VOLUME_REDIRECTED 0x00000001
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
;
;
}
, *
;
#define CSV_NAMESPACE_INFO_V1 (sizeof(CSV_NAMESPACE_INFO))
#define CSV_INVALID_DEVICE_NUMBER 0xFFFFFFFF
typedef
enum
{
CsvControlStartRedirectFile
=
0x02
,
CsvControlStopRedirectFile
=
0x03
,
CsvControlQueryRedirectState
=
0x04
,
CsvControlQueryFileRevision
=
0x06
,
=
0x08
,
CsvControlQueryFileRevisionFileId128
=
0x09
,
CsvControlQueryVolumeRedirectState
=
0x0a
,
CsvControlEnableUSNRangeModificationTracking
=
0x0d
,
CsvControlMarkHandleLocalVolumeMount
=
0x0e
,
CsvControlUnmarkHandleLocalVolumeMount
=
0x0f
,
CsvControlGetCsvFsMdsPathV2
=
0x12
,
=
0x13
,
=
0x14
,
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
_CSV_QUERY_REDIRECT_STATE
{
;
;
;
}
, *
PCSV_QUERY_REDIRECT_STATE
;
typedef
struct
{
;
[
3
];
}
, *
;
typedef
struct
_CSV_QUERY_FILE_REVISION_FILE_ID_128
{
;
[
3
];
}
CSV_QUERY_FILE_REVISION_FILE_ID_128
, *
PCSV_QUERY_FILE_REVISION_FILE_ID_128
;
typedef
struct
{
;
;
;
[
1
];
}
, *
;
typedef
enum
{
CsvFsDiskConnectivityNone
=
0
,
CsvFsDiskConnectivityMdsNodeOnly
=
1
,
CsvFsDiskConnectivitySubsetOfNodes
=
2
,
CsvFsDiskConnectivityAllNodes
=
3
}
, *
;
typedef
struct
_CSV_QUERY_VOLUME_REDIRECT_STATE
{
;
;
;
;
;
}
CSV_QUERY_VOLUME_REDIRECT_STATE
, *
PCSV_QUERY_VOLUME_REDIRECT_STATE
;
#define CSV_QUERY_MDS_PATH_V2_VERSION_1 1
#define CSV_QUERY_MDS_PATH_FLAG_STORAGE_ON_THIS_NODE_IS_CONNECTED 0x1
#define CSV_QUERY_MDS_PATH_FLAG_CSV_DIRECT_IO_ENABLED 0x2
#define CSV_QUERY_MDS_PATH_FLAG_SMB_BYPASS_CSV_ENABLED 0x4
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
}
, *
;
typedef
struct
_CSV_QUERY_VETO_FILE_DIRECT_IO_OUTPUT
{
VetoedFromAltitudeIntegral
;
VetoedFromAltitudeDecimal
;
[
256
];
}
CSV_QUERY_VETO_FILE_DIRECT_IO_OUTPUT
, *
PCSV_QUERY_VETO_FILE_DIRECT_IO_OUTPUT
;
#endif /* _WIN32_WINNT >= _WIN32_WINNT_WIN7 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
typedef
enum
{
=
0
,
,
,
}
, *
;
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
[
1
];
}
, *
;
typedef
struct
{
;
}
, *
;
#define QUERY_FILE_LAYOUT_RESTART (0x00000001)
#define QUERY_FILE_LAYOUT_INCLUDE_NAMES (0x00000002)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS (0x00000004)
#define QUERY_FILE_LAYOUT_INCLUDE_EXTENTS (0x00000008)
#define QUERY_FILE_LAYOUT_INCLUDE_EXTRA_INFO (0x00000010)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS_WITH_NO_CLUSTERS_ALLOCATED (0x00000020)
#define QUERY_FILE_LAYOUT_INCLUDE_FULL_PATH_IN_NAMES (0x00000040)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAM_INFORMATION (0x00000080)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAM_INFORMATION_FOR_DSC_ATTRIBUTE (0x00000100)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAM_INFORMATION_FOR_TXF_ATTRIBUTE (0x00000200)
#define QUERY_FILE_LAYOUT_INCLUDE_STREAM_INFORMATION_FOR_EFS_ATTRIBUTE (0x00000400)
#define QUERY_FILE_LAYOUT_INCLUDE_ONLY_FILES_WITH_SPECIFIC_ATTRIBUTES (0x00000800)
#define QUERY_FILE_LAYOUT_INCLUDE_FILES_WITH_DSC_ATTRIBUTE (0x00001000)
typedef
enum
_QUERY_FILE_LAYOUT_FILTER_TYPE
{
QUERY_FILE_LAYOUT_FILTER_TYPE_NONE
=
0
,
QUERY_FILE_LAYOUT_FILTER_TYPE_CLUSTERS
=
1
,
QUERY_FILE_LAYOUT_FILTER_TYPE_FILEID
=
2
,
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
QUERY_FILE_LAYOUT_FILTER_TYPE_STORAGE_RESERVE_ID
=
3
,
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5) */
QUERY_FILE_LAYOUT_NUM_FILTER_TYPES
}
QUERY_FILE_LAYOUT_FILTER_TYPE
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
StartingFileReferenceNumber
;
EndingFileReferenceNumber
;
}
, *
;
typedef
struct
{
union
{
;
;
;
QUERY_FILE_LAYOUT_FILTER_TYPE
;
;
union
{
_When_((FilterType == QUERY_FILE_LAYOUT_FILTER_TYPE_CLUSTERS),
_Field_size_(FilterEntryCount))
[
1
];
_When_((FilterType == QUERY_FILE_LAYOUT_FILTER_TYPE_FILEID),
_Field_size_(FilterEntryCount))
[
1
];
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
_When_((FilterType == QUERY_FILE_LAYOUT_FILTER_TYPE_STORAGE_RESERVE_ID),
_Field_size_(FilterEntryCount))
[
1
];
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5) */
}
;
}
, *
;
#define QUERY_FILE_LAYOUT_SINGLE_INSTANCED (0x00000001)
typedef
struct
_QUERY_FILE_LAYOUT_OUTPUT
{
;
;
;
;
}
, *
PQUERY_FILE_LAYOUT_OUTPUT
;
typedef
struct
{
;
;
;
;
;
;
;
;
#if (_WIN32_WINNT < _WIN32_WINNT_WIN10_RS5)
//
// For alignment/future use.
//
DWORD Reserved;
#else
;
#endif /* (_WIN32_WINNT < _WIN32_WINNT_WIN10_RS5) */
}
, *
;
#define FILE_LAYOUT_NAME_ENTRY_PRIMARY (0x00000001)
#define FILE_LAYOUT_NAME_ENTRY_DOS (0x00000002)
typedef
struct
{
;
;
ParentFileReferenceNumber
;
;
;
_Field_size_bytes_(FileNameLength)
[
1
];
}
, *
;
typedef
struct
{
struct
{
;
;
;
;
;
}
;
;
;
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS5)
;
#endif /* (_WIN32_WINNT < _WIN32_WINNT_WIN10_RS5) */
}
, *
;
#define STREAM_LAYOUT_ENTRY_IMMOVABLE (0x00000001)
#define STREAM_LAYOUT_ENTRY_PINNED (0x00000002)
#define STREAM_LAYOUT_ENTRY_RESIDENT (0x00000004)
#define STREAM_LAYOUT_ENTRY_NO_CLUSTERS_ALLOCATED (0x00000008)
#define STREAM_LAYOUT_ENTRY_HAS_INFORMATION (0x00000010)
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
_Field_size_bytes_(StreamIdentifierLength)
[
1
];
}
, *
;
#define STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS (0x00000001)
#define STREAM_EXTENT_ENTRY_ALL_EXTENTS (0x00000002)
typedef
struct
{
;
union
{
RETRIEVAL_POINTERS_BUFFER
;
}
;
}
, *
;
#define CHECKSUM_TYPE_UNCHANGED (-1)
#define CHECKSUM_TYPE_NONE (0)
#define CHECKSUM_TYPE_CRC32 (1)
#define CHECKSUM_TYPE_CRC64 (2)
#define CHECKSUM_TYPE_ECC (3)
#define CHECKSUM_TYPE_FIRST_UNUSED_TYPE (4)
#define FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF (1)
typedef
struct
{
;
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
typedef
struct
{
;
;
;
;
;
[
7
];
}
, *
;
#endif // #if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
typedef
struct
{
;
;
;
;
;
;
}
, *
;
typedef
struct
_FSCTL_OFFLOAD_READ_OUTPUT
{
;
;
;
[
512
];
}
FSCTL_OFFLOAD_READ_OUTPUT
, *
PFSCTL_OFFLOAD_READ_OUTPUT
;
#define OFFLOAD_READ_FLAG_ALL_ZERO_BEYOND_CURRENT_RANGE (1)
typedef
struct
{
;
;
;
;
;
[
512
];
}
, *
;
typedef
struct
_FSCTL_OFFLOAD_WRITE_OUTPUT
{
;
;
;
}
FSCTL_OFFLOAD_WRITE_OUTPUT
, *
PFSCTL_OFFLOAD_WRITE_OUTPUT
;
typedef
struct
{
;
}
, *
;
#define SET_PURGE_FAILURE_MODE_ENABLED 0x00000001 // Enable purge failure mode
#define SET_PURGE_FAILURE_MODE_DISABLED 0x00000002 // Disable purge failure mode
typedef
struct
{
;
;
;
;
;
;
DWORD RepairCopies[ANYSIZE_ARRAY]; // The copy numbers of all the copies that will be repaired.
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
#define FILE_REGION_USAGE_VALID_CACHED_DATA 0x00000001
#define FILE_REGION_USAGE_VALID_NONCACHED_DATA 0x00000002
#define FILE_REGION_USAGE_OTHER_PAGE_ALIGNMENT 0x00000004
#define FILE_REGION_USAGE_LARGE_PAGE_ALIGNMENT 0x00000008
#ifdef _WIN64
#define FILE_REGION_USAGE_HUGE_PAGE_ALIGNMENT 0x00000010
#define FILE_REGION_USAGE_QUERY_ALIGNMENT (FILE_REGION_USAGE_LARGE_PAGE_ALIGNMENT |\
FILE_REGION_USAGE_HUGE_PAGE_ALIGNMENT)
#else
#define FILE_REGION_USAGE_QUERY_ALIGNMENT (FILE_REGION_USAGE_LARGE_PAGE_ALIGNMENT)
#endif // _WIN64
typedef
struct
{
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
;
[
1
];
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define VALID_WRITE_USN_REASON_MASK (USN_REASON_DATA_OVERWRITE | \
USN_REASON_CLOSE)
typedef
struct
{
;
;
}
, *
;
#endif /*_WIN32_WINNT >= _WIN32_WINNT_WIN8 */
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#define FILE_STORAGE_TIER_NAME_LENGTH (256)
#define FILE_STORAGE_TIER_DESCRIPTION_LENGTH (512)
#define FILE_STORAGE_TIER_FLAG_NO_SEEK_PENALTY (0x00020000)
#define FILE_STORAGE_TIER_FLAG_WRITE_BACK_CACHE (0x00200000)
#define FILE_STORAGE_TIER_FLAG_READ_CACHE (0x00400000)
#define FILE_STORAGE_TIER_FLAG_PARITY (0x00800000)
#define FILE_STORAGE_TIER_FLAG_SMR (0x01000000)
typedef
enum
{
=
0
,
=
1
,
=
2
,
=
4
,
}
, *
;
typedef
enum
{
FileStorageTierClassUnspecified
=
0
,
FileStorageTierClassCapacity
,
,
}
, *
;
typedef
struct
{
;
WCHAR Name[FILE_STORAGE_TIER_NAME_LENGTH];
WCHAR Description[FILE_STORAGE_TIER_NAME_LENGTH];
;
;
FILE_STORAGE_TIER_MEDIA_TYPE
;
;
}
, *
;
#define QUERY_STORAGE_CLASSES_FLAGS_MEASURE_WRITE 0x80000000
#define QUERY_STORAGE_CLASSES_FLAGS_MEASURE_READ 0x40000000
#define QUERY_STORAGE_CLASSES_FLAGS_NO_DEFRAG_VOLUME 0x20000000
typedef _Struct_size_bytes_(Size) struct _FSCTL_QUERY_STORAGE_CLASSES_OUTPUT {
typedef
struct
_FSCTL_QUERY_STORAGE_CLASSES_OUTPUT
{
;
;
;
;
;
FILE_STORAGE_TIER Tiers[ANYSIZE_ARRAY];
}
FSCTL_QUERY_STORAGE_CLASSES_OUTPUT
, *
PFSCTL_QUERY_STORAGE_CLASSES_OUTPUT
;
#define FSCTL_QUERY_STORAGE_CLASSES_OUTPUT_VERSION sizeof(FSCTL_QUERY_STORAGE_CLASSES_OUTPUT)
typedef
struct
_STREAM_INFORMATION_ENTRY
{
;
;
union
{
struct
{
;
;
}
;
}
;
}
, *
PSTREAM_INFORMATION_ENTRY
;
typedef
struct
{
;
;
;
;
GUID TierIds[ANYSIZE_ARRAY]; // Storage tiers to return information for
}
, *
;
#define FSCTL_QUERY_REGION_INFO_INPUT_VERSION sizeof(FSCTL_QUERY_REGION_INFO_INPUT)
typedef
struct
_FILE_STORAGE_TIER_REGION
{
;
;
;
}
, *
PFILE_STORAGE_TIER_REGION
;
typedef
struct
_FSCTL_QUERY_REGION_INFO_OUTPUT
{
;
;
;
;
;
;
;
FILE_STORAGE_TIER_REGION Regions[ANYSIZE_ARRAY]; // Detailed info on the regions.
}
FSCTL_QUERY_REGION_INFO_OUTPUT
, *
PFSCTL_QUERY_REGION_INFO_OUTPUT
;
#define FSCTL_QUERY_REGION_INFO_OUTPUT_VERSION sizeof(FSCTL_QUERY_REGION_INFO_OUTPUT)
typedef
struct
{
;
;
}
, *
;
#define QUERY_STORAGE_CLASSES_FLAGS_MEASURE_WRITE 0x80000000
#define QUERY_STORAGE_CLASSES_FLAGS_MEASURE_READ 0x40000000
typedef
struct
{
;
;
;
;
}
, *
;
#if ((_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2) && defined(_WIN64))
//
// 32/64 Bit thunking support structure
//
typedef struct _DUPLICATE_EXTENTS_DATA32 {
UINT32 FileHandle;
LARGE_INTEGER SourceFileOffset;
LARGE_INTEGER TargetFileOffset;
LARGE_INTEGER ByteCount;
} DUPLICATE_EXTENTS_DATA32, *PDUPLICATE_EXTENTS_DATA32;
#endif /* ((_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2) && defined(_WIN64)) */
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3)
#define DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC 0x00000001
typedef
struct
_DUPLICATE_EXTENTS_DATA_EX
{
;
;
;
;
;
;
}
DUPLICATE_EXTENTS_DATA_EX
, *
PDUPLICATE_EXTENTS_DATA_EX
;
#if ((_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3) && defined(_WIN64))
//
// 32/64 Bit thunking support structure
//
typedef struct _DUPLICATE_EXTENTS_DATA_EX32 {
DWORD32 Size;
DWORD32 FileHandle;
LARGE_INTEGER SourceFileOffset;
LARGE_INTEGER TargetFileOffset;
LARGE_INTEGER ByteCount;
DWORD Flags;
} DUPLICATE_EXTENTS_DATA_EX32, *PDUPLICATE_EXTENTS_DATA_EX32;
#endif /* ((_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3) && defined(_WIN64)) */
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2)
#define REFS_SMR_VOLUME_INFO_OUTPUT_VERSION_V1 1
typedef
enum
_REFS_SMR_VOLUME_GC_STATE
{
=
0
,
=
1
,
=
2
,
SmrGcStateActiveFullSpeed
=
3
,
}
, *
PREFS_SMR_VOLUME_GC_STATE
;
typedef
struct
_REFS_SMR_VOLUME_INFO_OUTPUT
{
;
;
SizeOfRandomlyWritableTier
;
FreeSpaceInRandomlyWritableTier
;
;
;
;
;
;
[
7
];
}
REFS_SMR_VOLUME_INFO_OUTPUT
, *
PREFS_SMR_VOLUME_INFO_OUTPUT
;
#define REFS_SMR_VOLUME_GC_PARAMETERS_VERSION_V1 1
typedef
enum
_REFS_SMR_VOLUME_GC_ACTION
{
=
1
,
SmrGcActionStartFullSpeed
=
2
,
=
3
,
=
4
,
}
REFS_SMR_VOLUME_GC_ACTION
, *
PREFS_SMR_VOLUME_GC_ACTION
;
typedef
enum
_REFS_SMR_VOLUME_GC_METHOD
{
=
1
,
=
2
,
=
3
,
}
REFS_SMR_VOLUME_GC_METHOD
, *
PREFS_SMR_VOLUME_GC_METHOD
;
typedef
struct
_REFS_SMR_VOLUME_GC_PARAMETERS
{
;
;
REFS_SMR_VOLUME_GC_ACTION
;
REFS_SMR_VOLUME_GC_METHOD
;
;
;
[
8
];
}
REFS_SMR_VOLUME_GC_PARAMETERS
, *
PREFS_SMR_VOLUME_GC_PARAMETERS
;
#define STREAMS_INVALID_ID (0)
#define STREAMS_MAX_ID (MAXWORD )
typedef
struct
_STREAMS_QUERY_PARAMETERS_OUTPUT_BUFFER
{
;
;
;
;
}
STREAMS_QUERY_PARAMETERS_OUTPUT_BUFFER
, *
PSTREAMS_QUERY_PARAMETERS_OUTPUT_BUFFER
;
#define STREAMS_ASSOCIATE_ID_CLEAR (0x1)
#define STREAMS_ASSOCIATE_ID_SET (0x2)
typedef
struct
{
;
;
}
, *
;
typedef
struct
_STREAMS_QUERY_ID_OUTPUT_BUFFER
{
;
}
STREAMS_QUERY_ID_OUTPUT_BUFFER
, *
PSTREAMS_QUERY_ID_OUTPUT_BUFFER
;
#endif // #if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS2)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3)
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
QUERY_BAD_RANGES_INPUT_RANGE
[
1
];
}
, *
;
typedef
struct
_QUERY_BAD_RANGES_OUTPUT_RANGE
{
;
;
;
;
}
QUERY_BAD_RANGES_OUTPUT_RANGE
, *
PQUERY_BAD_RANGES_OUTPUT_RANGE
;
typedef
struct
{
;
;
;
QUERY_BAD_RANGES_OUTPUT_RANGE
[
1
];
}
, *
;
typedef
struct
{
;
;
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4)
;
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4) */
}
, *
;
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4)
#define DAX_ALLOC_ALIGNMENT_FLAG_MANDATORY (0x00000001)
#define DAX_ALLOC_ALIGNMENT_FLAG_FALLBACK_SPECIFIED (0x00000002)
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS4) */
typedef
enum
_VIRTUAL_STORAGE_BEHAVIOR_CODE
{
VirtualStorageBehaviorUndefined
=
0
,
VirtualStorageBehaviorCacheWriteThrough
=
1
,
VirtualStorageBehaviorCacheWriteBack
=
2
}
VIRTUAL_STORAGE_BEHAVIOR_CODE
, *
PVIRTUAL_STORAGE_BEHAVIOR_CODE
;
typedef
struct
{
;
VIRTUAL_STORAGE_BEHAVIOR_CODE
;
}
, *
;
typedef
struct
{
;
;
;
;
;
;
;
}
, *
;
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS3) */
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define WOF_CURRENT_VERSION (0x00000001)
#define WOF_PROVIDER_WIM (0x00000001)
#define WOF_PROVIDER_FILE (0x00000002)
#define WOF_PROVIDER_CLOUD (0x00000003)
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
}
, *
;
#ifndef WIM_PROVIDER_HASH_SIZE
#define WIM_PROVIDER_HASH_SIZE 20
#endif
#define WIM_PROVIDER_CURRENT_VERSION (0x00000001)
#define WIM_PROVIDER_EXTERNAL_FLAG_NOT_ACTIVE (0x00000001)
#define WIM_PROVIDER_EXTERNAL_FLAG_SUSPENDED (0x00000002)
typedef
struct
_WIM_PROVIDER_EXTERNAL_INFO
{
;
;
;
BYTE ResourceHash[WIM_PROVIDER_HASH_SIZE];
}
WIM_PROVIDER_EXTERNAL_INFO
, *
PWIM_PROVIDER_EXTERNAL_INFO
;
#define WIM_BOOT_OS_WIM (0x00000001)
#define WIM_BOOT_NOT_OS_WIM (0x00000000)
typedef
struct
{
;
;
;
;
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
{
;
}
, *
;
typedef
struct
_WIM_PROVIDER_OVERLAY_ENTRY
{
;
;
;
;
;
;
;
}
WIM_PROVIDER_OVERLAY_ENTRY
, *
PWIM_PROVIDER_OVERLAY_ENTRY
;
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#define FILE_PROVIDER_CURRENT_VERSION (0x00000001)
#define FILE_PROVIDER_SINGLE_FILE (0x00000001)
#define FILE_PROVIDER_COMPRESSION_XPRESS4K (0x00000000)
#define FILE_PROVIDER_COMPRESSION_LZX (0x00000001)
#define FILE_PROVIDER_COMPRESSION_XPRESS8K (0x00000002)
#define FILE_PROVIDER_COMPRESSION_XPRESS16K (0x00000003)
#define FILE_PROVIDER_COMPRESSION_MAXIMUM (0x00000004)
#define FILE_PROVIDER_FLAG_COMPRESS_ON_WRITE (0x00000001)
typedef
struct
_FILE_PROVIDER_EXTERNAL_INFO_V0
{
;
;
}
FILE_PROVIDER_EXTERNAL_INFO_V0
, *
PFILE_PROVIDER_EXTERNAL_INFO_V0
;
typedef
struct
_FILE_PROVIDER_EXTERNAL_INFO_V1
{
;
;
;
}
FILE_PROVIDER_EXTERNAL_INFO_V1
, *
PFILE_PROVIDER_EXTERNAL_INFO_V1
;
typedef
FILE_PROVIDER_EXTERNAL_INFO_V1
FILE_PROVIDER_EXTERNAL_INFO
;
typedef
PFILE_PROVIDER_EXTERNAL_INFO_V1
PFILE_PROVIDER_EXTERNAL_INFO
;
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINTHRESHOLD)
typedef
struct
{
;
}
, *
;
#define CONTAINER_VOLUME_STATE_HOSTING_CONTAINER (0x00000001)
typedef
struct
{
;
}
, *
;
typedef
struct
_CONTAINER_ROOT_INFO_OUTPUT
{
;
BYTE ContainerRootId[ANYSIZE_ARRAY];
}
CONTAINER_ROOT_INFO_OUTPUT
, *
PCONTAINER_ROOT_INFO_OUTPUT
;
#define CONTAINER_ROOT_INFO_FLAG_SCRATCH_ROOT (0x00000001)
#define CONTAINER_ROOT_INFO_FLAG_LAYER_ROOT (0x00000002)
#define CONTAINER_ROOT_INFO_FLAG_VIRTUALIZATION_ROOT (0x00000004)
#define CONTAINER_ROOT_INFO_FLAG_VIRTUALIZATION_TARGET_ROOT (0x00000008)
#define CONTAINER_ROOT_INFO_FLAG_VIRTUALIZATION_EXCEPTION_ROOT (0x00000010)
#define CONTAINER_ROOT_INFO_FLAG_BIND_ROOT (0x00000020)
#define CONTAINER_ROOT_INFO_FLAG_BIND_TARGET_ROOT (0x00000040)
#define CONTAINER_ROOT_INFO_FLAG_BIND_EXCEPTION_ROOT (0x00000080)
#define CONTAINER_ROOT_INFO_FLAG_BIND_DO_NOT_MAP_NAME (0x00000100)
#define CONTAINER_ROOT_INFO_VALID_FLAGS (0x000001ff)
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1)
typedef
struct
{
;
;
}
, *
;
#define PROJFS_PROTOCOL_VERSION 3
typedef
struct
{
;
;
;
;
;
}
, *
;
typedef
struct
_VIRTUALIZATION_INSTANCE_INFO_OUTPUT
{
;
}
VIRTUALIZATION_INSTANCE_INFO_OUTPUT
, *
PVIRTUALIZATION_INSTANCE_INFO_OUTPUT
;
typedef
struct
{
;
WCHAR Altitude[ANYSIZE_ARRAY];
}
, *
;
typedef
struct
_GET_FILTER_FILE_IDENTIFIER_OUTPUT
{
FilterFileIdentifierLength
;
BYTE FilterFileIdentifier[ANYSIZE_ARRAY];
}
GET_FILTER_FILE_IDENTIFIER_OUTPUT
, *
PGET_FILTER_FILE_IDENTIFIER_OUTPUT
;
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN10_RS1)
#endif // _FILESYSTEMFSCTL_
#ifndef SMB_CCF_APP_INSTANCE_EA_NAME
#define SMB_CCF_APP_INSTANCE_EA_NAME "ClusteredApplicationInstance"
#endif //SMB_CCF_APP_INSTANCE_EA_NAME
#ifndef _NETWORK_APP_INSTANCE_EA_DEFINED
#define _NETWORK_APP_INSTANCE_EA_DEFINED
#if (NTDDI_VERSION >= NTDDI_WIN10)
//
// Define the SMB Cluster Client Failover AppInstance Extended Attribute name
// newer version of input payload assumes that EA is not just a GUID,
// but instead is a structure that contains additional information
//
//
// Is used only when file is opened directly on CSVFS. This flag is ignored when file
// is opened over SMB.
// Tells CSVFS that this file open should be valid only on coordinating node.
// If open comes to CSVFS, and this node is not a coordinating then open would fail.
// If file is opened, and coordinating node is moved then file open will be invalidated
//
#ifndef NETWORK_APP_INSTANCE_CSV_FLAGS_VALID_ONLY_IF_CSV_COORDINATOR
#define NETWORK_APP_INSTANCE_CSV_FLAGS_VALID_ONLY_IF_CSV_COORDINATOR 0x00000001
#endif //NETWORK_APP_INSTANCE_CSV_FLAGS_VALID_ONLY_IF_CSV_COORDINATOR
typedef struct _NETWORK_APP_INSTANCE_EA {
//
// The caller places a GUID that should always be unique for a single instance of
// the application.
//
GUID AppInstanceID;
//
// Combination of the NETWORK_APP_INSTANCE_CSV_FLAGS_* flags
//
DWORD CsvFlags;
} NETWORK_APP_INSTANCE_EA, *PNETWORK_APP_INSTANCE_EA;
#endif // (NTDDI_VERSION >= NTDDI_WIN10)
#endif //_NETWORK_APP_INSTANCE_EA_DEFINED
#define IOCTL_VOLUME_BASE 0x00000056 // 'V'
#if (NTDDI_VERSION >= NTDDI_WIN2K)
#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
DISK_EXTENT Extents[ANYSIZE_ARRAY];
}
, *
;
#define IOCTL_VOLUME_ONLINE CTL_CODE(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_VOLUME_OFFLINE CTL_CODE(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#endif // NTDDI_VERSION >= NTDDI_WIN2K
#if (NTDDI_VERSION >= NTDDI_WINXP)
#define IOCTL_VOLUME_IS_CLUSTERED CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_VOLUME_GET_GPT_ATTRIBUTES CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
typedef
struct
{
;
}
, *
;
#endif // NTDDI_VERSION >= NTDDI_WINXP
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#ifndef _IO_IRP_EXT_TRACK_OFFSET_HEADER_
#define _IO_IRP_EXT_TRACK_OFFSET_HEADER_
struct
;
(*
PIO_IRP_EXT_PROCESS_TRACKED_OFFSET_CALLBACK
)(
_In_ struct _IO_IRP_EXT_TRACK_OFFSET_HEADER *SourceContext,
struct
_IO_IRP_EXT_TRACK_OFFSET_HEADER
*SourceContext,
_Inout_ struct _IO_IRP_EXT_TRACK_OFFSET_HEADER *TargetContext,
struct
_IO_IRP_EXT_TRACK_OFFSET_HEADER
*TargetContext,
_In_ LONGLONG RelativeOffset
);
#define IRP_EXT_TRACK_OFFSET_HEADER_VALIDATION_VALUE 'TO' //Track Offset
typedef
struct
{
;
;
PIO_IRP_EXT_PROCESS_TRACKED_OFFSET_CALLBACK
;
} , *;
#define EFS_TRACKED_OFFSET_HEADER_FLAG 0x0001 //EFS Flag
#define SPACES_TRACKED_OFFSET_HEADER_FLAG 0x0002 //SPACES Flag
#endif // _IO_IRP_EXT_TRACK_OFFSET_HEADER_
#endif // (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif // _WINIOCTL_