From 7b866177293ccb27e603f3ca6c5494d13624e6ec Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Wed, 24 Aug 2011 23:31:58 +0800 Subject: [PATCH] libfreerdp-core/fastpath: add surfcmd frame marker. --- libfreerdp-core/fastpath.c | 19 ++++++++++++++++++- libfreerdp-core/fastpath.h | 3 ++- libfreerdp-core/update.c | 3 ++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/libfreerdp-core/fastpath.c b/libfreerdp-core/fastpath.c index 15f80f3d7..155a036bf 100644 --- a/libfreerdp-core/fastpath.c +++ b/libfreerdp-core/fastpath.c @@ -475,7 +475,23 @@ boolean fastpath_send_update_pdu(rdpFastPath* fastpath, STREAM* s) return True; } -boolean fastpath_send_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* cmd) +boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId) +{ + STREAM* s; + s = transport_send_stream_init(fastpath->rdp->transport, 127); + stream_write_uint8(s, 0); /* fpOutputHeader (1 byte) */ + stream_write_uint8(s, 5 + SURFCMD_FRAME_MARKER_LENGTH); /* length1 */ + stream_write_uint8(s, FASTPATH_UPDATETYPE_SURFCMDS); /* updateHeader (1 byte) */ + stream_write_uint16(s, SURFCMD_FRAME_MARKER_LENGTH); /* size (2 bytes) */ + update_write_surfcmd_frame_marker(s, frameAction, frameId); + + if (transport_write(fastpath->rdp->transport, s) < 0) + return False; + + return True; +} + +boolean fastpath_send_surfcmd_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* cmd) { STREAM* s; uint16 size; @@ -527,6 +543,7 @@ boolean fastpath_send_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* if (!fastpath_send_update_pdu(fastpath, s)) return False; } + return True; } diff --git a/libfreerdp-core/fastpath.h b/libfreerdp-core/fastpath.h index dbf5bae18..5a6166aef 100644 --- a/libfreerdp-core/fastpath.h +++ b/libfreerdp-core/fastpath.h @@ -101,7 +101,8 @@ boolean fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s); STREAM* fastpath_update_pdu_init(rdpFastPath* fastpath); boolean fastpath_send_update_pdu(rdpFastPath* fastpath, STREAM* s); -boolean fastpath_send_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* cmd); +boolean fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId); +boolean fastpath_send_surfcmd_surface_bits(rdpFastPath* fastpath, SURFACE_BITS_COMMAND* cmd); rdpFastPath* fastpath_new(rdpRdp* rdp); void fastpath_free(rdpFastPath* fastpath); diff --git a/libfreerdp-core/update.c b/libfreerdp-core/update.c index c8a9bf65c..5c0067377 100644 --- a/libfreerdp-core/update.c +++ b/libfreerdp-core/update.c @@ -19,6 +19,7 @@ #include "update.h" #include "bitmap.h" +#include "surface.h" uint8 UPDATE_TYPE_STRINGS[][32] = { @@ -229,7 +230,7 @@ static void update_send_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* su { rdpRdp* rdp = (rdpRdp*)update->rdp; - fastpath_send_surface_bits(rdp->fastpath, surface_bits_command); + fastpath_send_surfcmd_surface_bits(rdp->fastpath, surface_bits_command); } void update_register_server_callbacks(rdpUpdate* update)