Discards all characters of a specified communications resource from the output or input buffer. It can also terminate pending read or write operations on the resource.
BOOLEAN PurgeComm( COMMHANDLE hComm, // handle to communications resource DWORD dwFlags // action to perform );
hComm
dwFlags
Value | Description |
---|---|
PURGE_TXABORT | Terminates all outstanding overlapped write operations and returns immediately, even if the write operations have not been completed. |
PURGE_RXABORT | Terminates all outstanding overlapped read operations and returns immediately, even if the read operations are not complete. |
PURGE_TXCLEAR | Clears the output buffer (if the device driver has one). |
PURGE_RXCLEAR | Clears the input buffer (if the device driver has one). |
0
(zero)
E_DISCONNECTED
E_PARAM
If a thread uses PurgeComm to flush an output buffer, the deleted characters are not transmitted. To empty the output buffer while ensuring that the contents are transmitted, call FlushCommBuffers (a synchronous operation). Note, however, that FlushCommBuffers is subject to flow control but not to write time-outs, and it does not return until all pending write operations are transmitted.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.1 | intime/rt/include/comm.h | comm.h | comm.lib |