1 |
/* |
/* |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
RDP order processing |
RDP order processing |
4 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2005 |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
37 |
RDP_ORDER_DESKSAVE = 11, |
RDP_ORDER_DESKSAVE = 11, |
38 |
RDP_ORDER_MEMBLT = 13, |
RDP_ORDER_MEMBLT = 13, |
39 |
RDP_ORDER_TRIBLT = 14, |
RDP_ORDER_TRIBLT = 14, |
40 |
|
RDP_ORDER_POLYGON = 20, |
41 |
|
RDP_ORDER_POLYGON2 = 21, |
42 |
RDP_ORDER_POLYLINE = 22, |
RDP_ORDER_POLYLINE = 22, |
43 |
|
RDP_ORDER_ELLIPSE = 25, |
44 |
|
RDP_ORDER_ELLIPSE2 = 26, |
45 |
RDP_ORDER_TEXT2 = 27 |
RDP_ORDER_TEXT2 = 27 |
46 |
}; |
}; |
47 |
|
|
50 |
RDP_ORDER_RAW_BMPCACHE = 0, |
RDP_ORDER_RAW_BMPCACHE = 0, |
51 |
RDP_ORDER_COLCACHE = 1, |
RDP_ORDER_COLCACHE = 1, |
52 |
RDP_ORDER_BMPCACHE = 2, |
RDP_ORDER_BMPCACHE = 2, |
53 |
RDP_ORDER_FONTCACHE = 3 |
RDP_ORDER_FONTCACHE = 3, |
54 |
|
RDP_ORDER_RAW_BMPCACHE2 = 4, |
55 |
|
RDP_ORDER_BMPCACHE2 = 5, |
56 |
|
RDP_ORDER_BRUSHCACHE = 7 |
57 |
}; |
}; |
58 |
|
|
59 |
typedef struct _DESTBLT_ORDER |
typedef struct _DESTBLT_ORDER |
60 |
{ |
{ |
61 |
uint16 x; |
sint16 x; |
62 |
uint16 y; |
sint16 y; |
63 |
uint16 cx; |
sint16 cx; |
64 |
uint16 cy; |
sint16 cy; |
65 |
uint8 opcode; |
uint8 opcode; |
66 |
|
|
67 |
} |
} |
69 |
|
|
70 |
typedef struct _PATBLT_ORDER |
typedef struct _PATBLT_ORDER |
71 |
{ |
{ |
72 |
uint16 x; |
sint16 x; |
73 |
uint16 y; |
sint16 y; |
74 |
uint16 cx; |
sint16 cx; |
75 |
uint16 cy; |
sint16 cy; |
76 |
uint8 opcode; |
uint8 opcode; |
77 |
uint8 bgcolour; |
uint32 bgcolour; |
78 |
uint8 fgcolour; |
uint32 fgcolour; |
79 |
BRUSH brush; |
BRUSH brush; |
80 |
|
|
81 |
} |
} |
83 |
|
|
84 |
typedef struct _SCREENBLT_ORDER |
typedef struct _SCREENBLT_ORDER |
85 |
{ |
{ |
86 |
uint16 x; |
sint16 x; |
87 |
uint16 y; |
sint16 y; |
88 |
uint16 cx; |
sint16 cx; |
89 |
uint16 cy; |
sint16 cy; |
90 |
uint8 opcode; |
uint8 opcode; |
91 |
uint16 srcx; |
sint16 srcx; |
92 |
uint16 srcy; |
sint16 srcy; |
93 |
|
|
94 |
} |
} |
95 |
SCREENBLT_ORDER; |
SCREENBLT_ORDER; |
97 |
typedef struct _LINE_ORDER |
typedef struct _LINE_ORDER |
98 |
{ |
{ |
99 |
uint16 mixmode; |
uint16 mixmode; |
100 |
uint16 startx; |
sint16 startx; |
101 |
uint16 starty; |
sint16 starty; |
102 |
uint16 endx; |
sint16 endx; |
103 |
uint16 endy; |
sint16 endy; |
104 |
uint8 bgcolour; |
uint32 bgcolour; |
105 |
uint8 opcode; |
uint8 opcode; |
106 |
PEN pen; |
PEN pen; |
107 |
|
|
110 |
|
|
111 |
typedef struct _RECT_ORDER |
typedef struct _RECT_ORDER |
112 |
{ |
{ |
113 |
uint16 x; |
sint16 x; |
114 |
uint16 y; |
sint16 y; |
115 |
uint16 cx; |
sint16 cx; |
116 |
uint16 cy; |
sint16 cy; |
117 |
uint8 colour; |
uint32 colour; |
118 |
|
|
119 |
} |
} |
120 |
RECT_ORDER; |
RECT_ORDER; |
122 |
typedef struct _DESKSAVE_ORDER |
typedef struct _DESKSAVE_ORDER |
123 |
{ |
{ |
124 |
uint32 offset; |
uint32 offset; |
125 |
uint16 left; |
sint16 left; |
126 |
uint16 top; |
sint16 top; |
127 |
uint16 right; |
sint16 right; |
128 |
uint16 bottom; |
sint16 bottom; |
129 |
uint8 action; |
uint8 action; |
130 |
|
|
131 |
} |
} |
135 |
{ |
{ |
136 |
uint8 colour_table; |
uint8 colour_table; |
137 |
uint8 cache_id; |
uint8 cache_id; |
138 |
uint16 x; |
sint16 x; |
139 |
uint16 y; |
sint16 y; |
140 |
uint16 cx; |
sint16 cx; |
141 |
uint16 cy; |
sint16 cy; |
142 |
uint8 opcode; |
uint8 opcode; |
143 |
uint16 srcx; |
sint16 srcx; |
144 |
uint16 srcy; |
sint16 srcy; |
145 |
uint8 bgcolour; |
uint32 bgcolour; |
146 |
uint8 fgcolour; |
uint32 fgcolour; |
147 |
BRUSH brush; |
BRUSH brush; |
148 |
uint16 cache_idx; |
uint16 cache_idx; |
149 |
uint16 unknown; |
uint16 unknown; |
155 |
{ |
{ |
156 |
uint8 colour_table; |
uint8 colour_table; |
157 |
uint8 cache_id; |
uint8 cache_id; |
158 |
uint16 x; |
sint16 x; |
159 |
uint16 y; |
sint16 y; |
160 |
uint16 cx; |
sint16 cx; |
161 |
uint16 cy; |
sint16 cy; |
162 |
uint8 opcode; |
uint8 opcode; |
163 |
uint16 srcx; |
sint16 srcx; |
164 |
uint16 srcy; |
sint16 srcy; |
165 |
uint16 cache_idx; |
uint16 cache_idx; |
166 |
|
|
167 |
} |
} |
169 |
|
|
170 |
#define MAX_DATA 256 |
#define MAX_DATA 256 |
171 |
|
|
172 |
|
typedef struct _POLYGON_ORDER |
173 |
|
{ |
174 |
|
sint16 x; |
175 |
|
sint16 y; |
176 |
|
uint8 opcode; |
177 |
|
uint8 fillmode; |
178 |
|
uint32 fgcolour; |
179 |
|
uint8 npoints; |
180 |
|
uint8 datasize; |
181 |
|
uint8 data[MAX_DATA]; |
182 |
|
|
183 |
|
} |
184 |
|
POLYGON_ORDER; |
185 |
|
|
186 |
|
typedef struct _POLYGON2_ORDER |
187 |
|
{ |
188 |
|
sint16 x; |
189 |
|
sint16 y; |
190 |
|
uint8 opcode; |
191 |
|
uint8 fillmode; |
192 |
|
uint32 bgcolour; |
193 |
|
uint32 fgcolour; |
194 |
|
BRUSH brush; |
195 |
|
uint8 npoints; |
196 |
|
uint8 datasize; |
197 |
|
uint8 data[MAX_DATA]; |
198 |
|
|
199 |
|
} |
200 |
|
POLYGON2_ORDER; |
201 |
|
|
202 |
typedef struct _POLYLINE_ORDER |
typedef struct _POLYLINE_ORDER |
203 |
{ |
{ |
204 |
uint16 x; |
sint16 x; |
205 |
uint16 y; |
sint16 y; |
206 |
uint8 opcode; |
uint8 opcode; |
207 |
uint8 fgcolour; |
uint32 fgcolour; |
208 |
uint8 lines; |
uint8 lines; |
209 |
uint8 datasize; |
uint8 datasize; |
210 |
uint8 data[MAX_DATA]; |
uint8 data[MAX_DATA]; |
212 |
} |
} |
213 |
POLYLINE_ORDER; |
POLYLINE_ORDER; |
214 |
|
|
215 |
|
typedef struct _ELLIPSE_ORDER |
216 |
|
{ |
217 |
|
sint16 left; |
218 |
|
sint16 top; |
219 |
|
sint16 right; |
220 |
|
sint16 bottom; |
221 |
|
uint8 opcode; |
222 |
|
uint8 fillmode; |
223 |
|
uint32 fgcolour; |
224 |
|
|
225 |
|
} |
226 |
|
ELLIPSE_ORDER; |
227 |
|
|
228 |
|
typedef struct _ELLIPSE2_ORDER |
229 |
|
{ |
230 |
|
sint16 left; |
231 |
|
sint16 top; |
232 |
|
sint16 right; |
233 |
|
sint16 bottom; |
234 |
|
uint8 opcode; |
235 |
|
uint8 fillmode; |
236 |
|
BRUSH brush; |
237 |
|
uint32 bgcolour; |
238 |
|
uint32 fgcolour; |
239 |
|
|
240 |
|
} |
241 |
|
ELLIPSE2_ORDER; |
242 |
|
|
243 |
#define MAX_TEXT 256 |
#define MAX_TEXT 256 |
244 |
|
|
245 |
typedef struct _TEXT2_ORDER |
typedef struct _TEXT2_ORDER |
248 |
uint8 flags; |
uint8 flags; |
249 |
uint8 mixmode; |
uint8 mixmode; |
250 |
uint8 unknown; |
uint8 unknown; |
251 |
uint8 fgcolour; |
uint32 fgcolour; |
252 |
uint8 bgcolour; |
uint32 bgcolour; |
253 |
uint16 clipleft; |
sint16 clipleft; |
254 |
uint16 cliptop; |
sint16 cliptop; |
255 |
uint16 clipright; |
sint16 clipright; |
256 |
uint16 clipbottom; |
sint16 clipbottom; |
257 |
uint16 boxleft; |
sint16 boxleft; |
258 |
uint16 boxtop; |
sint16 boxtop; |
259 |
uint16 boxright; |
sint16 boxright; |
260 |
uint16 boxbottom; |
sint16 boxbottom; |
261 |
uint16 x; |
sint16 x; |
262 |
uint16 y; |
sint16 y; |
263 |
uint8 length; |
uint8 length; |
264 |
uint8 text[MAX_TEXT]; |
uint8 text[MAX_TEXT]; |
265 |
|
|
279 |
DESKSAVE_ORDER desksave; |
DESKSAVE_ORDER desksave; |
280 |
MEMBLT_ORDER memblt; |
MEMBLT_ORDER memblt; |
281 |
TRIBLT_ORDER triblt; |
TRIBLT_ORDER triblt; |
282 |
|
POLYGON_ORDER polygon; |
283 |
|
POLYGON2_ORDER polygon2; |
284 |
POLYLINE_ORDER polyline; |
POLYLINE_ORDER polyline; |
285 |
|
ELLIPSE_ORDER ellipse; |
286 |
|
ELLIPSE2_ORDER ellipse2; |
287 |
TEXT2_ORDER text2; |
TEXT2_ORDER text2; |
288 |
|
|
289 |
} |
} |
321 |
} |
} |
322 |
RDP_BMPCACHE_ORDER; |
RDP_BMPCACHE_ORDER; |
323 |
|
|
324 |
|
/* RDP_BMPCACHE2_ORDER */ |
325 |
|
#define ID_MASK 0x0007 |
326 |
|
#define MODE_MASK 0x0038 |
327 |
|
#define SQUARE 0x0080 |
328 |
|
#define PERSIST 0x0100 |
329 |
|
#define FLAG_51_UNKNOWN 0x0800 |
330 |
|
|
331 |
|
#define MODE_SHIFT 3 |
332 |
|
|
333 |
|
#define LONG_FORMAT 0x80 |
334 |
|
#define BUFSIZE_MASK 0x3FFF /* or 0x1FFF? */ |
335 |
|
|
336 |
#define MAX_GLYPH 32 |
#define MAX_GLYPH 32 |
337 |
|
|
338 |
typedef struct _RDP_FONT_GLYPH |
typedef struct _RDP_FONT_GLYPH |