Query driver for list of its devices

How can I query a driver to obtain a list of all its devices and then how
I’d like to query the devices for the media they are attached.
I want to retrieve info something like Osr’s DeviceTree.

Thanks !

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com