X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=blobdiff_plain;f=rdp.c;h=49ff6a9722394fee3cb0f3cc3a7fe1787dd26a54;hp=39d2ce8eeb2b3dbe9efd540fb0dff885ea3cb566;hb=2b90e41918be23158e9d56c60b9736ccf107ba52;hpb=7772d71ffd742cfc9b7ff214659d16c5bb56a391 diff --git a/rdp.c b/rdp.c index 39d2ce8..49ff6a9 100644 --- a/rdp.c +++ b/rdp.c @@ -72,7 +72,7 @@ rdp_recv(uint8 * type) #if WITH_DEBUG DEBUG(("RDP packet #%d, (type %x, length %u)\n", ++g_packetno, *type, length)); - //hexdump(g_next_packet, length); + hexdump(g_next_packet, length); #endif /* */ g_next_packet += length; @@ -152,8 +152,14 @@ 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 + 5; + + s = rdp5_init(length, 1); + + 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 +174,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); + rdp5_send(s, 1); } #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); } @@ -275,12 +281,13 @@ rdp_get_logon_info(STREAM s) printf("directory='%s'\n", directory); } - if (!s_check_end(s)) - error("Unknown data at end of logon packet!\n"); + if (!s_check_end(s)) { + printf("Unknown data at end of logon packet!\n"); + } } /* Send a control PDU */ -static void +void rdp_send_control(uint16 action) { STREAM s; @@ -296,7 +303,7 @@ rdp_send_control(uint16 action) } /* Send a synchronisation PDU */ -static void +void rdp_send_synchronise(void) { STREAM s;