[stream] fix sign issues with stream API use

This commit is contained in:
akallabeth 2024-10-29 15:21:07 +01:00
parent 10e7acdd49
commit 566d4cf637
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
5 changed files with 12 additions and 12 deletions

View File

@ -119,8 +119,8 @@ disp_send_display_control_monitor_layout_pdu(GENERIC_CHANNEL_CALLBACK* callback,
current.Height = 8192; current.Height = 8192;
Stream_Write_UINT32(s, current.Flags); /* Flags (4 bytes) */ Stream_Write_UINT32(s, current.Flags); /* Flags (4 bytes) */
Stream_Write_UINT32(s, current.Left); /* Left (4 bytes) */ Stream_Write_INT32(s, current.Left); /* Left (4 bytes) */
Stream_Write_UINT32(s, current.Top); /* Top (4 bytes) */ Stream_Write_INT32(s, current.Top); /* Top (4 bytes) */
Stream_Write_UINT32(s, current.Width); /* Width (4 bytes) */ Stream_Write_UINT32(s, current.Width); /* Width (4 bytes) */
Stream_Write_UINT32(s, current.Height); /* Height (4 bytes) */ Stream_Write_UINT32(s, current.Height); /* Height (4 bytes) */
Stream_Write_UINT32(s, current.PhysicalWidth); /* PhysicalWidth (4 bytes) */ Stream_Write_UINT32(s, current.PhysicalWidth); /* PhysicalWidth (4 bytes) */

View File

@ -293,10 +293,10 @@ static UINT rdpgfx_send_reset_graphics_pdu(RdpgfxServerContext* context,
for (UINT32 index = 0; index < pdu->monitorCount; index++) for (UINT32 index = 0; index < pdu->monitorCount; index++)
{ {
const MONITOR_DEF* monitor = &(pdu->monitorDefArray[index]); const MONITOR_DEF* monitor = &(pdu->monitorDefArray[index]);
Stream_Write_UINT32(s, monitor->left); /* left (4 bytes) */ Stream_Write_INT32(s, monitor->left); /* left (4 bytes) */
Stream_Write_UINT32(s, monitor->top); /* top (4 bytes) */ Stream_Write_INT32(s, monitor->top); /* top (4 bytes) */
Stream_Write_UINT32(s, monitor->right); /* right (4 bytes) */ Stream_Write_INT32(s, monitor->right); /* right (4 bytes) */
Stream_Write_UINT32(s, monitor->bottom); /* bottom (4 bytes) */ Stream_Write_INT32(s, monitor->bottom); /* bottom (4 bytes) */
Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */ Stream_Write_UINT32(s, monitor->flags); /* flags (4 bytes) */
} }

View File

@ -493,9 +493,9 @@ static UINT urb_select_configuration(IUDEVICE* pdev, GENERIC_CHANNEL_CALLBACK* c
if (MsOutSize > 0) if (MsOutSize > 0)
{ {
/** CbTsUrbResult */ /** CbTsUrbResult */
Stream_Write_UINT32(out, 8 + MsOutSize); Stream_Write_UINT32(out, 8U + (UINT32)MsOutSize);
/** TS_URB_RESULT_HEADER Size*/ /** TS_URB_RESULT_HEADER Size*/
Stream_Write_UINT16(out, 8 + MsOutSize); Stream_Write_UINT16(out, 8U + (UINT32)MsOutSize);
} }
else else
{ {

View File

@ -2626,8 +2626,8 @@ static BOOL update_send_new_or_existing_window(rdpContext* context,
if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET) != 0) if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VIS_OFFSET) != 0)
{ {
Stream_Write_UINT32(s, stateOrder->visibleOffsetX); Stream_Write_INT32(s, stateOrder->visibleOffsetX);
Stream_Write_UINT32(s, stateOrder->visibleOffsetY); Stream_Write_INT32(s, stateOrder->visibleOffsetY);
} }
if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) != 0) if ((orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) != 0)

View File

@ -410,13 +410,13 @@ int er_write_integer(wStream* s, INT32 value)
else if (value <= 32767 && value >= -32768) else if (value <= 32767 && value >= -32768)
{ {
er_write_length(s, 2, FALSE); er_write_length(s, 2, FALSE);
Stream_Write_UINT16_BE(s, value); Stream_Write_INT16_BE(s, value);
return 3; return 3;
} }
else else
{ {
er_write_length(s, 4, FALSE); er_write_length(s, 4, FALSE);
Stream_Write_UINT32_BE(s, value); Stream_Write_INT32_BE(s, value);
return 5; return 5;
} }
} }