Discussion:
HalGetBusData
(too old to reply)
d***@gmail.com
2008-08-19 13:00:20 UTC
Permalink
Hi

In WDF driver, i want to read all pci devices configuration space in
system. In WDM, we can use HalGetBusData function. But in WDF, shall
we use the same one.

If anyone have a snippet for above case (WDM or WDF) , also give it.

Thanks in advance.

Regards - Dsrking
Manish
2008-08-19 13:14:02 UTC
Permalink
HalGetBusData is obselete. You can use IRP_MN_READ_CONFIG of IRP_MJ_PNP in
WDM and corrosponding in WDF too.

-Manish
Post by d***@gmail.com
Hi
In WDF driver, i want to read all pci devices configuration space in
system. In WDM, we can use HalGetBusData function. But in WDF, shall
we use the same one.
If anyone have a snippet for above case (WDM or WDF) , also give it.
Thanks in advance.
Regards - Dsrking
Tim Roberts
2008-08-20 05:09:46 UTC
Permalink
Post by Manish
HalGetBusData is obselete. You can use IRP_MN_READ_CONFIG of IRP_MJ_PNP in
WDM and corrosponding in WDF too.
That only lets you read your OWN configuration space. The OP asked to read
ALL configuration spaces.

There are very few good reasons for doing so, which is why there are very
few good ways of doing it.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Manish
2008-08-20 07:12:20 UTC
Permalink
I don't know any other way to access ALL configuration space except writing
bus filter driver and use bus interface to call GetBusData . If there are
any other ways please let me know.

Thanks
Manish
Post by Tim Roberts
Post by Manish
HalGetBusData is obselete. You can use IRP_MN_READ_CONFIG of IRP_MJ_PNP in
WDM and corrosponding in WDF too.
That only lets you read your OWN configuration space. The OP asked to read
ALL configuration spaces.
There are very few good reasons for doing so, which is why there are very
few good ways of doing it.
--
Providenza & Boekelheide, Inc.
d***@gmail.com
2008-08-21 06:00:36 UTC
Permalink
Hi

Thanks for info.

Finally, I read pci configuration info. for all pci devices using
HalGetBusData function by changing only
busnumber,devicenumber,function number in WDM and also WDF.

Thanks
Dsrking.
d***@gmail.com
2008-08-21 06:27:38 UTC
Permalink
Hi

I have one more problem in reading pci config - Base Address value ...
I give PCI_TYPE0_ADDRESSES= 0 for accessing BaseAddresses. But it
doesnt read correct value what i am seeing in Resources in Device
Manager. But it is work fine for other pci devices. Anyone have idea
in this?

Thanks in Advance.
Dsrking.
Don Burn
2008-08-21 12:46:47 UTC
Permalink
Just be aware as we pointed out, that this is an obsolete interface and
could be gone tommorrow.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
Post by d***@gmail.com
Hi
Thanks for info.
Finally, I read pci configuration info. for all pci devices using
HalGetBusData function by changing only
busnumber,devicenumber,function number in WDM and also WDF.
Thanks
Dsrking.
Don Burn
2008-08-19 13:12:42 UTC
Permalink
Actually, you should not be using it in WDM it is obsolete. Unfortunately
there is no good replacement for it. Look at the white paper at
http://www.hollistech.com/ called "Replacing HalGetBusData in Windows 2000".
The only blessed approach would be to have a PCI bus filter that collects
all this data and then provides an interface to retrieve it.

But within the limits that the routine could go away at anytime, you can use
HalGetBus data in WDF, in fact you can use any WDM call in WDF.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
Post by d***@gmail.com
Hi
In WDF driver, i want to read all pci devices configuration space in
system. In WDM, we can use HalGetBusData function. But in WDF, shall
we use the same one.
If anyone have a snippet for above case (WDM or WDF) , also give it.
Thanks in advance.
Regards - Dsrking
dsrking
2008-08-21 13:27:01 UTC
Permalink
Ya ...
Post by Don Burn
The only blessed approach would be to have a PCI bus filter that collects
all this data and then provides an interface to retrieve it.
Do you have any code snippet for PCI bus filter driver ?( I think it is for
only our specified device ... Is it?)

Is it possible to get configuration details of all pci devices present in
system using PCI bus filter driver?

Regards - Dsrking.
Don Burn
2008-08-21 13:34:54 UTC
Permalink
No I have no snippet of code that I will share. The PCI bus filter is
installed over the system's PCI bus controller(s) and then can attach itself
to all devices as they apprear.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
Post by dsrking
Ya ...
Post by Don Burn
The only blessed approach would be to have a PCI bus filter that collects
all this data and then provides an interface to retrieve it.
Do you have any code snippet for PCI bus filter driver ?( I think it is for
only our specified device ... Is it?)
Is it possible to get configuration details of all pci devices present in
system using PCI bus filter driver?
Regards - Dsrking.
Loading...