#include <freerdp/utils/stream.h>
#include "orders.h"
+#include "per.h"
#include "update.h"
#include "surface.h"
{
uint8 header;
uint16 length;
- uint8 t;
- uint16 hs;
- hs = 2;
stream_read_uint8(s, header);
if (fastpath != NULL)
fastpath->numberEvents = (header & 0x3C) >> 2;
}
- stream_read_uint8(s, length); /* length1 */
- /* If most significant bit is not set, length2 is not presented. */
- if ((length & 0x80))
- {
- hs++;
- length &= 0x7F;
- length <<= 8;
- stream_read_uint8(s, t);
- length += t;
- }
+ per_read_length(s, &length);
- return length - hs;
+ return length - stream_get_length(s);
}
static void fastpath_recv_orders(rdpFastPath* fastpath, STREAM* s)