Added data_pdu_type_to_string

This commit is contained in:
akallabeth 2020-11-19 13:42:28 +01:00 committed by akallabeth
parent 1dc8198803
commit 10fad497a3
3 changed files with 11 additions and 6 deletions

View File

@ -276,8 +276,7 @@ static BOOL peer_recv_data_pdu(freerdp_peer* client, wStream* s, UINT16 totalLen
#ifdef WITH_DEBUG_RDP
WLog_DBG(TAG, "recv %s Data PDU (0x%02" PRIX8 "), length: %" PRIu16 "",
type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type,
length);
data_pdu_type_to_string(type), type, length);
#endif
switch (type)

View File

@ -34,7 +34,7 @@
#define TAG FREERDP_TAG("core.rdp")
const char* DATA_PDU_TYPE_STRINGS[80] = {
static const char* DATA_PDU_TYPE_STRINGS[80] = {
"?",
"?", /* 0x00 - 0x01 */
"Update", /* 0x02 */
@ -102,6 +102,13 @@ const char* DATA_PDU_TYPE_STRINGS[80] = {
"?" /* 0x41 - 0x46 */
};
const char* data_pdu_type_to_string(UINT8 type)
{
if (type > ARRAYSIZE(DATA_PDU_TYPE_STRINGS))
return "???";
return DATA_PDU_TYPE_STRINGS[type];
}
static BOOL rdp_read_flow_control_pdu(wStream* s, UINT16* type, UINT16* channel_id);
static void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type,
UINT16 channel_id);
@ -920,8 +927,7 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s)
}
WLog_DBG(TAG, "recv %s Data PDU (0x%02" PRIX8 "), length: %" PRIu16 "",
type < ARRAYSIZE(DATA_PDU_TYPE_STRINGS) ? DATA_PDU_TYPE_STRINGS[type] : "???", type,
length);
data_pdu_type_to_string(type), type, length);
switch (type)
{

View File

@ -231,7 +231,7 @@ FREERDP_LOCAL BOOL rdp_set_io_callbacks(rdpRdp* rdp, const rdpTransportIo* io_ca
#define RDP_TAG FREERDP_TAG("core.rdp")
#ifdef WITH_DEBUG_RDP
#define DEBUG_RDP(...) WLog_DBG(RDP_TAG, __VA_ARGS__)
extern const char* DATA_PDU_TYPE_STRINGS[80];
const char* data_pdu_type_to_string(UINT8 type);
#else
#define DEBUG_RDP(...) \
do \