TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Jeffrey Habets
date: 1997-03-21 20:29:04
subject: Carrier is not dropped if a second program has com=port open

Hi All,

I have a piece of code that opens a com-port in sharing mode and basically
only monitors the MSR using DosDevIOCtl calls like this:

rc = DosOpen( pszPort, &hPort, &ulAction, 0, FILE_NORMAL, 0x0001,
              OPEN_ACCESS_READWRITE | OPEN_FLAGS_NOINHERIT |
              OPEN_SHARE_DENYNONE, NULL );

rc = DosDevIOCtl( hPort, IOCTL_ASYNC, ASYNC_GETMODEMINPUT, NULL, 0, NULL,
                  &Data, ulDataLen, &ulDataLen );

Some other program does communication on that same port. Now if that other
program tries to hang up by dropping DTR, this has no effect if my program
has the comport open.
(An example of such a program is slippm.exe (or better slattach.exe))

Dropping DTR from within my program however works as expected.

Now, I'm not a serial communications guru. So it could be that I missed
something. But what?
Are there certain flags that I should use on DosOpen maybe?

==========================================================================
* Greetz from Maastricht/The Netherlands, Jeffrey
* Home: www.xs4all.nl/~jeffh    email: jeffh{at}xs4all.nl / Fido: 2:284/312.3
* PM Timer/2 - Keep an eye on that ever growing phone bill !!

---
* Origin: Windows: From the people who brought you EDLIN! (2:284/312)
SEEN-BY: 50/99 54/99 270/101 620/243 625/155 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 284/312 3 5 280/801 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.