Question about SCSI_PASS_THROUGH_DIRECT documentation

Hello

The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
"Contains the sum of the length of the SCSI_PASS_THROUGH structure and the
lengths of the accompanying data and request sense buffers. "

However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
sizeof(sense_buffer) and issue the DeviceIoControl, I get this error: 1306 =
Indicates two revision levels are incompatible.

If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call to
DeviceIoControl works.

Please advise.


Elias

Quoting lallous :

> Hello
>
> The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
> "Contains the sum of the length of the SCSI_PASS_THROUGH structure and the
> lengths of the accompanying data and request sense buffers. "
>
> However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
> sizeof(sense_buffer) and issue the DeviceIoControl, I get this error: 1306 =
>
> Indicates two revision levels are incompatible.
>
> If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call to
> DeviceIoControl works.
>
> Please advise.

The input buffer should be the size of SCSI_PASS_THROUGH(_DIRECT). The
output buffer should be larger to accomodate sense and data.

Hello Ian,

I don’t feel my question was answered or I didn’t get you:

“ian blake” wrote in message news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello
>>
>> The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
>> "Contains the sum of the length of the SCSI_PASS_THROUGH structure and
>> the
>> lengths of the accompanying data and request sense buffers. "
>>
>> However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
>> sizeof(sense_buffer) and issue the DeviceIoControl, I get this error:
>> 1306 =
>>
>> Indicates two revision levels are incompatible.
>>
>> If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call to
>> DeviceIoControl works.
>>
>> Please advise.
>
> The input buffer should be the size of SCSI_PASS_THROUGH(_DIRECT). The
> output buffer should be larger to accomodate sense and data.
>

What should the SCSI_PASS_THROUGH_DIRECT.Length be filled exactly?
The documentation confused me (please read my original post again).


Elias

The documentation is wrong. The Length member must be set to sizeof
(SCSI_PASS_THROUGH).
Read the SPTI sample in the DDK and do what it does.
Jerry.

“lallous”
Sent by: xxxxx@lists.osr.com
07/26/2006 07:17 AM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
Re:[ntdev] Question about SCSI_PASS_THROUGH_DIRECT documentation

Hello Ian,

I don’t feel my question was answered or I didn’t get you:

“ian blake” wrote in message news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello
>>
>> The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
>> "Contains the sum of the length of the SCSI_PASS_THROUGH structure and
>> the
>> lengths of the accompanying data and request sense buffers. "
>>
>> However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
>> sizeof(sense_buffer) and issue the DeviceIoControl, I get this error:
>> 1306 =
>>
>> Indicates two revision levels are incompatible.
>>
>> If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call to
>> DeviceIoControl works.
>>
>> Please advise.
>
> The input buffer should be the size of SCSI_PASS_THROUGH(_DIRECT). The
> output buffer should be larger to accomodate sense and data.
>

What should the SCSI_PASS_THROUGH_DIRECT.Length be filled exactly?
The documentation confused me (please read my original post again).


Elias


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Quoting lallous :

> Hello Ian,
>
> I don’t feel my question was answered or I didn’t get you:
>

Sorry I misread the original post the .Length field is always
sizeof(SCSI_PASS_THROUGH{_DIRECT})

“ian blake” wrote in message news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello Ian,
>>
>> I don’t feel my question was answered or I didn’t get you:
>>
>
> Sorry I misread the original post the .Length field is always
> sizeof(SCSI_PASS_THROUGH{_DIRECT})
>

Fine, but the documentation says otherwise:

The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
"Contains the sum of the length of the SCSI_PASS_THROUGH structure and the
lengths of the accompanying data and request sense buffers. "

How should one interpret that?


Elias

I would probably interpret it as an indication that the documentation is
wrong :slight_smile:

IIRC the Length field is used for a version check, so it needs to be a
fixed size and not vary depending on how big the data and sense info
buffers are.

If setting .Length to sizeof(SCSI_PASS_THROUGH[_DIRECT]) works then use
it.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of lallous
Sent: Wednesday, July 26, 2006 11:15 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:Question about SCSI_PASS_THROUGH_DIRECT
documentation

“ian blake” wrote in message
news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello Ian,
>>
>> I don’t feel my question was answered or I didn’t get you:
>>
>
> Sorry I misread the original post the .Length field is always
> sizeof(SCSI_PASS_THROUGH{_DIRECT})
>

Fine, but the documentation says otherwise:

The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
"Contains the sum of the length of the SCSI_PASS_THROUGH structure and
the lengths of the accompanying data and request sense buffers. "

How should one interpret that?


Elias


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Sorry about that. I think I filed a bug on this a few weeks ago but will
make sure. I wonder if the documentation has been wrong for all these
years…

-----Original Message-----
From: xxxxx@attotech.com [mailto:xxxxx@attotech.com]
Sent: Wednesday, July 26, 2006 5:23 AM
Subject: Re:Question about SCSI_PASS_THROUGH_DIRECT documentation

The documentation is wrong. The Length member must be set to sizeof
(SCSI_PASS_THROUGH).
Read the SPTI sample in the DDK and do what it does.
Jerry.

“lallous”
Sent by: xxxxx@lists.osr.com
07/26/2006 07:17 AM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
Re:[ntdev] Question about SCSI_PASS_THROUGH_DIRECT documentation

Hello Ian,

I don’t feel my question was answered or I didn’t get you:

“ian blake” wrote in message
news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello
>>
>> The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
>> "Contains the sum of the length of the SCSI_PASS_THROUGH structure
and
>> the
>> lengths of the accompanying data and request sense buffers. "
>>
>> However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
>> sizeof(sense_buffer) and issue the DeviceIoControl, I get this error:

>> 1306 =
>>
>> Indicates two revision levels are incompatible.
>>
>> If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call
to
>> DeviceIoControl works.
>>
>> Please advise.
>
> The input buffer should be the size of SCSI_PASS_THROUGH(_DIRECT).
The
> output buffer should be larger to accomodate sense and data.
>

What should the SCSI_PASS_THROUGH_DIRECT.Length be filled exactly?
The documentation confused me (please read my original post again).


Elias


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Jeff,

I think that one’s finally fixed, along with a few others. Googling for
SCSI_PASS_THROUGH and SCSI_PASS_THROUGH_DIRECT found the following URLs:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/Storage_r/hh/Storage_r/structs-scsibus_6d017ae1-d61d-49b8-bfaf-b6b15341732b.xml.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/Storage_r/hh/Storage_r/structs-scsibus_64c46eef-e5bc-4e81-a479-2bdbd93605e7.xml.asp

Both of them appear to have all the bugs that I’ve filed (_DIRECT.DataIn
member direction was inverted), plus the one Elias is complaining about,
corrected.

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

“Jeff Goldner”
Sent by: xxxxx@lists.osr.com
No Phone Info Available
07/27/2006 08:14 AM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
RE:[ntdev] Question about SCSI_PASS_THROUGH_DIRECT documentation

Sorry about that. I think I filed a bug on this a few weeks ago but will
make sure. I wonder if the documentation has been wrong for all these
years…

-----Original Message-----
From: xxxxx@attotech.com [mailto:xxxxx@attotech.com]
Sent: Wednesday, July 26, 2006 5:23 AM
Subject: Re:Question about SCSI_PASS_THROUGH_DIRECT documentation

The documentation is wrong. The Length member must be set to sizeof
(SCSI_PASS_THROUGH).
Read the SPTI sample in the DDK and do what it does.
Jerry.

“lallous”
Sent by: xxxxx@lists.osr.com
07/26/2006 07:17 AM
Please respond to
“Windows System Software Devs Interest List”

To
“Windows System Software Devs Interest List”
cc

Subject
Re:[ntdev] Question about SCSI_PASS_THROUGH_DIRECT documentation

Hello Ian,

I don’t feel my question was answered or I didn’t get you:

“ian blake” wrote in message
news:xxxxx@ntdev…
> Quoting lallous :
>
>> Hello
>>
>> The documentation says that SCSI_PASS_THROUGH_DIRECT.Length:
>> "Contains the sum of the length of the SCSI_PASS_THROUGH structure
and
>> the
>> lengths of the accompanying data and request sense buffers. "
>>
>> However, if I set the Length to sizeof(SCSI_PASS_THROUGH) +
>> sizeof(sense_buffer) and issue the DeviceIoControl, I get this error:

>> 1306 =
>>
>> Indicates two revision levels are incompatible.
>>
>> If the length is set to only sizeof(SCSI_PASS_THROUGH) then the call
to
>> DeviceIoControl works.
>>
>> Please advise.
>
> The input buffer should be the size of SCSI_PASS_THROUGH(_DIRECT).
The
> output buffer should be larger to accomodate sense and data.
>

What should the SCSI_PASS_THROUGH_DIRECT.Length be filled exactly?
The documentation confused me (please read my original post again).


Elias


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer