26 |
|
|
27 |
/* Read field indicating which parameters are present */ |
/* Read field indicating which parameters are present */ |
28 |
static void |
static void |
29 |
rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size) |
rdp_in_present(STREAM s, uint32 * present, uint8 flags, int size) |
30 |
{ |
{ |
31 |
uint8 bits; |
uint8 bits; |
32 |
int i; |
int i; |
54 |
|
|
55 |
/* Read a co-ordinate (16-bit, or 8-bit delta) */ |
/* Read a co-ordinate (16-bit, or 8-bit delta) */ |
56 |
static void |
static void |
57 |
rdp_in_coord(STREAM s, uint16 *coord, BOOL delta) |
rdp_in_coord(STREAM s, uint16 * coord, BOOL delta) |
58 |
{ |
{ |
59 |
uint8 change; |
uint8 change; |
60 |
|
|
71 |
|
|
72 |
/* Read a colour entry */ |
/* Read a colour entry */ |
73 |
static void |
static void |
74 |
rdp_in_colour(STREAM s, uint8 *colour) |
rdp_in_colour(STREAM s, uint8 * colour) |
75 |
{ |
{ |
76 |
in_uint8(s, *colour); |
in_uint8(s, *colour); |
77 |
s->p += 2; |
s->p += 2; |
79 |
|
|
80 |
/* Parse bounds information */ |
/* Parse bounds information */ |
81 |
static BOOL |
static BOOL |
82 |
rdp_parse_bounds(STREAM s, BOUNDS *bounds) |
rdp_parse_bounds(STREAM s, BOUNDS * bounds) |
83 |
{ |
{ |
84 |
uint8 present; |
uint8 present; |
85 |
|
|
110 |
|
|
111 |
/* Parse a pen */ |
/* Parse a pen */ |
112 |
static BOOL |
static BOOL |
113 |
rdp_parse_pen(STREAM s, PEN *pen, uint32 present) |
rdp_parse_pen(STREAM s, PEN * pen, uint32 present) |
114 |
{ |
{ |
115 |
if (present & 1) |
if (present & 1) |
116 |
in_uint8(s, pen->style); |
in_uint8(s, pen->style); |
126 |
|
|
127 |
/* Parse a brush */ |
/* Parse a brush */ |
128 |
static BOOL |
static BOOL |
129 |
rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present) |
rdp_parse_brush(STREAM s, BRUSH * brush, uint32 present) |
130 |
{ |
{ |
131 |
if (present & 1) |
if (present & 1) |
132 |
in_uint8(s, brush->xorigin); |
in_uint8(s, brush->xorigin); |
148 |
|
|
149 |
/* Process a destination blt order */ |
/* Process a destination blt order */ |
150 |
static void |
static void |
151 |
process_destblt(STREAM s, DESTBLT_ORDER *os, uint32 present, BOOL delta) |
process_destblt(STREAM s, DESTBLT_ORDER * os, uint32 present, BOOL delta) |
152 |
{ |
{ |
153 |
if (present & 0x01) |
if (present & 0x01) |
154 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
173 |
|
|
174 |
/* Process a pattern blt order */ |
/* Process a pattern blt order */ |
175 |
static void |
static void |
176 |
process_patblt(STREAM s, PATBLT_ORDER *os, uint32 present, BOOL delta) |
process_patblt(STREAM s, PATBLT_ORDER * os, uint32 present, BOOL delta) |
177 |
{ |
{ |
178 |
if (present & 0x0001) |
if (present & 0x0001) |
179 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
198 |
|
|
199 |
rdp_parse_brush(s, &os->brush, present >> 7); |
rdp_parse_brush(s, &os->brush, present >> 7); |
200 |
|
|
201 |
DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", |
DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x, os->y, os->cx, os->cy, os->brush.style, os->bgcolour, os->fgcolour)); |
|
os->opcode, os->x, os->y, os->cx, os->cy, |
|
|
os->brush.style, os->bgcolour, os->fgcolour)); |
|
202 |
|
|
203 |
ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy, |
ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy, |
204 |
&os->brush, os->bgcolour, os->fgcolour); |
&os->brush, os->bgcolour, os->fgcolour); |
206 |
|
|
207 |
/* Process a screen blt order */ |
/* Process a screen blt order */ |
208 |
static void |
static void |
209 |
process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, BOOL delta) |
process_screenblt(STREAM s, SCREENBLT_ORDER * os, uint32 present, BOOL delta) |
210 |
{ |
{ |
211 |
if (present & 0x0001) |
if (present & 0x0001) |
212 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
238 |
|
|
239 |
/* Process a line order */ |
/* Process a line order */ |
240 |
static void |
static void |
241 |
process_line(STREAM s, LINE_ORDER *os, uint32 present, BOOL delta) |
process_line(STREAM s, LINE_ORDER * os, uint32 present, BOOL delta) |
242 |
{ |
{ |
243 |
if (present & 0x0001) |
if (present & 0x0001) |
244 |
in_uint16_le(s, os->mixmode); |
in_uint16_le(s, os->mixmode); |
279 |
|
|
280 |
/* Process an opaque rectangle order */ |
/* Process an opaque rectangle order */ |
281 |
static void |
static void |
282 |
process_rect(STREAM s, RECT_ORDER *os, uint32 present, BOOL delta) |
process_rect(STREAM s, RECT_ORDER * os, uint32 present, BOOL delta) |
283 |
{ |
{ |
284 |
if (present & 0x01) |
if (present & 0x01) |
285 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
304 |
|
|
305 |
/* Process a desktop save order */ |
/* Process a desktop save order */ |
306 |
static void |
static void |
307 |
process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, BOOL delta) |
process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, BOOL delta) |
308 |
{ |
{ |
309 |
int width, height; |
int width, height; |
310 |
|
|
342 |
|
|
343 |
/* Process a memory blt order */ |
/* Process a memory blt order */ |
344 |
static void |
static void |
345 |
process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, BOOL delta) |
process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta) |
346 |
{ |
{ |
347 |
HBITMAP bitmap; |
HBITMAP bitmap; |
348 |
|
|
390 |
|
|
391 |
/* Process a 3-way blt order */ |
/* Process a 3-way blt order */ |
392 |
static void |
static void |
393 |
process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, BOOL delta) |
process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta) |
394 |
{ |
{ |
395 |
HBITMAP bitmap; |
HBITMAP bitmap; |
396 |
|
|
435 |
if (present & 0x010000) |
if (present & 0x010000) |
436 |
in_uint16_le(s, os->unknown); |
in_uint16_le(s, os->unknown); |
437 |
|
|
438 |
DEBUG(("TRIBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d,bs=%d,bg=0x%x,fg=0x%x)\n", |
DEBUG(("TRIBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour)); |
|
os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, |
|
|
os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour)); |
|
439 |
|
|
440 |
bitmap = cache_get_bitmap(os->cache_id, os->cache_idx); |
bitmap = cache_get_bitmap(os->cache_id, os->cache_idx); |
441 |
if (bitmap == NULL) |
if (bitmap == NULL) |
448 |
|
|
449 |
/* Parse a delta co-ordinate in polyline order form */ |
/* Parse a delta co-ordinate in polyline order form */ |
450 |
static int |
static int |
451 |
parse_delta(uint8 *buffer, int *offset) |
parse_delta(uint8 * buffer, int *offset) |
452 |
{ |
{ |
453 |
int value = buffer[(*offset)++]; |
int value = buffer[(*offset)++]; |
454 |
int two_byte = value & 0x80; |
int two_byte = value & 0x80; |
466 |
|
|
467 |
/* Process a polyline order */ |
/* Process a polyline order */ |
468 |
static void |
static void |
469 |
process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, BOOL delta) |
process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta) |
470 |
{ |
{ |
471 |
int index, line, data; |
int index, line, data; |
472 |
int x, y, xfrom, yfrom; |
int x, y, xfrom, yfrom; |
500 |
opcode = ROP2_NXOR; |
opcode = ROP2_NXOR; |
501 |
|
|
502 |
DEBUG(("POLYLINE(x=%d,y=%d,fl=0x%x,fg=0x%x,n=%d,sz=%d)\n", |
DEBUG(("POLYLINE(x=%d,y=%d,fl=0x%x,fg=0x%x,n=%d,sz=%d)\n", |
503 |
os->x, os->y, os->flags, os->fgcolour, os->lines, os->datasize)); |
os->x, os->y, os->flags, os->fgcolour, os->lines, |
504 |
|
os->datasize)); |
505 |
|
|
506 |
DEBUG(("Data: ")); |
DEBUG(("Data: ")); |
507 |
|
|
542 |
|
|
543 |
/* Process a text order */ |
/* Process a text order */ |
544 |
static void |
static void |
545 |
process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, BOOL delta) |
process_text2(STREAM s, TEXT2_ORDER * os, uint32 present, BOOL delta) |
546 |
{ |
{ |
547 |
int i; |
int i; |
548 |
|
|
600 |
in_uint8a(s, os->text, os->length); |
in_uint8a(s, os->text, os->length); |
601 |
} |
} |
602 |
|
|
603 |
DEBUG(("TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,bb=%d,br=%d,fg=0x%x,bg=0x%x,font=%d,fl=0x%x,mix=%d,unk=0x%x,n=%d)\n", |
DEBUG(("TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,bb=%d,br=%d,fg=0x%x,bg=0x%x,font=%d,fl=0x%x,mix=%d,unk=0x%x,n=%d)\n", os->x, os->y, os->clipleft, os->cliptop, os->clipright, os->clipbottom, os->boxleft, os->boxtop, os->boxright, os->boxbottom, os->fgcolour, os->bgcolour, os->font, os->flags, os->mixmode, os->unknown, os->length)); |
|
os->x, os->y, os->clipleft, os->cliptop, os->clipright, |
|
|
os->clipbottom, os->boxleft, os->boxtop, os->boxright, |
|
|
os->boxbottom, os->fgcolour, os->bgcolour, os->font, |
|
|
os->flags, os->mixmode, os->unknown, os->length)); |
|
604 |
|
|
605 |
DEBUG(("Text: ")); |
DEBUG(("Text: ")); |
606 |
|
|