From: Pavel A. on
"Mark McDougall" <markm(a)vl.com.au> wrote in message
news:#NIpVgC4KHA.1624(a)TK2MSFTNGP06.phx.gbl...
............
> During AddDevice() in my child device driver, I need to assign the
> symbolic name - eg. MYDEV0, MYDEV1... This, however, needs the same "port
> number" or UINumber that was assigned during enumeration - but how do I
> access this from the DeviceAdd()?

You need to decide how you determine which device is which "port number" -
such as by PCI device & function, by i/o address, etc.
The driver may see the devices in any (read: random) order.
Also, decide what to do if some devices won't show up (holes in numbering?).

-- pa


From: Mark McDougall on
Pavel A. wrote:

> You need to decide how you determine which device is which "port number" -

Got it sorted now.

The bus driver assigns the UINumber during enumeration which is stored in
the caps (and hence hardware registry).

The child driver then picks up the UINumber device property
(WdfDeviceQueryProperty) in AddDevice() and uses that to create the
symbolic link. Likewise, when it calls QueryInterface to get the physical
resources from the bus driver, it also reads the port number (again) from
the interface.

Hence the port number in the PDO matches the symbolic name of the FDO. Now
I just need to add the co-installer to change the friendly name in device
manager to also show the port number and everything will be consistent.

The enumeration is static. No missing ports. Closed system.

Thanks all!
Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266