thanks for the info you sent earlier. I had some more detailed
questions:
When enumerating devcies if the Port class, I guess I'd have to first
use SetupDiGetClassDevs() function. One of the parameters to this is a
pointer to a classGUID. How do I pass that it. Are these defined
somewhere. I found out for eg ... that the ClassGUId for Ports class
is: ClassGuid = {4d36e978-e325-11ce-bfc1-08002be10318} . How would I
create a pointer to this and pass it in the function.
Am I on the right track?
thanks,
Hetal.
From: Eliyas Yakub (eli...@microsoft.com)
Subject: Re: Programatially figure out USB assigned COM port for a
modem device
Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode
View this article only
Date: 2002-02-05 10:07:29 PST
Enumerate devices of the Ports class and first get the
SPDRP_ENUMERATOR_NAME
using SetupDiGetDeviceRegistryProperty. If the enumerator is USB then
get
the FriendlyName (SPDRP_FRIENDLYNAME) using the same function. The
friendlyname gives you the COM port name.
You can modify the PrintToasterDeviceInfo function in
src\general\toaster\exe\toast.c of XP DDK to easily achieve this.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no
rights.
You assume all risk for your use.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hetal" <Patel...@msn.com> wrote in message
news:e10a28.020506...@posting.google.com...
I am using a USB modem device. I want to figure out the Virtual COM
port assinged to this device programatically so I can communicate with
it. The problem I'm facing is this:
If I use enumerate devices of the ports class, it does not list the
USB assigned (Virtual) COMM ports even when the device is on, so the
other functions mentioned will not get any info on that.
If I use the modem class, then the available options for the
SetupDiGetDeviceRegistryProperty function such as SPDRP_FRIENDLYNAME
or SPDRP_DEVICEDESC gets the name of the modem eg. "My Modem" from the
registry setting correspoding the DeviceDesc or Friendlyname. However,
I am looking for the port number (which is the AttachedTo registry
setting). I am not able to get the COMM port number for a USB modem.
Is there any way ... API's I could use to figure out the Virtual COMM
port assigned to my USB modem device?
Also, the code I wrote for Windows 2K to list all the modem devices
installed does not work for Windows ME? Is there a different set of
files I have to use from another DDK?
thanks in advance,
Hetal Patel
"Eliyas Yakub" <eli...@microsoft.com> wrote in message news:<3cd6f3e9$1...@news.microsoft.com>...
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hetal" <Patel...@msn.com> wrote in message
news:e10a28.020507...@posting.google.com...
Thanks for your response. The registry path that I am refering to for
Win 2K is
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0001
where the modem settings/properties would be under 0001. In my case it
is a USB modem.
Name of Value: AttachedTo
Type : REG_SZ
Data: COM4
I am interested in getting the data value ie COM4. With the different
tests I tried, I was able to get
"{4D36E96D-E325-11CE-BFC1-08002BE10318}\0001" when I pass SPDRP_DRIVER
to the SetupDiGetDeviceRegistryProperty function.
It is interesting that you mentioned only Win 2k. Because I wrote a
small program to enumerate available modem devices on my Windows 2K
m/c using the SetupDi fns and it worked, but when I used the same
program also building it on windows ME, it doesn't work? any idea on
this? are there a different set of functions for Win ME ... do the
SetupDi fnS work on Win ME?
thanks,
Hetal.
"Eliyas Yakub" <eli...@microsoft.com> wrote in message news:<3cd86d4e$1...@news.microsoft.com>...
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hetal" <Patel...@msn.com> wrote in message
news:e10a28.020509...@posting.google.com...