How to walk device tree ?

Hello,
I know how to walk device tree from user mode application ("SetupDi..." and
"CM_Get_..." functions). How can inspect this tree from my driver code ?

I found at
http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/
windows2000/techinfo/reskit/en-us/prork/prdh_dmt_ilhl.asp
that "The Windows 2000 Professional device tree is a record of the devices
currently loaded, based on the configuration information in the registry.
The device tree is created in random access memory (RAM) each time the
system is started or whenever a dynamic change occurs to the system
configuration"

Does anyone know how to find and decode this record in RAM.

Thanks,
Michael Videlgauz

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003

Michael Videlgauz wrote:

I know how to walk device tree from user mode application (“SetupDi…” and
“CM_Get_…” functions). How can inspect this tree from my driver code ?

What are you trying to do for which you think this is the solution?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

Hello Michael,

If you have XP DDK you can see the example in the WXP DDK and the
DDK\src\setup\devcon directory.
And especially the devcon.cpp and the EnumerateDevices() function.
For example use

devs = SetupDiGetClassDevsEx(NULL,NULL,NULL,DIGCF_ALLCLASSES|DIGCF_PRESENT,NULL, NULL);
and then for all found devices call SetupDiEnumDeviceInfo(devs, Index, &devinfo)

That is all.

Irina

MV> I know how to walk device tree from user mode application (“SetupDi…” and
MV> “CM_Get_…” functions). How can inspect this tree from my driver code ?

MV> I found at
MV> http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/
MV> windows2000/techinfo/reskit/en-us/prork/prdh_dmt_ilhl.asp
MV> that “The Windows 2000 Professional device tree is a record of the devices
MV> currently loaded, based on the configuration information in the registry.
MV> The device tree is created in random access memory (RAM) each time the
MV> system is started or whenever a dynamic change occurs to the system
MV> configuration”

MV> Does anyone know how to find and decode this record in RAM.

Irina
mailto:xxxxx@comtv.ru

> Michael Videlgauz wrote:

> I know how to walk device tree from user mode application (“SetupDi…” and
> “CM_Get_…” functions). How can inspect this tree from my driver code ?

What are you trying to do for which you think this is the solution?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

Reason N 1: I am curious about it.
Reason N 2: I have daemon-tools installed. I see in “Device Manager” (view
“by connection”) that real CD drives appear under “PCI bus” brunch (“IDE
controller” - “… IDE channel” or “… SCSI card”) and emulated one
appears under “BIOS extension” brunch. I know this can be changed in
future versions of daemon tools, but now this is one quick way to
distinguish between real hardware and emulated CD drives

Michael

Hello Irina,
Thanks for your respond.
As I mentioned in my question I know about “SetupDi…” API available for
user mode application, but I am interested in doing it in kernel mode
driver. Devcon is user mode application.
Do you mean that by including appropriate *.h files and linking to
appropriate import library I can get that API also in kernel - mode driver
?

Thanks
Michael

Hello Michael,

If you have XP DDK you can see the example in the WXP DDK and the
DDK\src\setup\devcon directory.
And especially the devcon.cpp and the EnumerateDevices() function.
For example use

devs = SetupDiGetClassDevsEx(NULL,NULL,NULL,DIGCF_ALLCLASSES|DIGCF_PRESENT,NULL, NULL);
and then for all found devices call SetupDiEnumDeviceInfo(devs, Index, &devinfo)

That is all.

Irina

MV> I know how to walk device tree from user mode application (“SetupDi…” and
MV> “CM_Get_…” functions). How can inspect this tree from my driver code ?

MV> I found at
MV> http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/
MV> windows2000/techinfo/reskit/en-us/prork/prdh_dmt_ilhl.asp
MV> that “The Windows 2000 Professional device tree is a record of the devices
MV> currently loaded, based on the configuration information in the registry.
MV> The device tree is created in random access memory (RAM) each time the
MV> system is started or whenever a dynamic change occurs to the system
MV> configuration”

MV> Does anyone know how to find and decode this record in RAM.

Irina
mailto:xxxxx@comtv.ru

The 2nd test answer.

Hello,
I know how to walk device tree from user mode application (“SetupDi…” and
“CM_Get_…” functions). How can inspect this tree from my driver code ?

I found at
http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/
windows2000/techinfo/reskit/en-us/prork/prdh_dmt_ilhl.asp
that “The Windows 2000 Professional device tree is a record of the devices
currently loaded, based on the configuration information in the registry.
The device tree is created in random access memory (RAM) each time the
system is started or whenever a dynamic change occurs to the system
configuration”

Does anyone know how to find and decode this record in RAM.

Thanks,
Michael Videlgauz

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003

> As I mentioned in my question I know about “SetupDi…” API
available for

user mode application, but I am interested in doing it in kernel
mode
driver.

And what is your purpose? maybe it would be better to handle this in
an accompanying user app?

Max