summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Andersson <hean01@cendio.com>2017-10-26 16:31:21 +0200
committerGitHub <noreply@github.com>2017-10-26 16:31:21 +0200
commit71b0100044207d87113c1ced3e7369ed771ed2b7 (patch)
tree9f9ca9f02c81d6908e02370b5fc1fc6f9f9ca5fd
parent04bbb961ce7d7f25364299a6a9236915ddf573fc (diff)
parent8c162a55636d91c3031c024b4eaf15ba509f8905 (diff)
downloadrdesktop-71b0100044207d87113c1ced3e7369ed771ed2b7.zip
Merge pull request #177 from derfian/32bit-color
Enable 32-bit color depths
-rw-r--r--secure.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/secure.c b/secure.c
index 4f31ffe..9328739 100644
--- a/secure.c
+++ b/secure.c
@@ -395,7 +395,7 @@ sec_out_mcs_connect_initial_pdu(STREAM s, uint32 selected_protocol)
unsigned int i;
uint32 rdpversion = RDP_40;
uint16 capflags = RNS_UD_CS_SUPPORT_ERRINFO_PDU;
- uint16 colorsupport = RNS_UD_24BPP_SUPPORT | RNS_UD_16BPP_SUPPORT;
+ uint16 colorsupport = RNS_UD_24BPP_SUPPORT | RNS_UD_16BPP_SUPPORT | RNS_UD_32BPP_SUPPORT;
if (g_rdp_version >= RDP_V5)
rdpversion = RDP_50;
@@ -441,7 +441,13 @@ sec_out_mcs_connect_initial_pdu(STREAM s, uint32 selected_protocol)
out_uint16_le(s, RNS_UD_COLOR_8BPP); /* postBeta2ColorDepth (overrides colorDepth) */
out_uint16_le(s, 1); /* clientProductId (should be 1) */
out_uint32_le(s, 0); /* serialNumber (should be 0) */
- out_uint16_le(s, g_server_depth); /* highColorDepth (overrides postBeta2ColorDepth) */
+
+ /* highColorDepth (overrides postBeta2ColorDepth). Capped at 24BPP.
+ To get 32BPP sessions, we need to set a capability flag. */
+ out_uint16_le(s, MIN(g_server_depth, 24));
+ if (g_server_depth == 32)
+ capflags |= RNS_UD_CS_WANT_32BPP_SESSION;
+
out_uint16_le(s, colorsupport); /* supportedColorDepths */
out_uint16_le(s, capflags); /* earlyCapabilityFlags */
out_uint8s(s, 64); /* clientDigProductId */