This is a multi-part message in MIME format.

------=_NextPart_000_0061_01C5B72C.64B73720
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

I'm trying to use IOCTL_SCSI_PASS_THROUGH_DIRECT, but I don't understand =
how SCSI_PASS_THROUGH_DIRECT works.

In SCSI_PASS_THROUGH_DIRECT, there is a PVOID DataBuffer for the data =
transfer, but for the request-sense buffer there is an offset. I =
understand that approach in SCSI_PASS_THROUGH_WITH_BUFFERS, but I don't =
understand how can I set SenseInfoOffset.

TIA

Jesus Guinda (jesusg@removethis.naemas.com)
------=_NextPart_000_0061_01C5B72C.64B73720
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>I'm trying to use=20
IOCTL_SCSI_PASS_THROUGH_DIRECT, but I don't understand how=20
SCSI_PASS_THROUGH_DIRECT works.</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>In <FONT =
size=3D2>SCSI_PASS_THROUGH_DIRECT,=20
there is a <FONT size=3D2>PVOID DataBuffer for the data transfer, but =
for the=20
request-sense buffer there is an offset. I understand that approach in =
<FONT=20
size=3D2>SCSI_PASS_THROUGH_WITH_BUFFERS, but I don't understand how can =
I set=20
<FONT size=3D2>SenseInfoOffset.</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>TIA</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>Jesus Guinda (</FONT><FONT=20
face=3D"Trebuchet MS" size=3D2><A=20
href=3D"mailto:jesusg@removethis.naemas.com">jesusg@removethis.naemas.com=
</A>)</FONT></DIV></BODY></HTML>

------=_NextPart_000_0061_01C5B72C.64B73720--

Re: Help with IOCTL_SCSI_PASS_THROUGH_DIRECT by heinz

heinz
Mon Sep 12 02:57:21 CDT 2005

Use the spti example in the DDK as a basis. It is advisable to always
use the indirect ioctl and never direct. This is because there are some
nasty blue screen scenarios you can run into with the direct ioctl.
Search the microsoft knowledgebase if you really want to know about
them. And by the way, SenseInfoOffset works identically in the
direct/indirect form--it's an offset into the structure.


Re: Help with IOCTL_SCSI_PASS_THROUGH_DIRECT by Jesus

Jesus
Mon Sep 12 12:49:07 CDT 2005

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C5B7D3.09388A50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks, heinz, but ...

I've taken my code from spti sample, but it shows only _WITH_BUFFERS.=20

My problem is that the ammount of data I need to transfer is grater than =
the buffer size (512 bytes).

The KB does not have any info about this...

And my problem with SenseInfoOffset is that in the '_WITH_BUFFERS' =
structure I can calculate (with spti sample code) the offset from the =
beginning of the SCSI_PASS_THROUGH_WITH_BUFFERS structure to the =
SenseBuf member (the same way I do with DataBufferOffset and DataBuf), =
but the SCSI_PASS_THROUGH_DIRECT structure has a DataBuffer pointer (ok, =
I know the blahblah about user mode memory) but instead of a =
'SenseBuffer' pointer it has an offset... How do I calculate it?=20

------------------------------------------

While I was writting the above text, I've discovered my mistake.

I've supposed that the _SCSI_PASS_THROUGH_WITH_BUFFERS struct came from =
the standard scsi headers, but it came from the spti code, so the buffer =
size problem does not exists :)

spti.h includes a _SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER struct with an =
ucSenseBuf buffer, so the offset mistery is also solved :)

I think my mistake may be illustrative for somebody else, so I'm going =
to publish it as it was wroten.

Thanks again,

Jesus
-------------------------------------------------------------------
"heinz" <heinz_baer@my-deja.com> wrote in message =
news:1126511841.432315.120560@g14g2000cwa.googlegroups.com...
| Use the spti example in the DDK as a basis. It is advisable to always
| use the indirect ioctl and never direct. This is because there are =
some
| nasty blue screen scenarios you can run into with the direct ioctl.
| Search the microsoft knowledgebase if you really want to know about
| them. And by the way, SenseInfoOffset works identically in the
| direct/indirect form--it's an offset into the structure.
|
------=_NextPart_000_000B_01C5B7D3.09388A50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>Thanks, heinz, but =
...</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>I've taken my code from spti =
sample, but=20
it shows only _WITH_BUFFERS. </FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>My problem is that the ammount =
of data I=20
need to transfer is grater than the buffer size (512 =
bytes).</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>The KB does not have any info =
about=20
this...</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>And my problem with =
SenseInfoOffset is=20
that in the '_WITH_BUFFERS' structure I can calculate (with spti sample =
code)=20
the offset from the beginning of the SCSI_PASS_THROUGH_WITH_BUFFERS =
structure to=20
the SenseBuf member (the same way I do with DataBufferOffset and =
DataBuf), but=20
the SCSI_PASS_THROUGH_DIRECT structure has a DataBuffer pointer (ok, I =
know the=20
blahblah about user mode memory) but instead of a 'SenseBuffer' pointer =
it has=20
an offset... How do I calculate it? </FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS"=20
size=3D2>------------------------------------------</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>While I was writting the above =
text, I've=20
discovered my mistake.</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>I've supposed that the=20
_SCSI_PASS_THROUGH_WITH_BUFFERS struct came from the standard scsi =
headers, but=20
it came from the spti code, so the buffer size problem does not exists=20
:)</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>spti.h includes a=20
_SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER struct with an ucSenseBuf buffer, =
so the=20
offset mistery is also solved :)</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>I think my mistake may be =
illustrative for=20
somebody else, so I'm going to publish it as it was wroten.</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2>Thanks again,</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" =
size=3D2><STRONG>Jesus</STRONG></FONT></DIV>
<DIV><FONT face=3DVerdana=20
size=3D2>----------------------------------------------------------------=
---</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2>"heinz" &lt;</FONT><A=20
href=3D"mailto:heinz_baer@my-deja.com"><FONT face=3DVerdana=20
size=3D2>heinz_baer@my-deja.com</FONT></A><FONT face=3DVerdana =
size=3D2>&gt; wrote in=20
message </FONT><A=20
href=3D"news:1126511841.432315.120560@g14g2000cwa.googlegroups.com"><FONT=
=20
face=3DVerdana=20
size=3D2>news:1126511841.432315.120560@g14g2000cwa.googlegroups.com</FONT=
></A><FONT=20
face=3DVerdana size=3D2>...</FONT></DIV><FONT face=3DVerdana size=3D2>| =
Use the spti=20
example in the DDK as a basis. It is advisable to always<BR>| use the =
indirect=20
ioctl and never direct. This is because there are some<BR>| nasty blue =
screen=20
scenarios you can run into with the direct ioctl.<BR>| Search the =
microsoft=20
knowledgebase if you really want to know about<BR>| them. And by the =
way,=20
SenseInfoOffset works identically in the<BR>| direct/indirect form--it's =
an=20
offset into the structure.<BR>|</FONT></BODY></HTML>

------=_NextPart_000_000B_01C5B7D3.09388A50--