;--- include file created by h2incx v0.99.18, copyright 2005-2006 japheth
;--- source file: D:\Microsoft SDK\Include\winioctl.h, last modified: 6/4/2001 15:43
;--- cmdline used for creation: -i -o ASM -e windows.h

ifdef DEFINE_GUID
if 0;ifndef FAR
ifdef _WIN32
;FAR	EQU	<>
else 
;FAR	EQU	<_far>
endif 
endif 
DEFINE_GUID( GUID_DEVINTERFACE_DISK , 53f56307h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_CDROM , 53f56308h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_PARTITION , 53f5630ah , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_TAPE , 53f5630bh , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_WRITEONCEDISK , 53f5630ch , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_VOLUME , 53f5630dh , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_MEDIUMCHANGER , 53f56310h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_FLOPPY , 53f56311h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_CDCHANGER , 53f56312h , 0b6bfh , 11d0h , 94h , 0f2h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_STORAGEPORT , 2accfe60h , 0c130h , 11d2h , 0b0h , 82h , 00h , 0a0h , 0c9h , 1eh , 0fbh , 8bh)
DEFINE_GUID( GUID_DEVINTERFACE_COMPORT , 86e0d1e0h , 8089h , 11d0h , 9ch , 0e4h , 08h , 00h , 3eh , 30h , 1fh , 73h)
DEFINE_GUID( GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR , 4D36E978h , 0E325h , 11CEh , 0BFh , 0C1h , 08h , 00h , 2Bh , 0E1h , 03h , 18h)
DiskClassGuid	EQU	<GUID_DEVINTERFACE_DISK>
CdRomClassGuid	EQU	<GUID_DEVINTERFACE_CDROM>
PartitionClassGuid	EQU	<GUID_DEVINTERFACE_PARTITION>
TapeClassGuid	EQU	<GUID_DEVINTERFACE_TAPE>
WriteOnceDiskClassGuid	EQU	<GUID_DEVINTERFACE_WRITEONCEDISK>
VolumeClassGuid	EQU	<GUID_DEVINTERFACE_VOLUME>
MediumChangerClassGuid	EQU	<GUID_DEVINTERFACE_MEDIUMCHANGER>
FloppyClassGuid	EQU	<GUID_DEVINTERFACE_FLOPPY>
CdChangerClassGuid	EQU	<GUID_DEVINTERFACE_CDCHANGER>
StoragePortClassGuid	EQU	<GUID_DEVINTERFACE_STORAGEPORT>
GUID_CLASS_COMPORT	EQU	<GUID_DEVINTERFACE_COMPORT>
GUID_SERENUM_BUS_ENUMERATOR	EQU	<GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR>
endif 
ifndef _WINIOCTL_
_WINIOCTL_	EQU	<>
ifndef _DEVIOCTL_
_DEVIOCTL_	EQU	<>
DEVICE_TYPE	EQU	<DWORD>
FILE_DEVICE_BEEP	EQU	00000001h
FILE_DEVICE_CD_ROM	EQU	00000002h
FILE_DEVICE_CD_ROM_FILE_SYSTEM	EQU	00000003h
FILE_DEVICE_CONTROLLER	EQU	00000004h
FILE_DEVICE_DATALINK	EQU	00000005h
FILE_DEVICE_DFS	EQU	00000006h
FILE_DEVICE_DISK	EQU	00000007h
FILE_DEVICE_DISK_FILE_SYSTEM	EQU	00000008h
FILE_DEVICE_FILE_SYSTEM	EQU	00000009h
FILE_DEVICE_INPORT_PORT	EQU	0000000ah
FILE_DEVICE_KEYBOARD	EQU	0000000bh
FILE_DEVICE_MAILSLOT	EQU	0000000ch
FILE_DEVICE_MIDI_IN	EQU	0000000dh
FILE_DEVICE_MIDI_OUT	EQU	0000000eh
FILE_DEVICE_MOUSE	EQU	0000000fh
FILE_DEVICE_MULTI_UNC_PROVIDER	EQU	00000010h
FILE_DEVICE_NAMED_PIPE	EQU	00000011h
FILE_DEVICE_NETWORK	EQU	00000012h
FILE_DEVICE_NETWORK_BROWSER	EQU	00000013h
FILE_DEVICE_NETWORK_FILE_SYSTEM	EQU	00000014h
FILE_DEVICE_NULL	EQU	00000015h
FILE_DEVICE_PARALLEL_PORT	EQU	00000016h
FILE_DEVICE_PHYSICAL_NETCARD	EQU	00000017h
FILE_DEVICE_PRINTER	EQU	00000018h
FILE_DEVICE_SCANNER	EQU	00000019h
FILE_DEVICE_SERIAL_MOUSE_PORT	EQU	0000001ah
FILE_DEVICE_SERIAL_PORT	EQU	0000001bh
FILE_DEVICE_SCREEN	EQU	0000001ch
FILE_DEVICE_SOUND	EQU	0000001dh
FILE_DEVICE_STREAMS	EQU	0000001eh
FILE_DEVICE_TAPE	EQU	0000001fh
FILE_DEVICE_TAPE_FILE_SYSTEM	EQU	00000020h
FILE_DEVICE_TRANSPORT	EQU	00000021h
FILE_DEVICE_UNKNOWN	EQU	00000022h
FILE_DEVICE_VIDEO	EQU	00000023h
FILE_DEVICE_VIRTUAL_DISK	EQU	00000024h
FILE_DEVICE_WAVE_IN	EQU	00000025h
FILE_DEVICE_WAVE_OUT	EQU	00000026h
FILE_DEVICE_8042_PORT	EQU	00000027h
FILE_DEVICE_NETWORK_REDIRECTOR	EQU	00000028h
FILE_DEVICE_BATTERY	EQU	00000029h
FILE_DEVICE_BUS_EXTENDER	EQU	0000002ah
FILE_DEVICE_MODEM	EQU	0000002bh
FILE_DEVICE_VDM	EQU	0000002ch
FILE_DEVICE_MASS_STORAGE	EQU	0000002dh
FILE_DEVICE_SMB	EQU	0000002eh
FILE_DEVICE_KS	EQU	0000002fh
FILE_DEVICE_CHANGER	EQU	00000030h
FILE_DEVICE_SMARTCARD	EQU	00000031h
FILE_DEVICE_ACPI	EQU	00000032h
FILE_DEVICE_DVD	EQU	00000033h
FILE_DEVICE_FULLSCREEN_VIDEO	EQU	00000034h
FILE_DEVICE_DFS_FILE_SYSTEM	EQU	00000035h
FILE_DEVICE_DFS_VOLUME	EQU	00000036h
FILE_DEVICE_SERENUM	EQU	00000037h
FILE_DEVICE_TERMSRV	EQU	00000038h
FILE_DEVICE_KSEC	EQU	00000039h
FILE_DEVICE_FIPS	EQU	0000003Ah
CTL_CODE macro DeviceType,Function,Method,Access
	exitm <( ( ( DeviceType )  shl  16 )  or  ( ( Access )  shl  14 )  or  ( ( Function )  shl  2 )  or  ( Method ) ) >
	endm
DEVICE_TYPE_FROM_CTL_CODE macro ctrlCode
	exitm <( ( ( ctrlCode  and  0ffff0000h ) )  shr  16 ) >
	endm
METHOD_BUFFERED	EQU	0
METHOD_IN_DIRECT	EQU	1
METHOD_OUT_DIRECT	EQU	2
METHOD_NEITHER	EQU	3
FILE_ANY_ACCESS	EQU	0
FILE_SPECIAL_ACCESS	EQU	<( FILE_ANY_ACCESS )>
FILE_READ_ACCESS	EQU	0001h
FILE_WRITE_ACCESS	EQU	0002h
endif 
ifndef _NTDDSTOR_H_
_NTDDSTOR_H_	EQU	<>
ifdef __cplusplus
;extern "C"
;{
endif 
IOCTL_STORAGE_BASE	EQU	<FILE_DEVICE_MASS_STORAGE>
IOCTL_STORAGE_CHECK_VERIFY	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0200h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_CHECK_VERIFY2	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0200h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_MEDIA_REMOVAL	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0201h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_EJECT_MEDIA	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0202h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_LOAD_MEDIA	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0203h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_LOAD_MEDIA2	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0203h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_RESERVE	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0204h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_RELEASE	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0205h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_FIND_NEW_DEVICES	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0206h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_EJECTION_CONTROL	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0250h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_MCN_CONTROL	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0251h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_GET_MEDIA_TYPES	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0300h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_GET_MEDIA_TYPES_EX	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0301h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0304h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_GET_HOTPLUG_INFO	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0305h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_SET_HOTPLUG_INFO	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0306h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_STORAGE_RESET_BUS	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0400h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_RESET_DEVICE	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0401h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_BREAK_RESERVATION	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0405h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_STORAGE_GET_DEVICE_NUMBER	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0420h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_STORAGE_PREDICT_FAILURE	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0440h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
OBSOLETE_IOCTL_STORAGE_RESET_BUS	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0400h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
OBSOLETE_IOCTL_STORAGE_RESET_DEVICE	EQU	<CTL_CODE ( IOCTL_STORAGE_BASE , 0401h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
STORAGE_HOTPLUG_INFO	struct 
Size_	DWORD	?
MediaRemovable	BOOLEAN	?
MediaHotplug	BOOLEAN	?
DeviceHotplug	BOOLEAN	?
WriteCacheEnableOverride	BOOLEAN	?
STORAGE_HOTPLUG_INFO	ends

PSTORAGE_HOTPLUG_INFO typedef ptr STORAGE_HOTPLUG_INFO

STORAGE_DEVICE_NUMBER	struct 
DeviceType	DEVICE_TYPE	?
DeviceNumber	DWORD	?
PartitionNumber	DWORD	?
STORAGE_DEVICE_NUMBER	ends

PSTORAGE_DEVICE_NUMBER typedef ptr STORAGE_DEVICE_NUMBER

STORAGE_BUS_RESET_REQUEST	struct 
PathId	BYTE	?
STORAGE_BUS_RESET_REQUEST	ends

PSTORAGE_BUS_RESET_REQUEST typedef ptr STORAGE_BUS_RESET_REQUEST

PREVENT_MEDIA_REMOVAL	struct 
PreventMediaRemoval	BOOLEAN	?
PREVENT_MEDIA_REMOVAL	ends

PPREVENT_MEDIA_REMOVAL typedef ptr PREVENT_MEDIA_REMOVAL

TAPE_STATISTICS	struct 
Version	DWORD	?
Flags	DWORD	?
RecoveredWrites	LARGE_INTEGER	<>
UnrecoveredWrites	LARGE_INTEGER	<>
RecoveredReads	LARGE_INTEGER	<>
UnrecoveredReads	LARGE_INTEGER	<>
CompressionRatioReads	BYTE	?
CompressionRatioWrites	BYTE	?
TAPE_STATISTICS	ends

PTAPE_STATISTICS typedef ptr TAPE_STATISTICS

RECOVERED_WRITES_VALID	EQU	00000001h
UNRECOVERED_WRITES_VALID	EQU	00000002h
RECOVERED_READS_VALID	EQU	00000004h
UNRECOVERED_READS_VALID	EQU	00000008h
WRITE_COMPRESSION_INFO_VALID	EQU	00000010h
READ_COMPRESSION_INFO_VALID	EQU	00000020h
TAPE_GET_STATISTICS	struct 
Operation	DWORD	?
TAPE_GET_STATISTICS	ends

PTAPE_GET_STATISTICS typedef ptr TAPE_GET_STATISTICS

TAPE_RETURN_STATISTICS	EQU	0
TAPE_RETURN_ENV_INFO	EQU	1
TAPE_RESET_STATISTICS	EQU	2
STORAGE_MEDIA_TYPE typedef DWORD
DDS_4mm = 20h 
MiniQic = 21
Travan = 22
QIC = 23
MP_8mm = 24
AME_8mm = 25
AIT1_8mm = 26
DLT = 27
NCTP = 28
IBM_3480 = 29
IBM_3490E = 30
IBM_Magstar_3590 = 31
IBM_Magstar_MP = 32
STK_DATA_D3 = 33
SONY_DTF = 34
DV_6mm = 35
DMI = 36
SONY_D2 = 37
CLEANER_CARTRIDGE = 38
CD_ROM = 39
CD_R = 40
CD_RW = 41
DVD_ROM = 42
DVD_R = 43
DVD_RW = 44
MO_3_RW = 45
MO_5_WO = 46
MO_5_RW = 47
MO_5_LIMDOW = 48
PC_5_WO = 49
PC_5_RW = 50
PD_5_RW = 51
ABL_5_WO = 52
PINNACLE_APEX_5_RW = 53
SONY_12_WO = 54
PHILIPS_12_WO = 55
HITACHI_12_WO = 56
CYGNET_12_WO = 57
KODAK_14_WO = 58
MO_NFR_525 = 59
NIKON_12_RW = 60
IOMEGA_ZIP = 61
IOMEGA_JAZ = 62
SYQUEST_EZ135 = 63
SYQUEST_EZFLYER = 64
SYQUEST_SYJET = 65
AVATAR_F2 = 66
MP2_8mm = 67
DST_S = 68
DST_M = 69
DST_L = 70
VXATape_1 = 71
VXATape_2 = 72
STK_9840 = 73
LTO_Ultrium = 74
LTO_Accelis = 75
DVD_RAM = 76
AIT_8mm = 77
ADR_1 = 78
ADR_2 = 79

PSTORAGE_MEDIA_TYPE typedef ptr STORAGE_MEDIA_TYPE

MEDIA_ERASEABLE	EQU	00000001h
MEDIA_WRITE_ONCE	EQU	00000002h
MEDIA_READ_ONLY	EQU	00000004h
MEDIA_READ_WRITE	EQU	00000008h
MEDIA_WRITE_PROTECTED	EQU	00000100h
MEDIA_CURRENTLY_MOUNTED	EQU	80000000h
STORAGE_BUS_TYPE typedef DWORD
BusTypeUnknown = 00h 
BusTypeScsi = 1
BusTypeAtapi = 2
BusTypeAta = 3
BusType1394 = 4
BusTypeSsa = 5
BusTypeFibre = 6
BusTypeUsb = 7
BusTypeRAID = 8
BusTypeMaxReserved = 7Fh 

PSTORAGE_BUS_TYPE typedef ptr STORAGE_BUS_TYPE

DEVICE_MEDIA_INFO	struct 
union DeviceSpecific
struct DiskInfo
Cylinders	LARGE_INTEGER	<>
MediaType	STORAGE_MEDIA_TYPE	?
TracksPerCylinder	DWORD	?
SectorsPerTrack	DWORD	?
BytesPerSector	DWORD	?
NumberMediaSides	DWORD	?
MediaCharacteristics	DWORD	?
ends
struct RemovableDiskInfo
Cylinders	LARGE_INTEGER	<>
MediaType	STORAGE_MEDIA_TYPE	?
TracksPerCylinder	DWORD	?
SectorsPerTrack	DWORD	?
BytesPerSector	DWORD	?
NumberMediaSides	DWORD	?
MediaCharacteristics	DWORD	?
ends
struct TapeInfo
MediaType	STORAGE_MEDIA_TYPE	?
MediaCharacteristics	DWORD	?
CurrentBlockSize	DWORD	?
BusType	STORAGE_BUS_TYPE	?
union BusSpecificData
struct ScsiInformation
MediumType	BYTE	?
DensityCode	BYTE	?
ends
ends
ends
ends
DEVICE_MEDIA_INFO	ends

PDEVICE_MEDIA_INFO typedef ptr DEVICE_MEDIA_INFO

GET_MEDIA_TYPES	struct 
DeviceType	DWORD	?
MediaInfoCount	DWORD	?
MediaInfo	DEVICE_MEDIA_INFO 1 dup (<>)
GET_MEDIA_TYPES	ends

PGET_MEDIA_TYPES typedef ptr GET_MEDIA_TYPES

STORAGE_PREDICT_FAILURE	struct 
PredictFailure	DWORD	?
VendorSpecific	BYTE 512 dup (?)
STORAGE_PREDICT_FAILURE	ends

PSTORAGE_PREDICT_FAILURE typedef ptr STORAGE_PREDICT_FAILURE

ifdef __cplusplus
;}
endif 
endif 
IOCTL_DISK_BASE	EQU	<FILE_DEVICE_DISK>
IOCTL_DISK_GET_DRIVE_GEOMETRY	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0000h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_GET_PARTITION_INFO	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0001h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_SET_PARTITION_INFO	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0002h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GET_DRIVE_LAYOUT	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0003h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_SET_DRIVE_LAYOUT	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0004h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_VERIFY	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0005h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_FORMAT_TRACKS	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0006h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_REASSIGN_BLOCKS	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0007h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_PERFORMANCE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0008h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_IS_WRITABLE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0009h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_LOGGING	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000ah , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_FORMAT_TRACKS_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000bh , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_HISTOGRAM_STRUCTURE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000ch , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_HISTOGRAM_DATA	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000dh , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_HISTOGRAM_RESET	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000eh , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_REQUEST_STRUCTURE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 000fh , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_REQUEST_DATA	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0010h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_PERFORMANCE_OFF	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0018h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
if (_WIN32_WINNT ge 0400h)
IOCTL_DISK_CONTROLLER_NUMBER	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0011h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
SMART_GET_VERSION	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0020h , METHOD_BUFFERED , FILE_READ_ACCESS )>
SMART_SEND_DRIVE_COMMAND	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0021h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
SMART_RCV_DRIVE_DATA	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0022h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
endif 
if (_WIN32_WINNT ge 500h)
IOCTL_DISK_GET_PARTITION_INFO_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0012h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_SET_PARTITION_INFO_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0013h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GET_DRIVE_LAYOUT_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0014h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_SET_DRIVE_LAYOUT_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0015h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_CREATE_DISK	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0016h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GET_LENGTH_INFO	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0017h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0028h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
endif 
if (_WIN32_WINNT ge 0500h)
IOCTL_DISK_UPDATE_DRIVE_SIZE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0032h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GROW_PARTITION	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0034h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GET_CACHE_INFORMATION	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0035h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_SET_CACHE_INFORMATION	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0036h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_GET_WRITE_CACHE_STATE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0037h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_DELETE_DRIVE_LAYOUT	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0040h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_UPDATE_PROPERTIES	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0050h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_DISK_FORMAT_DRIVE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 00f3h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_DISK_SENSE_DEVICE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 00f8h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
endif 
IOCTL_DISK_CHECK_VERIFY	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0200h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_MEDIA_REMOVAL	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0201h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_EJECT_MEDIA	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0202h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_LOAD_MEDIA	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0203h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_RESERVE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0204h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_RELEASE	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0205h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_FIND_NEW_DEVICES	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0206h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_DISK_GET_MEDIA_TYPES	EQU	<CTL_CODE ( IOCTL_DISK_BASE , 0300h , METHOD_BUFFERED , FILE_ANY_ACCESS )>
PARTITION_ENTRY_UNUSED	EQU	00h
PARTITION_FAT_12	EQU	01h
PARTITION_XENIX_1	EQU	02h
PARTITION_XENIX_2	EQU	03h
PARTITION_FAT_16	EQU	04h
PARTITION_EXTENDED	EQU	05h
PARTITION_HUGE	EQU	06h
PARTITION_IFS	EQU	07h
PARTITION_OS2BOOTMGR	EQU	0Ah
PARTITION_FAT32	EQU	0Bh
PARTITION_FAT32_XINT13	EQU	0Ch
PARTITION_XINT13	EQU	0Eh
PARTITION_XINT13_EXTENDED	EQU	0Fh
PARTITION_PREP	EQU	41h
PARTITION_LDM	EQU	42h
PARTITION_UNIX	EQU	63h
VALID_NTFT	EQU	0C0h
PARTITION_NTFT	EQU	80h
IsContainerPartition macro PartitionType
	exitm <( ( PartitionType == PARTITION_EXTENDED ) || ( PartitionType == PARTITION_XINT13_EXTENDED ) ) >
	endm
IsFTPartition macro PartitionType
	exitm <( ( ( PartitionType )  and  PARTITION_NTFT ) && IsRecognizedPartition ( PartitionType ) ) >
	endm
MEDIA_TYPE typedef DWORD
Unknown = 0
F5_1Pt2_512 = 1
F3_1Pt44_512 = 2
F3_2Pt88_512 = 3
F3_20Pt8_512 = 4
F3_720_512 = 5
F5_360_512 = 6
F5_320_512 = 7
F5_320_1024 = 8
F5_180_512 = 9
F5_160_512 = 10
RemovableMedia = 11
FixedMedia = 12
F3_120M_512 = 13
F3_640_512 = 14
F5_640_512 = 15
F5_720_512 = 16
F3_1Pt2_512 = 17
F3_1Pt23_1024 = 18
F5_1Pt23_1024 = 19
F3_128Mb_512 = 20
F3_230Mb_512 = 21
F8_256_128 = 22
F3_200Mb_512 = 23
F3_240M_512 = 24
F3_32M_512 = 25

PMEDIA_TYPE typedef ptr MEDIA_TYPE

FORMAT_PARAMETERS	struct 
MediaType	MEDIA_TYPE	?
StartCylinderNumber	DWORD	?
EndCylinderNumber	DWORD	?
StartHeadNumber	DWORD	?
EndHeadNumber	DWORD	?
FORMAT_PARAMETERS	ends

PFORMAT_PARAMETERS typedef ptr FORMAT_PARAMETERS

BAD_TRACK_NUMBER typedef WORD
PBAD_TRACK_NUMBER typedef ptr WORD
FORMAT_EX_PARAMETERS	struct 
MediaType	MEDIA_TYPE	?
StartCylinderNumber	DWORD	?
EndCylinderNumber	DWORD	?
StartHeadNumber	DWORD	?
EndHeadNumber	DWORD	?
FormatGapLength	WORD	?
SectorsPerTrack	WORD	?
SectorNumber	WORD 1 dup (?)
FORMAT_EX_PARAMETERS	ends

PFORMAT_EX_PARAMETERS typedef ptr FORMAT_EX_PARAMETERS

DISK_GEOMETRY	struct 
Cylinders	LARGE_INTEGER	<>
MediaType	MEDIA_TYPE	?
TracksPerCylinder	DWORD	?
SectorsPerTrack	DWORD	?
BytesPerSector	DWORD	?
DISK_GEOMETRY	ends

PDISK_GEOMETRY typedef ptr DISK_GEOMETRY

WMI_DISK_GEOMETRY_GUID	EQU	<{ 25007f51h , 57c2h , 11d1h , { 0a5h , 28h , 0h , 0a0h , 0c9h , 6h , 29h , 10h } }>

PARTITION_INFORMATION	struct 8
StartingOffset	LARGE_INTEGER	<>
PartitionLength	LARGE_INTEGER	<>
HiddenSectors	DWORD	?
PartitionNumber	DWORD	?
PartitionType	BYTE	?
BootIndicator	BOOLEAN	?
RecognizedPartition	BOOLEAN	?
RewritePartition	BOOLEAN	?
PARTITION_INFORMATION	ends

PPARTITION_INFORMATION typedef ptr PARTITION_INFORMATION

SET_PARTITION_INFORMATION	struct 
PartitionType	BYTE	?
SET_PARTITION_INFORMATION	ends

PSET_PARTITION_INFORMATION typedef ptr SET_PARTITION_INFORMATION

DRIVE_LAYOUT_INFORMATION	struct 
PartitionCount	DWORD	?
Signature	DWORD	?
PartitionEntry	PARTITION_INFORMATION 1 dup (<>)
DRIVE_LAYOUT_INFORMATION	ends

PDRIVE_LAYOUT_INFORMATION typedef ptr DRIVE_LAYOUT_INFORMATION

VERIFY_INFORMATION	struct 
StartingOffset	LARGE_INTEGER	<>
Length_	DWORD	?
VERIFY_INFORMATION	ends

PVERIFY_INFORMATION typedef ptr VERIFY_INFORMATION

REASSIGN_BLOCKS	struct 
Reserved	WORD	?
Count	WORD	?
BlockNumber	DWORD 1 dup (?)
REASSIGN_BLOCKS	ends

PREASSIGN_BLOCKS typedef ptr REASSIGN_BLOCKS

if (_WIN32_WINNT ge 500h)
PARTITION_STYLE typedef DWORD
PARTITION_STYLE_MBR = 0
PARTITION_STYLE_GPT = 1
PARTITION_STYLE_RAW = 2

PARTITION_INFORMATION_GPT	struct 
PartitionType	GUID	<>
PartitionId	GUID	<>
Attributes	DWORD64	?
Name_	WCHAR 36 dup (?)
PARTITION_INFORMATION_GPT	ends

PPARTITION_INFORMATION_GPT typedef ptr PARTITION_INFORMATION_GPT

GPT_ATTRIBUTE_PLATFORM_REQUIRED	EQU	0000000000000001h
GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER	EQU	8000000000000000h
GPT_BASIC_DATA_ATTRIBUTE_HIDDEN	EQU	4000000000000000h
GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY	EQU	1000000000000000h
PARTITION_INFORMATION_MBR	struct 
PartitionType	BYTE	?
BootIndicator	BOOLEAN	?
RecognizedPartition	BOOLEAN	?
HiddenSectors	DWORD	?
PARTITION_INFORMATION_MBR	ends

PPARTITION_INFORMATION_MBR typedef ptr PARTITION_INFORMATION_MBR

SET_PARTITION_INFORMATION_MBR typedef SET_PARTITION_INFORMATION
SET_PARTITION_INFORMATION_GPT typedef PARTITION_INFORMATION_GPT
SET_PARTITION_INFORMATION_EX	struct 
PartitionStyle	PARTITION_STYLE	?
union
Mbr	SET_PARTITION_INFORMATION_MBR	<>
Gpt	SET_PARTITION_INFORMATION_GPT	<>
ends
SET_PARTITION_INFORMATION_EX	ends

PSET_PARTITION_INFORMATION_EX typedef ptr SET_PARTITION_INFORMATION_EX

CREATE_DISK_GPT	struct 
DiskId	GUID	<>
MaxPartitionCount	DWORD	?
CREATE_DISK_GPT	ends

PCREATE_DISK_GPT typedef ptr CREATE_DISK_GPT

CREATE_DISK_MBR	struct 
Signature	DWORD	?
CREATE_DISK_MBR	ends

PCREATE_DISK_MBR typedef ptr CREATE_DISK_MBR

CREATE_DISK	struct 
PartitionStyle	PARTITION_STYLE	?
union
Mbr	CREATE_DISK_MBR	<>
Gpt	CREATE_DISK_GPT	<>
ends
CREATE_DISK	ends

PCREATE_DISK typedef ptr CREATE_DISK

GET_LENGTH_INFORMATION	struct 
Length_	LARGE_INTEGER	<>
GET_LENGTH_INFORMATION	ends

PGET_LENGTH_INFORMATION typedef ptr GET_LENGTH_INFORMATION

PARTITION_INFORMATION_EX	struct 
PartitionStyle	PARTITION_STYLE	?
StartingOffset	LARGE_INTEGER	<>
PartitionLength	LARGE_INTEGER	<>
PartitionNumber	DWORD	?
RewritePartition	BOOLEAN	?
union
Mbr	PARTITION_INFORMATION_MBR	<>
Gpt	PARTITION_INFORMATION_GPT	<>
ends
PARTITION_INFORMATION_EX	ends

PPARTITION_INFORMATION_EX typedef ptr PARTITION_INFORMATION_EX

DRIVE_LAYOUT_INFORMATION_GPT	struct 
DiskId	GUID	<>
StartingUsableOffset	LARGE_INTEGER	<>
UsableLength	LARGE_INTEGER	<>
MaxPartitionCount	DWORD	?
DRIVE_LAYOUT_INFORMATION_GPT	ends

PDRIVE_LAYOUT_INFORMATION_GPT typedef ptr DRIVE_LAYOUT_INFORMATION_GPT

DRIVE_LAYOUT_INFORMATION_MBR	struct 
Signature	DWORD	?
DRIVE_LAYOUT_INFORMATION_MBR	ends

PDRIVE_LAYOUT_INFORMATION_MBR typedef ptr DRIVE_LAYOUT_INFORMATION_MBR

DRIVE_LAYOUT_INFORMATION_EX	struct 
PartitionStyle	DWORD	?
PartitionCount	DWORD	?
union
Mbr	DRIVE_LAYOUT_INFORMATION_MBR	<>
Gpt	DRIVE_LAYOUT_INFORMATION_GPT	<>
ends
PartitionEntry	PARTITION_INFORMATION_EX 1 dup (<>)
DRIVE_LAYOUT_INFORMATION_EX	ends

PDRIVE_LAYOUT_INFORMATION_EX typedef ptr DRIVE_LAYOUT_INFORMATION_EX

endif 
if (_WIN32_WINNT ge 0500h)
DETECTION_TYPE typedef DWORD
DetectNone = 0
DetectInt13 = 1
DetectExInt13 = 2

DISK_INT13_INFO	struct 4
DriveSelect	WORD	?
MaxCylinders	DWORD	?
SectorsPerTrack	WORD	?
MaxHeads	WORD	?
NumberDrives	WORD	?
DISK_INT13_INFO	ends

PDISK_INT13_INFO typedef ptr DISK_INT13_INFO

DISK_EX_INT13_INFO	struct 8
ExBufferSize	WORD	?
ExFlags	WORD	?
ExCylinders	DWORD	?
ExHeads	DWORD	?
ExSectorsPerTrack	DWORD	?
ExSectorsPerDrive	DWORD64	?
ExSectorSize	WORD	?
ExReserved	WORD	?
DISK_EX_INT13_INFO	ends

PDISK_EX_INT13_INFO typedef ptr DISK_EX_INT13_INFO

DISK_DETECTION_INFO	struct 
SizeOfDetectInfo	DWORD	?
DetectionType	DETECTION_TYPE	?
union
struct
Int13	DISK_INT13_INFO	<>
ExInt13	DISK_EX_INT13_INFO	<>
ends
ends
DISK_DETECTION_INFO	ends

PDISK_DETECTION_INFO typedef ptr DISK_DETECTION_INFO

DISK_PARTITION_INFO	struct 
SizeOfPartitionInfo	DWORD	?
PartitionStyle	PARTITION_STYLE	?
union
struct Mbr
Signature	DWORD	?
CheckSum	DWORD	?
ends
struct Gpt
DiskId	GUID	<>
ends
ends
DISK_PARTITION_INFO	ends

PDISK_PARTITION_INFO typedef ptr DISK_PARTITION_INFO

DiskGeometryGetPartition macro Geometry
	exitm <( ( PDISK_PARTITION_INFO ) ( ( Geometry ) + 1 ) ) >
	endm
DiskGeometryGetDetect macro Geometry
	exitm <( ( PDISK_DETECTION_INFO ) ( ( DiskGeometryGetPartition ( Geometry ) + DiskGeometryGetPartition ( Geometry ) -> SizeOfPartitionInfo ) ) ) >
	endm
DISK_GEOMETRY_EX	struct 8 
Geometry	DISK_GEOMETRY	<>
DiskSize	LARGE_INTEGER	<>
Data	BYTE 1 dup (?)
DISK_GEOMETRY_EX	ends

PDISK_GEOMETRY_EX typedef ptr DISK_GEOMETRY_EX

endif 
if (_WIN32_WINNT ge 0400h)
DISK_CONTROLLER_NUMBER	struct 
ControllerNumber	DWORD	?
DiskNumber	DWORD	?
DISK_CONTROLLER_NUMBER	ends

PDISK_CONTROLLER_NUMBER typedef ptr DISK_CONTROLLER_NUMBER

endif 
if (_WIN32_WINNT ge 0500h)
DISK_CACHE_RETENTION_PRIORITY typedef DWORD
EqualPriority = 0
KeepPrefetchedData = 1
KeepReadData = 2

DISK_WRITE_CACHE_STATE typedef DWORD
DiskWriteCacheNormal = 0
DiskWriteCacheForceDisable = 1
DiskWriteCacheDisableNotSupported = 2

PDISK_WRITE_CACHE_STATE typedef ptr DISK_WRITE_CACHE_STATE

DISK_CACHE_INFORMATION	struct 
ParametersSavable	BOOLEAN	?
ReadCacheEnabled	BOOLEAN	?
WriteCacheEnabled	BOOLEAN	?
ReadRetentionPriority	DISK_CACHE_RETENTION_PRIORITY	?
WriteRetentionPriority	DISK_CACHE_RETENTION_PRIORITY	?
DisablePrefetchTransferLength	WORD	?
PrefetchScalar	BOOLEAN	?
union
struct ScalarPrefetch
Minimum	WORD	?
Maximum	WORD	?
MaximumBlocks	WORD	?
ends
struct BlockPrefetch
Minimum	WORD	?
Maximum	WORD	?
ends
ends
DISK_CACHE_INFORMATION	ends

PDISK_CACHE_INFORMATION typedef ptr DISK_CACHE_INFORMATION

DISK_GROW_PARTITION	struct 
PartitionNumber	DWORD	?
BytesToGrow	LARGE_INTEGER	<>
DISK_GROW_PARTITION	ends

PDISK_GROW_PARTITION typedef ptr DISK_GROW_PARTITION

endif 
HIST_NO_OF_BUCKETS	EQU	24
HISTOGRAM_BUCKET	struct 
Reads	DWORD	?
Writes	DWORD	?
HISTOGRAM_BUCKET	ends

PHISTOGRAM_BUCKET typedef ptr HISTOGRAM_BUCKET

HISTOGRAM_BUCKET_SIZE	EQU	<sizeof ( HISTOGRAM_BUCKET )>
DISK_HISTOGRAM	struct 
DiskSize	LARGE_INTEGER	<>
Start	LARGE_INTEGER	<>
End_	LARGE_INTEGER	<>
Average	LARGE_INTEGER	<>
AverageRead	LARGE_INTEGER	<>
AverageWrite	LARGE_INTEGER	<>
Granularity	DWORD	?
Size_	DWORD	?
ReadCount	DWORD	?
WriteCount	DWORD	?
Histogram	PHISTOGRAM_BUCKET	?
DISK_HISTOGRAM	ends

PDISK_HISTOGRAM typedef ptr DISK_HISTOGRAM

DISK_HISTOGRAM_SIZE	EQU	<sizeof ( DISK_HISTOGRAM )>
DISK_PERFORMANCE	struct 
BytesRead	LARGE_INTEGER	<>
BytesWritten	LARGE_INTEGER	<>
ReadTime	LARGE_INTEGER	<>
WriteTime	LARGE_INTEGER	<>
IdleTime	LARGE_INTEGER	<>
ReadCount	DWORD	?
WriteCount	DWORD	?
QueueDepth	DWORD	?
SplitCount	DWORD	?
QueryTime	LARGE_INTEGER	<>
StorageDeviceNumber	DWORD	?
StorageManagerName	WCHAR 8 dup (?)
DISK_PERFORMANCE	ends

PDISK_PERFORMANCE typedef ptr DISK_PERFORMANCE

DISK_RECORD	struct 
ByteOffset	LARGE_INTEGER	<>
StartTime	LARGE_INTEGER	<>
EndTime	LARGE_INTEGER	<>
VirtualAddress	PVOID	?
NumberOfBytes	DWORD	?
DeviceNumber	BYTE	?
ReadRequest	BOOLEAN	?
DISK_RECORD	ends

PDISK_RECORD typedef ptr DISK_RECORD

DISK_LOGGING	struct 
Function	BYTE	?
BufferAddress	PVOID	?
BufferSize	DWORD	?
DISK_LOGGING	ends

PDISK_LOGGING typedef ptr DISK_LOGGING

DISK_LOGGING_START	EQU	0
DISK_LOGGING_STOP	EQU	1
DISK_LOGGING_DUMP	EQU	2
DISK_BINNING	EQU	3
BIN_TYPES typedef DWORD
RequestSize = 0
RequestLocation = 1

BIN_RANGE	struct 
StartValue	LARGE_INTEGER	<>
Length_	LARGE_INTEGER	<>
BIN_RANGE	ends

PBIN_RANGE typedef ptr BIN_RANGE

PERF_BIN	struct 
NumberOfBins	DWORD	?
TypeOfBin	DWORD	?
BinsRanges	BIN_RANGE 1 dup (<>)
PERF_BIN	ends

PPERF_BIN typedef ptr PERF_BIN

BIN_COUNT	struct 
BinRange	BIN_RANGE	<>
BinCount	DWORD	?
BIN_COUNT	ends

PBIN_COUNT typedef ptr BIN_COUNT

BIN_RESULTS	struct 
NumberOfBins	DWORD	?
BinCounts	BIN_COUNT 1 dup (<>)
BIN_RESULTS	ends

PBIN_RESULTS typedef ptr BIN_RESULTS

if (_WIN32_WINNT ge 0400h)
	include pshpack1.inc
GETVERSIONINPARAMS	struct 
bVersion	BYTE	?
bRevision	BYTE	?
bReserved	BYTE	?
bIDEDeviceMap	BYTE	?
fCapabilities	DWORD	?
dwReserved	DWORD 4 dup (?)
GETVERSIONINPARAMS	ends

PGETVERSIONINPARAMS typedef ptr GETVERSIONINPARAMS
LPGETVERSIONINPARAMS typedef ptr GETVERSIONINPARAMS

	include poppack.inc
CAP_ATA_ID_CMD	EQU	1
CAP_ATAPI_ID_CMD	EQU	2
CAP_SMART_CMD	EQU	4
	include pshpack1.inc
IDEREGS	struct 
bFeaturesReg	BYTE	?
bSectorCountReg	BYTE	?
bSectorNumberReg	BYTE	?
bCylLowReg	BYTE	?
bCylHighReg	BYTE	?
bDriveHeadReg	BYTE	?
bCommandReg	BYTE	?
bReserved	BYTE	?
IDEREGS	ends

PIDEREGS typedef ptr IDEREGS
LPIDEREGS typedef ptr IDEREGS

	include poppack.inc
ATAPI_ID_CMD	EQU	0A1h
ID_CMD	EQU	0ECh
SMART_CMD	EQU	0B0h
SMART_CYL_LOW	EQU	4Fh
SMART_CYL_HI	EQU	0C2h
	include pshpack1.inc
SENDCMDINPARAMS	struct 
cBufferSize	DWORD	?
irDriveRegs	IDEREGS	<>
bDriveNumber	BYTE	?
bReserved	BYTE 3 dup (?)
dwReserved	DWORD 4 dup (?)
bBuffer	BYTE 1 dup (?)
SENDCMDINPARAMS	ends

PSENDCMDINPARAMS typedef ptr SENDCMDINPARAMS
LPSENDCMDINPARAMS typedef ptr SENDCMDINPARAMS

	include poppack.inc
	include pshpack1.inc
DRIVERSTATUS	struct 
bDriverError	BYTE	?
bIDEError	BYTE	?
bReserved	BYTE 2 dup (?)
dwReserved	DWORD 2 dup (?)
DRIVERSTATUS	ends

PDRIVERSTATUS typedef ptr DRIVERSTATUS
LPDRIVERSTATUS typedef ptr DRIVERSTATUS

	include poppack.inc
SMART_NO_ERROR	EQU	0
SMART_IDE_ERROR	EQU	1
SMART_INVALID_FLAG	EQU	2
SMART_INVALID_COMMAND	EQU	3
SMART_INVALID_BUFFER	EQU	4
SMART_INVALID_DRIVE	EQU	5
SMART_INVALID_IOCTL	EQU	6
SMART_ERROR_NO_MEM	EQU	7
SMART_INVALID_REGISTER	EQU	8
SMART_NOT_SUPPORTED	EQU	9
SMART_NO_IDE_DEVICE	EQU	10
SMART_OFFLINE_ROUTINE_OFFLINE	EQU	0
SMART_SHORT_SELFTEST_OFFLINE	EQU	1
SMART_EXTENDED_SELFTEST_OFFLINE	EQU	2
SMART_ABORT_OFFLINE_SELFTEST	EQU	127
SMART_SHORT_SELFTEST_CAPTIVE	EQU	129
SMART_EXTENDED_SELFTEST_CAPTIVE	EQU	130
	include pshpack1.inc
SENDCMDOUTPARAMS	struct 
cBufferSize	DWORD	?
DriverStatus	DRIVERSTATUS	<>
bBuffer	BYTE 1 dup (?)
SENDCMDOUTPARAMS	ends

PSENDCMDOUTPARAMS typedef ptr SENDCMDOUTPARAMS
LPSENDCMDOUTPARAMS typedef ptr SENDCMDOUTPARAMS

	include poppack.inc
READ_ATTRIBUTE_BUFFER_SIZE	EQU	512
IDENTIFY_BUFFER_SIZE	EQU	512
READ_THRESHOLD_BUFFER_SIZE	EQU	512
SMART_LOG_SECTOR_SIZE	EQU	512
READ_ATTRIBUTES	EQU	0D0h
READ_THRESHOLDS	EQU	0D1h
ENABLE_DISABLE_AUTOSAVE	EQU	0D2h
SAVE_ATTRIBUTE_VALUES	EQU	0D3h
EXECUTE_OFFLINE_DIAGS	EQU	0D4h
SMART_READ_LOG	EQU	0D5h
SMART_WRITE_LOG	EQU	0d6h
ENABLE_SMART	EQU	0D8h
DISABLE_SMART	EQU	0D9h
RETURN_SMART_STATUS	EQU	0DAh
ENABLE_DISABLE_AUTO_OFFLINE	EQU	0DBh
endif 
IOCTL_CHANGER_BASE	EQU	<FILE_DEVICE_CHANGER>
IOCTL_CHANGER_GET_PARAMETERS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0000h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_GET_STATUS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0001h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_GET_PRODUCT_DATA	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0002h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_SET_ACCESS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0004h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_CHANGER_GET_ELEMENT_STATUS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0005h , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0006h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_SET_POSITION	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0007h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_EXCHANGE_MEDIUM	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0008h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_MOVE_MEDIUM	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 0009h , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_REINITIALIZE_TRANSPORT	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 000Ah , METHOD_BUFFERED , FILE_READ_ACCESS )>
IOCTL_CHANGER_QUERY_VOLUME_TAGS	EQU	<CTL_CODE ( IOCTL_CHANGER_BASE , 000Bh , METHOD_BUFFERED , FILE_READ_ACCESS  or  FILE_WRITE_ACCESS )>
MAX_VOLUME_ID_SIZE	EQU	36
MAX_VOLUME_TEMPLATE_SIZE	EQU	40
VENDOR_ID_LENGTH	EQU	8
PRODUCT_ID_LENGTH	EQU	16
REVISION_LENGTH	EQU	4
SERIAL_NUMBER_LENGTH	EQU	32
ELEMENT_TYPE typedef DWORD
AllElements = 0
ChangerTransport = 1
ChangerSlot = 2
ChangerIEPort = 3
ChangerDrive = 4
ChangerDoor = 5
ChangerKeypad = 6
ChangerMaxElement = 7

PELEMENT_TYPE typedef ptr ELEMENT_TYPE

CHANGER_ELEMENT	struct 
ElementType	ELEMENT_TYPE	?
ElementAddress	DWORD	?
CHANGER_ELEMENT	ends

PCHANGER_ELEMENT typedef ptr CHANGER_ELEMENT

CHANGER_ELEMENT_LIST	struct 
Element	CHANGER_ELEMENT	<>
NumberOfElements	DWORD	?
CHANGER_ELEMENT_LIST	ends

PCHANGER_ELEMENT_LIST typedef ptr CHANGER_ELEMENT_LIST

CHANGER_BAR_CODE_SCANNER_INSTALLED	EQU	00000001h
CHANGER_INIT_ELEM_STAT_WITH_RANGE	EQU	00000002h
CHANGER_CLOSE_IEPORT	EQU	00000004h
CHANGER_OPEN_IEPORT	EQU	00000008h
CHANGER_STATUS_NON_VOLATILE	EQU	00000010h
CHANGER_EXCHANGE_MEDIA	EQU	00000020h
CHANGER_CLEANER_SLOT	EQU	00000040h
CHANGER_LOCK_UNLOCK	EQU	00000080h
CHANGER_CARTRIDGE_MAGAZINE	EQU	00000100h
CHANGER_MEDIUM_FLIP	EQU	00000200h
CHANGER_POSITION_TO_ELEMENT	EQU	00000400h
CHANGER_REPORT_IEPORT_STATE	EQU	00000800h
CHANGER_STORAGE_DRIVE	EQU	00001000h
CHANGER_STORAGE_IEPORT	EQU	00002000h
CHANGER_STORAGE_SLOT	EQU	00004000h
CHANGER_STORAGE_TRANSPORT	EQU	00008000h
CHANGER_DRIVE_CLEANING_REQUIRED	EQU	00010000h
CHANGER_PREDISMOUNT_EJECT_REQUIRED	EQU	00020000h
CHANGER_CLEANER_ACCESS_NOT_VALID	EQU	00040000h
CHANGER_PREMOUNT_EJECT_REQUIRED	EQU	00080000h
CHANGER_VOLUME_IDENTIFICATION	EQU	00100000h
CHANGER_VOLUME_SEARCH	EQU	00200000h
CHANGER_VOLUME_ASSERT	EQU	00400000h
CHANGER_VOLUME_REPLACE	EQU	00800000h
CHANGER_VOLUME_UNDEFINE	EQU	01000000h
CHANGER_SERIAL_NUMBER_VALID	EQU	04000000h
CHANGER_DEVICE_REINITIALIZE_CAPABLE	EQU	08000000h
CHANGER_KEYPAD_ENABLE_DISABLE	EQU	10000000h
CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS	EQU	20000000h
CHANGER_RESERVED_BIT	EQU	80000000h
CHANGER_PREDISMOUNT_ALIGN_TO_SLOT	EQU	80000001h
CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE	EQU	80000002h
CHANGER_CLEANER_AUTODISMOUNT	EQU	80000004h
CHANGER_TRUE_EXCHANGE_CAPABLE	EQU	80000008h
CHANGER_SLOTS_USE_TRAYS	EQU	80000010h
CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR	EQU	80000020h
CHANGER_CLEANER_OPS_NOT_SUPPORTED	EQU	80000040h
CHANGER_IEPORT_USER_CONTROL_OPEN	EQU	80000080h
CHANGER_IEPORT_USER_CONTROL_CLOSE	EQU	80000100h
CHANGER_MOVE_EXTENDS_IEPORT	EQU	80000200h
CHANGER_MOVE_RETRACTS_IEPORT	EQU	80000400h
CHANGER_TO_TRANSPORT	EQU	01h
CHANGER_TO_SLOT	EQU	02h
CHANGER_TO_IEPORT	EQU	04h
CHANGER_TO_DRIVE	EQU	08h
LOCK_UNLOCK_IEPORT	EQU	01h
LOCK_UNLOCK_DOOR	EQU	02h
LOCK_UNLOCK_KEYPAD	EQU	04h
GET_CHANGER_PARAMETERS	struct 
Size_	DWORD	?
NumberTransportElements	WORD	?
NumberStorageElements	WORD	?
NumberCleanerSlots	WORD	?
NumberIEElements	WORD	?
NumberDataTransferElements	WORD	?
NumberOfDoors	WORD	?
FirstSlotNumber	WORD	?
FirstDriveNumber	WORD	?
FirstTransportNumber	WORD	?
FirstIEPortNumber	WORD	?
FirstCleanerSlotAddress	WORD	?
MagazineSize	WORD	?
DriveCleanTimeout	DWORD	?
Features0	DWORD	?
Features1	DWORD	?
MoveFromTransport	BYTE	?
MoveFromSlot	BYTE	?
MoveFromIePort	BYTE	?
MoveFromDrive	BYTE	?
ExchangeFromTransport	BYTE	?
ExchangeFromSlot	BYTE	?
ExchangeFromIePort	BYTE	?
ExchangeFromDrive	BYTE	?
LockUnlockCapabilities	BYTE	?
PositionCapabilities	BYTE	?
Reserved1	BYTE 2 dup (?)
Reserved2	DWORD 2 dup (?)
GET_CHANGER_PARAMETERS	ends

PGET_CHANGER_PARAMETERS typedef ptr GET_CHANGER_PARAMETERS

CHANGER_PRODUCT_DATA	struct 
VendorId	BYTE VENDOR_ID_LENGTH dup (?)
ProductId	BYTE PRODUCT_ID_LENGTH dup (?)
Revision	BYTE REVISION_LENGTH dup (?)
SerialNumber	BYTE SERIAL_NUMBER_LENGTH dup (?)
DeviceType	BYTE	?
CHANGER_PRODUCT_DATA	ends

PCHANGER_PRODUCT_DATA typedef ptr CHANGER_PRODUCT_DATA

LOCK_ELEMENT	EQU	0
UNLOCK_ELEMENT	EQU	1
EXTEND_IEPORT	EQU	2
RETRACT_IEPORT	EQU	3
CHANGER_SET_ACCESS	struct 
Element	CHANGER_ELEMENT	<>
Control	DWORD	?
CHANGER_SET_ACCESS	ends

PCHANGER_SET_ACCESS typedef ptr CHANGER_SET_ACCESS

CHANGER_READ_ELEMENT_STATUS	struct 
ElementList	CHANGER_ELEMENT_LIST	<>
VolumeTagInfo	BOOLEAN	?
CHANGER_READ_ELEMENT_STATUS	ends

PCHANGER_READ_ELEMENT_STATUS typedef ptr CHANGER_READ_ELEMENT_STATUS

CHANGER_ELEMENT_STATUS	struct 
Element	CHANGER_ELEMENT	<>
SrcElementAddress	CHANGER_ELEMENT	<>
Flags	DWORD	?
ExceptionCode	DWORD	?
TargetId	BYTE	?
Lun	BYTE	?
Reserved	WORD	?
PrimaryVolumeID	BYTE MAX_VOLUME_ID_SIZE dup (?)
AlternateVolumeID	BYTE MAX_VOLUME_ID_SIZE dup (?)
CHANGER_ELEMENT_STATUS	ends

PCHANGER_ELEMENT_STATUS typedef ptr CHANGER_ELEMENT_STATUS

CHANGER_ELEMENT_STATUS_EX	struct 
Element	CHANGER_ELEMENT	<>
SrcElementAddress	CHANGER_ELEMENT	<>
Flags	DWORD	?
ExceptionCode	DWORD	?
TargetId	BYTE	?
Lun	BYTE	?
Reserved	WORD	?
PrimaryVolumeID	BYTE MAX_VOLUME_ID_SIZE dup (?)
AlternateVolumeID	BYTE MAX_VOLUME_ID_SIZE dup (?)
VendorIdentification	BYTE VENDOR_ID_LENGTH dup (?)
ProductIdentification	BYTE PRODUCT_ID_LENGTH dup (?)
SerialNumber	BYTE SERIAL_NUMBER_LENGTH dup (?)
CHANGER_ELEMENT_STATUS_EX	ends

PCHANGER_ELEMENT_STATUS_EX typedef ptr CHANGER_ELEMENT_STATUS_EX

ELEMENT_STATUS_FULL	EQU	00000001h
ELEMENT_STATUS_IMPEXP	EQU	00000002h
ELEMENT_STATUS_EXCEPT	EQU	00000004h
ELEMENT_STATUS_ACCESS	EQU	00000008h
ELEMENT_STATUS_EXENAB	EQU	00000010h
ELEMENT_STATUS_INENAB	EQU	00000020h
ELEMENT_STATUS_PRODUCT_DATA	EQU	00000040h
ELEMENT_STATUS_LUN_VALID	EQU	00001000h
ELEMENT_STATUS_ID_VALID	EQU	00002000h
ELEMENT_STATUS_NOT_BUS	EQU	00008000h
ELEMENT_STATUS_INVERT	EQU	00400000h
ELEMENT_STATUS_SVALID	EQU	00800000h
ELEMENT_STATUS_PVOLTAG	EQU	10000000h
ELEMENT_STATUS_AVOLTAG	EQU	20000000h
ERROR_LABEL_UNREADABLE	EQU	00000001h
ERROR_LABEL_QUESTIONABLE	EQU	00000002h
ERROR_SLOT_NOT_PRESENT	EQU	00000004h
ERROR_DRIVE_NOT_INSTALLED	EQU	00000008h
ERROR_TRAY_MALFUNCTION	EQU	00000010h
ERROR_INIT_STATUS_NEEDED	EQU	00000011h
ERROR_UNHANDLED_ERROR	EQU	0FFFFFFFFh
CHANGER_INITIALIZE_ELEMENT_STATUS	struct 
ElementList	CHANGER_ELEMENT_LIST	<>
BarCodeScan	BOOLEAN	?
CHANGER_INITIALIZE_ELEMENT_STATUS	ends

PCHANGER_INITIALIZE_ELEMENT_STATUS typedef ptr CHANGER_INITIALIZE_ELEMENT_STATUS

CHANGER_SET_POSITION	struct 
Transport	CHANGER_ELEMENT	<>
Destination	CHANGER_ELEMENT	<>
Flip	BOOLEAN	?
CHANGER_SET_POSITION	ends

PCHANGER_SET_POSITION typedef ptr CHANGER_SET_POSITION

CHANGER_EXCHANGE_MEDIUM	struct 
Transport	CHANGER_ELEMENT	<>
Source	CHANGER_ELEMENT	<>
Destination1	CHANGER_ELEMENT	<>
Destination2	CHANGER_ELEMENT	<>
Flip1	BOOLEAN	?
Flip2	BOOLEAN	?
CHANGER_EXCHANGE_MEDIUM	ends

PCHANGER_EXCHANGE_MEDIUM typedef ptr CHANGER_EXCHANGE_MEDIUM

CHANGER_MOVE_MEDIUM	struct 
Transport	CHANGER_ELEMENT	<>
Source	CHANGER_ELEMENT	<>
Destination	CHANGER_ELEMENT	<>
Flip	BOOLEAN	?
CHANGER_MOVE_MEDIUM	ends

PCHANGER_MOVE_MEDIUM typedef ptr CHANGER_MOVE_MEDIUM

CHANGER_SEND_VOLUME_TAG_INFORMATION	struct 
StartingElement	CHANGER_ELEMENT	<>
ActionCode	DWORD	?
VolumeIDTemplate	BYTE MAX_VOLUME_TEMPLATE_SIZE dup (?)
CHANGER_SEND_VOLUME_TAG_INFORMATION	ends

PCHANGER_SEND_VOLUME_TAG_INFORMATION typedef ptr CHANGER_SEND_VOLUME_TAG_INFORMATION

READ_ELEMENT_ADDRESS_INFO	struct 
NumberOfElements	DWORD	?
ElementStatus	CHANGER_ELEMENT_STATUS 1 dup (<>)
READ_ELEMENT_ADDRESS_INFO	ends

PREAD_ELEMENT_ADDRESS_INFO typedef ptr READ_ELEMENT_ADDRESS_INFO

SEARCH_ALL	EQU	0h
SEARCH_PRIMARY	EQU	1h
SEARCH_ALTERNATE	EQU	2h
SEARCH_ALL_NO_SEQ	EQU	4h
SEARCH_PRI_NO_SEQ	EQU	5h
SEARCH_ALT_NO_SEQ	EQU	6h
ASSERT_PRIMARY	EQU	8h
ASSERT_ALTERNATE	EQU	9h
REPLACE_PRIMARY	EQU	0Ah
REPLACE_ALTERNATE	EQU	0Bh
UNDEFINE_PRIMARY	EQU	0Ch
UNDEFINE_ALTERNATE	EQU	0Dh
CHANGER_DEVICE_PROBLEM_TYPE typedef DWORD
DeviceProblemNone = 0
DeviceProblemHardware = 1
DeviceProblemCHMError = 2
DeviceProblemDoorOpen = 3
DeviceProblemCalibrationError = 4
DeviceProblemTargetFailure = 5
DeviceProblemCHMMoveError = 6
DeviceProblemCHMZeroError = 7
DeviceProblemCartridgeInsertError = 8
DeviceProblemPositionError = 9
DeviceProblemSensorError = 10
DeviceProblemCartridgeEjectError = 11
DeviceProblemGripperError = 12
DeviceProblemDriveError = 13

PCHANGER_DEVICE_PROBLEM_TYPE typedef ptr CHANGER_DEVICE_PROBLEM_TYPE

IOCTL_SERIAL_LSRMST_INSERT	EQU	<CTL_CODE ( FILE_DEVICE_SERIAL_PORT , 31 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_SERENUM_EXPOSE_HARDWARE	EQU	<CTL_CODE ( FILE_DEVICE_SERENUM , 128 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_SERENUM_REMOVE_HARDWARE	EQU	<CTL_CODE ( FILE_DEVICE_SERENUM , 129 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_SERENUM_PORT_DESC	EQU	<CTL_CODE ( FILE_DEVICE_SERENUM , 130 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_SERENUM_GET_PORT_NAME	EQU	<CTL_CODE ( FILE_DEVICE_SERENUM , 131 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
SERIAL_LSRMST_ESCAPE	EQU	00h
SERIAL_LSRMST_LSR_DATA	EQU	01h
SERIAL_LSRMST_LSR_NODATA	EQU	02h
SERIAL_LSRMST_MST	EQU	03h
SERIAL_IOC_FCR_FIFO_ENABLE	EQU	00000001h
SERIAL_IOC_FCR_RCVR_RESET	EQU	00000002h
SERIAL_IOC_FCR_XMIT_RESET	EQU	00000004h
SERIAL_IOC_FCR_DMA_MODE	EQU	00000008h
SERIAL_IOC_FCR_RES1	EQU	00000010h
SERIAL_IOC_FCR_RES2	EQU	00000020h
SERIAL_IOC_FCR_RCVR_TRIGGER_LSB	EQU	00000040h
SERIAL_IOC_FCR_RCVR_TRIGGER_MSB	EQU	00000080h
SERIAL_IOC_MCR_DTR	EQU	00000001h
SERIAL_IOC_MCR_RTS	EQU	00000002h
SERIAL_IOC_MCR_OUT1	EQU	00000004h
SERIAL_IOC_MCR_OUT2	EQU	00000008h
SERIAL_IOC_MCR_LOOP	EQU	00000010h
ifndef _FILESYSTEMFSCTL_
_FILESYSTEMFSCTL_	EQU	<>
FSCTL_REQUEST_OPLOCK_LEVEL_1	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 0 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_REQUEST_OPLOCK_LEVEL_2	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 1 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_REQUEST_BATCH_OPLOCK	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 2 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_OPLOCK_BREAK_ACKNOWLEDGE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 3 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_OPBATCH_ACK_CLOSE_PENDING	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 4 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_OPLOCK_BREAK_NOTIFY	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 5 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_LOCK_VOLUME	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 6 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_UNLOCK_VOLUME	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 7 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_DISMOUNT_VOLUME	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 8 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_IS_VOLUME_MOUNTED	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 10 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_IS_PATHNAME_VALID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 11 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_MARK_VOLUME_DIRTY	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 12 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_QUERY_RETRIEVAL_POINTERS	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 14 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_GET_COMPRESSION	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 15 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_SET_COMPRESSION	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 16 , METHOD_BUFFERED , FILE_READ_DATA  or  FILE_WRITE_DATA )>
FSCTL_MARK_AS_SYSTEM_HIVE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 19 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_OPLOCK_BREAK_ACK_NO_2	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 20 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_INVALIDATE_VOLUMES	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 21 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_QUERY_FAT_BPB	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 22 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_REQUEST_FILTER_OPLOCK	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 23 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_FILESYSTEM_GET_STATISTICS	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 24 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
if (_WIN32_WINNT ge 0400h)
FSCTL_GET_NTFS_VOLUME_DATA	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 25 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_GET_NTFS_FILE_RECORD	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 26 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_GET_VOLUME_BITMAP	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 27 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_GET_RETRIEVAL_POINTERS	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 28 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_MOVE_FILE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 29 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_IS_VOLUME_DIRTY	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 30 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_ALLOW_EXTENDED_DASD_IO	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 32 , METHOD_NEITHER , FILE_ANY_ACCESS )>
endif 
if (_WIN32_WINNT ge 0500h)
FSCTL_FIND_FILES_BY_SID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 35 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_SET_OBJECT_ID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 38 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_GET_OBJECT_ID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 39 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_DELETE_OBJECT_ID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 40 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_SET_REPARSE_POINT	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 41 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_GET_REPARSE_POINT	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 42 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_DELETE_REPARSE_POINT	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 43 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_ENUM_USN_DATA	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 44 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_SECURITY_ID_CHECK	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 45 , METHOD_NEITHER , FILE_READ_DATA )>
FSCTL_READ_USN_JOURNAL	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 46 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_SET_OBJECT_ID_EXTENDED	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 47 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_CREATE_OR_GET_OBJECT_ID	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 48 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_SET_SPARSE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 49 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
FSCTL_SET_ZERO_DATA	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 50 , METHOD_BUFFERED , FILE_WRITE_DATA )>
FSCTL_QUERY_ALLOCATED_RANGES	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 51 , METHOD_NEITHER , FILE_READ_DATA )>
FSCTL_SET_ENCRYPTION	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 53 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_ENCRYPTION_FSCTL_IO	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 54 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_WRITE_RAW_ENCRYPTED	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 55 , METHOD_NEITHER , FILE_SPECIAL_ACCESS )>
FSCTL_READ_RAW_ENCRYPTED	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 56 , METHOD_NEITHER , FILE_SPECIAL_ACCESS )>
FSCTL_CREATE_USN_JOURNAL	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 57 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_READ_FILE_USN_DATA	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 58 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_WRITE_USN_CLOSE_RECORD	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 59 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_EXTEND_VOLUME	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 60 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_QUERY_USN_JOURNAL	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 61 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_DELETE_USN_JOURNAL	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 62 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_MARK_HANDLE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 63 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_SIS_COPYFILE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 64 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
FSCTL_SIS_LINK_FILES	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 65 , METHOD_BUFFERED , FILE_READ_DATA  or  FILE_WRITE_DATA )>
FSCTL_HSM_MSG	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 66 , METHOD_BUFFERED , FILE_READ_DATA  or  FILE_WRITE_DATA )>
FSCTL_HSM_DATA	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 68 , METHOD_NEITHER , FILE_READ_DATA  or  FILE_WRITE_DATA )>
FSCTL_RECALL_FILE	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 69 , METHOD_NEITHER , FILE_ANY_ACCESS )>
FSCTL_READ_FROM_PLEX	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 71 , METHOD_OUT_DIRECT , FILE_READ_DATA )>
FSCTL_FILE_PREFETCH	EQU	<CTL_CODE ( FILE_DEVICE_FILE_SYSTEM , 72 , METHOD_BUFFERED , FILE_SPECIAL_ACCESS )>
endif 
PATHNAME_BUFFER	struct 
PathNameLength	DWORD	?
Name_	WCHAR 1 dup (?)
PATHNAME_BUFFER	ends

PPATHNAME_BUFFER typedef ptr PATHNAME_BUFFER

FSCTL_QUERY_FAT_BPB_BUFFER	struct 
First0x24BytesOfBootSector	BYTE 24h dup (?)
FSCTL_QUERY_FAT_BPB_BUFFER	ends

PFSCTL_QUERY_FAT_BPB_BUFFER typedef ptr FSCTL_QUERY_FAT_BPB_BUFFER

if (_WIN32_WINNT ge 0400h)
NTFS_VOLUME_DATA_BUFFER	struct 
VolumeSerialNumber	LARGE_INTEGER	<>
NumberSectors	LARGE_INTEGER	<>
TotalClusters	LARGE_INTEGER	<>
FreeClusters	LARGE_INTEGER	<>
TotalReserved	LARGE_INTEGER	<>
BytesPerSector	DWORD	?
BytesPerCluster	DWORD	?
BytesPerFileRecordSegment	DWORD	?
ClustersPerFileRecordSegment	DWORD	?
MftValidDataLength	LARGE_INTEGER	<>
MftStartLcn	LARGE_INTEGER	<>
Mft2StartLcn	LARGE_INTEGER	<>
MftZoneStart	LARGE_INTEGER	<>
MftZoneEnd	LARGE_INTEGER	<>
NTFS_VOLUME_DATA_BUFFER	ends

PNTFS_VOLUME_DATA_BUFFER typedef ptr NTFS_VOLUME_DATA_BUFFER

NTFS_EXTENDED_VOLUME_DATA	struct 
ByteCount	DWORD	?
MajorVersion	WORD	?
MinorVersion	WORD	?
NTFS_EXTENDED_VOLUME_DATA	ends

PNTFS_EXTENDED_VOLUME_DATA typedef ptr NTFS_EXTENDED_VOLUME_DATA

endif 
if (_WIN32_WINNT ge 0400h)
STARTING_LCN_INPUT_BUFFER	struct 
StartingLcn	LARGE_INTEGER	<>
STARTING_LCN_INPUT_BUFFER	ends

PSTARTING_LCN_INPUT_BUFFER typedef ptr STARTING_LCN_INPUT_BUFFER

VOLUME_BITMAP_BUFFER	struct 
StartingLcn	LARGE_INTEGER	<>
BitmapSize	LARGE_INTEGER	<>
Buffer	BYTE 1 dup (?)
VOLUME_BITMAP_BUFFER	ends

PVOLUME_BITMAP_BUFFER typedef ptr VOLUME_BITMAP_BUFFER

endif 
if (_WIN32_WINNT ge 0400h)
STARTING_VCN_INPUT_BUFFER	struct 
StartingVcn	LARGE_INTEGER	<>
STARTING_VCN_INPUT_BUFFER	ends

PSTARTING_VCN_INPUT_BUFFER typedef ptr STARTING_VCN_INPUT_BUFFER

RETRIEVAL_POINTERS_BUFFER	struct 
ExtentCount	DWORD	?
StartingVcn	LARGE_INTEGER	<>
struct Extents
NextVcn	LARGE_INTEGER	<>
Lcn	LARGE_INTEGER	<>
ends
RETRIEVAL_POINTERS_BUFFER	ends

PRETRIEVAL_POINTERS_BUFFER typedef ptr RETRIEVAL_POINTERS_BUFFER

endif 
if (_WIN32_WINNT ge 0400h)
NTFS_FILE_RECORD_INPUT_BUFFER	struct 
FileReferenceNumber	LARGE_INTEGER	<>
NTFS_FILE_RECORD_INPUT_BUFFER	ends

PNTFS_FILE_RECORD_INPUT_BUFFER typedef ptr NTFS_FILE_RECORD_INPUT_BUFFER

NTFS_FILE_RECORD_OUTPUT_BUFFER	struct 
FileReferenceNumber	LARGE_INTEGER	<>
FileRecordLength	DWORD	?
FileRecordBuffer	BYTE 1 dup (?)
NTFS_FILE_RECORD_OUTPUT_BUFFER	ends

PNTFS_FILE_RECORD_OUTPUT_BUFFER typedef ptr NTFS_FILE_RECORD_OUTPUT_BUFFER

endif 
if (_WIN32_WINNT ge 0400h)
MOVE_FILE_DATA	struct 
FileHandle	HANDLE	?
StartingVcn	LARGE_INTEGER	<>
StartingLcn	LARGE_INTEGER	<>
ClusterCount	DWORD	?
MOVE_FILE_DATA	ends

PMOVE_FILE_DATA typedef ptr MOVE_FILE_DATA

ifndef defined
defined macro x
ifdef x
  exitm <1>
else
  exitm <0>
endif
endm
endif
if defined(_WIN64)
MOVE_FILE_DATA32	struct 
FileHandle	UINT32	?
StartingVcn	LARGE_INTEGER	<>
StartingLcn	LARGE_INTEGER	<>
ClusterCount	DWORD	?
MOVE_FILE_DATA32	ends

PMOVE_FILE_DATA32 typedef ptr MOVE_FILE_DATA32

endif 
endif 
if (_WIN32_WINNT ge 0500h)
FIND_BY_SID_DATA	struct 
Restart	DWORD	?
Sid	SID	<>
FIND_BY_SID_DATA	ends

PFIND_BY_SID_DATA typedef ptr FIND_BY_SID_DATA

endif 
if (_WIN32_WINNT ge 0500h)
MFT_ENUM_DATA	struct 
StartFileReferenceNumber	QWORD	?
LowUsn	USN	?
HighUsn	USN	?
MFT_ENUM_DATA	ends

PMFT_ENUM_DATA typedef ptr MFT_ENUM_DATA

CREATE_USN_JOURNAL_DATA	struct 
MaximumSize	QWORD	?
AllocationDelta	QWORD	?
CREATE_USN_JOURNAL_DATA	ends

PCREATE_USN_JOURNAL_DATA typedef ptr CREATE_USN_JOURNAL_DATA

READ_USN_JOURNAL_DATA	struct 
StartUsn	USN	?
ReasonMask	DWORD	?
ReturnOnlyOnClose	DWORD	?
Timeout	QWORD	?
BytesToWaitFor	QWORD	?
UsnJournalID	QWORD	?
READ_USN_JOURNAL_DATA	ends

PREAD_USN_JOURNAL_DATA typedef ptr READ_USN_JOURNAL_DATA

USN_RECORD	struct 
RecordLength	DWORD	?
MajorVersion	WORD	?
MinorVersion	WORD	?
FileReferenceNumber	QWORD	?
ParentFileReferenceNumber	QWORD	?
Usn	USN	?
TimeStamp	LARGE_INTEGER	<>
Reason	DWORD	?
SourceInfo	DWORD	?
SecurityId	DWORD	?
FileAttributes	DWORD	?
FileNameLength	WORD	?
FileNameOffset	WORD	?
FileName	WCHAR 1 dup (?)
USN_RECORD	ends

PUSN_RECORD typedef ptr USN_RECORD

USN_PAGE_SIZE	EQU	1000h
USN_REASON_DATA_OVERWRITE	EQU	00000001h
USN_REASON_DATA_EXTEND	EQU	00000002h
USN_REASON_DATA_TRUNCATION	EQU	00000004h
USN_REASON_NAMED_DATA_OVERWRITE	EQU	00000010h
USN_REASON_NAMED_DATA_EXTEND	EQU	00000020h
USN_REASON_NAMED_DATA_TRUNCATION	EQU	00000040h
USN_REASON_FILE_CREATE	EQU	00000100h
USN_REASON_FILE_DELETE	EQU	00000200h
USN_REASON_EA_CHANGE	EQU	00000400h
USN_REASON_SECURITY_CHANGE	EQU	00000800h
USN_REASON_RENAME_OLD_NAME	EQU	00001000h
USN_REASON_RENAME_NEW_NAME	EQU	00002000h
USN_REASON_INDEXABLE_CHANGE	EQU	00004000h
USN_REASON_BASIC_INFO_CHANGE	EQU	00008000h
USN_REASON_HARD_LINK_CHANGE	EQU	00010000h
USN_REASON_COMPRESSION_CHANGE	EQU	00020000h
USN_REASON_ENCRYPTION_CHANGE	EQU	00040000h
USN_REASON_OBJECT_ID_CHANGE	EQU	00080000h
USN_REASON_REPARSE_POINT_CHANGE	EQU	00100000h
USN_REASON_STREAM_CHANGE	EQU	00200000h
USN_REASON_CLOSE	EQU	80000000h
USN_JOURNAL_DATA	struct 
UsnJournalID	QWORD	?
FirstUsn	USN	?
NextUsn	USN	?
LowestValidUsn	USN	?
MaxUsn	USN	?
MaximumSize	QWORD	?
AllocationDelta	QWORD	?
USN_JOURNAL_DATA	ends

PUSN_JOURNAL_DATA typedef ptr USN_JOURNAL_DATA

DELETE_USN_JOURNAL_DATA	struct 
UsnJournalID	QWORD	?
DeleteFlags	DWORD	?
DELETE_USN_JOURNAL_DATA	ends

PDELETE_USN_JOURNAL_DATA typedef ptr DELETE_USN_JOURNAL_DATA

USN_DELETE_FLAG_DELETE	EQU	00000001h
USN_DELETE_FLAG_NOTIFY	EQU	00000002h
USN_DELETE_VALID_FLAGS	EQU	00000003h
MARK_HANDLE_INFO	struct 
UsnSourceInfo	DWORD	?
VolumeHandle	HANDLE	?
HandleInfo	DWORD	?
MARK_HANDLE_INFO	ends

PMARK_HANDLE_INFO typedef ptr MARK_HANDLE_INFO

if defined(_WIN64)
MARK_HANDLE_INFO32	struct 
UsnSourceInfo	DWORD	?
VolumeHandle	UINT32	?
HandleInfo	DWORD	?
MARK_HANDLE_INFO32	ends

PMARK_HANDLE_INFO32 typedef ptr MARK_HANDLE_INFO32

endif 
USN_SOURCE_DATA_MANAGEMENT	EQU	00000001h
USN_SOURCE_AUXILIARY_DATA	EQU	00000002h
USN_SOURCE_REPLICATION_MANAGEMENT	EQU	00000004h
MARK_HANDLE_PROTECT_CLUSTERS	EQU	00000001h
endif 
if (_WIN32_WINNT ge 0500h)
BULK_SECURITY_TEST_DATA	struct 
DesiredAccess	ACCESS_MASK	?
SecurityIds	DWORD 1 dup (?)
BULK_SECURITY_TEST_DATA	ends

PBULK_SECURITY_TEST_DATA typedef ptr BULK_SECURITY_TEST_DATA

endif 
if (_WIN32_WINNT ge 0500h)
VOLUME_IS_DIRTY	EQU	00000001h
VOLUME_UPGRADE_SCHEDULED	EQU	00000002h
endif 
FILE_PREFETCH	struct 
Type_	DWORD	?
Count	DWORD	?
Prefetch_	QWORD 1 dup (?)
FILE_PREFETCH	ends

PFILE_PREFETCH typedef ptr FILE_PREFETCH

FILE_PREFETCH_TYPE_FOR_CREATE	EQU	1h
FILESYSTEM_STATISTICS	struct 
FileSystemType	WORD	?
Version	WORD	?
SizeOfCompleteStructure	DWORD	?
UserFileReads	DWORD	?
UserFileReadBytes	DWORD	?
UserDiskReads	DWORD	?
UserFileWrites	DWORD	?
UserFileWriteBytes	DWORD	?
UserDiskWrites	DWORD	?
MetaDataReads	DWORD	?
MetaDataReadBytes	DWORD	?
MetaDataDiskReads	DWORD	?
MetaDataWrites	DWORD	?
MetaDataWriteBytes	DWORD	?
MetaDataDiskWrites	DWORD	?
FILESYSTEM_STATISTICS	ends

PFILESYSTEM_STATISTICS typedef ptr FILESYSTEM_STATISTICS

FILESYSTEM_STATISTICS_TYPE_NTFS	EQU	1
FILESYSTEM_STATISTICS_TYPE_FAT	EQU	2
FAT_STATISTICS	struct 
CreateHits	DWORD	?
SuccessfulCreates	DWORD	?
FailedCreates	DWORD	?
NonCachedReads	DWORD	?
NonCachedReadBytes	DWORD	?
NonCachedWrites	DWORD	?
NonCachedWriteBytes	DWORD	?
NonCachedDiskReads	DWORD	?
NonCachedDiskWrites	DWORD	?
FAT_STATISTICS	ends

PFAT_STATISTICS typedef ptr FAT_STATISTICS

NTFS_STATISTICS	struct 
LogFileFullExceptions	DWORD	?
OtherExceptions	DWORD	?
MftReads	DWORD	?
MftReadBytes	DWORD	?
MftWrites	DWORD	?
MftWriteBytes	DWORD	?
struct MftWritesUserLevel
Write	WORD	?
Create	WORD	?
SetInfo	WORD	?
Flush	WORD	?
ends
MftWritesFlushForLogFileFull	WORD	?
MftWritesLazyWriter	WORD	?
MftWritesUserRequest	WORD	?
Mft2Writes	DWORD	?
Mft2WriteBytes	DWORD	?
struct Mft2WritesUserLevel
Write	WORD	?
Create	WORD	?
SetInfo	WORD	?
Flush	WORD	?
ends
Mft2WritesFlushForLogFileFull	WORD	?
Mft2WritesLazyWriter	WORD	?
Mft2WritesUserRequest	WORD	?
RootIndexReads	DWORD	?
RootIndexReadBytes	DWORD	?
RootIndexWrites	DWORD	?
RootIndexWriteBytes	DWORD	?
BitmapReads	DWORD	?
BitmapReadBytes	DWORD	?
BitmapWrites	DWORD	?
BitmapWriteBytes	DWORD	?
BitmapWritesFlushForLogFileFull	WORD	?
BitmapWritesLazyWriter	WORD	?
BitmapWritesUserRequest	WORD	?
struct BitmapWritesUserLevel
Write	WORD	?
Create	WORD	?
SetInfo	WORD	?
ends
MftBitmapReads	DWORD	?
MftBitmapReadBytes	DWORD	?
MftBitmapWrites	DWORD	?
MftBitmapWriteBytes	DWORD	?
MftBitmapWritesFlushForLogFileFull	WORD	?
MftBitmapWritesLazyWriter	WORD	?
MftBitmapWritesUserRequest	WORD	?
struct MftBitmapWritesUserLevel
Write	WORD	?
Create	WORD	?
SetInfo	WORD	?
Flush	WORD	?
ends
UserIndexReads	DWORD	?
UserIndexReadBytes	DWORD	?
UserIndexWrites	DWORD	?
UserIndexWriteBytes	DWORD	?
LogFileReads	DWORD	?
LogFileReadBytes	DWORD	?
LogFileWrites	DWORD	?
LogFileWriteBytes	DWORD	?
struct Allocate
Calls	DWORD	?
Clusters	DWORD	?
Hints	DWORD	?
RunsReturned	DWORD	?
HintsHonored	DWORD	?
HintsClusters	DWORD	?
Cache	DWORD	?
CacheClusters	DWORD	?
CacheMiss	DWORD	?
CacheMissClusters	DWORD	?
ends
NTFS_STATISTICS	ends

PNTFS_STATISTICS typedef ptr NTFS_STATISTICS

if (_WIN32_WINNT ge 0500h)
if _MSC_VER ge 1200
;#pragma warning ( push ) 
endif 
;#pragma warning ( disable : 4201 ) 
FILE_OBJECTID_BUFFER	struct 
ObjectId	BYTE 16 dup (?)
union
struct
BirthVolumeId	BYTE 16 dup (?)
BirthObjectId	BYTE 16 dup (?)
DomainId	BYTE 16 dup (?)
ends
ExtendedInfo	BYTE 48 dup (?)
ends
FILE_OBJECTID_BUFFER	ends

PFILE_OBJECTID_BUFFER typedef ptr FILE_OBJECTID_BUFFER

if _MSC_VER ge 1200
;#pragma warning ( pop ) 
else 
;#pragma warning ( default : 4201 ) 
endif 
endif 
if (_WIN32_WINNT ge 0500h)
FILE_SET_SPARSE_BUFFER	struct 
SetSparse	BOOLEAN	?
FILE_SET_SPARSE_BUFFER	ends

PFILE_SET_SPARSE_BUFFER typedef ptr FILE_SET_SPARSE_BUFFER

endif 
if (_WIN32_WINNT ge 0500h)
FILE_ZERO_DATA_INFORMATION	struct 
FileOffset	LARGE_INTEGER	<>
BeyondFinalZero	LARGE_INTEGER	<>
FILE_ZERO_DATA_INFORMATION	ends

PFILE_ZERO_DATA_INFORMATION typedef ptr FILE_ZERO_DATA_INFORMATION

endif 
if (_WIN32_WINNT ge 0500h)
FILE_ALLOCATED_RANGE_BUFFER	struct 
FileOffset	LARGE_INTEGER	<>
Length_	LARGE_INTEGER	<>
FILE_ALLOCATED_RANGE_BUFFER	ends

PFILE_ALLOCATED_RANGE_BUFFER typedef ptr FILE_ALLOCATED_RANGE_BUFFER

endif 
if (_WIN32_WINNT ge 0500h)
ENCRYPTION_BUFFER	struct 
EncryptionOperation	DWORD	?
Private	BYTE 1 dup (?)
ENCRYPTION_BUFFER	ends

PENCRYPTION_BUFFER typedef ptr ENCRYPTION_BUFFER

FILE_SET_ENCRYPTION	EQU	00000001h
FILE_CLEAR_ENCRYPTION	EQU	00000002h
STREAM_SET_ENCRYPTION	EQU	00000003h
STREAM_CLEAR_ENCRYPTION	EQU	00000004h
MAXIMUM_ENCRYPTION_VALUE	EQU	00000004h
DECRYPTION_STATUS_BUFFER	struct 
NoEncryptedStreams	BOOLEAN	?
DECRYPTION_STATUS_BUFFER	ends

PDECRYPTION_STATUS_BUFFER typedef ptr DECRYPTION_STATUS_BUFFER

ENCRYPTION_FORMAT_DEFAULT	EQU	01h
COMPRESSION_FORMAT_SPARSE	EQU	4000h
REQUEST_RAW_ENCRYPTED_DATA	struct 
FileOffset	QWORD	?
Length_	DWORD	?
REQUEST_RAW_ENCRYPTED_DATA	ends

PREQUEST_RAW_ENCRYPTED_DATA typedef ptr REQUEST_RAW_ENCRYPTED_DATA

ENCRYPTED_DATA_INFO	struct 
StartingFileOffset	QWORD	?
OutputBufferOffset	DWORD	?
BytesWithinFileSize	DWORD	?
BytesWithinValidDataLength	DWORD	?
CompressionFormat	WORD	?
DataUnitShift	BYTE	?
ChunkShift	BYTE	?
ClusterShift	BYTE	?
EncryptionFormat	BYTE	?
NumberOfDataBlocks	WORD	?
DataBlockSize	DWORD ANYSIZE_ARRAY dup (?)
ENCRYPTED_DATA_INFO	ends

PENCRYPTED_DATA_INFO typedef ptr ENCRYPTED_DATA_INFO
endif 
if (_WIN32_WINNT ge 0500h)
PLEX_READ_DATA_REQUEST	struct 
ByteOffset	LARGE_INTEGER	<>
ByteLength	DWORD	?
PlexNumber	DWORD	?
PLEX_READ_DATA_REQUEST	ends

PPLEX_READ_DATA_REQUEST typedef ptr PLEX_READ_DATA_REQUEST

endif 
if (_WIN32_WINNT ge 0500h)
SI_COPYFILE	struct 
SourceFileNameLength	DWORD	?
DestinationFileNameLength	DWORD	?
Flags	DWORD	?
FileNameBuffer	WCHAR 1 dup (?)
SI_COPYFILE	ends

PSI_COPYFILE typedef ptr SI_COPYFILE

COPYFILE_SIS_LINK	EQU	0001h
COPYFILE_SIS_REPLACE	EQU	0002h
COPYFILE_SIS_FLAGS	EQU	0003h
endif 
endif 
IOCTL_VOLUME_BASE	EQU	<( 'V' )>
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS	EQU	<CTL_CODE ( IOCTL_VOLUME_BASE , 0 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
IOCTL_VOLUME_IS_CLUSTERED	EQU	<CTL_CODE ( IOCTL_VOLUME_BASE , 12 , METHOD_BUFFERED , FILE_ANY_ACCESS )>
DISK_EXTENT	struct 
DiskNumber	DWORD	?
StartingOffset	LARGE_INTEGER	<>
ExtentLength	LARGE_INTEGER	<>
DISK_EXTENT	ends

PDISK_EXTENT typedef ptr DISK_EXTENT

VOLUME_DISK_EXTENTS	struct 
NumberOfDiskExtents	DWORD	?
Extents	DISK_EXTENT 1 dup (<>)
VOLUME_DISK_EXTENTS	ends

PVOLUME_DISK_EXTENTS typedef ptr VOLUME_DISK_EXTENTS

endif 

;--- errors: 0
;--- end of file ---
