Integrate feedback from pull request

* orders.c: remove ; at eol
* rdpdr_main.c: simplify error case
* rdpsnd_pulse.c: fix incorrect check
* rdpsnd_main.c: adapt return value according to documentation
* update.c: fix incorrect return values
This commit is contained in:
Bernhard Miklautz 2015-03-30 18:29:32 +02:00
parent 8615f74eac
commit 79de8168f9
5 changed files with 7 additions and 11 deletions

View File

@ -264,7 +264,7 @@ static int rdpdr_server_write_smartcard_capability_set(RdpdrServerContext* conte
static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context) static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context)
{ {
wStream* s; wStream* s;
BOOL status; BOOL status = FALSE;
RDPDR_HEADER header; RDPDR_HEADER header;
UINT16 numCapabilities; UINT16 numCapabilities;
ULONG written; ULONG written;
@ -291,13 +291,9 @@ static int rdpdr_server_send_core_capability_request(RdpdrServerContext* context
goto out_error; goto out_error;
Stream_SealLength(s); Stream_SealLength(s);
status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), &written); status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_Length(s), &written);
Stream_Free(s, TRUE);
return status ? 0 : -1;
out_error: out_error:
Stream_Free(s, TRUE); Stream_Free(s, TRUE);
return -1; return status ? 0 : -1;
} }
static int rdpdr_server_receive_core_capability_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) static int rdpdr_server_receive_core_capability_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header)

View File

@ -545,7 +545,7 @@ static void rdpsnd_pulse_play(rdpsndDevicePlugin* device, BYTE* data, int size)
return; return;
pcmData = rdpsnd_pulse_convert_audio(device, data, &size); pcmData = rdpsnd_pulse_convert_audio(device, data, &size);
if (pcmData) if (!pcmData)
return; return;
pa_threaded_mainloop_lock(pulse->mainloop); pa_threaded_mainloop_lock(pulse->mainloop);

View File

@ -667,7 +667,7 @@ int rdpsnd_server_handle_messages(RdpsndServerContext *context)
if (priv->expectedBytes) if (priv->expectedBytes)
{ {
if (!Stream_EnsureCapacity(s, priv->expectedBytes)) if (!Stream_EnsureCapacity(s, priv->expectedBytes))
return -1; return 0;
return 1; return 1;
} }
} }

View File

@ -944,7 +944,7 @@ int update_approximate_scrblt_order(ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt)
BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt) BOOL update_write_scrblt_order(wStream* s, ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt)
{ {
if (!Stream_EnsureRemainingCapacity(s, update_approximate_scrblt_order(orderInfo, scrblt))); if (!Stream_EnsureRemainingCapacity(s, update_approximate_scrblt_order(orderInfo, scrblt)))
return FALSE; return FALSE;
orderInfo->fieldFlags = 0; orderInfo->fieldFlags = 0;

View File

@ -115,7 +115,7 @@ BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapD
BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) BOOL update_write_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData)
{ {
if (!Stream_EnsureRemainingCapacity(s, 64 + bitmapData->bitmapLength)) if (!Stream_EnsureRemainingCapacity(s, 64 + bitmapData->bitmapLength))
return TRUE; return FALSE;
bitmapData->flags = 0; bitmapData->flags = 0;
bitmapData->cbCompFirstRowSize = 0; bitmapData->cbCompFirstRowSize = 0;
@ -204,7 +204,7 @@ BOOL update_write_bitmap_update(rdpUpdate* update, wStream* s, BITMAP_UPDATE* bi
int i; int i;
if (!Stream_EnsureRemainingCapacity(s, 32)) if (!Stream_EnsureRemainingCapacity(s, 32))
return TRUE; return FALSE;
Stream_Write_UINT16(s, UPDATE_TYPE_BITMAP); /* updateType */ Stream_Write_UINT16(s, UPDATE_TYPE_BITMAP); /* updateType */