summaryrefslogtreecommitdiffstats
path: root/channels/rail
diff options
context:
space:
mode:
Diffstat (limited to 'channels/rail')
-rw-r--r--channels/rail/client/rail_orders.c7
-rw-r--r--channels/rail/rail_common.c28
2 files changed, 35 insertions, 0 deletions
diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c
index 7ac432e..b186eb3 100644
--- a/channels/rail/client/rail_orders.c
+++ b/channels/rail/client/rail_orders.c
@@ -469,6 +469,13 @@ static UINT rail_recv_handshake_ex_order(railPlugin* rail, wStream* s)
rail->channelBuildNumber = serverHandshake.buildNumber;
rail->channelFlags = serverHandshake.railHandshakeFlags;
+ {
+ char buffer[192] = { 0 };
+ WLog_DBG(TAG, "HandshakeFlags=%s [buildNumber=0x%08" PRIx32 "]",
+ rail_handshake_ex_flags_to_string(rail->channelFlags, buffer, sizeof(buffer)),
+ rail->channelBuildNumber);
+ }
+
if (rail->sendHandshake)
{
RAIL_HANDSHAKE_ORDER clientHandshake = { 0 };
diff --git a/channels/rail/rail_common.c b/channels/rail/rail_common.c
index fb6bc80..6deb968 100644
--- a/channels/rail/rail_common.c
+++ b/channels/rail/rail_common.c
@@ -589,3 +589,31 @@ BOOL rail_is_extended_spi_supported(UINT32 channelFlags)
{
return (channelFlags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED) ? TRUE : FALSE;
}
+
+const char* rail_handshake_ex_flags_to_string(UINT32 flags, char* buffer, size_t len)
+{
+ if (len < 1)
+ return NULL;
+
+ _snprintf(buffer, len, "{");
+ char* fbuffer = &buffer[1];
+ len--;
+
+ if (flags & TS_RAIL_ORDER_HANDSHAKEEX_FLAGS_HIDEF)
+ winpr_str_append("HIDEF", fbuffer, len, "|");
+ if (flags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_SUPPORTED)
+ winpr_str_append("EXTENDED_SPI_SUPPORTED", fbuffer, len, "|");
+ if (flags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_SNAP_ARRANGE_SUPPORTED)
+ winpr_str_append("SNAP_ARRANGE_SUPPORTED", fbuffer, len, "|");
+ if (flags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_TEXT_SCALE_SUPPORTED)
+ winpr_str_append("TEXT_SCALE_SUPPORTED", fbuffer, len, "|");
+ if (flags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_CARET_BLINK_SUPPORTED)
+ winpr_str_append("CARET_BLINK_SUPPORTED", fbuffer, len, "|");
+ if (flags & TS_RAIL_ORDER_HANDSHAKE_EX_FLAGS_EXTENDED_SPI_2_SUPPORTED)
+ winpr_str_append("EXTENDED_SPI_2_SUPPORTED", fbuffer, len, "|");
+
+ char number[16] = { 0 };
+ _snprintf(number, sizeof(number), "[0x%08" PRIx32 "]", flags);
+ winpr_str_append(number, buffer, len, "}");
+ return buffer;
+}