// ntddscsi.h
typedef struct _ATA_PASS_THROUGH_DIRECT {
USHORT Length;
USHORT AtaFlags;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
UCHAR ReservedAsUchar;
ULONG DataTransferLength;
ULONG TimeOutValue;
ULONG ReservedAsUlong;
PVOID DataBuffer;
UCHAR PreviousTaskFile[8];
UCHAR CurrentTaskFile[8];
} ATA_PASS_THROUGH_DIRECT, *PATA_PASS_THROUGH_DIRECT;
View the official Windows Driver Kit DDI referenceNo description available.
The ATA_PASS_THROUGH_DIRECT structure is used in conjunction with an IOCTL_ATA_PASS_THROUGH_DIRECT request to instruct the port driver to send an embedded ATA command to the target device.
LengthSpecifies the length in bytes of the ATA_PASS_THROUGH_DIRECT structure.
AtaFlagsIndicates the direction of data transfer and specifies the kind of operation to be performed. The value of this member must be some combination of the flags in the following table.
| ATA flags | Meaning |
|---|---|
| ATA_FLAGS_DRDY_REQUIRED | Wait for DRDY status from the device before sending the command to the device. |
| ATA_FLAGS_DATA_IN | Read data from the device. |
| ATA_FLAGS_DATA_OUT | Write data to the device. |
| ATA_FLAGS_48BIT_COMMAND | The ATA command to be sent uses the 48-bit logical block address (LBA) feature set. When this flag is set, the contents of the PreviousTaskFile member in the ATA_PASS_THROUGH_DIRECT structure should be valid. |
| ATA_FLAGS_USE_DMA | Set the transfer mode to DMA. |
| ATA_FLAGS_NO_MULTIPLE | Read single sector only. |
PathIdContains an integer that indicates the IDE port or bus for the request. This value is set by the port driver.
TargetIdContains an integer that indicates the target device on the bus. This value is set by the port driver.
LunIndicates the logical unit number of the device. This value is set by the port driver.
ReservedAsUcharReserved for future use.
DataTransferLengthIndicates the size, in bytes, of the data buffer. If an underrun occurs, the miniport driver must update this member to the number of bytes actually transferred.
TimeOutValueIndicates the number of seconds that are allowed for the request to execute before the OS-specific port driver determines that the request has timed out.
ReservedAsUlongReserved for future use.
DataBufferPointer to the data buffer.
PreviousTaskFileSpecifies the contents of the input task file register prior to the current pass-through command. This member is not used when the ATA_FLAGS_48BIT_COMMAND flag is not set.
CurrentTaskFileSpecifies the content of the task file register on both input and output. On input, the array values in CurrentTaskFile map to the input registers in the following manner.
| Byte | Input Register |
|---|---|
| 0 | Features Register |
| 1 | Sector Count Register |
| 2 | Sector Number Register |
| 3 | Cylinder Low Register |
| 4 | Cylinder High Register |
| 5 | Device/Head Register |
| 6 | Command Register |
| 7 | Reserved |
When IOCTL_ATA_PASS_THROUGH_DIRECT completes, the port driver updates CurrentTaskFile with the values that are present in the device's output registers at the completion of the embedded command. The array values in CurrentTaskFile correspond to the following task file output registers.
| Byte | Output Register |
|---|---|
| 0 | Error Register |
| 1 | Sector Count Register |
| 2 | Sector Number Register |
| 3 | Cylinder Low Register |
| 4 | Cylinder High Register |
| 5 | Device/Head Register |
| 6 | Status Register |
| 7 | Reserved |
The ATA_PASS_THROUGH_DIRECT structure is used with IOCTL_ATA_PASS_THROUGH_DIRECT. With this request, the system locks down the buffer in user memory and the device accesses this memory directly. For a double-buffered equivalent of this device control request, see IOCTL_ATA_PASS_THROUGH and ATA_PASS_THROUGH_EX.