51 *present |=
bits << (
i * 8);
77 int two_byte =
value & 0x80;
113 else if (present & 16)
118 else if (present & 32)
123 else if (present & 64)
128 else if (present & 128)
158 if (out_brush->style & 0x80)
160 colour_code = out_brush->style & 0x0f;
161 cache_idx = out_brush->pattern[0];
165 error(
"error getting brush data, style %x\n", out_brush->style);
166 out_brush->bd =
NULL;
167 memset(out_brush->pattern, 0, 8);
171 out_brush->bd = brush_data;
173 out_brush->style = 3;
218 DEBUG((
"DESTBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d)\n",
230 if (present & 0x0001)
233 if (present & 0x0002)
236 if (present & 0x0004)
239 if (present & 0x0008)
242 if (present & 0x0010)
245 if (present & 0x0020)
248 if (present & 0x0040)
253 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,
266 if (present & 0x0001)
269 if (present & 0x0002)
272 if (present & 0x0004)
275 if (present & 0x0008)
278 if (present & 0x0010)
281 if (present & 0x0020)
284 if (present & 0x0040)
287 DEBUG((
"SCREENBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,srcx=%d,srcy=%d)\n",
297 if (present & 0x0001)
300 if (present & 0x0002)
303 if (present & 0x0004)
306 if (present & 0x0008)
309 if (present & 0x0010)
312 if (present & 0x0020)
315 if (present & 0x0040)
320 DEBUG((
"LINE(op=0x%x,sx=%d,sy=%d,dx=%d,dy=%d,fg=0x%x)\n",
367 DEBUG((
"RECT(x=%d,y=%d,cx=%d,cy=%d,fg=0x%x)\n", os->
x, os->
y, os->
cx, os->
cy, os->
colour));
396 DEBUG((
"DESKSAVE(l=%d,t=%d,r=%d,b=%d,off=%d,op=%d)\n",
414 if (present & 0x0001)
420 if (present & 0x0002)
423 if (present & 0x0004)
426 if (present & 0x0008)
429 if (present & 0x0010)
432 if (present & 0x0020)
435 if (present & 0x0040)
438 if (present & 0x0080)
441 if (present & 0x0100)
444 DEBUG((
"MEMBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,id=%d,idx=%d)\n",
461 if (present & 0x000001)
467 if (present & 0x000002)
470 if (present & 0x000004)
473 if (present & 0x000008)
476 if (present & 0x000010)
479 if (present & 0x000020)
482 if (present & 0x000040)
485 if (present & 0x000080)
488 if (present & 0x000100)
491 if (present & 0x000200)
496 if (present & 0x008000)
499 if (present & 0x010000)
502 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",
548 DEBUG((
"POLYGON(x=%d,y=%d,op=0x%x,fm=%d,fg=0x%x,n=%d,sz=%d)\n",
574 if ((
next - 1) % 4 == 0)
590 error(
"polygon parse error\n");
604 if (present & 0x0001)
607 if (present & 0x0002)
610 if (present & 0x0004)
613 if (present & 0x0008)
616 if (present & 0x0010)
619 if (present & 0x0020)
624 if (present & 0x0800)
627 if (present & 0x1000)
633 DEBUG((
"POLYGON2(x=%d,y=%d,op=0x%x,fm=%d,bs=%d,bg=0x%x,fg=0x%x,n=%d,sz=%d)\n",
662 if ((
next - 1) % 4 == 0)
678 error(
"polygon2 parse error\n");
713 DEBUG((
"POLYLINE(x=%d,y=%d,op=0x%x,fg=0x%x,n=%d,sz=%d)\n",
741 if ((
next - 1) % 4 == 0)
756 error(
"polyline parse error\n");
786 DEBUG((
"ELLIPSE(l=%d,t=%d,r=%d,b=%d,op=0x%x,fm=%d,fg=0x%x)\n", os->
left, os->
top,
799 if (present & 0x0001)
802 if (present & 0x0002)
805 if (present & 0x0004)
808 if (present & 0x0008)
811 if (present & 0x0010)
814 if (present & 0x0020)
817 if (present & 0x0040)
820 if (present & 0x0080)
825 DEBUG((
"ELLIPSE2(l=%d,t=%d,r=%d,b=%d,op=0x%x,fm=%d,bs=%d,bg=0x%x,fg=0x%x)\n",
842 if (present & 0x000001)
845 if (present & 0x000002)
848 if (present & 0x000004)
851 if (present & 0x000008)
854 if (present & 0x000010)
857 if (present & 0x000020)
860 if (present & 0x000040)
863 if (present & 0x000080)
866 if (present & 0x000100)
869 if (present & 0x000200)
872 if (present & 0x000400)
875 if (present & 0x000800)
878 if (present & 0x001000)
881 if (present & 0x002000)
886 if (present & 0x080000)
889 if (present & 0x100000)
892 if (present & 0x200000)
898 DEBUG((
"TEXT2(x=%d,y=%d,cl=%d,ct=%d,cr=%d,cb=%d,bl=%d,bt=%d,br=%d,bb=%d,bs=%d,bg=0x%x,fg=0x%x,font=%d,fl=0x%x,op=0x%x,mix=%d,n=%d)\n", os->
x, os->
y, os->
clipleft, os->
cliptop, os->
clipright, os->
clipbottom, os->
boxleft, os->
boxtop, os->
boxright, os->
boxbottom, os->
brush.style, os->
bgcolour, os->
fgcolour, os->
font, os->
flags, os->
opcode, os->
mixmode, os->
length));
936 DEBUG((
"RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n",
width,
height, cache_id, cache_idx));
960 pad2 = row_size = final_size = 0xffff;
988 DEBUG((
"BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d,bpp=%d,size=%d,pad1=%d,bufsize=%d,pad2=%d,rs=%d,fs=%d)\n",
width,
height, cache_id, cache_idx,
bpp,
size, pad1,
bufsize, pad2, row_size, final_size));
999 DEBUG((
"Failed to decompress bitmap data\n"));
1001 if (pad1 || pad2) {}
1043 cache_idx = ((cache_idx ^
LONG_FORMAT) << 8) + cache_idx_low;
1048 DEBUG((
"BMPCACHE2(compr=%d,flags=%x,cx=%d,cy=%d,id=%d,idx=%d,Bpp=%d,bs=%d)\n",
1057 DEBUG((
"Failed to decompress bitmap data\n"));
1080 DEBUG((
"process_bmpcache2: ui_create_bitmap failed\n"));
1101 for (
i = 0;
i <
map.ncolours;
i++)
1110 DEBUG((
"COLCACHE(id=%d,n=%d)\n", cache_id,
map.ncolours));
1133 DEBUG((
"FONTCACHE(font=%d,n=%d)\n",
font, nglyphs));
1135 for (
i = 0;
i < nglyphs;
i++)
1154 int x,
y, pal_index, in_index,
shift, do2,
i;
1160 for (
y = 7;
y >= 0;
y--)
1164 for (do2 = 0; do2 < 2; do2++)
1170 pal_index = (
in[in_index] >>
shift) & 3;
1172 for (
i = 0;
i < Bpp;
i++)
1174 out[(
y * 8 +
x) * Bpp +
i] = pal[pal_index * Bpp +
i];
1205 if (colour_code == 1)
1220 warning(
"incompatible brush, colour_code %d size %d\n", colour_code,
1225 else if ((colour_code >= 3) && (colour_code <= 6))
1227 Bpp = colour_code - 2;
1231 if (
size == 16 + 4 * Bpp)
1244 warning(
"incompatible brush, colour_code %d size %d\n", colour_code,
size);
1325 error(
"order parsing failed\n");
RD_BOOL bitmap_decompress(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
void cache_put_font(uint8 font, uint16 character, uint16 offset, uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap)
BRUSHDATA * cache_get_brush_data(uint8 colour_code, uint8 idx)
RD_HBITMAP cache_get_bitmap(uint8 id, uint16 idx)
void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap)
void cache_put_brush_data(uint8 colour_code, uint8 idx, BRUSHDATA *brush_data)
static RD_BOOL rdp_parse_brush(STREAM s, BRUSH *brush, uint32 present)
static void process_rect(STREAM s, RECT_ORDER *os, uint32 present, RD_BOOL delta)
static int parse_delta(uint8 *buffer, int *offset)
static void process_bmpcache(STREAM s)
void process_orders(STREAM s, uint16 num_orders)
static void process_polygon2(STREAM s, POLYGON2_ORDER *os, uint32 present, RD_BOOL delta)
static void process_bmpcache2(STREAM s, uint16 flags, RD_BOOL compressed)
static void process_desksave(STREAM s, DESKSAVE_ORDER *os, uint32 present, RD_BOOL delta)
static void process_triblt(STREAM s, TRIBLT_ORDER *os, uint32 present, RD_BOOL delta)
static void process_ellipse2(STREAM s, ELLIPSE2_ORDER *os, uint32 present, RD_BOOL delta)
static void rdp_in_colour(STREAM s, uint32 *colour)
static void process_destblt(STREAM s, DESTBLT_ORDER *os, uint32 present, RD_BOOL delta)
static void process_compressed_8x8_brush_data(uint8 *in, uint8 *out, int Bpp)
static void process_polygon(STREAM s, POLYGON_ORDER *os, uint32 present, RD_BOOL delta)
static void rdp_in_coord(STREAM s, sint16 *coord, RD_BOOL delta)
RDP_VERSION g_rdp_version
static void process_ellipse(STREAM s, ELLIPSE_ORDER *os, uint32 present, RD_BOOL delta)
static void process_brushcache(STREAM s, uint16 flags)
static void rdp_in_present(STREAM s, uint32 *present, uint8 flags, int size)
static void process_fontcache(STREAM s)
static void process_raw_bmpcache(STREAM s)
static RDP_ORDER_STATE g_order_state
static void process_screenblt(STREAM s, SCREENBLT_ORDER *os, uint32 present, RD_BOOL delta)
void reset_order_state(void)
static void setup_brush(BRUSH *out_brush, BRUSH *in_brush)
static void process_memblt(STREAM s, MEMBLT_ORDER *os, uint32 present, RD_BOOL delta)
static void process_colcache(STREAM s)
static void process_text2(STREAM s, TEXT2_ORDER *os, uint32 present, RD_BOOL delta)
static void process_polyline(STREAM s, POLYLINE_ORDER *os, uint32 present, RD_BOOL delta)
static RD_BOOL rdp_parse_pen(STREAM s, PEN *pen, uint32 present)
static RD_BOOL rdp_parse_bounds(STREAM s, BOUNDS *bounds)
static void process_secondary_order(STREAM s)
static void process_patblt(STREAM s, PATBLT_ORDER *os, uint32 present, RD_BOOL delta)
static void process_line(STREAM s, LINE_ORDER *os, uint32 present, RD_BOOL delta)
#define RDP_ORDER_SECONDARY
#define RDP_ORDER_STANDARD
#define RDP_ORDER_LASTBOUNDS
@ RDP_ORDER_RAW_BMPCACHE2
#define in_uint16_le(s, v)
#define in_uint8p(s, v, n)
#define in_uint8a(s, v, n)
#define in_uint16_be(s, v)
#define in_uint32_le(s, v)
void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy)
void ui_rect(int x, int y, int cx, int cy, int colour)
void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
RD_HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
RD_BOOL pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 *key, uint8 width, uint8 height, uint16 length, uint8 *data)
void ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
RD_HGLYPH ui_create_glyph(int width, int height, uint8 *data)
void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, BRUSH *brush, int bgcolour, int fgcolour, uint8 *text, uint8 length)
void ui_set_colourmap(RD_HCOLOURMAP map)
void unimpl(char *format,...)
void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
void ui_set_clip(int x, int y, int cx, int cy)
void ui_polyline(uint8 opcode, RD_POINT *points, int npoints, PEN *pen)
RD_HCOLOURMAP ui_create_colourmap(COLOURMAP *colours)
void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
struct _RD_POINT RD_POINT
enum _RDP_VERSION RDP_VERSION
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLsizei GLsizei * length
GLenum GLuint GLsizei bufsize
GLsizei const GLfloat * points
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static unsigned __int64 next
SCREENBLT_ORDER screenblt
static int processed(const type_t *type)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out