Send DeviceIoControl to a PDO

Hi folks,

In my design, there is a PCI device driver which used to enumerate some
virtual block devices. A scsi miniport driver will service there block
devices. In FindAdapter routine of scsi miniport driver, I can use
IoGetDeviceInterfaces -> IoGetDeviceObjectPointer ->
IoBuildDeviceIoControlRequest -> IoCallDriver to send a DeviceIoControl
to PCI driver’s FDO. But when I try to send a DeviceIoControl to PCI
driver’s PDO using the same approach. IoGetDeviceObjectPointer will
return failed. In PCI device driver, I register and setup interface in
PDO START_DEVICE routine. Any idea?

Best regards, Wayne

If you wrote yourself a storport miniport instead of a scsiport miniport
you could call StorPortGetDeviceObjects which would return you the PDO
for the virtual miniport. You will then have a device object pointer to
your PDO. IoGetDeviceObjectPointer is going to return “a pointer to the
top object in the named device object’s stack” - that would be your
miniport FDO owned by scsiport and your miniport, not the PDO.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Wayne Gong
Sent: Monday, September 08, 2008 2:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Send DeviceIoControl to a PDO

Hi folks,

In my design, there is a PCI device driver which used to enumerate some
virtual block devices. A scsi miniport driver will service there block
devices. In FindAdapter routine of scsi miniport driver, I can use
IoGetDeviceInterfaces -> IoGetDeviceObjectPointer ->
IoBuildDeviceIoControlRequest -> IoCallDriver to send a DeviceIoControl
to PCI driver’s FDO. But when I try to send a DeviceIoControl to PCI
driver’s PDO using the same approach. IoGetDeviceObjectPointer will
return failed. In PCI device driver, I register and setup interface in
PDO START_DEVICE routine. Any idea?

Best regards, Wayne


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