JwaWinIoctl.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:173k
源码类别:
Windows编程
开发平台:
Delphi
- IOCTL_CHANGER_GET_PARAMETERS = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0000 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_GET_PARAMETERS}
- IOCTL_CHANGER_GET_STATUS = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0001 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_GET_STATUS}
- IOCTL_CHANGER_GET_PRODUCT_DATA = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0002 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_GET_PRODUCT_DATA}
- IOCTL_CHANGER_SET_ACCESS = (
- (IOCTL_CHANGER_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0004 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_SET_ACCESS}
- IOCTL_CHANGER_GET_ELEMENT_STATUS = (
- (IOCTL_CHANGER_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($0005 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_GET_ELEMENT_STATUS}
- IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0006 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS}
- IOCTL_CHANGER_SET_POSITION = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0007 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_SET_POSITION}
- IOCTL_CHANGER_EXCHANGE_MEDIUM = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0008 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_EXCHANGE_MEDIUM}
- IOCTL_CHANGER_MOVE_MEDIUM = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($0009 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_MOVE_MEDIUM}
- IOCTL_CHANGER_REINITIALIZE_TRANSPORT = (
- (IOCTL_CHANGER_BASE shl 16) or (FILE_READ_ACCESS shl 14) or
- ($000A shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_REINITIALIZE_TRANSPORT}
- IOCTL_CHANGER_QUERY_VOLUME_TAGS = (
- (IOCTL_CHANGER_BASE shl 16) or ((FILE_READ_ACCESS or FILE_WRITE_ACCESS) shl 14) or
- ($000B shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_CHANGER_QUERY_VOLUME_TAGS}
- MAX_VOLUME_ID_SIZE = 36;
- {$EXTERNALSYM MAX_VOLUME_ID_SIZE}
- MAX_VOLUME_TEMPLATE_SIZE = 40;
- {$EXTERNALSYM MAX_VOLUME_TEMPLATE_SIZE}
- VENDOR_ID_LENGTH = 8;
- {$EXTERNALSYM VENDOR_ID_LENGTH}
- PRODUCT_ID_LENGTH = 16;
- {$EXTERNALSYM PRODUCT_ID_LENGTH}
- REVISION_LENGTH = 4;
- {$EXTERNALSYM REVISION_LENGTH}
- SERIAL_NUMBER_LENGTH = 32;
- {$EXTERNALSYM SERIAL_NUMBER_LENGTH}
- //
- // Common structures describing elements.
- //
- type
- _ELEMENT_TYPE = (
- AllElements, // As defined by SCSI
- ChangerTransport, // As defined by SCSI
- ChangerSlot, // As defined by SCSI
- ChangerIEPort, // As defined by SCSI
- ChangerDrive, // As defined by SCSI
- ChangerDoor, // Front panel, used to access internal of cabinet.
- ChangerKeypad, // Keypad/input on front panel.
- ChangerMaxElement); // Placeholder only. Not a valid type.
- {$EXTERNALSYM _ELEMENT_TYPE}
- ELEMENT_TYPE = _ELEMENT_TYPE;
- {$EXTERNALSYM ELEMENT_TYPE}
- PELEMENT_TYPE = ^ELEMENT_TYPE;
- {$EXTERNALSYM PELEMENT_TYPE}
- TElementType = ELEMENT_TYPE;
- PElementType = PELEMENT_TYPE;
- PCHANGER_ELEMENT = ^CHANGER_ELEMENT;
- {$EXTERNALSYM PCHANGER_ELEMENT}
- _CHANGER_ELEMENT = record
- ElementType: ELEMENT_TYPE;
- ElementAddress: DWORD;
- end;
- {$EXTERNALSYM _CHANGER_ELEMENT}
- CHANGER_ELEMENT = _CHANGER_ELEMENT;
- {$EXTERNALSYM CHANGER_ELEMENT}
- TChangerElement = CHANGER_ELEMENT;
- PChangerElement = PCHANGER_ELEMENT;
- PCHANGER_ELEMENT_LIST = ^CHANGER_ELEMENT_LIST;
- {$EXTERNALSYM PCHANGER_ELEMENT_LIST}
- _CHANGER_ELEMENT_LIST = record
- Element: CHANGER_ELEMENT;
- NumberOfElements: DWORD;
- end;
- {$EXTERNALSYM _CHANGER_ELEMENT_LIST}
- CHANGER_ELEMENT_LIST = _CHANGER_ELEMENT_LIST;
- {$EXTERNALSYM CHANGER_ELEMENT_LIST}
- TChangerElementList = CHANGER_ELEMENT_LIST;
- PChangerElementList = PCHANGER_ELEMENT_LIST;
- //
- // Definitions for IOCTL_CHANGER_GET_PARAMETERS
- //
- //
- // Definitions for Features0 of GET_CHANGER_PARAMETERS
- //
- const
- CHANGER_BAR_CODE_SCANNER_INSTALLED = $00000001; // The medium-changer has a bar code scanner installed.
- {$EXTERNALSYM CHANGER_BAR_CODE_SCANNER_INSTALLED}
- CHANGER_INIT_ELEM_STAT_WITH_RANGE = $00000002; // The medium-changer has the ability to initialize elements within a specified range.
- {$EXTERNALSYM CHANGER_INIT_ELEM_STAT_WITH_RANGE}
- CHANGER_CLOSE_IEPORT = $00000004; // The medium-changer has the ability to close the i/e port door.
- {$EXTERNALSYM CHANGER_CLOSE_IEPORT}
- CHANGER_OPEN_IEPORT = $00000008; // The medium-changer can open the i/e port door.
- {$EXTERNALSYM CHANGER_OPEN_IEPORT}
- CHANGER_STATUS_NON_VOLATILE = $00000010; // The medium-changer uses non-volatile memory for element status information.
- {$EXTERNALSYM CHANGER_STATUS_NON_VOLATILE}
- CHANGER_EXCHANGE_MEDIA = $00000020; // The medium-changer supports exchange operations.
- {$EXTERNALSYM CHANGER_EXCHANGE_MEDIA}
- CHANGER_CLEANER_SLOT = $00000040; // The medium-changer has a fixed slot designated for cleaner cartridges.
- {$EXTERNALSYM CHANGER_CLEANER_SLOT}
- CHANGER_LOCK_UNLOCK = $00000080; // The medium-changer can be (un)secured to (allow)prevent media removal.
- {$EXTERNALSYM CHANGER_LOCK_UNLOCK}
- CHANGER_CARTRIDGE_MAGAZINE = $00000100; // The medium-changer uses cartridge magazines for some storage slots.
- {$EXTERNALSYM CHANGER_CARTRIDGE_MAGAZINE}
- CHANGER_MEDIUM_FLIP = $00000200; // The medium-changer can flip medium.
- {$EXTERNALSYM CHANGER_MEDIUM_FLIP}
- CHANGER_POSITION_TO_ELEMENT = $00000400; // The medium-changer can position the transport to a particular element.
- {$EXTERNALSYM CHANGER_POSITION_TO_ELEMENT}
- CHANGER_REPORT_IEPORT_STATE = $00000800; // The medium-changer can determine whether media is present
- {$EXTERNALSYM CHANGER_REPORT_IEPORT_STATE}
- // in the IE Port.
- CHANGER_STORAGE_DRIVE = $00001000; // The medium-changer can use a drive as an independent storage element.
- {$EXTERNALSYM CHANGER_STORAGE_DRIVE}
- CHANGER_STORAGE_IEPORT = $00002000; // The medium-changer can use a i/e port as an independent storage element.
- {$EXTERNALSYM CHANGER_STORAGE_IEPORT}
- CHANGER_STORAGE_SLOT = $00004000; // The medium-changer can use a slot as an independent storage element.
- {$EXTERNALSYM CHANGER_STORAGE_SLOT}
- CHANGER_STORAGE_TRANSPORT = $00008000; // The medium-changer can use a transport as an independent storage element.
- {$EXTERNALSYM CHANGER_STORAGE_TRANSPORT}
- CHANGER_DRIVE_CLEANING_REQUIRED = $00010000; // The drives controlled by the medium changer require periodic cleaning
- {$EXTERNALSYM CHANGER_DRIVE_CLEANING_REQUIRED}
- // initiated by an application.
- CHANGER_PREDISMOUNT_EJECT_REQUIRED = $00020000; // The medium-changer requires a drive eject command to be issued, before a changer
- {$EXTERNALSYM CHANGER_PREDISMOUNT_EJECT_REQUIRED}
- // move / exchange command can be issued to the drive.
- CHANGER_CLEANER_ACCESS_NOT_VALID = $00040000; // The access bit in GES isn't valid for cleaner cartridges.
- {$EXTERNALSYM CHANGER_CLEANER_ACCESS_NOT_VALID}
- CHANGER_PREMOUNT_EJECT_REQUIRED = $00080000; // The medium-changer requires a drive eject command to be issued
- {$EXTERNALSYM CHANGER_PREMOUNT_EJECT_REQUIRED}
- // before a move / exchange command can be issued with the drive as src/dst.
- CHANGER_VOLUME_IDENTIFICATION = $00100000; // The medium-changer supports volume identification.
- {$EXTERNALSYM CHANGER_VOLUME_IDENTIFICATION}
- CHANGER_VOLUME_SEARCH = $00200000; // The medium-changer can search for volume information.
- {$EXTERNALSYM CHANGER_VOLUME_SEARCH}
- CHANGER_VOLUME_ASSERT = $00400000; // The medium-changer can verify volume information.
- {$EXTERNALSYM CHANGER_VOLUME_ASSERT}
- CHANGER_VOLUME_REPLACE = $00800000; // The medium-changer can replace volume information.
- {$EXTERNALSYM CHANGER_VOLUME_REPLACE}
- CHANGER_VOLUME_UNDEFINE = $01000000; // The medium-changer can undefine volume information.
- {$EXTERNALSYM CHANGER_VOLUME_UNDEFINE}
- CHANGER_SERIAL_NUMBER_VALID = $04000000; // The serial number reported in GetProductData is valid
- {$EXTERNALSYM CHANGER_SERIAL_NUMBER_VALID}
- // and unique.
- CHANGER_DEVICE_REINITIALIZE_CAPABLE = $08000000; // The medium-changer can be issued a ChangerReinitializeUnit.
- {$EXTERNALSYM CHANGER_DEVICE_REINITIALIZE_CAPABLE}
- CHANGER_KEYPAD_ENABLE_DISABLE = $10000000; // Indicates that the keypad can be enabled/disabled.
- {$EXTERNALSYM CHANGER_KEYPAD_ENABLE_DISABLE}
- CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS = $20000000; // Drives must be empty before access via the door is possible.
- {$EXTERNALSYM CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS}
- CHANGER_RESERVED_BIT = DWORD($80000000); // Will be used to indicate Features1 capability bits.
- {$EXTERNALSYM CHANGER_RESERVED_BIT}
- //
- // Definitions for Features1 of GET_CHANGER_PARAMETERS
- //
- CHANGER_PREDISMOUNT_ALIGN_TO_SLOT = DWORD($80000001); // The transport must be prepositioned to the slot prior to ejecting the media.
- {$EXTERNALSYM CHANGER_PREDISMOUNT_ALIGN_TO_SLOT}
- CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE = DWORD($80000002); // The transport must be prepositioned to the drive prior to ejecting the media.
- {$EXTERNALSYM CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE}
- CHANGER_CLEANER_AUTODISMOUNT = DWORD($80000004); // The device will move the cleaner cartridge back into the slot when cleaning has completed.
- {$EXTERNALSYM CHANGER_CLEANER_AUTODISMOUNT}
- CHANGER_TRUE_EXCHANGE_CAPABLE = DWORD($80000008); // Device can do src -> dest2 exchanges.
- {$EXTERNALSYM CHANGER_TRUE_EXCHANGE_CAPABLE}
- CHANGER_SLOTS_USE_TRAYS = DWORD($80000010); // Slots have removable trays, requiring multiple moves for inject/eject.
- {$EXTERNALSYM CHANGER_SLOTS_USE_TRAYS}
- CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR = DWORD($80000020); // Media must be returned to the slot from which it originated after a move to another element.
- {$EXTERNALSYM CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR}
- CHANGER_CLEANER_OPS_NOT_SUPPORTED = DWORD($80000040); // Automated cleaning operations are not supported on this device.
- {$EXTERNALSYM CHANGER_CLEANER_OPS_NOT_SUPPORTED}
- CHANGER_IEPORT_USER_CONTROL_OPEN = DWORD($80000080); // Indicates that user action is necessary to open a closed ieport.
- {$EXTERNALSYM CHANGER_IEPORT_USER_CONTROL_OPEN}
- CHANGER_IEPORT_USER_CONTROL_CLOSE = DWORD($80000100); // Indicates that user action is necessary to close an opened ieport.
- {$EXTERNALSYM CHANGER_IEPORT_USER_CONTROL_CLOSE}
- CHANGER_MOVE_EXTENDS_IEPORT = DWORD($80000200); // Indicates that a move media to the ieport extends the tray.
- {$EXTERNALSYM CHANGER_MOVE_EXTENDS_IEPORT}
- CHANGER_MOVE_RETRACTS_IEPORT = DWORD($80000400); // Indicates that a move media from the ieport retracts the tray.
- {$EXTERNALSYM CHANGER_MOVE_RETRACTS_IEPORT}
- //
- // Definitions for MoveFrom, ExchangeFrom, and PositionCapabilities
- //
- CHANGER_TO_TRANSPORT = $01; // The device can carry out the operation to a transport from the specified element.
- {$EXTERNALSYM CHANGER_TO_TRANSPORT}
- CHANGER_TO_SLOT = $02; // The device can carry out the operation to a slot from the specified element.
- {$EXTERNALSYM CHANGER_TO_SLOT}
- CHANGER_TO_IEPORT = $04; // The device can carry out the operation to an IE Port from the specified element.
- {$EXTERNALSYM CHANGER_TO_IEPORT}
- CHANGER_TO_DRIVE = $08; // The device can carry out the operation to a drive from the specified element.
- {$EXTERNALSYM CHANGER_TO_DRIVE}
- //
- // Definitions for LockUnlockCapabilities
- //
- LOCK_UNLOCK_IEPORT = $01; // The device can lock/unlock the ieport(s).
- {$EXTERNALSYM LOCK_UNLOCK_IEPORT}
- LOCK_UNLOCK_DOOR = $02; // The device can lock/unlock the door(s).
- {$EXTERNALSYM LOCK_UNLOCK_DOOR}
- LOCK_UNLOCK_KEYPAD = $04; // The device can lock/unlock the keypad.
- {$EXTERNALSYM LOCK_UNLOCK_KEYPAD}
- type
- PGET_CHANGER_PARAMETERS = ^GET_CHANGER_PARAMETERS;
- {$EXTERNALSYM PGET_CHANGER_PARAMETERS}
- _GET_CHANGER_PARAMETERS = record
- //
- // Size of the structure. Can be used for versioning.
- //
- Size: DWORD;
- //
- // Number of N element(s) as defined by the Element Address Page (or equivalent...).
- //
- NumberTransportElements: WORD;
- NumberStorageElements: WORD; // for data cartridges only
- NumberCleanerSlots: WORD; // for cleaner cartridges
- NumberIEElements: WORD;
- NumberDataTransferElements: WORD;
- //
- // Number of doors/front panels (allows user entry into the cabinet).
- //
- NumberOfDoors: WORD;
- //
- // The device-specific address (from user manual of the device) of the first N element. Used
- // by the UI to relate the various elements to the user.
- //
- FirstSlotNumber: WORD;
- FirstDriveNumber: WORD;
- FirstTransportNumber: WORD;
- FirstIEPortNumber: WORD;
- FirstCleanerSlotAddress: WORD;
- //
- // Indicates the capacity of each magazine, if they exist.
- //
- MagazineSize: WORD;
- //
- // Specifies the approximate number of seconds for when a cleaning should be completed.
- // Only applicable if drive cleaning is supported. See Features0.
- //
- DriveCleanTimeout: DWORD;
- //
- // See features bits, above.
- //
- Features0: DWORD;
- Features1: DWORD;
- //
- // Bitmask defining Move from N element to element. Defined by Device Capabilities Page (or equivalent).
- // AND-masking with the TO_XXX values will indicate legal destinations.
- //
- MoveFromTransport: BYTE;
- MoveFromSlot: BYTE;
- MoveFromIePort: BYTE;
- MoveFromDrive: BYTE;
- //
- // Bitmask defining Exchange from N element to element. Defined by Device Capabilities Page (or equivalent).
- // AND-masking with the TO_XXX values will indicate legal destinations.
- //
- ExchangeFromTransport: BYTE;
- ExchangeFromSlot: BYTE;
- ExchangeFromIePort: BYTE;
- ExchangeFromDrive: BYTE;
- //
- // Bitmask defining which elements are capable of lock/unlock. Valid only if
- // CHANGER_LOCK_UNLOCK is set in Features0.
- //
- LockUnlockCapabilities: BYTE;
- //
- // Bitmask defining which elements valid for positioning operations. Valid only if
- // CHANGER_POSITION_TO_ELEMENT is set in Features0.
- //
- PositionCapabilities: BYTE;
- //
- // For future expansion.
- //
- Reserved1: array [0..1] of BYTE;
- Reserved2: array [0..1] of DWORD;
- end;
- {$EXTERNALSYM _GET_CHANGER_PARAMETERS}
- GET_CHANGER_PARAMETERS = _GET_CHANGER_PARAMETERS;
- {$EXTERNALSYM GET_CHANGER_PARAMETERS}
- TGetChangerParameters = GET_CHANGER_PARAMETERS;
- PGetChangerParameters = PGET_CHANGER_PARAMETERS;
- //
- // Definitions for IOCTL_CHANGER_GET_PRODUCT_DATA
- //
- PCHANGER_PRODUCT_DATA = ^CHANGER_PRODUCT_DATA;
- {$EXTERNALSYM PCHANGER_PRODUCT_DATA}
- _CHANGER_PRODUCT_DATA = record
- //
- // Device manufacturer's name - based on inquiry data
- //
- VendorId: array [0..VENDOR_ID_LENGTH - 1] of BYTE;
- //
- // Product identification as defined by the vendor - based on Inquiry data
- //
- ProductId: array [0..PRODUCT_ID_LENGTH - 1] of BYTE;
- //
- // Product revision as defined by the vendor.
- //
- Revision: array [0..REVISION_LENGTH - 1] of BYTE;
- //
- // Vendor unique value used to globally identify this device. Can
- // be from Vital Product Data, for example.
- //
- SerialNumber: array [0..SERIAL_NUMBER_LENGTH - 1] of BYTE;
- //
- // Indicates device type of data transports, as defined by SCSI-2.
- //
- DeviceType: BYTE;
- end;
- {$EXTERNALSYM _CHANGER_PRODUCT_DATA}
- CHANGER_PRODUCT_DATA = _CHANGER_PRODUCT_DATA;
- {$EXTERNALSYM CHANGER_PRODUCT_DATA}
- TChangerProductData = CHANGER_PRODUCT_DATA;
- PChangerProductData = PCHANGER_PRODUCT_DATA;
- //
- // Definitions for IOCTL_CHANGER_SET_ACCESS
- //
- const
- LOCK_ELEMENT = 0;
- {$EXTERNALSYM LOCK_ELEMENT}
- UNLOCK_ELEMENT = 1;
- {$EXTERNALSYM UNLOCK_ELEMENT}
- EXTEND_IEPORT = 2;
- {$EXTERNALSYM EXTEND_IEPORT}
- RETRACT_IEPORT = 3;
- {$EXTERNALSYM RETRACT_IEPORT}
- type
- PCHANGER_SET_ACCESS = ^CHANGER_SET_ACCESS;
- {$EXTERNALSYM PCHANGER_SET_ACCESS}
- _CHANGER_SET_ACCESS = record
- //
- // Element can be ChangerIEPort, ChangerDoor, ChangerKeypad
- //
- Element: CHANGER_ELEMENT;
- //
- // See above for possible operations.
- //
- Control: DWORD;
- end;
- {$EXTERNALSYM _CHANGER_SET_ACCESS}
- CHANGER_SET_ACCESS = _CHANGER_SET_ACCESS;
- {$EXTERNALSYM CHANGER_SET_ACCESS}
- TChangerSetAccess = CHANGER_SET_ACCESS;
- PChangerSetAccess = PCHANGER_SET_ACCESS;
- //
- // Definitions for IOCTL_CHANGER_GET_ELEMENT_STATUS
- //
- //
- // Input buffer.
- //
- PCHANGER_READ_ELEMENT_STATUS = ^CHANGER_READ_ELEMENT_STATUS;
- {$EXTERNALSYM PCHANGER_READ_ELEMENT_STATUS}
- _CHANGER_READ_ELEMENT_STATUS = record
- //
- // List describing the elements and range on which to return information.
- //
- ElementList: CHANGER_ELEMENT_LIST;
- //
- // Indicates whether volume tag information is to be returned.
- //
- VolumeTagInfo: ByteBool;
- end;
- {$EXTERNALSYM _CHANGER_READ_ELEMENT_STATUS}
- CHANGER_READ_ELEMENT_STATUS = _CHANGER_READ_ELEMENT_STATUS;
- {$EXTERNALSYM CHANGER_READ_ELEMENT_STATUS}
- TChangerReadElementStatus = CHANGER_READ_ELEMENT_STATUS;
- PChangerReadElementStatus = PCHANGER_READ_ELEMENT_STATUS;
- //
- // Output buffer.
- //
- PCHANGER_ELEMENT_STATUS = ^CHANGER_ELEMENT_STATUS;
- {$EXTERNALSYM PCHANGER_ELEMENT_STATUS}
- _CHANGER_ELEMENT_STATUS = record
- //
- // Element to which this structure refers.
- //
- Element: CHANGER_ELEMENT;
- //
- // Address of the element from which the media was originally moved.
- // Valid if ELEMENT_STATUS_SVALID bit of Flags DWORD is set.
- // Needs to be converted to a zero-based offset from the device-unique value.
- //
- SrcElementAddress: CHANGER_ELEMENT;
- //
- // See below.
- //
- Flags: DWORD;
- //
- // See below for possible values.
- //
- ExceptionCode: DWORD;
- //
- // Scsi Target Id of this element.
- // Valid only if ELEMENT_STATUS_ID_VALID is set in Flags.
- //
- TargetId: BYTE;
- //
- // LogicalUnitNumber of this element.
- // Valid only if ELEMENT_STATUS_LUN_VALID is set in Flags.
- //
- Lun: BYTE;
- Reserved: WORD;
- //
- // Primary volume identification for the media.
- // Valid only if ELEMENT_STATUS_PVOLTAG bit is set in Flags.
- //
- PrimaryVolumeID: array [0..MAX_VOLUME_ID_SIZE - 1] of BYTE;
- //
- // Alternate volume identification for the media.
- // Valid for two-sided media only, and pertains to the id. of the inverted side.
- // Valid only if ELEMENT_STATUS_AVOLTAG bit is set in Flags.
- //
- AlternateVolumeID: array [0..MAX_VOLUME_ID_SIZE - 1] of BYTE;
- end;
- {$EXTERNALSYM _CHANGER_ELEMENT_STATUS}
- CHANGER_ELEMENT_STATUS = _CHANGER_ELEMENT_STATUS;
- {$EXTERNALSYM CHANGER_ELEMENT_STATUS}
- TChangerElementStatus = CHANGER_ELEMENT_STATUS;
- PChangerElementStatus = PCHANGER_ELEMENT_STATUS;
- PCHANGER_ELEMENT_STATUS_EX = ^CHANGER_ELEMENT_STATUS_EX;
- {$EXTERNALSYM PCHANGER_ELEMENT_STATUS_EX}
- _CHANGER_ELEMENT_STATUS_EX = record
- //
- // Element to which this structure refers.
- //
- Element: CHANGER_ELEMENT;
- //
- // Address of the element from which the media was originally moved.
- // Valid if ELEMENT_STATUS_SVALID bit of Flags DWORD is set.
- // Needs to be converted to a zero-based offset from the device-unique value.
- //
- SrcElementAddress: CHANGER_ELEMENT;
- //
- // See below.
- //
- Flags: DWORD;
- //
- // See below for possible values.
- //
- ExceptionCode: DWORD;
- //
- // Scsi Target Id of this element.
- // Valid only if ELEMENT_STATUS_ID_VALID is set in Flags.
- //
- TargetId: BYTE;
- //
- // LogicalUnitNumber of this element.
- // Valid only if ELEMENT_STATUS_LUN_VALID is set in Flags.
- //
- Lun: BYTE;
- Reserved: WORD;
- //
- // Primary volume identification for the media.
- // Valid only if ELEMENT_STATUS_PVOLTAG bit is set in Flags.
- //
- PrimaryVolumeID: array [0..MAX_VOLUME_ID_SIZE - 1] of BYTE;
- //
- // Alternate volume identification for the media.
- // Valid for two-sided media only, and pertains to the id. of the inverted side.
- // Valid only if ELEMENT_STATUS_AVOLTAG bit is set in Flags.
- //
- AlternateVolumeID: array [0..MAX_VOLUME_ID_SIZE - 1] of BYTE;
- //
- // Vendor ID
- //
- VendorIdentification: array [0..VENDOR_ID_LENGTH - 1] of BYTE;
- //
- // Product ID
- //
- ProductIdentification: array [0..PRODUCT_ID_LENGTH - 1] of BYTE;
- //
- // Serial number
- //
- SerialNumber: array [0..SERIAL_NUMBER_LENGTH - 1] of BYTE;
- end;
- {$EXTERNALSYM _CHANGER_ELEMENT_STATUS_EX}
- CHANGER_ELEMENT_STATUS_EX = _CHANGER_ELEMENT_STATUS_EX;
- {$EXTERNALSYM CHANGER_ELEMENT_STATUS_EX}
- TChangerElementStatusEx = CHANGER_ELEMENT_STATUS_EX;
- PChangerElementStatusEx = PCHANGER_ELEMENT_STATUS_EX;
- //
- // Possible flag values
- //
- const
- ELEMENT_STATUS_FULL = $00000001; // Element contains a unit of media.
- {$EXTERNALSYM ELEMENT_STATUS_FULL}
- ELEMENT_STATUS_IMPEXP = $00000002; // Media in i/e port was placed there by an operator.
- {$EXTERNALSYM ELEMENT_STATUS_IMPEXP}
- ELEMENT_STATUS_EXCEPT = $00000004; // Element is in an abnormal state; check ExceptionCode field for more information.
- {$EXTERNALSYM ELEMENT_STATUS_EXCEPT}
- ELEMENT_STATUS_ACCESS = $00000008; // Access to the i/e port from the medium changer is allowed.
- {$EXTERNALSYM ELEMENT_STATUS_ACCESS}
- ELEMENT_STATUS_EXENAB = $00000010; // Export of media is supported.
- {$EXTERNALSYM ELEMENT_STATUS_EXENAB}
- ELEMENT_STATUS_INENAB = $00000020; // Import of media is supported.
- {$EXTERNALSYM ELEMENT_STATUS_INENAB}
- ELEMENT_STATUS_PRODUCT_DATA = $00000040; // Serial number valid for the drive
- {$EXTERNALSYM ELEMENT_STATUS_PRODUCT_DATA}
- ELEMENT_STATUS_LUN_VALID = $00001000; // Lun information is valid.
- {$EXTERNALSYM ELEMENT_STATUS_LUN_VALID}
- ELEMENT_STATUS_ID_VALID = $00002000; // SCSI Id information is valid.
- {$EXTERNALSYM ELEMENT_STATUS_ID_VALID}
- ELEMENT_STATUS_NOT_BUS = $00008000; // Lun and SCSI Id fields are not on same bus as medium changer.
- {$EXTERNALSYM ELEMENT_STATUS_NOT_BUS}
- ELEMENT_STATUS_INVERT = $00400000; // Media in element was inverted (valid only if ELEMENT_STATUS_SVALID bit is set)
- {$EXTERNALSYM ELEMENT_STATUS_INVERT}
- ELEMENT_STATUS_SVALID = $00800000; // SourceElementAddress field and ELEMENT_STATUS_INVERT bit are valid.
- {$EXTERNALSYM ELEMENT_STATUS_SVALID}
- ELEMENT_STATUS_PVOLTAG = $10000000; // Primary volume information is valid.
- {$EXTERNALSYM ELEMENT_STATUS_PVOLTAG}
- ELEMENT_STATUS_AVOLTAG = $20000000; // Alternate volume information is valid.
- {$EXTERNALSYM ELEMENT_STATUS_AVOLTAG}
- //
- // ExceptionCode values.
- //
- ERROR_LABEL_UNREADABLE = $00000001; // Bar code scanner could not read bar code label.
- {$EXTERNALSYM ERROR_LABEL_UNREADABLE}
- ERROR_LABEL_QUESTIONABLE = $00000002; // Label could be invalid due to unit attention condition.
- {$EXTERNALSYM ERROR_LABEL_QUESTIONABLE}
- ERROR_SLOT_NOT_PRESENT = $00000004; // Slot is currently not addressable in the device.
- {$EXTERNALSYM ERROR_SLOT_NOT_PRESENT}
- ERROR_DRIVE_NOT_INSTALLED = $00000008; // Drive is not installed.
- {$EXTERNALSYM ERROR_DRIVE_NOT_INSTALLED}
- ERROR_TRAY_MALFUNCTION = $00000010; // Media tray is malfunctioning/broken.
- {$EXTERNALSYM ERROR_TRAY_MALFUNCTION}
- ERROR_INIT_STATUS_NEEDED = $00000011; // An Initialize Element Status command is needed.
- {$EXTERNALSYM ERROR_INIT_STATUS_NEEDED}
- ERROR_UNHANDLED_ERROR = DWORD($FFFFFFFF); // Unknown error condition
- {$EXTERNALSYM ERROR_UNHANDLED_ERROR}
- //
- // Definitions for IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS
- //
- type
- PCHANGER_INITIALIZE_ELEMENT_STATUS = ^CHANGER_INITIALIZE_ELEMENT_STATUS;
- {$EXTERNALSYM PCHANGER_INITIALIZE_ELEMENT_STATUS}
- _CHANGER_INITIALIZE_ELEMENT_STATUS = record
- //
- // List describing the elements and range on which to initialize.
- //
- ElementList: CHANGER_ELEMENT_LIST;
- //
- // Indicates whether a bar code scan should be used. Only applicable if
- // CHANGER_BAR_CODE_SCANNER_INSTALLED is set in Features0 of CHANGER_GET_PARAMETERS.
- //
- BarCodeScan: ByteBool;
- end;
- {$EXTERNALSYM _CHANGER_INITIALIZE_ELEMENT_STATUS}
- CHANGER_INITIALIZE_ELEMENT_STATUS = _CHANGER_INITIALIZE_ELEMENT_STATUS;
- {$EXTERNALSYM CHANGER_INITIALIZE_ELEMENT_STATUS}
- TChangerInitializeElementStatus = CHANGER_INITIALIZE_ELEMENT_STATUS;
- PChangerInitializeElementStatus = PCHANGER_INITIALIZE_ELEMENT_STATUS;
- //
- // Definitions for IOCTL_CHANGER_SET_POSITION
- //
- PCHANGER_SET_POSITION = ^CHANGER_SET_POSITION;
- {$EXTERNALSYM PCHANGER_SET_POSITION}
- _CHANGER_SET_POSITION = record
- //
- // Indicates which transport to move.
- //
- Transport: CHANGER_ELEMENT;
- //
- // Indicates the final destination of the transport.
- //
- Destination: CHANGER_ELEMENT;
- //
- // Indicates whether the media currently carried by Transport, should be flipped.
- //
- Flip: ByteBool;
- end;
- {$EXTERNALSYM _CHANGER_SET_POSITION}
- CHANGER_SET_POSITION = _CHANGER_SET_POSITION;
- {$EXTERNALSYM CHANGER_SET_POSITION}
- TChangerSetPosition = CHANGER_SET_POSITION;
- PChangerSetPosition = PCHANGER_SET_POSITION;
- //
- // Definitions for IOCTL_CHANGER_EXCHANGE_MEDIUM
- //
- PCHANGER_EXCHANGE_MEDIUM = ^CHANGER_EXCHANGE_MEDIUM;
- {$EXTERNALSYM PCHANGER_EXCHANGE_MEDIUM}
- _CHANGER_EXCHANGE_MEDIUM = record
- //
- // Indicates which transport to use for the exchange operation.
- //
- Transport: CHANGER_ELEMENT;
- //
- // Indicates the source for the media that is to be moved.
- //
- Source: CHANGER_ELEMENT;
- //
- // Indicates the final destination of the media originally at Source.
- //
- Destination1: CHANGER_ELEMENT;
- //
- // Indicates the destination of the media moved from Destination1.
- //
- Destination2: CHANGER_ELEMENT;
- //
- // Indicates whether the medium should be flipped.
- //
- Flip1: ByteBool;
- Flip2: ByteBool;
- end;
- {$EXTERNALSYM _CHANGER_EXCHANGE_MEDIUM}
- CHANGER_EXCHANGE_MEDIUM = _CHANGER_EXCHANGE_MEDIUM;
- {$EXTERNALSYM CHANGER_EXCHANGE_MEDIUM}
- TChangerExchangeMedium = CHANGER_EXCHANGE_MEDIUM;
- PChangerExchangeMedium = PCHANGER_EXCHANGE_MEDIUM;
- //
- // Definitions for IOCTL_CHANGER_MOVE_MEDIUM
- //
- PCHANGER_MOVE_MEDIUM = ^CHANGER_MOVE_MEDIUM;
- {$EXTERNALSYM PCHANGER_MOVE_MEDIUM}
- _CHANGER_MOVE_MEDIUM = record
- //
- // Indicates which transport to use for the move operation.
- //
- Transport: CHANGER_ELEMENT;
- //
- // Indicates the source for the media that is to be moved.
- //
- Source: CHANGER_ELEMENT;
- //
- // Indicates the destination of the media originally at Source.
- //
- Destination: CHANGER_ELEMENT;
- //
- // Indicates whether the media should be flipped.
- //
- Flip: ByteBool;
- end;
- {$EXTERNALSYM _CHANGER_MOVE_MEDIUM}
- CHANGER_MOVE_MEDIUM = _CHANGER_MOVE_MEDIUM;
- {$EXTERNALSYM CHANGER_MOVE_MEDIUM}
- TChangerMoveMedium = CHANGER_MOVE_MEDIUM;
- PChangerMoveMedium = PCHANGER_MOVE_MEDIUM;
- //
- // Definitions for IOCTL_QUERY_VOLUME_TAGS
- //
- //
- // Input buffer.
- //
- PCHANGER_SEND_VOLUME_TAG_INFORMATION = ^CHANGER_SEND_VOLUME_TAG_INFORMATION;
- {$EXTERNALSYM PCHANGER_SEND_VOLUME_TAG_INFORMATION}
- _CHANGER_SEND_VOLUME_TAG_INFORMATION = record
- //
- // Describes the starting element for which to return information.
- //
- StartingElement: CHANGER_ELEMENT;
- //
- // Indicates the specific action to perform. See below.
- //
- ActionCode: DWORD;
- //
- // Template used by the device to search for volume ids.
- //
- VolumeIDTemplate: array [0..MAX_VOLUME_TEMPLATE_SIZE - 1] of BYTE;
- end;
- {$EXTERNALSYM _CHANGER_SEND_VOLUME_TAG_INFORMATION}
- CHANGER_SEND_VOLUME_TAG_INFORMATION = _CHANGER_SEND_VOLUME_TAG_INFORMATION;
- {$EXTERNALSYM CHANGER_SEND_VOLUME_TAG_INFORMATION}
- TChangerSendVolumeTagInformation = CHANGER_SEND_VOLUME_TAG_INFORMATION;
- PChangerSendVolumeTagInformation = PCHANGER_SEND_VOLUME_TAG_INFORMATION;
- //
- // Output buffer.
- //
- PREAD_ELEMENT_ADDRESS_INFO = ^READ_ELEMENT_ADDRESS_INFO;
- {$EXTERNALSYM PREAD_ELEMENT_ADDRESS_INFO}
- _READ_ELEMENT_ADDRESS_INFO = record
- //
- // Number of elements matching criteria set forth by ActionCode.
- //
- NumberOfElements: DWORD;
- //
- // Array of CHANGER_ELEMENT_STATUS structures, one for each element that corresponded
- // with the information passed in with the CHANGER_SEND_VOLUME_TAG_INFORMATION structure.
- //
- ElementStatus: array [0..0] of CHANGER_ELEMENT_STATUS;
- end;
- {$EXTERNALSYM _READ_ELEMENT_ADDRESS_INFO}
- READ_ELEMENT_ADDRESS_INFO = _READ_ELEMENT_ADDRESS_INFO;
- {$EXTERNALSYM READ_ELEMENT_ADDRESS_INFO}
- TReadElementAddressInfo = READ_ELEMENT_ADDRESS_INFO;
- PReadElementAddressInfo = PREAD_ELEMENT_ADDRESS_INFO;
- //
- // Possible ActionCode values. See Features0 of CHANGER_GET_PARAMETERS for compatibility with
- // the current device.
- //
- const
- SEARCH_ALL = $0; // Translate - search all defined volume tags.
- {$EXTERNALSYM SEARCH_ALL}
- SEARCH_PRIMARY = $1; // Translate - search only primary volume tags.
- {$EXTERNALSYM SEARCH_PRIMARY}
- SEARCH_ALTERNATE = $2; // Translate - search only alternate volume tags.
- {$EXTERNALSYM SEARCH_ALTERNATE}
- SEARCH_ALL_NO_SEQ = $4; // Translate - search all defined volume tags but ignore sequence numbers.
- {$EXTERNALSYM SEARCH_ALL_NO_SEQ}
- SEARCH_PRI_NO_SEQ = $5; // Translate - search only primary volume tags but ignore sequence numbers.
- {$EXTERNALSYM SEARCH_PRI_NO_SEQ}
- SEARCH_ALT_NO_SEQ = $6; // Translate - search only alternate volume tags but ignore sequence numbers.
- {$EXTERNALSYM SEARCH_ALT_NO_SEQ}
- ASSERT_PRIMARY = $8; // Assert - as the primary volume tag - if tag now undefined.
- {$EXTERNALSYM ASSERT_PRIMARY}
- ASSERT_ALTERNATE = $9; // Assert - as the alternate volume tag - if tag now undefined.
- {$EXTERNALSYM ASSERT_ALTERNATE}
- REPLACE_PRIMARY = $A; // Replace - the primary volume tag - current tag ignored.
- {$EXTERNALSYM REPLACE_PRIMARY}
- REPLACE_ALTERNATE = $B; // Replace - the alternate volume tag - current tag ignored.
- {$EXTERNALSYM REPLACE_ALTERNATE}
- UNDEFINE_PRIMARY = $C; // Undefine - the primary volume tag - current tag ignored.
- {$EXTERNALSYM UNDEFINE_PRIMARY}
- UNDEFINE_ALTERNATE = $D; // Undefine - the alternate volume tag - current tag ignored.
- {$EXTERNALSYM UNDEFINE_ALTERNATE}
- //
- // Changer diagnostic test related definitions
- //
- type
- _CHANGER_DEVICE_PROBLEM_TYPE = (
- DeviceProblemNone,
- DeviceProblemHardware,
- DeviceProblemCHMError,
- DeviceProblemDoorOpen,
- DeviceProblemCalibrationError,
- DeviceProblemTargetFailure,
- DeviceProblemCHMMoveError,
- DeviceProblemCHMZeroError,
- DeviceProblemCartridgeInsertError,
- DeviceProblemPositionError,
- DeviceProblemSensorError,
- DeviceProblemCartridgeEjectError,
- DeviceProblemGripperError,
- DeviceProblemDriveError);
- {$EXTERNALSYM _CHANGER_DEVICE_PROBLEM_TYPE}
- CHANGER_DEVICE_PROBLEM_TYPE = _CHANGER_DEVICE_PROBLEM_TYPE;
- {$EXTERNALSYM CHANGER_DEVICE_PROBLEM_TYPE}
- PCHANGER_DEVICE_PROBLEM_TYPE = ^CHANGER_DEVICE_PROBLEM_TYPE;
- {$EXTERNALSYM PCHANGER_DEVICE_PROBLEM_TYPE}
- TChangerDeviceProblemType = CHANGER_DEVICE_PROBLEM_TYPE;
- PChangerDeviceProblemType = PCHANGER_DEVICE_PROBLEM_TYPE;
- const
- IOCTL_SERIAL_LSRMST_INSERT = (
- (FILE_DEVICE_SERIAL_PORT shl 16) or (FILE_ANY_ACCESS shl 14) or
- (31 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_SERIAL_LSRMST_INSERT}
- IOCTL_SERENUM_EXPOSE_HARDWARE = (
- (FILE_DEVICE_SERENUM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (128 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_SERENUM_EXPOSE_HARDWARE}
- IOCTL_SERENUM_REMOVE_HARDWARE = (
- (FILE_DEVICE_SERENUM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (129 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_SERENUM_REMOVE_HARDWARE}
- IOCTL_SERENUM_PORT_DESC = (
- (FILE_DEVICE_SERENUM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (130 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_SERENUM_PORT_DESC}
- IOCTL_SERENUM_GET_PORT_NAME = (
- (FILE_DEVICE_SERENUM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (131 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_SERENUM_GET_PORT_NAME}
- //
- // The following values follow the escape designator in the
- // data stream if the LSRMST_INSERT mode has been turned on.
- //
- SERIAL_LSRMST_ESCAPE = BYTE($00);
- {$EXTERNALSYM SERIAL_LSRMST_ESCAPE}
- //
- // Following this value is the contents of the line status
- // register, and then the character in the RX hardware when
- // the line status register was encountered.
- //
- SERIAL_LSRMST_LSR_DATA = BYTE($01);
- {$EXTERNALSYM SERIAL_LSRMST_LSR_DATA}
- //
- // Following this value is the contents of the line status
- // register. No error character follows
- //
- SERIAL_LSRMST_LSR_NODATA = BYTE($02);
- {$EXTERNALSYM SERIAL_LSRMST_LSR_NODATA}
- //
- // Following this value is the contents of the modem status
- // register.
- //
- SERIAL_LSRMST_MST = BYTE($03);
- {$EXTERNALSYM SERIAL_LSRMST_MST}
- //
- // Bit values for FIFO Control Register
- //
- SERIAL_IOC_FCR_FIFO_ENABLE = DWORD($00000001);
- {$EXTERNALSYM SERIAL_IOC_FCR_FIFO_ENABLE}
- SERIAL_IOC_FCR_RCVR_RESET = DWORD($00000002);
- {$EXTERNALSYM SERIAL_IOC_FCR_RCVR_RESET}
- SERIAL_IOC_FCR_XMIT_RESET = DWORD($00000004);
- {$EXTERNALSYM SERIAL_IOC_FCR_XMIT_RESET}
- SERIAL_IOC_FCR_DMA_MODE = DWORD($00000008);
- {$EXTERNALSYM SERIAL_IOC_FCR_DMA_MODE}
- SERIAL_IOC_FCR_RES1 = DWORD($00000010);
- {$EXTERNALSYM SERIAL_IOC_FCR_RES1}
- SERIAL_IOC_FCR_RES2 = DWORD($00000020);
- {$EXTERNALSYM SERIAL_IOC_FCR_RES2}
- SERIAL_IOC_FCR_RCVR_TRIGGER_LSB = DWORD($00000040);
- {$EXTERNALSYM SERIAL_IOC_FCR_RCVR_TRIGGER_LSB}
- SERIAL_IOC_FCR_RCVR_TRIGGER_MSB = DWORD($00000080);
- {$EXTERNALSYM SERIAL_IOC_FCR_RCVR_TRIGGER_MSB}
- //
- // Bit values for Modem Control Register
- //
- SERIAL_IOC_MCR_DTR = DWORD($00000001);
- {$EXTERNALSYM SERIAL_IOC_MCR_DTR}
- SERIAL_IOC_MCR_RTS = DWORD($00000002);
- {$EXTERNALSYM SERIAL_IOC_MCR_RTS}
- SERIAL_IOC_MCR_OUT1 = DWORD($00000004);
- {$EXTERNALSYM SERIAL_IOC_MCR_OUT1}
- SERIAL_IOC_MCR_OUT2 = DWORD($00000008);
- {$EXTERNALSYM SERIAL_IOC_MCR_OUT2}
- SERIAL_IOC_MCR_LOOP = DWORD($00000010);
- {$EXTERNALSYM SERIAL_IOC_MCR_LOOP}
- //
- // The following is a list of the native file system fsctls followed by
- // additional network file system fsctls. Some values have been
- // decommissioned.
- //
- FSCTL_REQUEST_OPLOCK_LEVEL_1 = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (0 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_REQUEST_OPLOCK_LEVEL_1}
- FSCTL_REQUEST_OPLOCK_LEVEL_2 = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (1 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_REQUEST_OPLOCK_LEVEL_2}
- FSCTL_REQUEST_BATCH_OPLOCK = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (2 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_REQUEST_BATCH_OPLOCK}
- FSCTL_OPLOCK_BREAK_ACKNOWLEDGE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (3 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_OPLOCK_BREAK_ACKNOWLEDGE}
- FSCTL_OPBATCH_ACK_CLOSE_PENDING = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (4 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_OPBATCH_ACK_CLOSE_PENDING}
- FSCTL_OPLOCK_BREAK_NOTIFY = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (5 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_OPLOCK_BREAK_NOTIFY}
- FSCTL_LOCK_VOLUME = ((FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or (6 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_LOCK_VOLUME}
- FSCTL_UNLOCK_VOLUME = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (7 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_UNLOCK_VOLUME}
- FSCTL_DISMOUNT_VOLUME = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (8 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_DISMOUNT_VOLUME}
- // decommissioned fsctl value 9
- FSCTL_IS_VOLUME_MOUNTED = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (10 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_IS_VOLUME_MOUNTED}
- FSCTL_IS_PATHNAME_VALID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (11 shl 2) or METHOD_BUFFERED); // PATHNAME_BUFFER,
- {$EXTERNALSYM FSCTL_IS_PATHNAME_VALID}
- FSCTL_MARK_VOLUME_DIRTY = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (12 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_MARK_VOLUME_DIRTY}
- // decommissioned fsctl value 13
- FSCTL_QUERY_RETRIEVAL_POINTERS = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (14 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_QUERY_RETRIEVAL_POINTERS}
- FSCTL_GET_COMPRESSION = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (15 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_COMPRESSION}
- FSCTL_SET_COMPRESSION = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or ((FILE_READ_DATA or FILE_WRITE_DATA) shl 14) or
- (16 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_COMPRESSION}
- // decommissioned fsctl value 17
- // decommissioned fsctl value 18
- FSCTL_MARK_AS_SYSTEM_HIVE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (19 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_MARK_AS_SYSTEM_HIVE}
- FSCTL_OPLOCK_BREAK_ACK_NO_2 = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (20 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_OPLOCK_BREAK_ACK_NO_2}
- FSCTL_INVALIDATE_VOLUMES = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (21 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_INVALIDATE_VOLUMES}
- FSCTL_QUERY_FAT_BPB = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (22 shl 2) or METHOD_BUFFERED); // FSCTL_QUERY_FAT_BPB_BUFFER
- {$EXTERNALSYM FSCTL_QUERY_FAT_BPB}
- FSCTL_REQUEST_FILTER_OPLOCK = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (23 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_REQUEST_FILTER_OPLOCK}
- FSCTL_FILESYSTEM_GET_STATISTICS = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (24 shl 2) or METHOD_BUFFERED); // FILESYSTEM_STATISTICS
- {$EXTERNALSYM FSCTL_FILESYSTEM_GET_STATISTICS}
- FSCTL_GET_NTFS_VOLUME_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (25 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_NTFS_VOLUME_DATA}
- FSCTL_GET_NTFS_FILE_RECORD = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (26 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_NTFS_FILE_RECORD}
- FSCTL_GET_VOLUME_BITMAP = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (27 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_GET_VOLUME_BITMAP}
- FSCTL_GET_RETRIEVAL_POINTERS = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (28 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_GET_RETRIEVAL_POINTERS}
- FSCTL_MOVE_FILE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (29 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_MOVE_FILE}
- FSCTL_IS_VOLUME_DIRTY = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (30 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_IS_VOLUME_DIRTY}
- // decomissioned fsctl value 31
- (* FSCTL_GET_HFS_INFORMATION = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (31 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_HFS_INFORMATION}
- *)
- FSCTL_ALLOW_EXTENDED_DASD_IO = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (32 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_ALLOW_EXTENDED_DASD_IO}
- // decommissioned fsctl value 33
- // decommissioned fsctl value 34
- (*
- FSCTL_READ_PROPERTY_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (33 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_READ_PROPERTY_DATA}
- FSCTL_WRITE_PROPERTY_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (34 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_WRITE_PROPERTY_DATA}
- *)
- FSCTL_FIND_FILES_BY_SID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (35 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_FIND_FILES_BY_SID}
- // decommissioned fsctl value 36
- // decommissioned fsctl value 37
- (* FSCTL_DUMP_PROPERTY_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (37 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_DUMP_PROPERTY_DATA}
- *)
- FSCTL_SET_OBJECT_ID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (38 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_OBJECT_ID}
- FSCTL_GET_OBJECT_ID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (39 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_OBJECT_ID}
- FSCTL_DELETE_OBJECT_ID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (40 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_DELETE_OBJECT_ID}
- FSCTL_SET_REPARSE_POINT = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (41 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_REPARSE_POINT}
- FSCTL_GET_REPARSE_POINT = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (42 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_GET_REPARSE_POINT}
- FSCTL_DELETE_REPARSE_POINT = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (43 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_DELETE_REPARSE_POINT}
- FSCTL_ENUM_USN_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (44 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_ENUM_USN_DATA}
- FSCTL_SECURITY_ID_CHECK = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_READ_DATA shl 14) or
- (45 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_SECURITY_ID_CHECK}
- FSCTL_READ_USN_JOURNAL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (46 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_READ_USN_JOURNAL}
- FSCTL_SET_OBJECT_ID_EXTENDED = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (47 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_OBJECT_ID_EXTENDED}
- FSCTL_CREATE_OR_GET_OBJECT_ID = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (48 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_CREATE_OR_GET_OBJECT_ID}
- FSCTL_SET_SPARSE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (49 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_SPARSE}
- FSCTL_SET_ZERO_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_WRITE_DATA shl 14) or
- (50 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SET_ZERO_DATA}
- FSCTL_QUERY_ALLOCATED_RANGES = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_READ_DATA shl 14) or
- (51 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_QUERY_ALLOCATED_RANGES}
- // decommissioned fsctl value 52
- (*
- FSCTL_ENABLE_UPGRADE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_WRITE_DATA shl 14) or
- (52 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_ENABLE_UPGRADE}
- *)
- FSCTL_SET_ENCRYPTION = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (53 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_SET_ENCRYPTION}
- FSCTL_ENCRYPTION_FSCTL_IO = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (54 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_ENCRYPTION_FSCTL_IO}
- FSCTL_WRITE_RAW_ENCRYPTED = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (55 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_WRITE_RAW_ENCRYPTED}
- FSCTL_READ_RAW_ENCRYPTED = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (56 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_READ_RAW_ENCRYPTED}
- FSCTL_CREATE_USN_JOURNAL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (57 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_CREATE_USN_JOURNAL}
- FSCTL_READ_FILE_USN_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (58 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_READ_FILE_USN_DATA}
- FSCTL_WRITE_USN_CLOSE_RECORD = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (59 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_WRITE_USN_CLOSE_RECORD}
- FSCTL_EXTEND_VOLUME = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (60 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_EXTEND_VOLUME}
- FSCTL_QUERY_USN_JOURNAL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (61 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_QUERY_USN_JOURNAL}
- FSCTL_DELETE_USN_JOURNAL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (62 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_DELETE_USN_JOURNAL}
- FSCTL_MARK_HANDLE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (63 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_MARK_HANDLE}
- FSCTL_SIS_COPYFILE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (64 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SIS_COPYFILE}
- FSCTL_SIS_LINK_FILES = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or ((FILE_READ_DATA or FILE_WRITE_DATA) shl 14) or
- (65 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_SIS_LINK_FILES}
- FSCTL_HSM_MSG = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or ((FILE_READ_DATA or FILE_WRITE_DATA) shl 14) or
- (66 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_HSM_MSG}
- // decommissioned fsctl value 67
- (*
- FSCTL_NSS_CONTROL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_WRITE_DATA shl 14) or
- (67 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_NSS_CONTROL}
- *)
- FSCTL_HSM_DATA = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or ((FILE_READ_DATA or FILE_WRITE_DATA) shl 14) or
- (68 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_HSM_DATA}
- FSCTL_RECALL_FILE = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_ANY_ACCESS shl 14) or
- (69 shl 2) or METHOD_NEITHER);
- {$EXTERNALSYM FSCTL_RECALL_FILE}
- // decommissioned fsctl value 70
- (*
- FSCTL_NSS_RCONTROL = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_READ_DATA shl 14) or
- (70 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_NSS_RCONTROL}
- *)
- FSCTL_READ_FROM_PLEX = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_READ_DATA shl 14) or
- (71 shl 2) or METHOD_OUT_DIRECT);
- {$EXTERNALSYM FSCTL_READ_FROM_PLEX}
- FSCTL_FILE_PREFETCH = (
- (FILE_DEVICE_FILE_SYSTEM shl 16) or (FILE_SPECIAL_ACCESS shl 14) or
- (72 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM FSCTL_FILE_PREFETCH}
- //
- // The following long list of structs are associated with the preceeding
- // file system fsctls.
- //
- // Note that the structs for the property sets fsctls are not included
- // in this file. They can be found in ntfsprop.h where they should stay
- // because of their dependency on objidl.h.
- //
- //
- // Structure for FSCTL_IS_PATHNAME_VALID
- //
- type
- PPATHNAME_BUFFER = ^PATHNAME_BUFFER;
- {$EXTERNALSYM PPATHNAME_BUFFER}
- _PATHNAME_BUFFER = record
- PathNameLength: DWORD;
- Name: array [0..0] of WCHAR;
- end;
- {$EXTERNALSYM _PATHNAME_BUFFER}
- PATHNAME_BUFFER = _PATHNAME_BUFFER;
- {$EXTERNALSYM PATHNAME_BUFFER}
- TPathnameBuffer = PATHNAME_BUFFER;
- PPathnameBuffer = PPATHNAME_BUFFER;
- //
- // Structure for FSCTL_QUERY_BPB_INFO
- //
- PFSCTL_QUERY_FAT_BPB_BUFFER = ^FSCTL_QUERY_FAT_BPB_BUFFER;
- {$EXTERNALSYM PFSCTL_QUERY_FAT_BPB_BUFFER}
- _FSCTL_QUERY_FAT_BPB_BUFFER = record
- First0x24BytesOfBootSector: array [0..$23] of BYTE;
- end;
- {$EXTERNALSYM _FSCTL_QUERY_FAT_BPB_BUFFER}
- FSCTL_QUERY_FAT_BPB_BUFFER = _FSCTL_QUERY_FAT_BPB_BUFFER;
- {$EXTERNALSYM FSCTL_QUERY_FAT_BPB_BUFFER}
- TFsctlQueryFatBpbBuffer = FSCTL_QUERY_FAT_BPB_BUFFER;
- PFsctlQueryFatBpbBuffer = PFSCTL_QUERY_FAT_BPB_BUFFER;
- //
- // Structures for FSCTL_GET_NTFS_VOLUME_DATA.
- // The user must pass the basic buffer below. Ntfs
- // will return as many fields as available in the extended
- // buffer which follows immediately after the VOLUME_DATA_BUFFER.
- //
- PNTFS_VOLUME_DATA_BUFFER = ^NTFS_VOLUME_DATA_BUFFER;
- {$EXTERNALSYM PNTFS_VOLUME_DATA_BUFFER}
- NTFS_VOLUME_DATA_BUFFER = record
- 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;
- end;
- {$EXTERNALSYM NTFS_VOLUME_DATA_BUFFER}
- TNtfsVolumeDataBuffer = NTFS_VOLUME_DATA_BUFFER;
- PNtfsVolumeDataBuffer = PNTFS_VOLUME_DATA_BUFFER;
- PNTFS_EXTENDED_VOLUME_DATA = ^NTFS_EXTENDED_VOLUME_DATA;
- {$EXTERNALSYM PNTFS_EXTENDED_VOLUME_DATA}
- NTFS_EXTENDED_VOLUME_DATA = record
- ByteCount: DWORD;
- MajorVersion: WORD;
- MinorVersion: WORD;
- end;
- {$EXTERNALSYM NTFS_EXTENDED_VOLUME_DATA}
- TNtfsExtendedVolumeData = NTFS_EXTENDED_VOLUME_DATA;
- PNtfsExtendedVolumeData = PNTFS_EXTENDED_VOLUME_DATA;
- //
- // Structure for FSCTL_GET_VOLUME_BITMAP
- //
- PSTARTING_LCN_INPUT_BUFFER = ^STARTING_LCN_INPUT_BUFFER;
- {$EXTERNALSYM PSTARTING_LCN_INPUT_BUFFER}
- STARTING_LCN_INPUT_BUFFER = record
- StartingLcn: LARGE_INTEGER;
- end;
- {$EXTERNALSYM STARTING_LCN_INPUT_BUFFER}
- TStartingLcnInputBuffer = STARTING_LCN_INPUT_BUFFER;
- PStartingLcnInputBuffer = PSTARTING_LCN_INPUT_BUFFER;
- PVOLUME_BITMAP_BUFFER = ^VOLUME_BITMAP_BUFFER;
- {$EXTERNALSYM PVOLUME_BITMAP_BUFFER}
- VOLUME_BITMAP_BUFFER = record
- StartingLcn: LARGE_INTEGER;
- BitmapSize: LARGE_INTEGER;
- Buffer: array [0..0] of BYTE;
- end;
- {$EXTERNALSYM VOLUME_BITMAP_BUFFER}
- TVolumeBitmapBuffer = VOLUME_BITMAP_BUFFER;
- PVolumeBitmapBuffer = PVOLUME_BITMAP_BUFFER;
- //
- // Structure for FSCTL_GET_RETRIEVAL_POINTERS
- //
- PSTARTING_VCN_INPUT_BUFFER = ^STARTING_VCN_INPUT_BUFFER;
- {$EXTERNALSYM PSTARTING_VCN_INPUT_BUFFER}
- STARTING_VCN_INPUT_BUFFER = record
- StartingVcn: LARGE_INTEGER;
- end;
- {$EXTERNALSYM STARTING_VCN_INPUT_BUFFER}
- TStartingVcnInputBuffer = STARTING_VCN_INPUT_BUFFER;
- PStartingVcnInputBuffer = PSTARTING_VCN_INPUT_BUFFER;
- TRPBExtends = record
- NextVcn: LARGE_INTEGER;
- Lcn: LARGE_INTEGER;
- end;
- PRETRIEVAL_POINTERS_BUFFER = ^RETRIEVAL_POINTERS_BUFFER;
- {$EXTERNALSYM PRETRIEVAL_POINTERS_BUFFER}
- RETRIEVAL_POINTERS_BUFFER = record
- ExtentCount: DWORD;
- StartingVcn: LARGE_INTEGER;
- Extends: array [0..0] of TRPBExtends;
- end;
- {$EXTERNALSYM RETRIEVAL_POINTERS_BUFFER}
- TRetrievalPointersBuffer = RETRIEVAL_POINTERS_BUFFER;
- PRetrievalPointersBuffer = PRETRIEVAL_POINTERS_BUFFER;
- //
- // Structures for FSCTL_GET_NTFS_FILE_RECORD
- //
- PNTFS_FILE_RECORD_INPUT_BUFFER = ^NTFS_FILE_RECORD_INPUT_BUFFER;
- {$EXTERNALSYM PNTFS_FILE_RECORD_INPUT_BUFFER}
- NTFS_FILE_RECORD_INPUT_BUFFER = record
- FileReferenceNumber: LARGE_INTEGER;
- end;
- {$EXTERNALSYM NTFS_FILE_RECORD_INPUT_BUFFER}
- TNtfsFileRecordInputBuffer = NTFS_FILE_RECORD_INPUT_BUFFER;
- PNtfsFileRecordInputBuffer = PNTFS_FILE_RECORD_INPUT_BUFFER;
- PNTFS_FILE_RECORD_OUTPUT_BUFFER = ^NTFS_FILE_RECORD_OUTPUT_BUFFER;
- {$EXTERNALSYM PNTFS_FILE_RECORD_OUTPUT_BUFFER}
- NTFS_FILE_RECORD_OUTPUT_BUFFER = record
- FileReferenceNumber: LARGE_INTEGER;
- FileRecordLength: DWORD;
- FileRecordBuffer: array [0..0] of BYTE;
- end;
- {$EXTERNALSYM NTFS_FILE_RECORD_OUTPUT_BUFFER}
- TNtfsFileRecordOutputBuffer = NTFS_FILE_RECORD_OUTPUT_BUFFER;
- PNtfsFileRecordOutputBuffer = PNTFS_FILE_RECORD_OUTPUT_BUFFER;
- //
- // Structure for FSCTL_MOVE_FILE
- //
- PMOVE_FILE_DATA = ^MOVE_FILE_DATA;
- {$EXTERNALSYM PMOVE_FILE_DATA}
- MOVE_FILE_DATA = record
- FileHandle: HANDLE;
- StartingVcn: LARGE_INTEGER;
- StartingLcn: LARGE_INTEGER;
- ClusterCount: DWORD;
- end;
- {$EXTERNALSYM MOVE_FILE_DATA}
- TMoveFileData = MOVE_FILE_DATA;
- PMoveFileData = PMOVE_FILE_DATA;
- {$IFDEF _WIN64}
- //
- // 32/64 Bit thunking support structure
- //
- _MOVE_FILE_DATA32 = record
- FileHandle: UINT32;
- StartingVcn: LARGE_INTEGER;
- StartingLcn: LARGE_INTEGER;
- ClusterCount: DWORD;
- end;
- {$EXTERNALSYM _MOVE_FILE_DATA32}
- MOVE_FILE_DATA32 = _MOVE_FILE_DATA32;
- {$EXTERNALSYM MOVE_FILE_DATA32}
- PMOVE_FILE_DATA32 = ^MOVE_FILE_DATA32;
- {$EXTERNALSYM PMOVE_FILE_DATA32}
- TMoveFileData32 = MOVE_FILE_DATA32;
- PMoveFileData32 = PMOVE_FILE_DATA32;
- {$ENDIF _WIN64}
- //
- // Structure for FSCTL_FIND_FILES_BY_SID
- //
- PFIND_BY_SID_DATA = ^FIND_BY_SID_DATA;
- {$EXTERNALSYM PFIND_BY_SID_DATA}
- FIND_BY_SID_DATA = record
- Restart: DWORD;
- Sid: SID;
- end;
- {$EXTERNALSYM FIND_BY_SID_DATA}
- TFindBySidData = FIND_BY_SID_DATA;
- PFindBySidData = PFIND_BY_SID_DATA;
- //
- // The following structures apply to Usn operations.
- //
- //
- // Structure for FSCTL_ENUM_USN_DATA
- //
- PMFT_ENUM_DATA = ^MFT_ENUM_DATA;
- {$EXTERNALSYM PMFT_ENUM_DATA}
- MFT_ENUM_DATA = record
- StartFileReferenceNumber: DWORDLONG;
- LowUsn: USN;
- HighUsn: USN;
- end;
- {$EXTERNALSYM MFT_ENUM_DATA}
- TMftEnumData = MFT_ENUM_DATA;
- PMftEnumData = PMFT_ENUM_DATA;
- //
- // Structure for FSCTL_CREATE_USN_JOURNAL
- //
- PCREATE_USN_JOURNAL_DATA = ^CREATE_USN_JOURNAL_DATA;
- {$EXTERNALSYM PCREATE_USN_JOURNAL_DATA}
- CREATE_USN_JOURNAL_DATA = record
- MaximumSize: DWORDLONG;
- AllocationDelta: DWORDLONG;
- end;
- {$EXTERNALSYM CREATE_USN_JOURNAL_DATA}
- TCreateUsnJournalData = CREATE_USN_JOURNAL_DATA;
- PCreateUsnJournalData = PCREATE_USN_JOURNAL_DATA;
- //
- // Structure for FSCTL_READ_USN_JOURNAL
- //
- PREAD_USN_JOURNAL_DATA = ^READ_USN_JOURNAL_DATA;
- {$EXTERNALSYM PREAD_USN_JOURNAL_DATA}
- READ_USN_JOURNAL_DATA = record
- StartUsn: USN;
- ReasonMask: DWORD;
- ReturnOnlyOnClose: DWORD;
- Timeout: DWORDLONG;
- BytesToWaitFor: DWORDLONG;
- UsnJournalID: DWORDLONG;
- end;
- {$EXTERNALSYM READ_USN_JOURNAL_DATA}
- TReadUsnJournalData = READ_USN_JOURNAL_DATA;
- PReadUsnJournalData = PREAD_USN_JOURNAL_DATA;
- //
- // The initial Major.Minor version of the Usn record will be 2.0.
- // In general, the MinorVersion may be changed if fields are added
- // to this structure in such a way that the previous version of the
- // software can still correctly the fields it knows about. The
- // MajorVersion should only be changed if the previous version of
- // any software using this structure would incorrectly handle new
- // records due to structure changes.
- //
- // The first update to this will force the structure to version 2.0.
- // This will add the extended information about the source as
- // well as indicate the file name offset within the structure.
- //
- // The following structure is returned with these fsctls.
- //
- // FSCTL_READ_USN_JOURNAL
- // FSCTL_READ_FILE_USN_DATA
- // FSCTL_ENUM_USN_DATA
- //
- PUSN_RECORD = ^USN_RECORD;
- {$EXTERNALSYM PUSN_RECORD}
- USN_RECORD = record
- RecordLength: DWORD;
- MajorVersion: WORD;
- MinorVersion: WORD;
- FileReferenceNumber: DWORDLONG;
- ParentFileReferenceNumber: DWORDLONG;
- Usn: USN;
- TimeStamp: LARGE_INTEGER;
- Reason: DWORD;
- SourceInfo: DWORD;
- SecurityId: DWORD;
- FileAttributes: DWORD;
- FileNameLength: WORD;
- FileNameOffset: WORD;
- FileName: array [0..0] of WCHAR;
- end;
- {$EXTERNALSYM USN_RECORD}
- TUsnRecord = USN_RECORD;
- PUsnRecord = PUSN_RECORD;
- const
- USN_PAGE_SIZE = ($1000);
- {$EXTERNALSYM USN_PAGE_SIZE}
- USN_REASON_DATA_OVERWRITE = ($00000001);
- {$EXTERNALSYM USN_REASON_DATA_OVERWRITE}
- USN_REASON_DATA_EXTEND = ($00000002);
- {$EXTERNALSYM USN_REASON_DATA_EXTEND}
- USN_REASON_DATA_TRUNCATION = ($00000004);
- {$EXTERNALSYM USN_REASON_DATA_TRUNCATION}
- USN_REASON_NAMED_DATA_OVERWRITE = ($00000010);
- {$EXTERNALSYM USN_REASON_NAMED_DATA_OVERWRITE}
- USN_REASON_NAMED_DATA_EXTEND = ($00000020);
- {$EXTERNALSYM USN_REASON_NAMED_DATA_EXTEND}
- USN_REASON_NAMED_DATA_TRUNCATION = ($00000040);
- {$EXTERNALSYM USN_REASON_NAMED_DATA_TRUNCATION}
- USN_REASON_FILE_CREATE = ($00000100);
- {$EXTERNALSYM USN_REASON_FILE_CREATE}
- USN_REASON_FILE_DELETE = ($00000200);
- {$EXTERNALSYM USN_REASON_FILE_DELETE}
- USN_REASON_EA_CHANGE = ($00000400);
- {$EXTERNALSYM USN_REASON_EA_CHANGE}
- USN_REASON_SECURITY_CHANGE = ($00000800);
- {$EXTERNALSYM USN_REASON_SECURITY_CHANGE}
- USN_REASON_RENAME_OLD_NAME = ($00001000);
- {$EXTERNALSYM USN_REASON_RENAME_OLD_NAME}
- USN_REASON_RENAME_NEW_NAME = ($00002000);
- {$EXTERNALSYM USN_REASON_RENAME_NEW_NAME}
- USN_REASON_INDEXABLE_CHANGE = ($00004000);
- {$EXTERNALSYM USN_REASON_INDEXABLE_CHANGE}
- USN_REASON_BASIC_INFO_CHANGE = ($00008000);
- {$EXTERNALSYM USN_REASON_BASIC_INFO_CHANGE}
- USN_REASON_HARD_LINK_CHANGE = ($00010000);
- {$EXTERNALSYM USN_REASON_HARD_LINK_CHANGE}
- USN_REASON_COMPRESSION_CHANGE = ($00020000);
- {$EXTERNALSYM USN_REASON_COMPRESSION_CHANGE}
- USN_REASON_ENCRYPTION_CHANGE = ($00040000);
- {$EXTERNALSYM USN_REASON_ENCRYPTION_CHANGE}
- USN_REASON_OBJECT_ID_CHANGE = ($00080000);
- {$EXTERNALSYM USN_REASON_OBJECT_ID_CHANGE}
- USN_REASON_REPARSE_POINT_CHANGE = ($00100000);
- {$EXTERNALSYM USN_REASON_REPARSE_POINT_CHANGE}
- USN_REASON_STREAM_CHANGE = ($00200000);
- {$EXTERNALSYM USN_REASON_STREAM_CHANGE}
- USN_REASON_CLOSE = DWORD($80000000);
- {$EXTERNALSYM USN_REASON_CLOSE}
- //
- // Structure for FSCTL_QUERY_USN_JOUNAL
- //
- type
- PUSN_JOURNAL_DATA = ^USN_JOURNAL_DATA;
- {$EXTERNALSYM PUSN_JOURNAL_DATA}
- USN_JOURNAL_DATA = record
- UsnJournalID: DWORDLONG;
- FirstUsn: USN;
- NextUsn: USN;
- LowestValidUsn: USN;
- MaxUsn: USN;
- MaximumSize: DWORDLONG;
- AllocationDelta: DWORDLONG;
- end;
- {$EXTERNALSYM USN_JOURNAL_DATA}
- TUsnJournalData = USN_JOURNAL_DATA;
- PUsnJournalData = PUSN_JOURNAL_DATA;
- //
- // Structure for FSCTL_DELETE_USN_JOURNAL
- //
- PDELETE_USN_JOURNAL_DATA = ^DELETE_USN_JOURNAL_DATA;
- {$EXTERNALSYM PDELETE_USN_JOURNAL_DATA}
- DELETE_USN_JOURNAL_DATA = record
- UsnJournalID: DWORDLONG;
- DeleteFlags: DWORD;
- end;
- {$EXTERNALSYM DELETE_USN_JOURNAL_DATA}
- TDeleteUsnJournalData = DELETE_USN_JOURNAL_DATA;
- PDeleteUsnJournalData = PDELETE_USN_JOURNAL_DATA;
- const
- USN_DELETE_FLAG_DELETE = ($00000001);
- {$EXTERNALSYM USN_DELETE_FLAG_DELETE}
- USN_DELETE_FLAG_NOTIFY = ($00000002);
- {$EXTERNALSYM USN_DELETE_FLAG_NOTIFY}
- USN_DELETE_VALID_FLAGS = ($00000003);
- {$EXTERNALSYM USN_DELETE_VALID_FLAGS}
- //
- // Structure for FSCTL_MARK_HANDLE
- //
- type
- PMARK_HANDLE_INFO = ^MARK_HANDLE_INFO;
- {$EXTERNALSYM PMARK_HANDLE_INFO}
- MARK_HANDLE_INFO = record
- UsnSourceInfo: DWORD;
- VolumeHandle: HANDLE;
- HandleInfo: DWORD;
- end;
- {$EXTERNALSYM MARK_HANDLE_INFO}
- TMarkHandleInfo = MARK_HANDLE_INFO;
- PMarkHandleInfo = PMARK_HANDLE_INFO;
- {$IFDEF _WIN64}
- //
- // 32/64 Bit thunking support structure
- //
- MARK_HANDLE_INFO32 = record
- UsnSourceInfo: DWORD;
- VolumeHandle: UINT32;
- HandleInfo: DWORD;
- end;
- {$EXTERNALSYM MARK_HANDLE_INFO32}
- PMARK_HANDLE_INFO32 = ^MARK_HANDLE_INFO32;
- {$EXTERNALSYM PMARK_HANDLE_INFO32}
- TMarkHandleInfo32 = MARK_HANDLE_INFO32;
- PMarkHandleInfo32 = PMARK_HANDLE_INFO32;
- {$ENDIF _WIN64}
- //
- // Flags for the additional source information above.
- //
- // USN_SOURCE_DATA_MANAGEMENT - Service is not modifying the external view
- // of any part of the file. Typical case is HSM moving data to
- // and from external storage.
- //
- // USN_SOURCE_AUXILIARY_DATA - Service is not modifying the external view
- // of the file with regard to the application that created this file.
- // Can be used to add private data streams to a file.
- //
- // USN_SOURCE_REPLICATION_MANAGEMENT - Service is modifying a file to match
- // the contents of the same file which exists in another member of the
- // replica set.
- //
- const
- USN_SOURCE_DATA_MANAGEMENT = ($00000001);
- {$EXTERNALSYM USN_SOURCE_DATA_MANAGEMENT}
- USN_SOURCE_AUXILIARY_DATA = ($00000002);
- {$EXTERNALSYM USN_SOURCE_AUXILIARY_DATA}
- USN_SOURCE_REPLICATION_MANAGEMENT = ($00000004);
- {$EXTERNALSYM USN_SOURCE_REPLICATION_MANAGEMENT}
- //
- // Flags for the HandleInfo field above
- //
- // MARK_HANDLE_PROTECT_CLUSTERS - disallow any defragmenting (FSCTL_MOVE_FILE) until the
- // the handle is closed
- //
- MARK_HANDLE_PROTECT_CLUSTERS = $00000001;
- {$EXTERNALSYM MARK_HANDLE_PROTECT_CLUSTERS}
- //
- // Structure for FSCTL_SECURITY_ID_CHECK
- //
- type
- PBULK_SECURITY_TEST_DATA = ^BULK_SECURITY_TEST_DATA;
- {$EXTERNALSYM PBULK_SECURITY_TEST_DATA}
- BULK_SECURITY_TEST_DATA = record
- DesiredAccess: ACCESS_MASK;
- SecurityIds: array [0..0] of DWORD;
- end;
- {$EXTERNALSYM BULK_SECURITY_TEST_DATA}
- TBulkSecurityTestData = BULK_SECURITY_TEST_DATA;
- PBulkSecurityTestData = PBULK_SECURITY_TEST_DATA;
- //
- // Output flags for the FSCTL_IS_VOLUME_DIRTY
- //
- const
- VOLUME_IS_DIRTY = ($00000001);
- {$EXTERNALSYM VOLUME_IS_DIRTY}
- VOLUME_UPGRADE_SCHEDULED = ($00000002);
- {$EXTERNALSYM VOLUME_UPGRADE_SCHEDULED}
- //
- // Structures for FSCTL_FILE_PREFETCH
- //
- type
- _FILE_PREFETCH = record
- Type_: DWORD;
- Count: DWORD;
- Prefetch: array [0..0] of DWORDLONG;
- end;
- {$EXTERNALSYM _FILE_PREFETCH}
- FILE_PREFETCH = _FILE_PREFETCH;
- {$EXTERNALSYM FILE_PREFETCH}
- PFILE_PREFETCH = ^FILE_PREFETCH;
- {$EXTERNALSYM PFILE_PREFETCH}
- TFilePrefetch = FILE_PREFETCH;
- PFilePrefetch = PFILE_PREFETCH;
- const
- FILE_PREFETCH_TYPE_FOR_CREATE = $1;
- {$EXTERNALSYM FILE_PREFETCH_TYPE_FOR_CREATE}
- //
- // Structures for FSCTL_FILESYSTEM_GET_STATISTICS
- //
- // Filesystem performance counters
- //
- type
- PFILESYSTEM_STATISTICS = ^FILESYSTEM_STATISTICS;
- {$EXTERNALSYM PFILESYSTEM_STATISTICS}
- _FILESYSTEM_STATISTICS = record
- FileSystemType: WORD;
- Version: WORD; // currently version 1
- SizeOfCompleteStructure: DWORD; // must by a mutiple of 64 bytes
- UserFileReads: DWORD;
- UserFileReadBytes: DWORD;
- UserDiskReads: DWORD;
- UserFileWrites: DWORD;
- UserFileWriteBytes: DWORD;
- UserDiskWrites: DWORD;
- MetaDataReads: DWORD;
- MetaDataReadBytes: DWORD;
- MetaDataDiskReads: DWORD;
- MetaDataWrites: DWORD;
- MetaDataWriteBytes: DWORD;
- MetaDataDiskWrites: DWORD;
- //
- // The file system's private structure is appended here.
- //
- end;
- {$EXTERNALSYM _FILESYSTEM_STATISTICS}
- FILESYSTEM_STATISTICS = _FILESYSTEM_STATISTICS;
- {$EXTERNALSYM FILESYSTEM_STATISTICS}
- TFilesystemStatistics = FILESYSTEM_STATISTICS;
- PFilesystemStatistics = PFILESYSTEM_STATISTICS;
- // values for FS_STATISTICS.FileSystemType
- const
- FILESYSTEM_STATISTICS_TYPE_NTFS = 1;
- {$EXTERNALSYM FILESYSTEM_STATISTICS_TYPE_NTFS}
- FILESYSTEM_STATISTICS_TYPE_FAT = 2;
- {$EXTERNALSYM FILESYSTEM_STATISTICS_TYPE_FAT}
- //
- // File System Specific Statistics Data
- //
- type
- PFAT_STATISTICS = ^FAT_STATISTICS;
- {$EXTERNALSYM PFAT_STATISTICS}
- _FAT_STATISTICS = record
- CreateHits: DWORD;
- SuccessfulCreates: DWORD;
- FailedCreates: DWORD;
- NonCachedReads: DWORD;
- NonCachedReadBytes: DWORD;
- NonCachedWrites: DWORD;
- NonCachedWriteBytes: DWORD;
- NonCachedDiskReads: DWORD;
- NonCachedDiskWrites: DWORD;
- end;
- {$EXTERNALSYM _FAT_STATISTICS}
- FAT_STATISTICS = _FAT_STATISTICS;
- {$EXTERNALSYM FAT_STATISTICS}
- TFatStatistics = FAT_STATISTICS;
- PFatStatistics = PFAT_STATISTICS;
- // NTFS Statistics
- TMftWritesUserLevel = record
- Write: WORD;
- Create: WORD;
- SetInfo: WORD;
- Flush: WORD;
- end;
- TMft2WritesUserLevel = record
- Write: WORD;
- Create: WORD;
- SetInfo: WORD;
- Flush: WORD;
- end;
- TBitmapWritesUserLevel = record
- Write: WORD;
- Create: WORD;
- SetInfo: WORD;
- end;
- TMftBitmapWritesUserLevel = record
- Write: WORD;
- Create: WORD;
- SetInfo: WORD;
- Flush: WORD;
- end;
- TAllocate = record
- Calls: DWORD; // number of individual calls to allocate clusters
- Clusters: DWORD; // number of clusters allocated
- Hints: DWORD; // number of times a hint was specified
- RunsReturned: DWORD; // number of runs used to satisify all the requests
- HintsHonored: DWORD; // number of times the hint was useful
- HintsClusters: DWORD; // number of clusters allocated via the hint
- Cache: DWORD; // number of times the cache was useful other than the hint
- CacheClusters: DWORD; // number of clusters allocated via the cache other than the hint
- CacheMiss: DWORD; // number of times the cache wasn't useful
- CacheMissClusters: DWORD; // number of clusters allocated without the cache
- end;
- {$EXTERNALSYM NTFS_STATISTICS}
- PNTFS_STATISTICS = ^NTFS_STATISTICS;
- _NTFS_STATISTICS = record
- LogFileFullExceptions: DWORD;
- OtherExceptions: DWORD;
- //
- // Other meta data io's
- //
- MftReads: DWORD;
- MftReadBytes: DWORD;
- MftWrites: DWORD;
- MftWriteBytes: DWORD;
- MftWritesUserLevel: TMftWritesUserLevel;
- MftWritesFlushForLogFileFull: WORD;
- MftWritesLazyWriter: WORD;
- MftWritesUserRequest: WORD;
- Mft2Writes: DWORD;
- Mft2WriteBytes: DWORD;
- Mft2WritesUserLevel: TMft2WritesUserLevel;
- 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;
- BitmapWritesUserLevel: TBitmapWritesUserLevel;
- MftBitmapReads: DWORD;
- MftBitmapReadBytes: DWORD;
- MftBitmapWrites: DWORD;
- MftBitmapWriteBytes: DWORD;
- MftBitmapWritesFlushForLogFileFull: WORD;
- MftBitmapWritesLazyWriter: WORD;
- MftBitmapWritesUserRequest: WORD;
- MftBitmapWritesUserLevel: TMftBitmapWritesUserLevel;
- UserIndexReads: DWORD;
- UserIndexReadBytes: DWORD;
- UserIndexWrites: DWORD;
- UserIndexWriteBytes: DWORD;
- //
- // Additions for NT 5.0
- //
- LogFileReads: DWORD;
- LogFileReadBytes: DWORD;
- LogFileWrites: DWORD;
- LogFileWriteBytes: DWORD;
- Allocate: TAllocate;
- end;
- {$EXTERNALSYM _NTFS_STATISTICS}
- NTFS_STATISTICS = _NTFS_STATISTICS;
- {$EXTERNALSYM PNTFS_STATISTICS}
- TNTFSStatistics = NTFS_STATISTICS;
- PNTFSStatistics = PNTFS_STATISTICS;
- //
- // Structure for FSCTL_SET_OBJECT_ID, FSCTL_GET_OBJECT_ID, and FSCTL_CREATE_OR_GET_OBJECT_ID
- //
- PFILE_OBJECTID_BUFFER = ^FILE_OBJECTID_BUFFER;
- {$EXTERNALSYM PFILE_OBJECTID_BUFFER}
- _FILE_OBJECTID_BUFFER = record
- //
- // This is the portion of the object id that is indexed.
- //
- ObjectId: array [0..15] of BYTE;
- //
- // This portion of the object id is not indexed, it's just
- // some metadata for the user's benefit.
- //
- case Integer of
- 0: (
- BirthVolumeId: array [0..15] of BYTE;
- BirthObjectId: array [0..15] of BYTE;
- DomainId: array [0..15] of BYTE);
- 1: (
- ExtendedInfo: array [0..47] of BYTE);
- end;
- {$EXTERNALSYM _FILE_OBJECTID_BUFFER}
- FILE_OBJECTID_BUFFER = _FILE_OBJECTID_BUFFER;
- {$EXTERNALSYM FILE_OBJECTID_BUFFER}
- TFileObjectIdBuffer = FILE_OBJECTID_BUFFER;
- PFileObjectIdBuffer = PFILE_OBJECTID_BUFFER;
- //
- // Structure for FSCTL_SET_SPARSE
- //
- PFILE_SET_SPARSE_BUFFER = ^FILE_SET_SPARSE_BUFFER;
- {$EXTERNALSYM PFILE_SET_SPARSE_BUFFER}
- _FILE_SET_SPARSE_BUFFER = record
- SetSparse: ByteBool;
- end;
- {$EXTERNALSYM _FILE_SET_SPARSE_BUFFER}
- FILE_SET_SPARSE_BUFFER = _FILE_SET_SPARSE_BUFFER;
- {$EXTERNALSYM FILE_SET_SPARSE_BUFFER}
- TFileSetSparseBuffer = FILE_SET_SPARSE_BUFFER;
- PFileSetSparseBuffer = PFILE_SET_SPARSE_BUFFER;
- //
- // Structure for FSCTL_SET_ZERO_DATA
- //
- PFILE_ZERO_DATA_INFORMATION = ^FILE_ZERO_DATA_INFORMATION;
- {$EXTERNALSYM PFILE_ZERO_DATA_INFORMATION}
- _FILE_ZERO_DATA_INFORMATION = record
- FileOffset: LARGE_INTEGER;
- BeyondFinalZero: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _FILE_ZERO_DATA_INFORMATION}
- FILE_ZERO_DATA_INFORMATION = _FILE_ZERO_DATA_INFORMATION;
- {$EXTERNALSYM FILE_ZERO_DATA_INFORMATION}
- TFileZeroDataInformation = FILE_ZERO_DATA_INFORMATION;
- PFileZeroDataInformation = PFILE_ZERO_DATA_INFORMATION;
- //
- // Structure for FSCTL_QUERY_ALLOCATED_RANGES
- //
- //
- // Querying the allocated ranges requires an output buffer to store the
- // allocated ranges and an input buffer to specify the range to query.
- // The input buffer contains a single entry, the output buffer is an
- // array of the following structure.
- //
- PFILE_ALLOCATED_RANGE_BUFFER = ^FILE_ALLOCATED_RANGE_BUFFER;
- {$EXTERNALSYM PFILE_ALLOCATED_RANGE_BUFFER}
- _FILE_ALLOCATED_RANGE_BUFFER = record
- FileOffset: LARGE_INTEGER;
- Length: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _FILE_ALLOCATED_RANGE_BUFFER}
- FILE_ALLOCATED_RANGE_BUFFER = _FILE_ALLOCATED_RANGE_BUFFER;
- {$EXTERNALSYM FILE_ALLOCATED_RANGE_BUFFER}
- TFileAllocatedRangeBuffer = FILE_ALLOCATED_RANGE_BUFFER;
- PFileAllocatedRangeBuffer = PFILE_ALLOCATED_RANGE_BUFFER;
- //
- // Structures for FSCTL_SET_ENCRYPTION, FSCTL_WRITE_RAW_ENCRYPTED, and FSCTL_READ_RAW_ENCRYPTED
- //
- //
- // The input buffer to set encryption indicates whether we are to encrypt/decrypt a file
- // or an individual stream.
- //
- PENCRYPTION_BUFFER = ^ENCRYPTION_BUFFER;
- {$EXTERNALSYM PENCRYPTION_BUFFER}
- _ENCRYPTION_BUFFER = record
- EncryptionOperation: DWORD;
- Private_: array [0..0] of BYTE;
- end;
- {$EXTERNALSYM _ENCRYPTION_BUFFER}
- ENCRYPTION_BUFFER = _ENCRYPTION_BUFFER;
- {$EXTERNALSYM ENCRYPTION_BUFFER}
- TEncryptionBuffer = ENCRYPTION_BUFFER;
- PEncryptionBuffer = PENCRYPTION_BUFFER;
- const
- FILE_SET_ENCRYPTION = $00000001;
- {$EXTERNALSYM FILE_SET_ENCRYPTION}
- FILE_CLEAR_ENCRYPTION = $00000002;
- {$EXTERNALSYM FILE_CLEAR_ENCRYPTION}
- STREAM_SET_ENCRYPTION = $00000003;
- {$EXTERNALSYM STREAM_SET_ENCRYPTION}
- STREAM_CLEAR_ENCRYPTION = $00000004;
- {$EXTERNALSYM STREAM_CLEAR_ENCRYPTION}
- MAXIMUM_ENCRYPTION_VALUE = $00000004;
- {$EXTERNALSYM MAXIMUM_ENCRYPTION_VALUE}
- //
- // The optional output buffer to set encryption indicates that the last encrypted
- // stream in a file has been marked as decrypted.
- //
- type
- PDECRYPTION_STATUS_BUFFER = ^DECRYPTION_STATUS_BUFFER;
- {$EXTERNALSYM PDECRYPTION_STATUS_BUFFER}
- _DECRYPTION_STATUS_BUFFER = record
- NoEncryptedStreams: ByteBool;
- end;
- {$EXTERNALSYM _DECRYPTION_STATUS_BUFFER}
- DECRYPTION_STATUS_BUFFER = _DECRYPTION_STATUS_BUFFER;
- {$EXTERNALSYM DECRYPTION_STATUS_BUFFER}
- TDecryptionStatusBuffer = DECRYPTION_STATUS_BUFFER;
- PDecryptionStatusBuffer = PDECRYPTION_STATUS_BUFFER;
- const
- ENCRYPTION_FORMAT_DEFAULT = ($01);
- {$EXTERNALSYM ENCRYPTION_FORMAT_DEFAULT}
- COMPRESSION_FORMAT_SPARSE = ($4000);
- {$EXTERNALSYM COMPRESSION_FORMAT_SPARSE}
- //
- // Request Encrypted Data structure. This is used to indicate
- // the range of the file to read. It also describes the
- // output buffer used to return the data.
- //
- type
- PREQUEST_RAW_ENCRYPTED_DATA = ^REQUEST_RAW_ENCRYPTED_DATA;
- {$EXTERNALSYM PREQUEST_RAW_ENCRYPTED_DATA}
- _REQUEST_RAW_ENCRYPTED_DATA = record
- //
- // Requested file offset and requested length to read.
- // The fsctl will round the starting offset down
- // to a file system boundary. It will also
- // round the length up to a file system boundary.
- //
- FileOffset: LONGLONG;
- Length: DWORD;
- end;
- {$EXTERNALSYM _REQUEST_RAW_ENCRYPTED_DATA}
- REQUEST_RAW_ENCRYPTED_DATA = _REQUEST_RAW_ENCRYPTED_DATA;
- {$EXTERNALSYM REQUEST_RAW_ENCRYPTED_DATA}
- TRequestRawEncryptedData = REQUEST_RAW_ENCRYPTED_DATA;
- PRequestRawEncryptedData = PREQUEST_RAW_ENCRYPTED_DATA;
- //
- // Encrypted Data Information structure. This structure
- // is used to return raw encrypted data from a file in
- // order to perform off-line recovery. The data will be
- // encrypted or encrypted and compressed. The off-line
- // service will need to use the encryption and compression
- // format information to recover the file data. In the
- // event that the data is both encrypted and compressed then
- // the decryption must occur before decompression. All
- // the data units below must be encrypted and compressed
- // with the same format.
- //
- // The data will be returned in units. The data unit size
- // will be fixed per request. If the data is compressed
- // then the data unit size will be the compression unit size.
- //
- // This structure is at the beginning of the buffer used to
- // return the encrypted data. The actual raw bytes from
- // the file will follow this buffer. The offset of the
- // raw bytes from the beginning of this structure is
- // specified in the REQUEST_RAW_ENCRYPTED_DATA structure
- // described above.
- //
- PENCRYPTED_DATA_INFO = ^ENCRYPTED_DATA_INFO;
- {$EXTERNALSYM PENCRYPTED_DATA_INFO}
- _ENCRYPTED_DATA_INFO = record
- //
- // This is the file offset for the first entry in the
- // data block array. The file system will round
- // the requested start offset down to a boundary
- // that is consistent with the format of the file.
- //
- StartingFileOffset: DWORDLONG;
- //
- // Data offset in output buffer. The output buffer
- // begins with an ENCRYPTED_DATA_INFO structure.
- // The file system will then store the raw bytes from
- // disk beginning at the following offset within the
- // output buffer.
- //
- OutputBufferOffset: DWORD;
- //
- // The number of bytes being returned that are within
- // the size of the file. If this value is less than
- // (NumberOfDataBlocks << DataUnitShift), it means the
- // end of the file occurs within this transfer. Any
- // data beyond file size is invalid and was never
- // passed to the encryption driver.
- //
- BytesWithinFileSize: DWORD;
- //
- // The number of bytes being returned that are below
- // valid data length. If this value is less than
- // (NumberOfDataBlocks << DataUnitShift), it means the
- // end of the valid data occurs within this transfer.
- // After decrypting the data from this transfer, any
- // byte(s) beyond valid data length must be zeroed.
- //
- BytesWithinValidDataLength: DWORD;
- //
- // Code for the compression format as defined in
- // ntrtl.h. Note that COMPRESSION_FORMAT_NONE
- // and COMPRESSION_FORMAT_DEFAULT are invalid if
- // any of the described chunks are compressed.
- //
- CompressionFormat: WORD;
- //
- // The DataUnit is the granularity used to access the
- // disk. It will be the same as the compression unit
- // size for a compressed file. For an uncompressed
- // file, it will be some cluster-aligned power of 2 that
- // the file system deems convenient. A caller should
- // not expect that successive calls will have the
- // same data unit shift value as the previous call.
- //
- // Since chunks and compression units are expected to be
- // powers of 2 in size, we express them log2. So, for
- // example (1 << ChunkShift) == ChunkSizeInBytes. The
- // ClusterShift indicates how much space must be saved
- // to successfully compress a compression unit - each
- // successfully compressed data unit must occupy
- // at least one cluster less in bytes than an uncompressed
- // data block unit.
- //
- DataUnitShift: BYTE;
- ChunkShift: BYTE;
- ClusterShift: BYTE;
- //
- // The format for the encryption.
- //
- EncryptionFormat: BYTE;
- //
- // This is the number of entries in the data block size
- // array.
- //
- NumberOfDataBlocks: WORD;
- //
- // This is an array of sizes in the data block array. There
- // must be one entry in this array for each data block
- // read from disk. The size has a different meaning
- // depending on whether the file is compressed.
- //
- // A size of zero always indicates that the final data consists entirely
- // of zeroes. There is no decryption or decompression to
- // perform.
- //
- // If the file is compressed then the data block size indicates
- // whether this block is compressed. A size equal to
- // the block size indicates that the corresponding block did
- // not compress. Any other non-zero size indicates the
- // size of the compressed data which needs to be
- // decrypted/decompressed.
- //
- // If the file is not compressed then the data block size
- // indicates the amount of data within the block that
- // needs to be decrypted. Any other non-zero size indicates
- // that the remaining bytes in the data unit within the file
- // consists of zeros. An example of this is when the
- // the read spans the valid data length of the file. There
- // is no data to decrypt past the valid data length.
- //
- DataBlockSize: array [0..ANYSIZE_ARRAY - 1] of DWORD;
- end;
- {$EXTERNALSYM _ENCRYPTED_DATA_INFO}
- ENCRYPTED_DATA_INFO = _ENCRYPTED_DATA_INFO;
- {$EXTERNALSYM ENCRYPTED_DATA_INFO}
- TEncryptedDataInfo = ENCRYPTED_DATA_INFO;
- PEncryptedDataInfo = PENCRYPTED_DATA_INFO;
- //
- // FSCTL_READ_FROM_PLEX support
- // Request Plex Read Data structure. This is used to indicate
- // the range of the file to read. It also describes
- // which plex to perform the read from.
- //
- _PLEX_READ_DATA_REQUEST = record
- //
- // Requested offset and length to read.
- // The offset can be the virtual offset (vbo) in to a file,
- // or a volume. In the case of a file offset,
- // the fsd will round the starting offset down
- // to a file system boundary. It will also
- // round the length up to a file system boundary and
- // enforce any other applicable limits.
- //
- ByteOffset: LARGE_INTEGER;
- ByteLength: DWORD;
- PlexNumber: DWORD;
- end;
- {$EXTERNALSYM _PLEX_READ_DATA_REQUEST}
- PLEX_READ_DATA_REQUEST = _PLEX_READ_DATA_REQUEST;
- {$EXTERNALSYM PLEX_READ_DATA_REQUEST}
- PPLEX_READ_DATA_REQUEST = ^PLEX_READ_DATA_REQUEST;
- {$EXTERNALSYM PPLEX_READ_DATA_REQUEST}
- TPlexReadDataRequest = PLEX_READ_DATA_REQUEST;
- PPlexReadDataRequest = PPLEX_READ_DATA_REQUEST;
- //
- // FSCTL_SIS_COPYFILE support
- // Source and destination file names are passed in the FileNameBuffer.
- // Both strings are null terminated, with the source name starting at
- // the beginning of FileNameBuffer, and the destination name immediately
- // following. Length fields include terminating nulls.
- //
- PSI_COPYFILE = ^SI_COPYFILE;
- {$EXTERNALSYM PSI_COPYFILE}
- _SI_COPYFILE = record
- SourceFileNameLength: DWORD;
- DestinationFileNameLength: DWORD;
- Flags: DWORD;
- FileNameBuffer: array [0..0] of WCHAR;
- end;
- {$EXTERNALSYM _SI_COPYFILE}
- SI_COPYFILE = _SI_COPYFILE;
- {$EXTERNALSYM SI_COPYFILE}
- TSiCopyfile = SI_COPYFILE;
- PSiCopyfile = PSI_COPYFILE;
- const
- COPYFILE_SIS_LINK = $0001; // Copy only if source is SIS
- {$EXTERNALSYM COPYFILE_SIS_LINK}
- COPYFILE_SIS_REPLACE = $0002; // Replace destination if it exists, otherwise don't.
- {$EXTERNALSYM COPYFILE_SIS_REPLACE}
- COPYFILE_SIS_FLAGS = $0003;
- {$EXTERNALSYM COPYFILE_SIS_FLAGS}
- //
- // These IOCTLs are handled by hard disk volumes.
- //
- IOCTL_VOLUME_BASE = DWORD('V');
- {$EXTERNALSYM IOCTL_VOLUME_BASE}
- IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = (
- (IOCTL_VOLUME_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- (0 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS}
- IOCTL_VOLUME_IS_CLUSTERED = (
- (IOCTL_VOLUME_BASE shl 16) or (FILE_ANY_ACCESS shl 14) or
- (12 shl 2) or METHOD_BUFFERED);
- {$EXTERNALSYM IOCTL_VOLUME_IS_CLUSTERED}
- //
- // Disk extent definition.
- //
- type
- PDISK_EXTENT = ^DISK_EXTENT;
- {$EXTERNALSYM PDISK_EXTENT}
- _DISK_EXTENT = record
- DiskNumber: DWORD;
- StartingOffset: LARGE_INTEGER;
- ExtentLength: LARGE_INTEGER;
- end;
- {$EXTERNALSYM _DISK_EXTENT}
- DISK_EXTENT = _DISK_EXTENT;
- {$EXTERNALSYM DISK_EXTENT}
- TDiskExtent = DISK_EXTENT;
- PDiskExtent = PDISK_EXTENT;
- //
- // Output structure for IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
- //
- PVOLUME_DISK_EXTENTS = ^VOLUME_DISK_EXTENTS;
- {$EXTERNALSYM PVOLUME_DISK_EXTENTS}
- _VOLUME_DISK_EXTENTS = record
- NumberOfDiskExtents: DWORD;
- Extents: array [0..0] of DISK_EXTENT;
- end;
- {$EXTERNALSYM _VOLUME_DISK_EXTENTS}
- VOLUME_DISK_EXTENTS = _VOLUME_DISK_EXTENTS;
- {$EXTERNALSYM VOLUME_DISK_EXTENTS}
- TVolumeDiskExtents = VOLUME_DISK_EXTENTS;
- PVolumeDiskExtents = PVOLUME_DISK_EXTENTS;
- implementation
- function CTL_CODE(DeviceType, Func, Method, Access: WORD): DWORD;
- begin
- Result := (DeviceType shl 16) or (Access shl 14) or (Func shl 2) or Method;
- end;
- function DEVICE_TYPE_FROM_CTL_CODE(CtrlCode: DWORD): WORD;
- begin
- Result := (CtrlCode and DWORD($FFFF0000)) shr 16;
- end;
- {
- #define IsRecognizedPartition( PartitionType ) (
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT_12)) ||
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_IFS)) ||
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_HUGE)) ||
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT32)) ||
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_FAT32_XINT13)) ||
- ((PartitionType & PARTITION_NTFT) && ((PartitionType & ~0xC0) == PARTITION_XINT13)) ||
- ((PartitionType) == PARTITION_FAT_12) ||
- ((PartitionType) == PARTITION_FAT_16) ||
- ((PartitionType) == PARTITION_IFS) ||
- ((PartitionType) == PARTITION_HUGE) ||
- ((PartitionType) == PARTITION_FAT32) ||
- ((PartitionType) == PARTITION_FAT32_XINT13) ||
- ((PartitionType) == PARTITION_XINT13) )
- }
- function IsRecognizedPartition(PartitionType: DWORD): Boolean;
- begin
- Result :=
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_FAT_12)) or
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_IFS)) or
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_HUGE)) or
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_FAT32)) or
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_FAT32_XINT13)) or
- (((PartitionType and PARTITION_NTFT) <> 0) and ((PartitionType and not $C0) = PARTITION_XINT13)) or
- ((PartitionType) = PARTITION_FAT_12) or
- ((PartitionType) = PARTITION_FAT_16) or
- ((PartitionType) = PARTITION_IFS) or
- ((PartitionType) = PARTITION_HUGE) or
- ((PartitionType) = PARTITION_FAT32) or
- ((PartitionType) = PARTITION_FAT32_XINT13) or
- ((PartitionType) = PARTITION_XINT13);
- end;
- function IsContainerPartition(PartitionType: DWORD): Boolean;
- begin
- Result :=
- (PartitionType = PARTITION_EXTENDED) or
- (PartitionType = PARTITION_XINT13_EXTENDED);
- end;
- function IsFTPartition(PartitionType: DWORD): Boolean;
- begin
- { (((PartitionType)&PARTITION_NTFT) && IsRecognizedPartition(PartitionType)) }
- Result := ((PartitionType and PARTITION_NTFT) = PARTITION_NTFT) and IsRecognizedPartition(PartitionType);
- end;
- function DiskGeometryGetPartition(Geometry: DWORD): PDISK_PARTITION_INFO;
- begin
- //((PDISK_PARTITION_INFO)((Geometry)+1))
- Result := PDISK_PARTITION_INFO(Geometry + 1);
- end;
- function DiskGeometryGetDetect(Geometry: DWORD): PDISK_DETECTION_INFO;
- begin
- //((PDISK_DETECTION_INFO)(((PBYTE)DiskGeometryGetPartition(Geometry)+
- //DiskGeometryGetPartition(Geometry)->SizeOfPartitionInfo)))
- Result := PDISK_DETECTION_INFO(DWORD_PTR(DiskGeometryGetPartition(Geometry)) + DiskGeometryGetPartition(Geometry)^.SizeOfPartitionInfo);
- end;
- end.