xrdp_sec: constify color depth value

master
Koichiro IWAO 7 years ago committed by metalefty
parent 8d951ab02e
commit 788ae1467a

@ -101,6 +101,13 @@
#define CONNECTION_TYPE_LAN 0x06 #define CONNECTION_TYPE_LAN 0x06
#define CONNECTION_TYPE_AUTODETECT 0x07 #define CONNECTION_TYPE_AUTODETECT 0x07
/* Client Core Data: colorDepth, postBeta2ColorDepth (MS-RDPBCGR 2.2.1.3.2) */
#define RNS_UD_COLOR_4BPP 0xCA00
#define RNS_UD_COLOR_8BPP 0xCA01
#define RNS_UD_COLOR_16BPP_555 0xCA02
#define RNS_UD_COLOR_16BPP_565 0xCA03
#define RNS_UD_COLOR_24BPP 0xCA04
/* Slow-Path Input Event: messageType (MS-RDPBCGR 2.2.8.1.1.3.1.1) */ /* Slow-Path Input Event: messageType (MS-RDPBCGR 2.2.8.1.1.3.1.1) */
/* TODO: to be renamed */ /* TODO: to be renamed */
#define RDP_INPUT_SYNCHRONIZE 0 #define RDP_INPUT_SYNCHRONIZE 0

@ -1608,10 +1608,10 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec* self, struct stream* s)
g_writeln("colorDepth 0x%4.4x (0xca00 4bpp 0xca01 8bpp)", colorDepth); g_writeln("colorDepth 0x%4.4x (0xca00 4bpp 0xca01 8bpp)", colorDepth);
switch (colorDepth) switch (colorDepth)
{ {
case 0xca00: /* RNS_UD_COLOR_4BPP */ case RNS_UD_COLOR_4BPP:
self->rdp_layer->client_info.bpp = 4; self->rdp_layer->client_info.bpp = 4;
break; break;
case 0xca01: /* RNS_UD_COLOR_8BPP */ case RNS_UD_COLOR_8BPP:
self->rdp_layer->client_info.bpp = 8; self->rdp_layer->client_info.bpp = 8;
break; break;
} }
@ -1630,19 +1630,19 @@ xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec* self, struct stream* s)
switch (postBeta2ColorDepth) switch (postBeta2ColorDepth)
{ {
case 0xca00: /* RNS_UD_COLOR_4BPP */ case RNS_UD_COLOR_4BPP:
self->rdp_layer->client_info.bpp = 4; self->rdp_layer->client_info.bpp = 4;
break; break;
case 0xca01: /* RNS_UD_COLOR_8BPP */ case RNS_UD_COLOR_8BPP :
self->rdp_layer->client_info.bpp = 8; self->rdp_layer->client_info.bpp = 8;
break; break;
case 0xca02: /* RNS_UD_COLOR_16BPP_555 */ case RNS_UD_COLOR_16BPP_555:
self->rdp_layer->client_info.bpp = 15; self->rdp_layer->client_info.bpp = 15;
break; break;
case 0xca03: /* RNS_UD_COLOR_16BPP_565 */ case RNS_UD_COLOR_16BPP_565:
self->rdp_layer->client_info.bpp = 16; self->rdp_layer->client_info.bpp = 16;
break; break;
case 0xca04: /* RNS_UD_COLOR_24BPP */ case RNS_UD_COLOR_24BPP:
self->rdp_layer->client_info.bpp = 24; self->rdp_layer->client_info.bpp = 24;
break; break;
} }

Loading…
Cancel
Save