X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=rdp.c;h=e0ce66af31662f88b529c6a514980997082b6ce9;hb=d7f4fdca92c39405a79d71d3910ff114e0a692f0;hp=e8e69cd0a2f2bbe5472a7a9141374f210b0c900d;hpb=99f2e8c32508ab193c1d42221c86cb7fca4be9ab;p=rdpsrv diff --git a/rdp.c b/rdp.c index e8e69cd..e0ce66a 100644 --- a/rdp.c +++ b/rdp.c @@ -152,8 +152,19 @@ void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned hei { STREAM s; - s = rdp_init_data(11*2 + width*height*3); - out_uint16_le(s, RDP_UPDATE_BITMAP); + int length = 10*2 + width*height*3 + 8; + + printf("RDP5 chunk length: %u\n", 10*2 + width*height*3 + 2); + + s = tcp_init(length); + out_uint8(s, 0); // version (RDP5) + out_uint8(s, 0x80 | (length >> 8)); + out_uint8(s, length & 0xff); + + out_uint8(s, 1); // process bitmap update + out_uint16_le(s, 10*2 + width*height*3 + 2); // RDP5 chunk length + out_uint16_le(s, 10*2 + width*height*3); // part length + out_uint16_le(s, 1); // one update out_uint16_le(s, x); // left, top, right, bottom out_uint16_le(s, y); @@ -168,7 +179,7 @@ void rdp_send_bitmap_update(unsigned x, unsigned y, unsigned width, unsigned hei out_uint8p(s, data, width*height*3); s_mark_end(s); - rdp_send_data(s, RDP_DATA_PDU_UPDATE); + tcp_send(s); } #define EXPECT16(value) { in_uint16_le(s, unknown); if (unknown != (value)) printf("Unknown value on code line %u; expected 0x%x, got 0x%x\n", __LINE__, (value), unknown); }