Code cleanups

prefer use of settings getter
This commit is contained in:
akallabeth 2022-10-21 09:28:53 +02:00 committed by David Fort
parent 01fba61670
commit c0e3624a10
3 changed files with 10 additions and 10 deletions

View File

@ -34,13 +34,12 @@ static BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp);
static BOOL rdp_write_synchronize_pdu(wStream* s, const rdpSettings* settings)
{
WINPR_ASSERT(s);
WINPR_ASSERT(settings);
const UINT32 PduSource = freerdp_settings_get_uint32(settings, FreeRDP_PduSource);
if (Stream_GetRemainingCapacity(s) < 4)
return FALSE;
Stream_Write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */
Stream_Write_UINT16(s, settings->PduSource); /* targetUser (2 bytes) */
Stream_Write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */
Stream_Write_UINT16(s, PduSource); /* targetUser (2 bytes) */
return TRUE;
}
@ -73,9 +72,6 @@ BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, wStream* s)
WINPR_ASSERT(rdp);
WINPR_ASSERT(s);
if (!rdp_finalize_set_flag(rdp, FINALIZE_SC_SYNCHRONIZE_PDU))
return FALSE;
if (!Stream_CheckAndLogRequiredLength(TAG, s, 4))
return FALSE;
@ -89,7 +85,7 @@ BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, wStream* s)
/* targetUser (2 bytes) */
Stream_Seek_UINT16(s);
return TRUE;
return rdp_finalize_set_flag(rdp, FINALIZE_CS_SYNCHRONIZE_PDU);
}
BOOL rdp_send_client_synchronize_pdu(rdpRdp* rdp)

View File

@ -912,7 +912,9 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(
strncpy(pChannelOpenData->name, pChannelDef->name, CHANNEL_NAME_LEN);
pChannelOpenData->options = pChannelDef->options;
if (settings->ChannelCount < CHANNEL_MAX_COUNT)
const UINT32 max = freerdp_settings_get_uint32(settings, FreeRDP_ChannelDefArraySize);
WINPR_ASSERT(max >= CHANNEL_MAX_COUNT);
if (settings->ChannelCount < max)
{
CHANNEL_DEF* channel = freerdp_settings_get_pointer_array_writable(
settings, FreeRDP_ChannelDefArray, settings->ChannelCount);

View File

@ -128,7 +128,9 @@ BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, UINT32 width
if ((flags & FREERDP_CODEC_REMOTEFX))
{
if (!(codecs->rfx = rfx_context_new_ex(FALSE, codecs->context->settings->ThreadingFlags)))
const UINT32 ThreadingFlags =
freerdp_settings_get_uint32(codecs->context->settings, FreeRDP_ThreadingFlags);
if (!(codecs->rfx = rfx_context_new_ex(FALSE, ThreadingFlags)))
{
WLog_ERR(TAG, "Failed to create rfx codec context");
return FALSE;