static void update_send_switch_surface_order(rdpContext* context, SWITCH_SURFACE_ORDER* switch_surface) { wStream* s; int bm, em; BYTE orderType; BYTE controlFlags; int headerLength; rdpUpdate* update = context->update; headerLength = 1; orderType = ORDER_TYPE_SWITCH_SURFACE; controlFlags = ORDER_SECONDARY | (orderType << 2); update_check_flush(context, headerLength + update_approximate_switch_surface_order(switch_surface)); s = update->us; bm = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_switch_surface_order(s, switch_surface); em = Stream_GetPosition(s); Stream_SetPosition(s, bm); Stream_Write_UINT8(s, controlFlags); /* controlFlags (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; }
static void update_send_create_offscreen_bitmap_order(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap) { wStream* s; int bm, em; BYTE orderType; BYTE controlFlags; int headerLength; rdpUpdate* update = context->update; headerLength = 1; orderType = ORDER_TYPE_CREATE_OFFSCREEN_BITMAP; controlFlags = ORDER_SECONDARY | (orderType << 2); update_check_flush(context, headerLength + update_approximate_create_offscreen_bitmap_order(create_offscreen_bitmap)); s = update->us; bm = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_create_offscreen_bitmap_order(s, create_offscreen_bitmap); em = Stream_GetPosition(s); Stream_SetPosition(s, bm); Stream_Write_UINT8(s, controlFlags); /* controlFlags (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; }
static void update_send_cache_brush(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush) { wStream* s; UINT16 flags; int bm, em; int headerLength; INT16 orderLength; rdpUpdate* update = context->update; flags = 0; headerLength = 6; update_check_flush(context, headerLength + update_approximate_cache_brush_order(cache_brush, &flags)); s = update->us; bm = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_cache_brush_order(s, cache_brush, &flags); em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */ Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */ Stream_Write_UINT8(s, ORDER_TYPE_CACHE_BRUSH); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; }
static void update_send_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2) { wStream* s; int bm, em; BYTE orderType; int headerLength; UINT16 extraFlags; INT16 orderLength; rdpUpdate* update = context->update; update_force_flush(context); extraFlags = 0; headerLength = 6; orderType = cache_bitmap_v2->compressed ? ORDER_TYPE_BITMAP_COMPRESSED_V2 : ORDER_TYPE_BITMAP_UNCOMPRESSED_V2; update_check_flush(context, headerLength + update_approximate_cache_bitmap_v2_order(cache_bitmap_v2, cache_bitmap_v2->compressed, &extraFlags)); s = update->us; bm = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_cache_bitmap_v2_order(s, cache_bitmap_v2, cache_bitmap_v2->compressed, &extraFlags); em = Stream_GetPosition(s); orderLength = (em - bm) - 13; Stream_SetPosition(s, bm); Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY | ORDER_TYPE_CHANGE); /* controlFlags (1 byte) */ Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */ Stream_Write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */ Stream_Write_UINT8(s, orderType); /* orderType (1 byte) */ Stream_SetPosition(s, em); update->numberOrders++; update_force_flush(context); }
static void update_send_line_to(rdpContext* context, LINE_TO_ORDER* line_to) { wStream* s; int offset; int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_LINE_TO); update_check_flush(context, headerLength + update_approximate_line_to_order(&orderInfo, line_to)); s = update->us; offset = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_line_to_order(s, &orderInfo, line_to); update_write_order_info(context, s, &orderInfo, offset); update->numberOrders++; }
static void update_send_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) { wStream* s; int offset; int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_OPAQUE_RECT); update_check_flush(context, headerLength + update_approximate_opaque_rect_order(&orderInfo, opaque_rect)); s = update->us; offset = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_opaque_rect_order(s, &orderInfo, opaque_rect); update_write_order_info(context, s, &orderInfo, offset); update->numberOrders++; }
static void update_send_glyph_index(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index) { wStream* s; int offset; int headerLength; ORDER_INFO orderInfo; rdpUpdate* update = context->update; headerLength = update_prepare_order_info(context, &orderInfo, ORDER_TYPE_GLYPH_INDEX); update_check_flush(context, headerLength + update_approximate_glyph_index_order(&orderInfo, glyph_index)); s = update->us; offset = Stream_GetPosition(s); Stream_EnsureRemainingCapacity(s, headerLength); Stream_Seek(s, headerLength); update_write_glyph_index_order(s, &orderInfo, glyph_index); update_write_order_info(context, s, &orderInfo, offset); update->numberOrders++; }