In terms of C or C++, you'll need to know the generics of either language! Once you can handle writing programs in either language, then you can look further to calling parts of the OS to get things you want done.
In terms of USB, each USB device has a configuration block onboard that contains a lot of information about the USB device. This includes the name of the device in several different languages, as well as class types, vendor IDs and device IDs.
For USB that's how Windows gets the name of the device - the device provides it when interrogated.
Devices like CD-ROMs and Hard disks operate in a similar way. There's a command that can be send across the IDE (or SCSI) bus that requests the identity of the device. However, this is done in a totally different way to USB, as the interface is completely different.
You'll need to find a way to ask Windows what devices are connected - it might be best interrogating the registry, as this information is usually stored there. You certainly don't want to be talking directly to the hardware, as there's more than one standard for talking to USB controllers. Thrown on top of that, there is the chance that Windows would be communicating with the hardware, and you could end up doing nasty things accessing hardware directly.
__________________ Any views, thoughts and opinions are entirely my own. They don't necessarily represent those of my employer (BlackBerry). |