Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get driver info of a PCI device

2 views
Skip to first unread message

2B

unread,
Nov 30, 2004, 2:45:45 PM11/30/04
to
Hello,
After scanning the pci bus, I can get a list of all cPCI devices with the
information on location ( bus number, device number, function number, vendor
id, device id ). With those information, how can I get the information of
the drivers that those cPCI devices are using ?
Thank you.


Pavel A.

unread,
Nov 30, 2004, 5:15:04 PM11/30/04
to
For which operating system?

"2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

Arkady Frenkel

unread,
Dec 1, 2004, 8:09:10 AM12/1/04
to
Drivers.exe from Resource Kit or pstat.exe from Platform SDK show all
drivers in the system.
Arkady

"2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

2B

unread,
Dec 1, 2004, 10:59:08 AM12/1/04
to
Win2K.

"Pavel A." <pav...@NOwritemeNO.com> wrote in message
news:%23tsGyBz...@tk2msftngp13.phx.gbl...

2B

unread,
Dec 1, 2004, 11:01:36 AM12/1/04
to
But for my application, I am wondering if there is an window's API, or a
registry key that can give me that information, instead of an utility.

Thank you

"Arkady Frenkel" <arkadyf@hotmailxdotxcom> wrote in message
news:%23ITgke6...@tk2msftngp13.phx.gbl...

Don Burn

unread,
Dec 1, 2004, 11:25:01 AM12/1/04
to
Look at the DevCon utility source from the latest DDK. I assume you have
used HalGetBusData to scan the PCI bus for the devices, if so be aware this
is obsolete and may stop working at some point.

You may want to look at the article "Replacing HalGetBusData in Windows
2000" that is at http://www.hollistech.com/. If you approach thing this way
you will have a PCI bus driver filter, and there are other ways you can
potentially get your data.

Note: If you are directly manipulating the PCI bus ports to read the device
data (some people have tried this) you are setting the sytem up for a crash.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

"2B" <2...@hotmail.com> wrote in message news:cokpt0$sct$1...@dns3.cae.ca...

Slobodan Brcin (eMVP)

unread,
Dec 2, 2004, 2:16:27 AM12/2/04
to
Hi 2B,

Question is who is using who. Drivers PCI device or vice versa.

You can use SetupAPI functions to enumerate trough all drivers (or only the ones that interest you). Then with same set of functions
you can obtain VID, PID numbers and match them to the ones that you already have/know.

Start by examining sources from DDK of devcon utility.
First function that you will need to know is SetupDiGetClassDevs.

HTH,
Slobodan


"2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

Slobodan Brcin (eMVP)

unread,
Dec 2, 2004, 11:58:43 AM12/2/04
to
2B,

I don't know if there is something special about CompactPCI I have never used it personally.

For Step 1, What API functions do you use to do this?
Step 2. What is exactly that you want to obtain? What information's? What do you have so far that can be used to make a match to
driver?

Looking from Device Manager are the information's that you need there? If they are then look at devcon sample.

Regards,
Slobodan

"2B" <2...@hotmail.com> wrote in message news:conekg$4eh$1...@dns3.cae.ca...
> Thank you for all of suggestions.
> I realize that my question was not clear.
>
> I am writting an user application. This application does 2 things :
> 1. Enumerate all cPCI devices which are present in the PC
> 2. Get the information of the driver that those cPCI devices are using.
>
> The step #1 is done. I can now have the list of all cPCI devices with data
> on bus number, device id, ...
>
> The step #2 is stuck :)
>
> Thank you again for your help.


>
>
>
> "2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

Slobodan Brcin (eMVP)

unread,
Dec 2, 2004, 12:37:59 PM12/2/04
to
Hi 2B,

For Step 2:
You will want to plunder code from example in DDK called devcon.
First function that you will use is SetupDiGetClassDevs and it will give you handle that you will use in enumeration also it can
narow the count of devices that you are interested in, so you enumerate certain types of devices and not all devices present in
registry (you can do this also).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_8f48a4a7-e4b9-4843-aacc-88f678b4145c.xml.asp

In next step you might be interested in SetupDiEnumDeviceInfo function that you will use for actual device enumeration:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_db6730f9-381a-4da6-91b1-046fec51f270.xml.asp

For determining if this is device that you was looking for use some of following functions: CM_Get_Device_ID,
SetupDiGetDeviceRegistryProperty

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/cfgmgrfn_9b900d97-f812-412b-b12c-d64b9aba3be7.xml.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_a60fa017-1c15-45bf-a178-37516bc0aea1.xml.asp

For some additional registry access and read operation you can use:
SetupDiOpenDeviceInterfaceRegKey

You will need to enumerate all devices and to go trough list of your information's and make matches.

HTH,
Slobodan


"2B" <2...@hotmail.com> wrote in message news:coniq2$m74$1...@dns3.cae.ca...
> Hi Slobodan,
>
> For step 1, there is no windows api function providing the service. I have
> to use a virtual device driver that scans the pci bus with the function
> HalGetBusDataByOffset() and gives me the information of the existing pci
> devices.
>
> For step 2, I'd like to obtain the driver file name (
> Ex.C:\winnt\system32\drivers\el90xbc5.sys ). The one that you can get in
> Driver Details of the Device Manager tool.
>
> Thank you Slobodan.
>
>
>
> "Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message
> news:ukFof$I2EHA...@tk2msftngp13.phx.gbl...

2B

unread,
Dec 2, 2004, 2:19:12 PM12/2/04
to
Your suggestion is very helpful. Thanks a lot for your help Mr. Slobodan.
Best regards!

"Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message

news:uGNDcVJ2...@TK2MSFTNGP11.phx.gbl...

2B

unread,
Dec 2, 2004, 12:18:58 PM12/2/04
to
Hi Slobodan,

For step 1, there is no windows api function providing the service. I have
to use a virtual device driver that scans the pci bus with the function
HalGetBusDataByOffset() and gives me the information of the existing pci
devices.

For step 2, I'd like to obtain the driver file name (
Ex.C:\winnt\system32\drivers\el90xbc5.sys ). The one that you can get in
Driver Details of the Device Manager tool.

Thank you Slobodan.

"Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message
news:ukFof$I2EHA...@tk2msftngp13.phx.gbl...

2B

unread,
Dec 2, 2004, 11:07:43 AM12/2/04
to
Thank you for all of suggestions.
I realize that my question was not clear.

I am writting an user application. This application does 2 things :
1. Enumerate all cPCI devices which are present in the PC
2. Get the information of the driver that those cPCI devices are using.

The step #1 is done. I can now have the list of all cPCI devices with data


on bus number, device id, ...

The step #2 is stuck :)

Thank you again for your help.

"2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

2B

unread,
Dec 3, 2004, 4:37:02 PM12/3/04
to
Hi Slobodan,

I followed your suggestions and found the answer for my application.
Thank you very much. Your help is unforgettable.

Best regards.

"Slobodan Brcin (eMVP)" <sbr...@ptt.yu> wrote in message

news:uGNDcVJ2...@TK2MSFTNGP11.phx.gbl...

Maxim S. Shatskih

unread,
Dec 5, 2004, 12:01:45 AM12/5/04
to
Enumerate all devices for PCI bus by SetupDiGetClassDevs.

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

"2B" <2...@hotmail.com> wrote in message news:coiila$38h$1...@dns3.cae.ca...

0 new messages