SCSI Port Filter driver

I have a basic filter driver that attaches to all ScsiPortX devices on my
system. It handles IRP_MJ_WRITE, IRP_MJ_READ, IRP_MJ_DEVICE_CONTROL,
IRP_MJ_CLEANUP, IRP_MJ_QUERY_INFORMATION, IRP_MJ_SET_INFORMATION,
IRP_MJ_FLUSH_BUFFERS, IRP_MJ_SCSI, IRP_MJ_CREATE & IRP_MJ_CLOSE.

It loads at boot time just ahead of the disk class driver. When the system
boots, I see lots of calls to my driver, mostly,
IOCTL_SCSI_GET_INQUIRY_DATA. I presume these are made by the disk class
driver as it discovers and creates devices for all partitions on all disks.
After that, I see no more IRPs even though I am able to successfully read
& write files on the disks being filtered. Any ideas why?

Thanks,
Ric

SCSIPORT itself only supports create, close, device control, and SCSI.
The others are unnecessary. Higher level reads and writes are converted
into SRBs issues via IRP_MJ_SCSI.

You could take a look at the device layering in DeviceTree (from OSR).
Make sure you’re attached the way you think.

Also, the first IRP_MJ_SCSI IRP the class driver sends will contain an
SRB with function SRB_FUNCTION_CLAIM_DEVICE. The DDK says about class
drivers:

On return from a successful call to the system port driver, the
ClaimDevice routine checks the SRB’s DataBuffer for a nonNULL
pointer to the port driver’s device object for the HBA.

The class driver must store such a returned pointer in the device
extension of its own device object that represents the newly
claimed device. The class driver must use this HBA-specific device
object pointer in all subsequent requests that the class driver
sends
down to the port-miniport driver pair.

This means the class driver is going to use the returned device object
pointer for subsequent calls to IoCallDriver() when it wants to send
SCSI commands. It will bypass your filter unless your filter catches
the completion of this initial SCSI (Claim) IRP and puts its own filter
device object pointer in the data buffer. So … are you SURE you’re
not seeing that first SCSI IRP?


Dave Cox
Hewlett-Packard Co.
HPSO/SSMO (Santa Barbara)
https://ecardfile.com/id/Dave+Cox

-----Original Message-----
From: xxxxx@huntconsulting.com [mailto:xxxxx@huntconsulting.com]
Sent: Tuesday, March 28, 2000 1:38 PM
To: File Systems Developers
Subject: [ntfsd] SCSI Port Filter driver

I have a basic filter driver that attaches to all ScsiPortX devices on my
system. It handles IRP_MJ_WRITE, IRP_MJ_READ, IRP_MJ_DEVICE_CONTROL,
IRP_MJ_CLEANUP, IRP_MJ_QUERY_INFORMATION, IRP_MJ_SET_INFORMATION,
IRP_MJ_FLUSH_BUFFERS, IRP_MJ_SCSI, IRP_MJ_CREATE & IRP_MJ_CLOSE.

It loads at boot time just ahead of the disk class driver. When the system
boots, I see lots of calls to my driver, mostly,
IOCTL_SCSI_GET_INQUIRY_DATA. I presume these are made by the disk class
driver as it discovers and creates devices for all partitions on all disks.
After that, I see no more IRPs even though I am able to successfully read
& write files on the disks being filtered. Any ideas why?

Thanks,
Ric


You are currently subscribed to ntfsd as: david_cox2@hp.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)