libfreerdp-core: can now receive bitmap updates

This commit is contained in:
Marc-André Moreau 2011-07-24 18:24:58 -04:00
parent e1f48c5b28
commit 358e034187
4 changed files with 37 additions and 3 deletions

View File

@ -104,6 +104,11 @@ boolean rdp_client_connect(rdpRdp* rdp)
rdp_client_activate(rdp);
while(1)
{
rdp_recv(rdp);
}
return True;
}

View File

@ -242,6 +242,32 @@ void rdp_read_set_error_info_data_pdu(STREAM* s)
printf("Error Info: 0x%08X\n", errorInfo);
}
void rdp_recv_update_data_pdu(rdpRdp* rdp, STREAM* s)
{
uint16 updateType;
stream_read_uint16(s, updateType); /* updateType (2 bytes) */
switch (updateType)
{
case UPDATE_TYPE_ORDERS:
printf("Orders Update\n");
break;
case UPDATE_TYPE_BITMAP:
printf("Bitmap Update\n");
break;
case UPDATE_TYPE_PALETTE:
printf("Palette Update\n");
break;
case UPDATE_TYPE_SYNCHRONIZE:
printf("Synchronize Update\n");
break;
}
}
void rdp_read_data_pdu(rdpRdp* rdp, STREAM* s)
{
uint8 type;
@ -255,6 +281,7 @@ void rdp_read_data_pdu(rdpRdp* rdp, STREAM* s)
switch (type)
{
case DATA_PDU_TYPE_UPDATE:
rdp_recv_update_data_pdu(rdp, s);
break;
case DATA_PDU_TYPE_CONTROL:

View File

@ -91,6 +91,11 @@ typedef struct rdp_rdp rdpRdp;
#define DATA_PDU_TYPE_STATUS_INFO 0x36
#define DATA_PDU_TYPE_MONITOR_LAYOUT 0x37
#define UPDATE_TYPE_ORDERS 0x0000
#define UPDATE_TYPE_BITMAP 0x0001
#define UPDATE_TYPE_PALETTE 0x0002
#define UPDATE_TYPE_SYNCHRONIZE 0x0003
/* Compression Types */
#define PACKET_COMPRESSED 0x20
#define PACKET_AT_FRONT 0x40

View File

@ -106,9 +106,6 @@ int tls_write(rdpTls* tls, uint8* data, int length)
int status;
int sent = 0;
printf("length:%d\n", length);
freerdp_hexdump(data, length);
while (sent < length)
{
status = SSL_write(tls->ssl, data, length);