how to find recently created port in windows??

How to find the latest virtual COM port created in my Pc??

device manager -> ports -> devicename ( COM X ).

How to find that “COM x” programatically or by commands??

thanks.

If you are looking for the LATEST installed COM port then there are several ways for doing this but AFAIK there is no 100% guarentee to get the exact date. You can check %WINDIR%\setupapi.log in XP and %WINDIR%\inf\setupapi.app.log and %WINDIR%\inf\setupapi.dev.log (Vista and upper) for all device related actions including its install date, but keep in mind that these files can be deleted by a admin user. There is also a PNF file with a INF file. The creation date of the INF file also can be of help. In usermode you can use RegEnumKeyEx() and RegQueryInfoKey() to get a registry key last write time which can be of help once you get the registry software and/or hardware key for the installed COM port and request that information on the keys. But AFAIK there is no 100% way to get that info you want.

I guess windows 8 has a few new properties published with the device like its install date, but i am not 100% certain about that.

Maintain your own registry branch of what COM ports are yours.

wrote in message news:xxxxx@ntdev…
> How to find the latest virtual COM port created in my Pc??
>
> device manager -> ports -> devicename ( COM X ).
>
> How to find that “COM x” programatically or by commands??
>
> thanks.
>
>
>

What problem are you trying to solve?

d

debt from my phone


From: xxxxx@gmail.com
Sent: 4/24/2012 5:02 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] how to find recently created port in windows??

How to find the latest virtual COM port created in my Pc??

device manager -> ports -> devicename ( COM X ).

How to find that “COM x” programatically or by commands??

thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I’m not sure how to find the “latest” port. But you could enumerate COM
port interfaces using the GUID for the device, or, if you have a separate
GUID for your virtual port. If you enable for notifications on device
insertion, you will get a notice in your app when a new device that
matches your requested notification ID. Read about WM_DEVICECHANGE.
joe

How to find the latest virtual COM port created in my Pc??

device manager -> ports -> devicename ( COM X ).

How to find that “COM x” programatically or by commands??

thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Dear Doron,

Am trying to create a Lan connection between my embedded device and my PC,
through USB.

When I insert the USB port of the embedded device into my PC the driver (
USBSER.sys ) gets installed and a COM port will be created. Once it is
done the next step is to create a LAN connection between my PC and the
device.

Now using that COM port as reference I can create a LAN connetion. To
achieve this I want to find the COM port number to give as input for
RASDIAL.

So is there any ways to find the last COM port created in my pc
programatically??

thanks,
Sethu

On Tue, Apr 24, 2012 at 7:51 PM, Doron Holan wrote:

> What problem are you trying to solve?
>
> d
>
> debt from my phone
> ------------------------------
> From: xxxxx@gmail.com
> Sent: 4/24/2012 5:02 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] how to find recently created port in windows??
>
> How to find the latest virtual COM port created in my Pc??
>
> device manager -> ports -> devicename ( COM X ).
>
> How to find that “COM x” programatically or by commands??
>
> thanks.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

That is not the way you should find it. Instead, enumerate all of the com ports on the system, for each one, get the hardware id and compare it to the hwid for your device.see the enum.exe project on the toaster sample for how to enum a device interface

d

debt from my phone


From: Sethuraman R
Sent: 4/24/2012 8:14 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] how to find recently created port in windows??

Dear Doron,

Am trying to create a Lan connection between my embedded device and my PC, through USB.

When I insert the USB port of the embedded device into my PC the driver ( USBSER.sys ) gets installed and a COM port will be created. Once it is done the next step is to create a LAN connection between my PC and the device.

Now using that COM port as reference I can create a LAN connetion. To achieve this I want to find the COM port number to give as input for RASDIAL.

So is there any ways to find the last COM port created in my pc programatically??

thanks,
Sethu

On Tue, Apr 24, 2012 at 7:51 PM, Doron Holan > wrote:
What problem are you trying to solve?

d

debt from my phone
________________________________
From: xxxxx@gmail.commailto:xxxxx
Sent: 4/24/2012 5:02 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] how to find recently created port in windows??

How to find the latest virtual COM port created in my Pc??

device manager -> ports -> devicename ( COM X ).

How to find that “COM x” programatically or by commands??

thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx>