server: define surfcmd header length constants.

This commit is contained in:
Vic Lee 2011-08-24 10:07:06 +08:00
parent 72961a256f
commit 98c11f0ae4
3 changed files with 13 additions and 11 deletions

View File

@ -498,7 +498,10 @@ boolean fastpath_send_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND*
size = 0;
if (i == 0)
size += update_write_surfcmd_surface_bits_header(s, cmd);
{
update_write_surfcmd_surface_bits_header(s, cmd);
size += SURFCMD_SURFACE_BITS_HEADER_LENGTH;
}
fragment_size = MIN(stream_get_left(s), bitmapDataLength);
if (fragment_size == bitmapDataLength)

View File

@ -84,9 +84,9 @@ boolean update_recv_surfcmds(rdpUpdate* update, uint16 size, STREAM* s)
return True;
}
int update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cmd)
void update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cmd)
{
stream_check_size(s, 22);
stream_check_size(s, SURFCMD_SURFACE_BITS_HEADER_LENGTH);
stream_write_uint16(s, CMDTYPE_STREAM_SURFACE_BITS);
@ -100,19 +100,15 @@ int update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cm
stream_write_uint16(s, cmd->width);
stream_write_uint16(s, cmd->height);
stream_write_uint32(s, cmd->bitmapDataLength);
return 22;
}
int update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId)
void update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId)
{
stream_check_size(s, 8);
stream_check_size(s, SURFCMD_FRAME_MARKER_LENGTH);
stream_write_uint16(s, CMDTYPE_FRAME_MARKER);
stream_write_uint16(s, frameAction);
stream_write_uint32(s, frameId);
return 8;
}

View File

@ -23,10 +23,13 @@
#include "rdp.h"
#include <freerdp/utils/stream.h>
#define SURFCMD_SURFACE_BITS_HEADER_LENGTH 22
#define SURFCMD_FRAME_MARKER_LENGTH 8
boolean update_recv_surfcmds(rdpUpdate* update, uint16 size, STREAM* s);
int update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cmd);
int update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId);
void update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cmd);
void update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId);
#endif /* __SURFACE */