IOCTL_IDE_PASS_THROUGH or IOCTL_SCSI_PASS_THROUGH

I was told by MS I could use the undocumented IOCTL_IDE_PASS_THROUGH to send ATA-5 commands to the hard drive. This works fine until I need to send a command that requires data transfer to the drive (transfer from the drive works OK).

Does anyone know how to do this?

If not, can someone help me how I can compose the CDB structure for an IDE
command when sending through IOCTL_SCSI_PASS_THROUGH? For example, how do I build the SCSI_PASS_THROUGH structure with the 7 IDE registers for command WRITE_SECTOR (0x30)

Brian,

Take a look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage/hh/
storage/k307_4x0y.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/buses/hh/bu
ses/scsi_struct_34tu.asp

I have used IOCTL_SCSI_PASS_THROUGH to talk to both IDE and SCSI devices. I
don’t think Windows really cares if the drive is actually SCSI or IDE.
Basically, you fill in a SCSI_PASS_THROUGH structure, which contains the
CDB, target ID, LUN, etc. But I think you want to make it a SCSI-style CDB
(i.e., 08 or 28 for read sectors, 0A or 2A for write sectors, etc.), not an
IDE-style CDB. Windows handles the translation to IDE commands.

If you like, I can dig up a code fragment for you.

Best regards,
-Dan

Dan Germann
xxxxx@nospam.visi.com

----- Original Message -----

Subject: IOCTL_IDE_PASS_THROUGH or IOCTL_SCSI_PASS_THROUGH
From: xxxxx@phoenix.com
Date: Thu, 7 Mar 2002 17:00:56 -0500
X-Message-Number: 19

I was told by MS I could use the undocumented IOCTL_IDE_PASS_THROUGH
to send ATA-5 commands to the hard drive. This works fine until I need
to send a command that requires data transfer to the drive (transfer
from the drive works OK).

Does anyone know how to do this?

If not, can someone help me how I can compose the CDB structure for an
IDE command when sending through IOCTL_SCSI_PASS_THROUGH? For
example, how do I build the SCSI_PASS_THROUGH structure with the 7 IDE
registers for command WRITE_SECTOR (0x30)