{
UINT16 capabilityLength;
- if (!Stream_EnsureRemainingCapacity(s, 2))
+ if (Stream_GetRemainingLength(s) < 2)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, capabilityLength);
- if (!Stream_EnsureRemainingCapacity(s, capabilityLength - 4))
+ if (Stream_GetRemainingLength(s) < capabilityLength - 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Seek(s, capabilityLength - 4);
{
UINT16 capabilityLength;
- if (!Stream_EnsureRemainingCapacity(s, 2))
+ if (Stream_GetRemainingLength(s) < 2)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, capabilityLength);
- if (!Stream_EnsureRemainingCapacity(s, capabilityLength - 4))
+ if (Stream_GetRemainingLength(s) < capabilityLength - 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Seek(s, capabilityLength - 4);
{
UINT16 capabilityLength;
- if (!Stream_EnsureRemainingCapacity(s, 2))
+ if (Stream_GetRemainingLength(s) < 2)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, capabilityLength);
- if (!Stream_EnsureRemainingCapacity(s, capabilityLength - 4))
+ if (Stream_GetRemainingLength(s) < capabilityLength - 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Seek(s, capabilityLength - 4);
{
UINT16 capabilityLength;
- if (!Stream_EnsureRemainingCapacity(s, 2))
+ if (Stream_GetRemainingLength(s) < 2)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, capabilityLength);
- if (!Stream_EnsureRemainingCapacity(s, capabilityLength - 4))
+ if (Stream_GetRemainingLength(s) < capabilityLength - 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Seek(s, capabilityLength - 4);
{
UINT16 capabilityLength;
- if (!Stream_EnsureRemainingCapacity(s, 2))
+ if (Stream_GetRemainingLength(s) < 2)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, capabilityLength);
- if (!Stream_EnsureRemainingCapacity(s, capabilityLength - 4))
+ if (Stream_GetRemainingLength(s) < capabilityLength - 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Seek(s, capabilityLength - 4);
if (!rdpdr || !s)
return CHANNEL_RC_NULL_DATA;
- if (!Stream_EnsureRemainingCapacity(s, 4))
+ if (Stream_GetRemainingLength(s) < 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, numCapabilities);
Stream_Seek(s, 2); /* pad (2 bytes) */
- if (!Stream_EnsureRemainingCapacity(s, sizeof(UINT16) * numCapabilities))
+ if (Stream_GetRemainingLength(s) < sizeof(UINT16) * numCapabilities)
return CHANNEL_RC_NO_BUFFER;
for (i = 0; i < numCapabilities; i++)
static UINT rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, wStream* s)
{
- if (!Stream_EnsureRemainingCapacity(s, 8))
+ if (Stream_GetRemainingLength(s) < 8)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, rdpdr->versionMajor);
UINT16 versionMinor;
UINT32 clientID;
- if (!Stream_EnsureRemainingCapacity(s, 8))
+ if (Stream_GetRemainingLength(s) < 8)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, versionMajor);
if (!rdpdr || !s)
return CHANNEL_RC_NULL_DATA;
- if (!Stream_EnsureRemainingCapacity(s, 4))
+ if (Stream_GetRemainingLength(s) < 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT16(s, component); /* Component (2 bytes) */
case PAKID_CORE_DEVICE_REPLY:
/* connect to a specific resource */
- if (Stream_EnsureRemainingCapacity(s, 8))
+ if (Stream_GetRemainingLength(s) < 8)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT32(s, deviceId);
case PAKID_PRN_CACHE_DATA:
{
UINT32 eventID;
- if (Stream_EnsureRemainingCapacity(s, 4))
+ if (Stream_GetRemainingLength(s) < 4)
return CHANNEL_RC_NO_BUFFER;
Stream_Read_UINT32(s, eventID);