Skip to content

Commit

Permalink
Don't enable GFX if client doesn't support 32 BPP
Browse files Browse the repository at this point in the history
mstsc.exe indicates it supports GFX in the early capability flags, even
if it not able to support 32 BPP. This results in a session failure
if a RDPGFX_CAPS_CONFIRM_PDU is sent on the EGFX virtual channel.
  • Loading branch information
matt335672 authored and Nexarian committed Jan 29, 2024
1 parent 4e8bcc7 commit 8cdec40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 12 additions & 2 deletions libxrdp/xrdp_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2138,15 +2138,25 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec *self, struct stream *s)
{
client_info->bpp = 32;
}
#ifdef XRDP_RFXCODEC
if (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL)
{
LOG(LOG_LEVEL_INFO, "client supports gfx protocol");
self->rdp_layer->client_info.gfx = 1;
if (client_info->bpp < 32)
{
LOG(LOG_LEVEL_WARNING,
"client requested gfx protocol with insufficient color depth");
}
else
{
LOG(LOG_LEVEL_INFO, "client supports gfx protocol");
self->rdp_layer->client_info.gfx = 1;
}
}
else
{
LOG_DEVEL(LOG_LEVEL_INFO, "client DOES NOT support gfx");
}
#endif
if (!s_check_rem(s, 64))
{
return 0;
Expand Down
3 changes: 1 addition & 2 deletions xrdp/xrdp_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,7 @@ int
egfx_initialize(struct xrdp_mm *self)
{
LOG_DEVEL(LOG_LEVEL_TRACE, "egfx_initialize");
if (!(self->wm->client_info->mcs_early_capability_flags
& RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL))
if (!(self->wm->client_info->gfx))
{
return 0;
}
Expand Down

0 comments on commit 8cdec40

Please sign in to comment.