TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Charles Gaefke
date: 1996-10-26 00:00:00
subject: Re: DosDevIOCtl for COM ports

PC> #define INCL_DOSDEVIOCTL
PC> 
PC> This one should resolve most ASYNC_IOCTL Category problems.
PC> Also look in bsedev.h, *most* constants and structures are defined
PC> there.

    I'm not including that one.. and it works fine (I got it working after I 
posted my question.  It usually happens that way.)  But thanks for the help.  
When I get a free moment or three, I'll see which ones I can #define and still
have it work.

PC> Best advice I can give is to get a copy of pmtermsr.lzh from Peter
PC> Fitzsimmons.  Its an excellent multi-threaded comm port example.

    And where can I obtain that?

PC> Its different for each function, you have to look at the docs for the
PC> function to see what it should be.  Its always either a USHORT or a
PC> ULONG, or a structure.  You only have to pass variables in one of the
PC> items (Parameter or Data), and the other is NULL, 0, NULL.

    Understood.  I got it working.

PC>  CG> Also, just to make sure, a "word" is an
"int" or "short", correct?
PC>  CG> And a "dword" is a "long", correct?
PC>  CG> And a "byte" is a "char", correct?
PC> 
PC> WORD is two bytes (USHORT), DWORD is four bytes (ULONG), byte is a
PC> UCHAR.  An int in OS/2 is four bytes.

    So WORD is a "short int", DWORD in a "long int" and
byte is a "char".  An 
int, in 32-bit, is four bytes, yes.  In 16-bit, it's two.  That's why I now 
declare all my ints as short or long, for portability.  I learned that the 
hard way. :)

PC>  CG> And if a port is "locked", do you have to
"unlock" it before you
PC>  CG> can  change the rate, then do you have to "relock" it?
PC> 
PC> I'm lost here, I use SIO which locks the port.

    So do I.  My question was from a programs standpoint.  SIO locks the port,
yes.  When you tell it to change the port rate, and it's already locked, does 
SIO unlock, then change it, then lock it, or does it just change it, and it 
stays locked?  So if it was locked, by SIO, and I changed it to a new value, 
would it still be locked?

PC> Get pmtermsr.lzh from Peter F.  I need a copy too, maybe he'll upload it
PC> to an ftp site?

    Who is he? :)


C. Gaefke
cdgaefke{at}sgi.net
[CDRMAIL Author]

--- RG05-11/CDRMAIL 104á
* Origin: LOTL/2 * 412 746 3592 * V34 33.6k * RGSNet PA Host (1:129/230)
SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1
@PATH: 129/230 11 270/101 712/515 711/808 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™.