How I send a irp to a port driver directly?

  • Thread starter Thread starter zhangjf
  • Start date Start date
Z

zhangjf

I want send a irp to read a sector from cdrom. I want to bypass the layered
driver architecture of windowsXP and directly send irp to port driver.

Who can help me?
 
Let me state this in another way. Use IoGetDeviceObjectPointer to get
the top device object and use IoCallDriver to send your IRP down the
stack which eventually will be handled by the port driver. Will that
work? If not, what is the problem?
 
If you want really low level, you could use DeviceIoControl with
IOCTL_SCSI_PASS_THROUGH. See the SPTI example in the DDK which is an
application, not a driver and it works with SCSI, ATAPI, USB, and
FireWire interfaces. The legacy way to get a handle is to call
CreateFile on a device name like "CdRom0". The new way is to discover
CD-ROM devices using the Setup API's to enumerate them.
 
FireWire interfaces. The legacy way to get a handle is to call
CreateFile on a device name like "CdRom0".

Drive letter is also fine in the \\.\D: form.
 
Now I do as what you said. But the catpure result of "BusTrace 2002
Professinal" show that the irp was generated as a SCSI Pass Through command
by "cdfs.sys". I want the irp was sent dorectly to the port driver,
bypassing the layered driver architecture of windows.
 
You cannot bypass CDFS at all. The IRP will be routed through it anyway.

Passthru just means that these layers - CDFS/CDROM - does not participate
in CDB creation, the CDB will be exactly as built by your app.
 
It uses unstable hacks.

People who are concerned about stability of their computers do not use this
software, they use Nero instead.
 
Back
Top