ComQryErr is used to sample the specified port's sticky error bits. Since the communication driver doesn't provide access to the UART's error bits on a character by character basis, the port's sticky error bits accumulate UART errors for all characters being received. Any characters received with a UART error (except for the "overrun" case) are simply buffered as any normal character. The application can then sample the error bits for an entire block of characters.
The sticky error bits are cleared whenever the port ownership changes, or immediately after the ComQryErr call has successfully sampled them.