process_message_channel_data(struct stream* s)
{
  int chan_id = 0;
  int chan_flags = 0;
  int rv = 0;
  int length = 0;
  int total_length = 0;

  in_uint16_le(s, chan_id);
  in_uint16_le(s, chan_flags);
  in_uint16_le(s, length);
  in_uint32_le(s, total_length);
  LOG(10, ("process_message_channel_data: chan_id %d "
           "chan_flags %d", chan_id, chan_flags));
  rv = send_channel_data_response_message();
  if (rv == 0)
  {
    if (chan_id == g_cliprdr_chan_id)
    {
      rv = clipboard_data_in(s, chan_id, chan_flags, length, total_length);
    }
    else if (chan_id == g_rdpsnd_chan_id)
    {
      rv = sound_data_in(s, chan_id, chan_flags, length, total_length);
    }
    else if (chan_id == g_rdpdr_chan_id)
    {
      rv = dev_redir_data_in(s, chan_id, chan_flags, length, total_length);
    }
  }
  return rv;
}
process_message_channel_data(struct stream* s)
{
  int chan_id = 0;
  int chan_flags = 0;
  int rv = 0;
  int length = 0;
  int total_length = 0;

  in_uint16_le(s, chan_id);
  in_uint16_le(s, chan_flags);
  in_uint16_le(s, length);
  in_uint32_le(s, total_length);
  LOG(10, ("process_message_channel_data: chan_id %d "
           "chan_flags %d", chan_id, chan_flags));
  rv = send_channel_data_response_message();
  if (rv == 0)
  {
    if (chan_id == g_cliprdr_chan_id)
    {
      rv = clipboard_data_in(s, chan_id, chan_flags, length, total_length);
    }
    else if (chan_id == g_rdpsnd_chan_id)
    {
      rv = sound_data_in(s, chan_id, chan_flags, length, total_length);
    }
    else if (chan_id == g_rdpdr_chan_id)
    {
      rv = dev_redir_data_in(s, chan_id, chan_flags, length, total_length);
    }
  }
  return rv;
}