From 702f76c078bc1fa9c071de8b836c0781a3470a2f Mon Sep 17 00:00:00 2001 From: speidy Date: Mon, 21 Apr 2014 16:57:06 +0300 Subject: [PATCH] libxrdp: xrdp_channel: don't change channel flags when CHANNEL_OPTION_SHOW_PROTOCOL flag exists. [according to doc: http://msdn.microsoft.com/en-us/library/cc240513.aspx] --- libxrdp/xrdp_channel.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/libxrdp/xrdp_channel.c b/libxrdp/xrdp_channel.c index 198b876b..7d3909d5 100644 --- a/libxrdp/xrdp_channel.c +++ b/libxrdp/xrdp_channel.c @@ -105,10 +105,21 @@ xrdp_channel_send(struct xrdp_channel *self, struct stream *s, int channel_id, s_pop_layer(s, channel_hdr); out_uint32_le(s, total_data_len); - if (channel->flags & XR_CHANNEL_OPTION_SHOW_PROTOCOL) - { - flags |= CHANNEL_FLAG_SHOW_PROTOCOL; - } + /* + * According to 2.2.1.3.4.1 Channel Definition Structure (CHANNEL_DEF): + * CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 + * The value of this flag MUST be ignored by the server. The + * visibility of the Channel PDU Header (section 2.2.6.1.1) is + * determined by the CHANNEL_FLAG_SHOW_PROTOCOL + * (0x00000010) flag as defined in the flags field (section + * 2.2.6.1.1). + * + * That's flag makes MSTSC crash when using RAIL channel. + */ +// if (channel->flags & XR_CHANNEL_OPTION_SHOW_PROTOCOL) +// { +// flags |= CHANNEL_FLAG_SHOW_PROTOCOL; +// } out_uint32_le(s, flags);