how the PnpManager handle multile device of the same type

Hello everyone.I would like to know how the PnpManager dispatch the irp to a lower driver.

I’m talking about the widcomm driver i have mutliple usb key dongle connected to my PC.
When you connect the key you have two drivers loading. The BTKRNL one whois the bluetooth bus enumerator. and for each device connected you BTWUSB (named BTWUSB-0… BTWUSB-1… and so on…) one device is created for each dongle.

When i inspected with windbg i saw that’s the BTKRNL is attached to the PnpManager. and the BTWUSB one is connected the usbhub. so my questions How the PnpManager select wich BTWUSB Devices it will use ? i mean when the IRP goes down to the driver stacks which device will be selected ?

Does the PnpManger dispatch it between the devices by magic :slight_smile: ?

i have read the ddk docs and i cant see anything about this case. if it’s not dispatching by itself could you give me idea for doing this ? i would love to use more then one bluetooth dongles at a time.

Else… do you know who we can track down a irp ? so i could check how it’s working on my system :>

xxxxx@hotmail.com wrote:

Hello everyone.I would like to know how the PnpManager dispatch the irp to a lower driver.

I’m talking about the widcomm driver i have mutliple usb key dongle connected to my PC.
When you connect the key you have two drivers loading. The BTKRNL one whois the bluetooth bus enumerator. and for each device connected you BTWUSB (named BTWUSB-0… BTWUSB-1… and so on…) one device is created for each dongle.

When i inspected with windbg i saw that’s the BTKRNL is attached to the PnpManager. and the BTWUSB one is connected the usbhub. so my questions How the PnpManager select wich BTWUSB Devices it will use ? i mean when the IRP goes down to the driver stacks which device will be selected ?

Every driver has only one parent. So, when an IRP goes to a lower
driver, there is no question about the ownership. I assume (without
knowing) that usbhub devices are then connected to BTKRNL, which sends
out to Bluetooth instead of USB. So, the device tree is something like
this:

Storage Storage Storage
| | |
BTWUSB-0 BTWUSB-1 BTWUSB-2
___________|__________/
|
usbhub
|
btkrnl

So, top-level requests for a particular partition go to the appropriate
BTWUSB driver because the system knows the mapping. After that, there’s
only one path to take downward.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>How the PnpManager select wich BTWUSB Devices it will use ?

Looks like BTWUSB registers a device interface of “Bluetooth host controller”,
and BTKRNL is listening for such registrations.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com