accessing scsiport/ataport without going through the class driver;

This is purely for experimental/learning purpose.

Is it possible to send requests directly to the disk PDO enumerated by scsiport/ataport drivers without going through the class driver? I’m sending irps (with embedded SRBs) from my disk upper filter driver to the ataport driver but I 'm getting SRB_STATUS_INVALID_REQUEST in the srb status and STATUS_INVALID_DEVICE_REQUEST as the returned status of IoCallDriver. I borrowed the irp building code from the WDK class driver (xferpkt.c). Thanks.

Scsi passthrough is supported from user mode. Otherwise you have to be
send srbs from below the class driver. What are you trying to do that
requires violating the storage stack design?

On Friday, August 28, 2009, wrote:
> This is purely for experimental/learning purpose.
>
> Is it possible to send requests directly to the disk PDO enumerated by scsiport/ataport drivers without going through the class driver? I’m sending irps (with embedded SRBs) from my disk upper filter driver to the ataport driver but I 'm getting SRB_STATUS_INVALID_REQUEST in the srb status and STATUS_INVALID_DEVICE_REQUEST as the returned status of IoCallDriver. I borrowed the irp building code from the WDK class driver (xferpkt.c). Thanks.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

I 'm trying to mimic the behavior of the class driver without writing a whole new driver. I was just trying if I can send read/write SRBs to the port driver. I tried sending SRBs (jsut the way class driver does) to the disk PDO enumerated by the port driver but no luck.

Good advice was already given. Part of your experimental/learning experience should be that exploring hacks is an avoidable waste of time when clean, easy, and supported ways are right in front of you. For an upper filter use SCSI pass through. If you must send SRBs, though doubtful you have even the slightest need to do this, then simply switch to a lower filter.

>Is it possible to send requests directly to the disk PDO enumerated by scsiport/ataport drivers without >going through the class driver? I’m sending irps (with embedded SRBs) from my disk upper filter >driver to the ataport driver but I 'm getting SRB_STATUS_INVALID_REQUEST in the srb status and >STATUS_INVALID_DEVICE_REQUEST as the returned status of IoCallDriver. I borrowed the irp >building code from the WDK class driver (xferpkt.c). Thanks.
I believe a class driver returns this status. In fact, the class driver builds SRB and embeds it into Irp. Sending such Irp from upper filter confuses the class driver.

If you must send SRBs, though doubtful you have even the slightest need to do this, then simply >switch to a lower filter.
Yes, it should work but what Mark suggests is more simple and easy to develop. Unless you have something different in mind.

Igor Sharovar