First, I’m trying to write arbitrary CDBs to SCSI devices (don’t worry, this
is a lab diagnostic/test app, it won’t ever end up on your customer’s
systems to cause the problems obvious and subtle this approach makes
trivial) at a queue depth greater than 1 (one) on Win2K/XP, so I’ve given up
on SPTI for the reason that SPTI is serialized in SCSIPORT, to the effect
that I will never see a queue. Am I right about that?
So I’m thinking an upper SCSI class filter instead, with a couple of
approaches. One would be to change the Inquiry data, so it doesn’t appear
to the system as a recognized device, and then add a class driver for the
new device type, which is nothing more than a front end to the diag app.
The second would be to create a named DO on the filter, and have the app
open that handle. The second way seems simpler, but less elegant, and opens
a potential BSOD if there is a recognized FS on the device under test, and
the user forgets to remove the volume before making changes to the media
that the fs driver doesn’t know about. So my inclination is to do it with a
custom device type in inquiry, with matching class driver. Anyone see any
holes in my logic? I won’t be surprised to find really big ones, though I
will certainly be grateful to the person who points them out.
Either way I go, I have to start with the filter. I’d prefer to buy one as
a starting point, but “Penny-wise, pound-foolish” is descriptive of my
operating environment right now. Having seen some discussion of SCSI upper
filters recently, I am trying to implement it the way Mark and PeterWie
suggested, which is to really attach as a lower filter to the PDOs for each
device on the SCSI bus. I’m looking at DeviceTree with Mark’s htsScsiView
filter loaded, and I can see where I need to plug into the stack. After
reading all the references to this I can find anywhere, including on the old
NTDEV archive, I believe I need to do this in
DispatchPnp->IRP_MN_QUERY_DEVICE_RELATIONS for
Irpstack->Parameters.QueryDeviceRelations.Type == BusRelations?. Am I
correct in this belief? I don’t get AddDevice calls for anything except the
SCSI bus FDO, which isn’t much use, of course.
What else do I need to know about this? If I’m inserting myself into the
device stack on IRP_MN_QUERY_DEVICE_RELATIONS, I need to take myself out on
IRP_MN_REMOVE, right? Any other considerations?
Thanks,
Phil
–
Philip D. Barila
Seagate Technology, LLC
(720) 684-1842