SCSI_PASS_THROUGH结构的说明



typedef struct _SCSI_PASS_THROUGH {

    USHORT Length;

    UCHAR ScsiStatus;

    UCHAR PathId;

    UCHAR TargetId;

    UCHAR Lun;

    UCHAR CdbLength;

    UCHAR SenseInfoLength;

    UCHAR DataIn;

    ULONG DataTransferLength;

    ULONG TimeOutValue;

    ULONG DataBufferOffset;

    ULONG SenseInfoOffset;

    UCHAR Cdb[16];

}SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;

The Length is the size of the SCSI_PASS_THROUGH structure. 

The ScsiStatus should be initialized to 0.  The SCSI status of the requested SCSI operation is returned in this structure member.  The possible SCSI statuses are defined in SCSI.H and are of the form SCSISTAT_xxx.

The PathId is the bus number for the SCSI host adapter that controls the SCSI device in question.  Typically, this value will be 0, but there are SCSI host adapters that have more than one SCSI bus on the adapter. 

The TargetId and Lun are the SCSI ID number and logical unit number for the device.  If the handle was obtained for a claimed device, then the PathId, TargetId and Lun as defined in this structure will be ignored and the appropriate class driver will provide this SCSI address information.  If the handle was obtained for the SCSI port driver, then the PathId, TargetId and Lun must be correct for the device intended. 

The CdbLength is the length of the CDB. Typical values are 6, 10, and 12 up to the maximum of 16.  The SenseInfoLength is the length of the SenseInfo buffer.  DataIn has three possible values which are defined in NTDDSCSI.H;  SCSI_IOCTL_DATA_OUT, SCSI_IOCTL_DATA_IN and SCSI_IOCTL_DATA_UNSPECIFIED.  SCSI_IOCTL_DATA_UNSPECIFIED should be used only if the appropriate SCSI miniport driver supports its usage.  The DataTransferLength is the byte size of the data buffer.  The TimeOutValue is the length of time, in seconds, until a time-out error should occur.  This can range from 0 to a maximum of 30 minutes (108000 seconds). 

The DataBufferOffset is the offset of the data buffer from the beginning of the pass through structure.  For the SCSI_PASS_THROUGH_DIRECT structure, this value is not an offset, but rather is a pointer to a data buffer.  The SenseInfoOffset is similarly an offset to the SenseInfo buffer from the beginning of the pass through structure. Finally, the sixteen remaining bytes are for the CDB data.  The format of this data must conform to the SCSI-2 standard as defined by ANSI.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值