diff --git a/common/ms-rdpbcgr.h b/common/ms-rdpbcgr.h index 5347a867..386a5994 100644 --- a/common/ms-rdpbcgr.h +++ b/common/ms-rdpbcgr.h @@ -80,6 +80,7 @@ #define RNS_UD_CS_WANT_32BPP_SESSION 0x0002 #define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040 #define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100 +#define RNS_UD_CS_SUPPORT_SKIP_CHANNELJOIN 0x0800 /* Client Core Data: connectionType (2.2.1.3.2) */ #define CONNECTION_TYPE_MODEM 0x01 diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c index 6317d1e1..a49eb120 100644 --- a/libxrdp/xrdp_mcs.c +++ b/libxrdp/xrdp_mcs.c @@ -1129,11 +1129,20 @@ handle_channel_join_requests(struct xrdp_mcs *self, struct stream *s, int *appid) { int rv = 0; - /* - * Expect a channel join request PDU for each of the static virtual - * channels, plus the user channel (self->chanid) and the I/O channel - * (MCS_GLOBAL_CHANNEL) */ - unsigned int expected_join_count = self->channel_list->count + 2; + unsigned int expected_join_count = 0; + if ((self->sec_layer->rdp_layer->client_info.mcs_early_capability_flags & + RNS_UD_CS_SUPPORT_SKIP_CHANNELJOIN) == 0) + { + /* + * The client has indicated it does not support skipping channel + * join request/confirm PDUs. + * + * Expect a channel join request PDU for each of the static + * virtual channels, plus the user channel (self->chanid) and + * the I/O channel (MCS_GLOBAL_CHANNEL) */ + expected_join_count = self->channel_list->count + 2; + } + unsigned int actual_join_count = 0; while (*appid == MCS_CJRQ)