All right, here’s one for all the C++ gurus out there.
I need to write a C++ routine to find out what hardware is present on a system. For the time being, I think I can limit myself to Plug and Play devices, and that may be all I ever have to do.
Surprisingly, there’s no tutorial out there. I’ve got specifications for ESCD and the PCI local bus, but I don’t really want to go digging through those, as they’re expecting my work to be done in the near future. Any of you guys know how to do this?
Yeah, it is Windows, but that’s not what I need. On rereading, the OP is inaccurate–what I actually need (for now) is a way to find the Plug and Play ID’s of every device on the system, and it doesn’t look like EnumDeviceDrivers has what I need. Thanks, though, cmkeller.
I am NOT a windows programmer, but I do design PCI cards for a living. Every card on the PCI bus will have a unique vendor ID, device ID, and subsystem ID that you can use to identify it. You can poll the PCI BIOS to find out what is where, and even what resources are assigned to each device.
There is information in the DDK that should explain how to get Plug’N’Play IDs. There are quite possibly example applications that will show you exactly how to get these IDs.
And yes, I did have to phone Microsoft to get this information.
Let me start by thanking everyone who’s responded.
engineer_comp_geek: Not to sound ungrateful (cause I’m not), but if I knew how to poll the PCI BIOS, I wouldn’t’ve started this thread.
Mr2001: We have concerns that registry data may not accurately reflect what’s currently installed if hardware has been removed from the machine. The last person tried to use a registry scan, and it didn’t work. But I don’t know what key she’s checking, so I’ll look into that.
ChrisW: First, welcome to the SDMB. I’ve got the win2k DDK, but I haven’t looked too deeply into the documentation. I was kinda hoping I wouldn’t have to. It looks like that’s what I’ll be doing, though. The one thing that concerns me is that whatever I write has to run on everything from win95 on up, and I’m not sure that the win2k DDK will help with that.
Look for rbpci about halfway down the page. It’s a dos utility that will tell you more than you ever wanted to know about every PCI device on your system, complete with source code. You could probably do a nice cut and paste and hack out the stuff you don’t want in a fairly short time.
Heh…would you believe that I already have that, and it won’t compile or run correctly on my system? I can’t make heads or tails of the code, either.
I did find some stuff in the win2k DDK that looks promising (and some stuff that’s EXACTLY what I need, but it’s OBSOLETE! :mad:****), so I’ll look into that.
Am I the only one who finds it ironic that you want to determine the hardware using a language that is touted for being platform independent?
Just me, huh? OK. Well then . . . carry on.