PCI card driver: enumeration and interfaces

PCI card driver: enumeration and interfaces

Post by JRos » Wed, 03 Mar 2004 03:39:35

Hallo, thank you for your help with my previous problems :)
I'm developing a driver for a custom PCI card which exposes some
resources. We want to hide the number of the cards from user mode, so i
wrote another driver which enumerates the real devices and routes the
requests to the appropriate device, appearing as one single big card.

I've got some problems here: when I try to enumerate the devices, I only
get the first device object, and I'm not able to obtain the other(s).
I've got two cards installed at the moment, and with Device Three i can
see both of them, but when i call IoGetDeviceInterfaces() I only get one
entry, and the device object obtained from that entry with
IoGetDeviceObjectPointer() has the NextDevice field set to null.
How can i get the full list of the devices given the class id or the hwid ?

Another thing: the two device types communicate through an interface.
The upper device opens the lower device and sends a
IRP_MN_QUERY_INTERFACE. in the lower device the request is handled
properly, and the Status field is set to STATUS success, but back in the
upper device i obtain an error in Status.
Before calling IoCallDriver i set the Status field to
STATUS_NOT_SUPPORTED and that (or whatever else i put in it) is the
value that I get back.

Thank you again for your help,


PCI card driver: enumeration and interfaces

Post by Eliyas Yak » Fri, 05 Mar 2004 15:21:13

Sorry, your description didn't make sense to me. You have two devices and
some how you made it to appear as a single card by writing a driver but then
you see two devices in the device manager. Confused.....Please restate your




PCI card driver: enumeration and interfaces

Post by Mark Rodd » Fri, 05 Mar 2004 20:43:51

OK - this is what I would call the 'mux pattern'. It is unclear how you
have configured things from a PnP perspective. Your physical devices are
declared in an inf file someplace, I assume. You have a function driver for
these physical devices, right? Have you verified with a de *** that your
function driver registers its device interface for each instance? Does your
virtual device driver register of PnP notification? If not it should,
otherwise how do you know WHEN to call IoGetDeviceInterface.

There are other ways to implement a mux by using a bus driver that I think
end up being a bit cleaner, although the bus driver part is a little on the
under-documented side.


Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032