Enumerate COM ports

Dear All,

I want to enumerate all the COM ports in the system. After enumerating I want to check the PID and VID of the COM port and then to create a handle if the PID and VID matches.

Please kindly help me to proceed with the above.

Kind regards,
Gajendran

Gajendran wrote:

I want to enumerate all the COM ports in the system. After enumerating
I want to check the PID and VID of the COM port and then to create a
handle if the PID and VID matches.

COM ports do not have VIDs and PIDs. That is a USB concept.

Are you actually saying, “I want to open the COM port created by a
particular USB device in my system”?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Standard COM ports don’t have VID/PIDs as you see with USB, PCI, etc.
devices, but how about a PCI card with a standard 16550AFN type of
controller? I have never used an add-in card since the days of ISA, but
they should have VID/PID to permit Windows to track their location and
maintain the bridges correctly. Of course, there are other COM devices that
report an 80h in the sub-class with 07h in the class that may not be of a
standard type of serial port. I have one of those on a device as the second
function.

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Gajendran wrote:
>>
>> I want to enumerate all the COM ports in the system. After enumerating
>> I want to check the PID and VID of the COM port and then to create a
>> handle if the PID and VID matches.
>>
>
> COM ports do not have VIDs and PIDs. That is a USB concept.
>
> Are you actually saying, “I want to open the COM port created by a
> particular USB device in my system”?
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>

David Craig wrote:

Standard COM ports don’t have VID/PIDs as you see with USB, PCI, etc.
devices, but how about a PCI card with a standard 16550AFN type of
controller? I have never used an add-in card since the days of ISA, but
they should have VID/PID to permit Windows to track their location and
maintain the bridges correctly.

PCI uses slightly different terms, but even in that case, it’s not the
COM port that has the vendor ID and device ID. The PCI board will be a
bus driver, and the COM objects will be PDOs exposed from that bus.

I’m being a little catty here. I’m 99% sure that the original poster
has a USB serial device, and he’s trying to open that one specific
device by VID/PID. I’m just trying to lead him toward thinking about
the problem in the right way.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.