30 |
uint8 *next_packet; |
uint8 *next_packet; |
31 |
uint32 rdp_shareid; |
uint32 rdp_shareid; |
32 |
|
|
33 |
|
#if WITH_DEBUG |
34 |
|
static uint32 packetno; |
35 |
|
#endif |
36 |
|
|
37 |
/* Initialise an RDP packet */ |
/* Initialise an RDP packet */ |
38 |
static STREAM |
static STREAM |
39 |
rdp_init(int maxlen) |
rdp_init(int maxlen) |
95 |
*type = pdu_type & 0xf; |
*type = pdu_type & 0xf; |
96 |
|
|
97 |
#if WITH_DEBUG |
#if WITH_DEBUG |
98 |
DEBUG(("RDP packet (type %x):\n", *type)); |
DEBUG(("RDP packet #%d, (type %x):\n", ++packetno, *type)); |
99 |
hexdump(next_packet, length); |
hexdump(next_packet, length); |
100 |
#endif /* */ |
#endif /* */ |
101 |
|
|
556 |
{ |
{ |
557 |
uint16 num_updates; |
uint16 num_updates; |
558 |
uint16 left, top, right, bottom, width, height; |
uint16 left, top, right, bottom, width, height; |
559 |
uint16 cx, cy, bpp, compress, bufsize, size; |
uint16 cx, cy, bpp, Bpp, compress, bufsize, size; |
560 |
uint8 *data, *bmpdata; |
uint8 *data, *bmpdata; |
561 |
int i; |
int i; |
562 |
|
|
571 |
in_uint16_le(s, width); |
in_uint16_le(s, width); |
572 |
in_uint16_le(s, height); |
in_uint16_le(s, height); |
573 |
in_uint16_le(s, bpp); |
in_uint16_le(s, bpp); |
574 |
|
Bpp = (bpp + 7) / 8; |
575 |
in_uint16_le(s, compress); |
in_uint16_le(s, compress); |
576 |
in_uint16_le(s, bufsize); |
in_uint16_le(s, bufsize); |
577 |
|
|
584 |
if (!compress) |
if (!compress) |
585 |
{ |
{ |
586 |
int y; |
int y; |
587 |
bmpdata = xmalloc(width * height * (bpp / 8)); |
bmpdata = xmalloc(width * height * Bpp); |
588 |
for (y = 0; y < height; y++) |
for (y = 0; y < height; y++) |
589 |
{ |
{ |
590 |
in_uint8a(s, &bmpdata[(height - y - 1) * (width * (bpp / 8))], width * (bpp / 8)); |
in_uint8a(s, &bmpdata[(height - y - 1) * (width * Bpp)], |
591 |
|
width * Bpp); |
592 |
} |
} |
593 |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
594 |
xfree(bmpdata); |
xfree(bmpdata); |
599 |
in_uint16_le(s, size); |
in_uint16_le(s, size); |
600 |
in_uint8s(s, 4); /* line_size, final_size */ |
in_uint8s(s, 4); /* line_size, final_size */ |
601 |
in_uint8p(s, data, size); |
in_uint8p(s, data, size); |
602 |
bmpdata = xmalloc(width * height * (bpp / 8)); |
bmpdata = xmalloc(width * height * Bpp); |
603 |
if (bitmap_decompress(bmpdata, width, height, data, size, bpp)) |
if (bitmap_decompress(bmpdata, width, height, data, size, Bpp)) |
604 |
{ |
{ |
605 |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
ui_paint_bitmap(left, top, cx, cy, width, height, bmpdata); |
606 |
} |
} |