Don't enable GFX if client doesn't support 32 BPP

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.
This commit is contained in:
matt335672 2024-01-23 16:55:48 +00:00 committed by Christopher Pitstick
parent e5d455d0be
commit d23d147dc7
2 changed files with 13 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}