`PurgeComm () ' can discard all characters in both or both of the Tx and Rx buffers and abort any pending read and / or write operations on the port. To do everything for the port, say something like:
PurgeComm(hPort, PURGE_RXABORT|PURGE_TXABORT|PURGE_RXCLEAR|PURGE_TXCLEAR)
You can also make sure that you have processed or explicitly ignored any pending errors on the port, possibly with ClearCommError().
ReadFile() Rx- FIFO . , "" ReadFile(), .
, COMMTIMEOUTS "", , .