{
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);
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); }
}
}
- printf("LISTEN_ON_VNC=%u\n", listen_on_vnc);
-
// activity on VNC socket?
if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) {
unsigned char buf[256];