SCSI_PASS_THROUGH

Hi,
I am sending SCSIOP_INQUIRY from an application to the
port driver.
This application works fine for the Non-Disk devices
but returns ERROR_INVALID_FUNCTION for the Disk
devices.
Does anyone has any idea about it.
I am sending the inquiry as follows:

for(j=0;j<5;j++)
{
for(i=0;i<16;i++)
{
sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH);
sptwb.spt.PathId = j;
sptwb.spt.TargetId = i;
sptwb.spt.Lun = 0;
sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
sptwb.spt.SenseInfoLength = 32;
sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
sptwb.spt.DataTransferLength = sizeof(InqData)
sptwb.spt.TimeOutValue = 2;
sptwb.spt.DataBufferOffset =
offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucD
sptwb.spt.SenseInfoOffset =
offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucS
sptwb.spt.Cdb[0] = SCSIOP_INQUIRY;
sptwb.spt.Cdb[1] = sptwb.spt.Lun << 5;
sptwb.spt.Cdb[4] = sizeof(InqData);
length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFE
sptwb.spt.DataTransferLength;

status = DeviceIoControl(
fileHandle,
IOCTL_SCSI_PASS_THROUGH,
&sptwb,
sizeof(SCSI_PASS_THROUGH)
&sptwb,
length,
&returned,
FALSE);

}
}


Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Some time ago I had the same problem. Found that’s easier to call
IOCTL_SCSI_GET_INQUIRY data than to fight with the wind mills trying to
send SCSIOP_INQUIRY.

On 10/24/01, “Gurpreet Anand ” wrote:
> Hi,
> I am sending SCSIOP_INQUIRY from an application to the
> port driver.
> This application works fine for the Non-Disk devices
> but returns ERROR_INVALID_FUNCTION for the Disk
> devices.
> Does anyone has any idea about it.
> I am sending the inquiry as follows:
>
> for(j=0;j<5;j++)
> {
> for(i=0;i<16;i++)
> {
> sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH);
> sptwb.spt.PathId = j;
> sptwb.spt.TargetId = i;
> sptwb.spt.Lun = 0;
> sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
> sptwb.spt.SenseInfoLength = 32;
> sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
> sptwb.spt.DataTransferLength = sizeof(InqData)
> sptwb.spt.TimeOutValue = 2;
> sptwb.spt.DataBufferOffset =
> offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucD
> sptwb.spt.SenseInfoOffset =
> offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucS
> sptwb.spt.Cdb[0] = SCSIOP_INQUIRY;
> sptwb.spt.Cdb[1] = sptwb.spt.Lun << 5;
> sptwb.spt.Cdb[4] = sizeof(InqData);
> length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFE
> sptwb.spt.DataTransferLength;
>
> status = DeviceIoControl(
> fileHandle,
> IOCTL_SCSI_PASS_THROUGH,
> &sptwb,
> sizeof(SCSI_PASS_THROUGH)
> &sptwb,
> length,
> &returned,
> FALSE);
>
> }
> }
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

For w2k and later, as the docs more or less clearly state, you have to go
through the class device if the scsi target is claimed. The example from
Gurpeet is (I guess) attempting to send scsi pass through to claimed targets
through the port device (e.g. scsi0) and that will not work.

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]

Sent: Thursday, October 25, 2001 6:44 AM
To: NT Developers Interest List
Subject: [ntdev] Re: SCSI_PASS_THROUGH

Some time ago I had the same problem. Found that’s easier to call
IOCTL_SCSI_GET_INQUIRY data than to fight with the wind mills trying to
send SCSIOP_INQUIRY.

On 10/24/01, “Gurpreet Anand ” wrote:
> Hi,
> I am sending SCSIOP_INQUIRY from an application to the
> port driver.
> This application works fine for the Non-Disk devices
> but returns ERROR_INVALID_FUNCTION for the Disk
> devices.
> Does anyone has any idea about it.
> I am sending the inquiry as follows:
>
> for(j=0;j<5;j++)
> {
> for(i=0;i<16;i++)
> {
> sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH); sptwb.spt.PathId = j;
> sptwb.spt.TargetId = i;
> sptwb.spt.Lun = 0;
> sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
> sptwb.spt.SenseInfoLength = 32;
> sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
> sptwb.spt.DataTransferLength = sizeof(InqData)
> sptwb.spt.TimeOutValue = 2;
> sptwb.spt.DataBufferOffset =
> offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucD
> sptwb.spt.SenseInfoOffset =
> offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucS
> sptwb.spt.Cdb[0] = SCSIOP_INQUIRY;
> sptwb.spt.Cdb[1] = sptwb.spt.Lun << 5;
> sptwb.spt.Cdb[4] = sizeof(InqData);
> length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFE
> sptwb.spt.DataTransferLength;
>
> status = DeviceIoControl(
> fileHandle,
> IOCTL_SCSI_PASS_THROUGH,
> &sptwb,
> sizeof(SCSI_PASS_THROUGH)
> &sptwb,
> length,
> &returned,
> FALSE);
>
> }
> }
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yeah I figured it out later.
Thanks for the help.
Regards,
Gurpreet
— “Roddy, Mark” wrote:
> For w2k and later, as the docs more or less clearly
> state, you have to go
> through the class device if the scsi target is
> claimed. The example from
> Gurpeet is (I guess) attempting to send scsi pass
> through to claimed targets
> through the port device (e.g. scsi0) and that will
> not work.
>
> -----Original Message-----
> From: xxxxx@hotmail.com
> [mailto:xxxxx@hotmail.com]
>
> Sent: Thursday, October 25, 2001 6:44 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: SCSI_PASS_THROUGH
>
>
> Some time ago I had the same problem. Found that’s
> easier to call
> IOCTL_SCSI_GET_INQUIRY data than to fight with the
> wind mills trying to
> send SCSIOP_INQUIRY.
>
> On 10/24/01, “Gurpreet Anand
> ” wrote:
> > Hi,
> > I am sending SCSIOP_INQUIRY from an application to
> the
> > port driver.
> > This application works fine for the Non-Disk
> devices
> > but returns ERROR_INVALID_FUNCTION for the Disk
> > devices.
> > Does anyone has any idea about it.
> > I am sending the inquiry as follows:
> >
> > for(j=0;j<5;j++)
> > {
> > for(i=0;i<16;i++)
> > {
> > sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH);
> sptwb.spt.PathId = j;
> > sptwb.spt.TargetId = i;
> > sptwb.spt.Lun = 0;
> > sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
> > sptwb.spt.SenseInfoLength = 32;
> > sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
> > sptwb.spt.DataTransferLength = sizeof(InqData)
> > sptwb.spt.TimeOutValue = 2;
> > sptwb.spt.DataBufferOffset =
> > offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucD
> > sptwb.spt.SenseInfoOffset =
> > offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucS
> > sptwb.spt.Cdb[0] = SCSIOP_INQUIRY;
> > sptwb.spt.Cdb[1] = sptwb.spt.Lun << 5;
> > sptwb.spt.Cdb[4] = sizeof(InqData);
> > length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFE
> > sptwb.spt.DataTransferLength;
> >
> > status = DeviceIoControl(
> > fileHandle,
> > IOCTL_SCSI_PASS_THROUGH,
> > &sptwb,
> > sizeof(SCSI_PASS_THROUGH)
> > &sptwb,
> > length,
> > &returned,
> > FALSE);
> >
> > }
> > }
> >
> >
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@stratus.com To
> > unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To
> unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

In this case all commands should fail not only SCSIOP_INQUIRY. Maybe I’ve
got something wrong…

On 10/25/01, ““Roddy, Mark” ” wrote:
> For w2k and later, as the docs more or less clearly state, you have to go
> through the class device if the scsi target is claimed. The example from
> Gurpeet is (I guess) attempting to send scsi pass through to claimed targets
> through the port device (e.g. scsi0) and that will not work.
>
> -----Original Message-----
> From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
>
> Sent: Thursday, October 25, 2001 6:44 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: SCSI_PASS_THROUGH
>
>
> Some time ago I had the same problem. Found that’s easier to call
> IOCTL_SCSI_GET_INQUIRY data than to fight with the wind mills trying to
> send SCSIOP_INQUIRY.
>
> On 10/24/01, “Gurpreet Anand ” wrote:
> > Hi,
> > I am sending SCSIOP_INQUIRY from an application to the
> > port driver.
> > This application works fine for the Non-Disk devices
> > but returns ERROR_INVALID_FUNCTION for the Disk
> > devices.
> > Does anyone has any idea about it.
> > I am sending the inquiry as follows:
> >
> > for(j=0;j<5;j++)
> > {
> > for(i=0;i<16;i++)
> > {
> > sptwb.spt.Length = sizeof(SCSI_PASS_THROUGH); sptwb.spt.PathId = j;
> > sptwb.spt.TargetId = i;
> > sptwb.spt.Lun = 0;
> > sptwb.spt.CdbLength = CDB6GENERIC_LENGTH;
> > sptwb.spt.SenseInfoLength = 32;
> > sptwb.spt.DataIn = SCSI_IOCTL_DATA_IN;
> > sptwb.spt.DataTransferLength = sizeof(InqData)
> > sptwb.spt.TimeOutValue = 2;
> > sptwb.spt.DataBufferOffset =
> > offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucD
> > sptwb.spt.SenseInfoOffset =
> > offsetof(SCSI_PASS_THROUGH_WITH_BUFFERS,ucS
> > sptwb.spt.Cdb[0] = SCSIOP_INQUIRY;
> > sptwb.spt.Cdb[1] = sptwb.spt.Lun << 5;
> > sptwb.spt.Cdb[4] = sizeof(InqData);
> > length = offsetof(SCSI_PASS_THROUGH_WITH_BUFFE
> > sptwb.spt.DataTransferLength;
> >
> > status = DeviceIoControl(
> > fileHandle,
> > IOCTL_SCSI_PASS_THROUGH,
> > &sptwb,
> > sizeof(SCSI_PASS_THROUGH)
> > &sptwb,
> > length,
> > &returned,
> > FALSE);
> >
> > }
> > }
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@stratus.com To
> > unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com