Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

ScsiPassThrough (Structures)
 
.
Summary
TODO - a short description
Summary

C# Definition:

    /// <summary>
    /// Wrapper for the ScsiPassThrough command
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public class ScsiPassThroughWithBuffers {
        /// <summary>The SPT we're wrapping</summary>
        public ScsiPassThrough spt;
    public class ScsiPassThrough {
        /// <summary>The size of the item passed to DeviceIoControl</summary>
        public ushort Length;

        /// <summary>Used to align the size of the structure</summary>
        public UInt32 Filler;
        /// <summary>The status of the SCSI command</summary>
        public byte ScsiStatus;

        /// <summary>The buffer to write sense info into</summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
        public byte[] ucSenseBuf;
        /// <summary>The SCSI bus</summary>
        public byte PathId;

        /// <summary>The buffer to write output data into</summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=512)]
        public byte[] ucDataBuf;
        /// <summary>The SCSI target</summary>
        public byte TargetId;

        /// <summary>
        /// Constructor for the command to send to the robot
        /// </summary>
        /// <param name="target">The SCSI target</param>
        /// <param name="bus">The SCSI bus</param>
        /// <param name="lun">The SCSI lun</param>
        /// <param name="cdbLen">The length of the CDB to be sent</param>
        /// <param name="dataTransferLength">The length to use</param>
        public ScsiPassThroughWithBuffers(byte target, byte bus, byte lun, byte cdbLen, UInt32 dataTransferLength) {
            spt = new ScsiPassThrough(target, bus, lun, cdbLen, dataTransferLength);
            Filler = 0;
            ucSenseBuf = new byte[32];
            ucDataBuf = new byte[512];
        }
    }

VB Definition:

Structure ScsiPassThroughWithBuffers
   Public TODO
End Structure

User-Defined Field Types:

None.

        /// <summary>The SCSI lun</summary>
        public byte Lun;

Notes:

None.

        /// <summary>The number of bytes in the CDB field</summary>
        public byte CdbLength;

Documentation

        /// <summary>How long the sense info structure is</summary>
        public byte SenseInfoLength;

        /// <summary>Usually set to SCSI_IOCTL_DATA_IN</summary>
        public byte DataIn;

        /// <summary>How many bytes to transfer</summary>
        public UInt32 DataTransferLength;

        /// <summary>How long to wait before timing out</summary>
        public UInt32 TimeOutValue;

        /// <summary>The offset of the data buffer area returned</summary>
        public UInt32 DataBufferOffset;

        /// <summary>The offset of the sense info returned</summary>
        public UInt32 SenseInfoOffset;

        /// <summary>The command code to send to the robot</summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
        public byte[] Cdb;

}

VB Definition:

Structure ScsiPassThrough
   Public TODO
End Structure

User-Defined Field Types:

None.

Notes:

You need to declare some type of constructor. For example:

/// <summary>
/// Constructor for the command to send to the device
/// </summary>
/// <param name="target">The SCSI target</param>
/// <param name="bus">The SCSI bus</param>
/// <param name="lun">The SCSI lun</param>
/// <param name="cdbLen">The length of the CDB to be sent</param>
/// <param name="dataTransferLength">The length to use</param>
public ScsiPassThrough(byte target, byte bus, byte lun, byte cdbLen, UInt32 dataTransferLength) {
    Length = (ushort) Marshal.SizeOf(typeof(ScsiPassThrough));
    ScsiStatus = 0;
    PathId = bus;
    TargetId = target;
    Lun = lun;
    CdbLength = cdbLen;
    SenseInfoLength = 24;
    DataIn = 1;    // SCSI_IOCTL_DATA_IN
    DataTransferLength = dataTransferLength;
    TimeOutValue = 200;
    DataBufferOffset = (uint) Marshal.OffsetOf(typeof ScsiPassThroughWithBuffers), "ucDataBuf");
    SenseInfoOffset = (uint) Marshal.OffsetOf(typeof ScsiPassThroughWithBuffers), "ucSenseBuf");
    Cdb = new byte[16] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
}

Documentation
Documentation
Documentation
Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions