I think setupapi is undocumented or unsupported API according to MS. There are at least 3 different methods of getting all the com ports on the PC.
1. System.IO.Ports.SerialPort.GetPortNames()
2. WMI - Select * from WIN32_SerialPort
3. Registry - HKLM - HARDWARE\DEVICEMAP\SERIALCOMM
For getting all serial ports, I'm using the registry.
For determining if the port is a Blue Soleil port, I loop through all ports from the registry, and use WMI to get the Device Manufacturer of each port. If the manufacturer is IVT, I treat it as a Blue Soleil serial port.