Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ucsd!hub!engrhub!patrick From: patrick@engrhub.ucsb.edu (Patrick Lindstrom) Newsgroups: comp.os.os2 Subject: Re: Is there a way to peek ahead and see how many bytes are in the COM buffer? Message-ID: <3423@hub.UUCP> Date: 28 Dec 89 22:32:04 GMT References: <1989Dec24.103004.26003@larouch.uucp> Sender: news@hub.UUCP Reply-To: patrick@engrhub.UUCP (Patrick A. Linstruth) Organization: University of California, Santa Barbara Lines: 15 In article <1989Dec24.103004.26003@larouch.uucp> yozzo@larouch.UUCP (Ralph Yozzo) writes: > >Does anyone know of a way to peek ahead and see how many bytes are in >the COM1 buffer? >The reason I ask is that I'd like to read as many bytes >as possible from the COM port and I'd rather >not ask for too much because the DosRead() will block. > Ralph, There is a Generic IOCtl call that will return to you the size of the receive buffer and the number of characters currently queued. I don't have my device driver technical reference manual handy so I can't tell you the exact number. Look for Category 1 function calls in your device drivers manual.