Finding DevceObject From Scsi Address

I have a filter driver which requires to see all requests to CD Rom
devices attached to the computer.

This is mostly a straight forward device filter. User/Higher driver
opens CDRom makes request. I am inserted lower down and have my
wicked way with the IRP.

Unfortunately this is not the only way requests are sent to a CD Rom
many programs (usually via ASPI) send the requests to the SCSI/ATAPI
controller device. So I filter this stream also. So far so good. But
I want to relate this request to the CD Rom DeviceObject.

I know some information via IOCTL_GET_SCSI_ADDRESS about the scsi
addressing of the CDRom device but this is not enough to identify the
cdrom from and SRB.

In a system with A CD rom drive on the slave of the primary and
secondary ide controller (Not that uncommon). Then the scsi address
would be
Port Number = 0 PathId = 0 Target = 1 Lun = 0
Port Number = 1 ParhId = 0 Target = 1 Lun = 0

The portnumber clearly differentiates between them. You can see that
PathId Target and Lun are the same. The Portnumber is not available
in a SRB

So I have PathId, TargetId, Lun and the DeviceObject of the
Controller.

How can I uniquely relate this to the target CDRom DeviceObject

Thankyou


This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email