'Return the number of bytes currently in the input buffer.'

@property
def in_waiting(self):

    flags = win32.DWORD()
    comstat = win32.COMSTAT()
    if (not win32.ClearCommError(self._port_handle, ctypes.byref(flags), ctypes.byref(comstat))):
        raise SerialException('call    to    ClearCommError    failed')
    return comstat.cbInQue
