Yes, that behaviour is wrong. ReadFile() should not return ERROR_IO_PENDING unless it needs to wait for data. If there is data there already, it should read the data normally and return success.
Mike
Rein Klazes wrote:
ClearCommError indicates 375 bytes available.
App. requests those 375 bytes.
Read returns failure with GLE() == ERROR_IO_PENDING, leading to an error messagbox in the program.