An application should never close an open handle to a COM port while there
are requests still pending for that handle. If a request has not completed,
it might be waiting for timeout processing. IOCtls are used to determine,
and change, the current timeout processing.
A Last Level Close occurs when the port is no longer open (from another
open without a close). When a Last Level Close occurs, the physical device
driver does some special processing:
- Clears the receive and transmit queues
- Turns break OFF, if it is currently transmitting a
break
- Clears any character waiting to be transmitted immediately,
if it cannot be transmitted If it can be transmitted, the physical device
driver makes sure that it is given to the transmit hardware
- Attempts to automatically transmit an XON (if possible),
if currently enabled for Automatic Receive Flow Control (XON/XOFF), and
the last character that the physical device driver automatically transmitted
was an XOFF
- Waits until all the data in the transmit hardware
has been physically transmitted
- Relinquishes the interrupt level
- Turns DTR and RTS OFF, if they are not already OFF.
The physical device driver first waits the specified number of character
times
- Relinquishes the Logical ID for the device (on PS/2
machines)
[Back]
[Next]