MLIB
|
Functions for retrieving available serial ports. More...
Functions for retrieving available serial ports.
These functions are heavily inspired from [CEnumerateSerial] (http://www.naughter.com/enumser.html) code.
From the original code I've removed methods that don't seem to be working (ComDBOpen) or that take a ridiculous amount of time to execute (GetDefaultCommConfig).
In the end I was left with three methods: using CreateFile, using SetupAPI and using the registry. The CreateFile method has no particular advantage except that it is conceptually very simple. The setup API is a bit slower (about 15 ms per port on my machine) but it returns also the friendly port name. The registry method is blazing fast (under 1 ms) but does not provide the friendly name.