PCI Bus access in C++ (Windows)

M

Michel Mengis

hi tere,

I'm trying to write an application which should access to the PCI Bus
headers to get all informations about installed cards.
But I dont know how to access to these informations from windows...

I read lspci.c file from a linux distribution, it seems to be not portable
to windows without cygwin...

So, where could I find some hint about how to access to these informations
???

thanks for your help,

best regards,

Michel

--
Equipe Poséidon_____________
http://poseidon.epfl.ch

Helpdesk:
Du Lundi au Jeudi de 11h à 18h
Le vendredi de 11h à 16h
local: CO 050
 
K

krbyxtrm

MIchel,
PCI cards installed in the PC using Windows are handled by the PnP
manager (Plug-and-Play). And accessing PCI configuration headers is
more of a device driver problem that a c++, but anyhow Windows has
already read those headers when the system boots up.
So instead of 'reading' in your own why not try it in the registry?
Information can be found in:
HKEY_LOCAL_MACHINE\Enum\PCI\VEN_<vendorID>&DEV_<deviceID>&SUBSYS_<subsystemID>&REV_<hardwarerevisionID>

Regards,
Krby
 
M

Michel Mengis

Krby,
I'm trying to acces to the PCI space cause I want to installed some specific
applications after windows installation. Applications like: fingerprint
software on thinkpads laptop...
But I need to know if the device is present or not..

regards,

michel.
 
K

krbyxtrm

I see, but are you detecting an specific hardware, or just seeing if
there are installed cards on the PC slots?
In either case, you can use the DevCon sample found in Windows DDK. The
sample shows how to enumerate devices such as PCI.

BTW, you can download the ddk free of charge from Microsoft.

Regards,
Krby
 
B

Ben Pope

Michel said:
Krby,
I'm trying to acces to the PCI space cause I want to installed some specific
applications after windows installation. Applications like: fingerprint
software on thinkpads laptop...
But I need to know if the device is present or not..

I suspect that will be much easier looking at the enumerated devices in
the registry, rather than poking around at the data on the bus.

Equally for linux... except perhaps I'd grep lspci output...

Anyway, this is pretty OS specific, there is no way to do it with just
C++, so you'd do better to ask in an OS specific newsgroup.

Ben Pope
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top