Merge pull request #6344 from kubistika/rail_server_mark_function_as_static

rail: server: mark rail_send_pdu as static function
This commit is contained in:
Kobi 2020-07-06 10:44:11 +03:00 committed by GitHub
commit 63e20345c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 18 deletions

View File

@ -51,9 +51,13 @@ static const char* const RAIL_ORDER_TYPE_STRINGS[] = { "",
"",
"" };
const char* rail_get_order_type_string(BYTE orderType)
const char* rail_get_order_type_string(UINT16 orderType)
{
return RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)];
UINT32 index = ((orderType & 0xF0) >> 3) + (orderType & 0x0F);
if (index >= ARRAYSIZE(RAIL_ORDER_TYPE_STRINGS))
return "UNKNOWN";
return RAIL_ORDER_TYPE_STRINGS[index];
}
/**

View File

@ -26,8 +26,6 @@
#include <freerdp/rail.h>
const char* rail_get_order_type_string(BYTE orderType);
#define RAIL_PDU_HEADER_LENGTH 4
/* Fixed length of PDUs, excluding variable lengths */
@ -72,5 +70,6 @@ UINT rail_read_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam, BOOL ex
UINT rail_write_sysparam_order(wStream* s, const RAIL_SYSPARAM_ORDER* sysparam,
BOOL extendedSpiSupported);
BOOL rail_is_extended_spi_supported(UINT32 channelsFlags);
const char* rail_get_order_type_string(UINT16 orderType);
#endif /* FREERDP_CHANNEL_RAIL_COMMON_H */

View File

@ -60,7 +60,7 @@ static UINT rail_send(RailServerContext* context, wStream* s, ULONG length)
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT rail_send_pdu(RailServerContext* context, wStream* s, UINT16 orderType)
static UINT rail_server_send_pdu(RailServerContext* context, wStream* s, UINT16 orderType)
{
UINT16 orderLength;
@ -278,7 +278,7 @@ static UINT rail_send_server_handshake(RailServerContext* context,
}
rail_write_handshake_order(s, handshake);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_HANDSHAKE);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_HANDSHAKE);
Stream_Free(s, TRUE);
return error;
}
@ -308,7 +308,7 @@ static UINT rail_send_server_handshake_ex(RailServerContext* context,
}
rail_write_handshake_ex_order(s, handshakeEx);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_HANDSHAKE_EX);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_HANDSHAKE_EX);
Stream_Free(s, TRUE);
return error;
}
@ -344,7 +344,7 @@ static UINT rail_send_server_sysparam(RailServerContext* context,
}
rail_write_sysparam_order(s, sysparam, extendedSpiSupported);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_SYSPARAM);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_SYSPARAM);
Stream_Free(s, TRUE);
return error;
}
@ -372,7 +372,7 @@ static UINT rail_send_server_local_move_size(RailServerContext* context,
}
rail_write_local_move_size_order(s, localMoveSize);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_LOCALMOVESIZE);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_LOCALMOVESIZE);
Stream_Free(s, TRUE);
return error;
}
@ -400,7 +400,7 @@ static UINT rail_send_server_min_max_info(RailServerContext* context,
}
rail_write_min_max_info_order(s, minMaxInfo);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_MINMAXINFO);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_MINMAXINFO);
Stream_Free(s, TRUE);
return error;
}
@ -428,7 +428,7 @@ static UINT rail_send_server_taskbar_info(RailServerContext* context,
}
rail_write_taskbar_info_order(s, taskbarInfo);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_TASKBARINFO);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_TASKBARINFO);
Stream_Free(s, TRUE);
return error;
}
@ -456,7 +456,7 @@ static UINT rail_send_server_langbar_info(RailServerContext* context,
}
rail_write_langbar_info_order(s, langbarInfo);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_LANGBARINFO);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_LANGBARINFO);
Stream_Free(s, TRUE);
return error;
}
@ -484,7 +484,7 @@ static UINT rail_send_server_exec_result(RailServerContext* context,
}
rail_write_exec_result_order(s, execResult);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_EXEC_RESULT);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_EXEC_RESULT);
Stream_Free(s, TRUE);
return error;
}
@ -512,7 +512,7 @@ static UINT rail_send_server_z_order_sync(RailServerContext* context,
}
rail_write_z_order_sync_order(s, zOrderSync);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_ZORDER_SYNC);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_ZORDER_SYNC);
Stream_Free(s, TRUE);
return error;
}
@ -539,7 +539,7 @@ static UINT rail_send_server_cloak(RailServerContext* context, const RAIL_CLOAK*
}
rail_write_cloak_order(s, cloak);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_CLOAK);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_CLOAK);
Stream_Free(s, TRUE);
return error;
}
@ -568,7 +568,7 @@ rail_send_server_power_display_request(RailServerContext* context,
}
rail_write_power_display_request_order(s, powerDisplayRequest);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_POWER_DISPLAY_REQUEST);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_POWER_DISPLAY_REQUEST);
Stream_Free(s, TRUE);
return error;
}
@ -596,7 +596,7 @@ static UINT rail_send_server_get_app_id_resp(RailServerContext* context,
}
rail_write_get_app_id_resp_order(s, getAppidResp);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_GET_APPID_RESP);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_GET_APPID_RESP);
Stream_Free(s, TRUE);
return error;
}
@ -624,7 +624,7 @@ static UINT rail_send_server_get_appid_resp_ex(RailServerContext* context,
}
rail_write_get_appid_resp_ex_order(s, getAppidRespEx);
error = rail_send_pdu(context, s, TS_RAIL_ORDER_GET_APPID_RESP_EX);
error = rail_server_send_pdu(context, s, TS_RAIL_ORDER_GET_APPID_RESP_EX);
Stream_Free(s, TRUE);
return error;
}