Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

Need to find all modem's com ports...

I need to be able to find the com port of the modems installed in Win95 & NT.  I have no problem finding the general information for the modems in both operating systems' registries.  What I can't figure out is the key that is the comport.  I have tried "AttatchedTo"... but this key doesn't exists for PCMCIA modems.
0
Doldrums
Asked:
Doldrums
  • 4
  • 2
  • 2
  • +1
1 Solution
 
fasterCommented:
I think instead of checking the registry, you can do a search on all the com ports, for example send any at commands and see whether "OK" is returned.
0
 
vinniewCommented:
Why not use the CreateFile function and check the error code on each?  If it's an error, it will tell you what kind of error.  For instance, and DEVICE_BUSY error would tell you that it is in use, and any other error would at least tell you if it exists.

In the registry, try:

hkLM/hardware/devicemap/serialcomm

It's not as reliable, though.
0
 
DoldrumsAuthor Commented:
The [HKEY_LOCAL_MACHINE\hardware\devicemap\serialcomm] doesn't really help...

The idea about the CreateFile has me a bit lost...  am I to create a file to the comport???  I have a modem's name... I need to find the comport the modem is on.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
vinniewCommented:
You can use the CreateFile() API to access any handle in Win95/NT.  File handles, StdHandles, Communication handles.

The usage goes something like this:

CreateFile("\\COMM1".....);
0
 
DoldrumsAuthor Commented:
Alright... so let's say I CreateFile for all the com ports.  This still doesn't give me anyway to find out what modem is on what port.

What I want to do is make a function that takes a modem's name and returns its comport.  Nothing more...
0
 
amartin030297Commented:
You have 50% of the information you need.  Basically IF
you can identify that a modem exists on a comport (And
it does sound like the above suggestions will do this),
unless you use the registry to tell you the modem name
(which as we also see is not reliable), THEN >YOU<
must use 'detection techniques' to determine modem type.
So.. AT I6, etc.. you'll need the AT Commands for
Rockwell and USR chipsets (the big boys), as well as
AT&T, etc... Most smaller players buy their chipsets from
the big-boys.. But thats the ONLY way to get a modem 'name'...
  Sorry for the crappy news, but unless you can have windows
identify the name, you have to know the protocol to do it
youself.. Fortionately, the AT commands are pretty standard..
  -- Aaron

0
 
DoldrumsAuthor Commented:
I found the answer to my question elsewhere.
Thanks to all who gave me their suggestions and comments.
0
 
DoldrumsAuthor Commented:
The way to find it is that once you have the modem name... you can look at:
\\hkey_local_machine\enum\pcmcia\<modem-name>

Special thanks to John Leier of TurboPower Software for his answer!
http://www.turbopower.com

Sidenote:  I do *NOT* work for or have any affiliation with TurboPower.  But, now I *can* start to finally grow back all the hair that I pulled out!!! :)

Hugh
0
 
amartin030297Commented:
well give SOMEONE the points!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now