As in my previous short article about flushing serial buffers, the most basic functions such as CreateFile, ReadFile and WriteFile are used for serial communication as well.
By using the function BOOL EscapeCommFunction(HANDLE, DWORD) we are able to control advance behaviours of the serial port as well. Values for DWORD will be as follows.