Merge pull request #12311 from akallabeth/winpr-attr-nodiscard-fkt-ptr

Winpr attr nodiscard fkt ptr
This commit is contained in:
akallabeth
2026-02-16 09:32:52 +01:00
committed by GitHub
116 changed files with 1462 additions and 1219 deletions

View File

@@ -860,8 +860,10 @@ state_run_t autodetect_recv_request_packet(rdpAutoDetect* autodetect, RDP_TRANSP
goto fail;
}
IFCALL(autodetect->RequestReceived, autodetect, transport, autodetectReqPdu.requestType,
autodetectReqPdu.sequenceNumber);
if (!IFCALLRESULT(TRUE, autodetect->RequestReceived, autodetect, transport,
autodetectReqPdu.requestType, autodetectReqPdu.sequenceNumber))
goto fail;
switch (autodetectReqPdu.requestType)
{
case RDP_RTT_REQUEST_TYPE_CONTINUOUS:
@@ -981,8 +983,10 @@ state_run_t autodetect_recv_response_packet(rdpAutoDetect* autodetect, RDP_TRANS
goto fail;
}
IFCALL(autodetect->ResponseReceived, autodetect, transport, autodetectRspPdu.responseType,
autodetectRspPdu.sequenceNumber);
if (!IFCALLRESULT(TRUE, autodetect->ResponseReceived, autodetect, transport,
autodetectRspPdu.responseType, autodetectRspPdu.sequenceNumber))
goto fail;
switch (autodetectRspPdu.responseType)
{
case RDP_RTT_RESPONSE_TYPE:

View File

@@ -1257,7 +1257,13 @@ static BOOL rdp_recv_logon_error_info(rdpRdp* rdp, wStream* s, logon_info_ex* in
Stream_Read_UINT32(s, errorNotificationData); /* errorNotificationData (4 bytes) */
WLog_DBG(TAG, "LogonErrorInfo: Data: 0x%08" PRIX32 " Type: 0x%08" PRIX32 "",
errorNotificationData, errorNotificationType);
IFCALL(instance->LogonErrorInfo, instance, errorNotificationData, errorNotificationType);
if (instance->LogonErrorInfo)
{
const int rc =
instance->LogonErrorInfo(instance, errorNotificationData, errorNotificationType);
if (rc < 0)
return FALSE;
}
info->ErrorNotificationType = errorNotificationType;
info->ErrorNotificationData = errorNotificationData;
return TRUE;

View File

@@ -407,7 +407,11 @@ static state_run_t peer_recv_data_pdu(freerdp_peer* client, wStream* s,
return STATE_RUN_FAILED;
Stream_Read_UINT32(s, client->ack_frame_id);
IFCALL(update->SurfaceFrameAcknowledge, update->context, client->ack_frame_id);
if (update->SurfaceFrameAcknowledge)
{
if (!update->SurfaceFrameAcknowledge(update->context, client->ack_frame_id))
return STATE_RUN_FAILED;
}
break;
case DATA_PDU_TYPE_REFRESH_RECT:
@@ -802,7 +806,11 @@ static state_run_t peer_recv_callback_internal(WINPR_ATTR_UNUSED rdpTransport* t
rdpSettings* settings = client->context->settings;
WINPR_ASSERT(settings);
IFCALL(client->ReachedState, client, rdp_get_state(rdp));
if (client->ReachedState)
{
if (!client->ReachedState(client, rdp_get_state(rdp)))
return STATE_RUN_FAILED;
}
switch (rdp_get_state(rdp))
{
case CONNECTION_STATE_INITIAL:
@@ -995,7 +1003,11 @@ static state_run_t peer_recv_callback_internal(WINPR_ATTR_UNUSED rdpTransport* t
{
MONITOR_DEF* monitors = NULL;
IFCALL(client->AdjustMonitorsLayout, client);
if (client->AdjustMonitorsLayout)
{
if (!client->AdjustMonitorsLayout(client))
return STATE_RUN_FAILED;
}
/* client supports the monitorLayout PDU, let's send him the monitors if any */
ret = STATE_RUN_SUCCESS;

View File

@@ -2011,7 +2011,8 @@ void transport_layer_free(rdpTransportLayer* layer)
if (!layer)
return;
IFCALL(intern->pub.Close, intern->pub.userContext);
if (intern->pub.Close)
intern->pub.Close(intern->pub.userContext);
free(intern->userContextShadowPtr);
free(intern);
}

View File

@@ -963,7 +963,11 @@ void update_reset_state(rdpUpdate* update)
WINPR_ASSERT(altsec);
altsec->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE;
IFCALL(altsec->common.SwitchSurface, update->context, &(altsec->switch_surface));
if (altsec->common.SwitchSurface)
{
if (!altsec->common.SwitchSurface(update->context, &(altsec->switch_surface)))
WLog_Print(up->log, WLOG_WARN, "altsec->common.SwitchSurface failed");
}
}
}
@@ -988,9 +992,10 @@ BOOL update_post_connect(rdpUpdate* update)
}
altsec->switch_surface.bitmapId = SCREEN_BITMAP_SURFACE;
IFCALL(update->altsec->SwitchSurface, update->context, &(altsec->switch_surface));
const BOOL rc = IFCALLRESULT(TRUE, update->altsec->SwitchSurface, update->context,
&(altsec->switch_surface));
up->initialState = FALSE;
return TRUE;
return rc;
}
void update_post_disconnect(rdpUpdate* update)