mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[server,warnings] properly handle function return
This commit is contained in:
@@ -2145,7 +2145,10 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMes
|
||||
if ((msg->xPos != client->pointerX) || (msg->yPos != client->pointerY))
|
||||
{
|
||||
WINPR_ASSERT(update->pointer);
|
||||
IFCALL(update->pointer->PointerPosition, context, &pointerPosition);
|
||||
if (CHANNEL_RC_OK != IFCALLRESULT(CHANNEL_RC_OK,
|
||||
update->pointer->PointerPosition, context,
|
||||
&pointerPosition))
|
||||
return -1;
|
||||
client->pointerX = msg->xPos;
|
||||
client->pointerY = msg->yPos;
|
||||
}
|
||||
@@ -2178,16 +2181,21 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMes
|
||||
|
||||
if (client->activated)
|
||||
{
|
||||
IFCALL(update->pointer->PointerNew, context, &pointerNew);
|
||||
if (!IFCALLRESULT(TRUE, update->pointer->PointerNew, context, &pointerNew))
|
||||
return -1;
|
||||
if (client->server->ShowMouseCursor)
|
||||
{
|
||||
IFCALL(update->pointer->PointerCached, context, &pointerCached);
|
||||
if (!IFCALLRESULT(TRUE, update->pointer->PointerCached, context,
|
||||
&pointerCached))
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
POINTER_SYSTEM_UPDATE pointer_system = { 0 };
|
||||
pointer_system.type = SYSPTR_NULL;
|
||||
IFCALL(update->pointer->PointerSystem, context, &pointer_system);
|
||||
if (!IFCALLRESULT(TRUE, update->pointer->PointerSystem, context,
|
||||
&pointer_system))
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2204,8 +2212,10 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMes
|
||||
if (client->activated && client->rdpsnd && client->rdpsnd->Activated)
|
||||
{
|
||||
client->rdpsnd->src_format = msg->audio_format;
|
||||
IFCALL(client->rdpsnd->SendSamples, client->rdpsnd, msg->buf, msg->nFrames,
|
||||
msg->wTimestamp);
|
||||
if (CHANNEL_RC_OK != IFCALLRESULT(CHANNEL_RC_OK, client->rdpsnd->SendSamples,
|
||||
client->rdpsnd, msg->buf, msg->nFrames,
|
||||
msg->wTimestamp))
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -2218,7 +2228,9 @@ static int shadow_client_subsystem_process_message(rdpShadowClient* client, wMes
|
||||
|
||||
if (client->activated && client->rdpsnd && client->rdpsnd->Activated)
|
||||
{
|
||||
IFCALL(client->rdpsnd->SetVolume, client->rdpsnd, msg->left, msg->right);
|
||||
if (CHANNEL_RC_OK != IFCALLRESULT(CHANNEL_RC_OK, client->rdpsnd->SetVolume,
|
||||
client->rdpsnd, msg->left, msg->right))
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -113,7 +113,11 @@ int shadow_client_encomsp_init(rdpShadowClient* client)
|
||||
encomsp->ChangeParticipantControlLevel = encomsp_change_participant_control_level;
|
||||
|
||||
if (client->encomsp)
|
||||
client->encomsp->Start(client->encomsp);
|
||||
{
|
||||
const UINT rc = client->encomsp->Start(client->encomsp);
|
||||
if (rc != CHANNEL_RC_OK)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ static void rdpsnd_activated(RdpsndServerContext* context)
|
||||
{
|
||||
if (audio_format_compatible(&context->server_formats[j], &context->client_formats[i]))
|
||||
{
|
||||
context->SelectFormat(context, WINPR_ASSERTING_INT_CAST(UINT16, i));
|
||||
const UINT rc = context->SelectFormat(context, WINPR_ASSERTING_INT_CAST(UINT16, i));
|
||||
if (rc != CHANNEL_RC_OK)
|
||||
WLog_WARN(TAG, "SelectFormat failed with %" PRIu32, rc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +77,8 @@ int shadow_client_rdpsnd_init(rdpShadowClient* client)
|
||||
rdpsnd->src_format = &rdpsnd->server_formats[0];
|
||||
|
||||
rdpsnd->Activated = rdpsnd_activated;
|
||||
rdpsnd->Initialize(rdpsnd, TRUE);
|
||||
if (rdpsnd->Initialize(rdpsnd, TRUE) != CHANNEL_RC_OK)
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,15 +26,20 @@
|
||||
|
||||
int shadow_client_remdesk_init(rdpShadowClient* client)
|
||||
{
|
||||
RemdeskServerContext* remdesk = NULL;
|
||||
RemdeskServerContext* remdesk = client->remdesk = remdesk_server_context_new(client->vcm);
|
||||
if (!remdesk)
|
||||
return -1;
|
||||
|
||||
remdesk = client->remdesk = remdesk_server_context_new(client->vcm);
|
||||
remdesk->rdpcontext = &client->context;
|
||||
|
||||
remdesk->custom = (void*)client;
|
||||
|
||||
if (client->remdesk)
|
||||
client->remdesk->Start(client->remdesk);
|
||||
{
|
||||
const UINT rc = client->remdesk->Start(client->remdesk);
|
||||
if (rc != CHANNEL_RC_OK)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user