[channels,rail] print handshakeEx flags

This commit is contained in:
Armin Novak 2024-03-20 09:34:05 +01:00 committed by akallabeth
parent 903172737a
commit ea9e219867
3 changed files with 38 additions and 0 deletions

View File

@ -469,6 +469,13 @@ static UINT rail_recv_handshake_ex_order(railPlugin* rail, wStream* s)
rail->channelBuildNumber = serverHandshake.buildNumber; rail->channelBuildNumber = serverHandshake.buildNumber;
rail->channelFlags = serverHandshake.railHandshakeFlags; 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) if (rail->sendHandshake)
{ {
RAIL_HANDSHAKE_ORDER clientHandshake = { 0 }; RAIL_HANDSHAKE_ORDER clientHandshake = { 0 };

View File

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

View File

@ -583,6 +583,9 @@ typedef enum
FREERDP_API BOOL utf8_string_to_rail_string(const char* string, FREERDP_API BOOL utf8_string_to_rail_string(const char* string,
RAIL_UNICODE_STRING* unicode_string); RAIL_UNICODE_STRING* unicode_string);
FREERDP_API const char* rail_handshake_ex_flags_to_string(UINT32 flags, char* buffer,
size_t len);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif