code: def read_message_bytes_from_pipe(pipe_handle):
      
      overlapped = OVERLAPPED()
      overlapped.hEvent = create_event()
  
      try:
          buff = create_string_buffer(BUFSIZE + 1)
          c_read = DWORD()
  
          success = windll.kernel32.ReadFile(
              pipe_handle,
              buff,
              DWORD(BUFSIZE),
              byref(c_read),
              byref(overlapped))
  
          if success:
              buff[c_read.value] = b'\0'
              raise Return(buff.value)
  
          error_code = windll.kernel32.GetLastError()
  
          if error_code == ERROR_IO_PENDING:
              yield From(wait_for_event(overlapped.hEvent))
  
              success = windll.kernel32.GetOverlappedResult(
                  pipe_handle,
                  byref(overlapped),
                  byref(c_read),
                  BOOL(False))
  
              if success:
                  buff[c_read.value] = b'\0'
                  raise Return(buff.value)
  
              else:
                  error_code = windll.kernel32.GetLastError()
                  if error_code == ERROR_BROKEN_PIPE:
                      raise BrokenPipeError
  
                  elif error_code == ERROR_MORE_DATA:
                      more_data = yield From(read_message_bytes_from_pipe(pipe_handle))
                      raise Return(buff.value + more_data)
                  else:
                      raise Exception(
                          'reading overlapped IO failed. error_code=%r' % error_code)
  
          elif error_code == ERROR_BROKEN_PIPE:
              raise BrokenPipeError
  
          elif error_code == ERROR_MORE_DATA:
              more_data = yield From(read_message_bytes_from_pipe(pipe_handle))
              raise Return(buff.value + more_data)
  
          else:
              raise Exception('Reading pipe failed, error_code=%s' % error_code)
      finally:
          windll.kernel32.CloseHandle(overlapped.hEvent)
docs: (coroutine)
      Read message from this pipe. Return bytes.