|
|
|
@ -2235,6 +2235,11 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self,
|
|
|
|
|
|
|
|
|
|
Bpp = (bpp + 7) / 8;
|
|
|
|
|
bufsize = (width + e) * height * Bpp;
|
|
|
|
|
while (bufsize + 16 > MAX_ORDERS_SIZE)
|
|
|
|
|
{
|
|
|
|
|
height--;
|
|
|
|
|
bufsize = (width + e) * height * Bpp;
|
|
|
|
|
}
|
|
|
|
|
if (xrdp_orders_check(self, bufsize + 16) != 0)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
@ -2254,33 +2259,58 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders *self,
|
|
|
|
|
out_uint16_le(self->out_s, bufsize);
|
|
|
|
|
out_uint16_le(self->out_s, cache_idx);
|
|
|
|
|
|
|
|
|
|
if (Bpp == 4)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
if (Bpp == 3)
|
|
|
|
|
pixel = GETPIXEL32(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 16);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 24);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Bpp == 3)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL32(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 16);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Bpp == 2)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL16(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Bpp == 1)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL8(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < e; j++)
|
|
|
|
|
{
|
|
|
|
|
out_uint8s(self->out_s, Bpp);
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2334,20 +2364,19 @@ xrdp_orders_send_bitmap(struct xrdp_orders *self,
|
|
|
|
|
if (bpp > 24)
|
|
|
|
|
{
|
|
|
|
|
lines_sending = xrdp_bitmap32_compress(data, width, height, s,
|
|
|
|
|
bpp, 16384,
|
|
|
|
|
bpp, MAX_ORDERS_SIZE,
|
|
|
|
|
i - 1, temp_s, e, 0x10);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384,
|
|
|
|
|
lines_sending = xrdp_bitmap_compress(data, width, height, s,
|
|
|
|
|
bpp, MAX_ORDERS_SIZE,
|
|
|
|
|
i - 1, temp_s, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lines_sending != height)
|
|
|
|
|
{
|
|
|
|
|
g_writeln("error in xrdp_orders_send_bitmap, lines_sending(%d) != \
|
|
|
|
|
height(%d)", lines_sending, height);
|
|
|
|
|
return 1;
|
|
|
|
|
height = lines_sending;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bufsize = (int)(s->p - p);
|
|
|
|
@ -2458,6 +2487,7 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
|
|
|
|
|
int pixel = 0;
|
|
|
|
|
int e = 0;
|
|
|
|
|
|
|
|
|
|
g_writeln("xrdp_orders_send_raw_bitmap2:");
|
|
|
|
|
if (width > 64)
|
|
|
|
|
{
|
|
|
|
|
g_writeln("error, width > 64");
|
|
|
|
@ -2479,6 +2509,11 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
|
|
|
|
|
|
|
|
|
|
Bpp = (bpp + 7) / 8;
|
|
|
|
|
bufsize = (width + e) * height * Bpp;
|
|
|
|
|
while (bufsize + 14 > MAX_ORDERS_SIZE)
|
|
|
|
|
{
|
|
|
|
|
height--;
|
|
|
|
|
bufsize = (width + e) * height * Bpp;
|
|
|
|
|
}
|
|
|
|
|
if (xrdp_orders_check(self, bufsize + 14) != 0)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
@ -2499,7 +2534,7 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
|
|
|
|
|
i = cache_idx & 0xff;
|
|
|
|
|
out_uint8(self->out_s, i);
|
|
|
|
|
|
|
|
|
|
if (1 && Bpp == 3)
|
|
|
|
|
if (Bpp == 4)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
@ -2509,43 +2544,48 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self,
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 16);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 24);
|
|
|
|
|
}
|
|
|
|
|
for (j = 0; j < e; j++)
|
|
|
|
|
{
|
|
|
|
|
out_uint8s(self->out_s, Bpp);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else if (Bpp == 3)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
if (Bpp == 3)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL32(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 16);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Bpp == 2)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL16(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
out_uint8(self->out_s, pixel >> 8);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (Bpp == 1)
|
|
|
|
|
{
|
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < width; j++)
|
|
|
|
|
{
|
|
|
|
|
pixel = GETPIXEL8(data, j, i, width);
|
|
|
|
|
out_uint8(self->out_s, pixel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < e; j++)
|
|
|
|
|
{
|
|
|
|
|
out_uint8s(self->out_s, Bpp);
|
|
|
|
|
}
|
|
|
|
|
out_uint8s(self->out_s, Bpp * e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2599,20 +2639,19 @@ xrdp_orders_send_bitmap2(struct xrdp_orders *self,
|
|
|
|
|
if (bpp > 24)
|
|
|
|
|
{
|
|
|
|
|
lines_sending = xrdp_bitmap32_compress(data, width, height, s,
|
|
|
|
|
bpp, 16384,
|
|
|
|
|
bpp, MAX_ORDERS_SIZE,
|
|
|
|
|
i - 1, temp_s, e, 0x10);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, 16384,
|
|
|
|
|
lines_sending = xrdp_bitmap_compress(data, width, height, s,
|
|
|
|
|
bpp, MAX_ORDERS_SIZE,
|
|
|
|
|
i - 1, temp_s, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lines_sending != height)
|
|
|
|
|
{
|
|
|
|
|
g_writeln("error in xrdp_orders_send_bitmap2, lines_sending(%d) != \
|
|
|
|
|
height(%d)", lines_sending, height);
|
|
|
|
|
return 1;
|
|
|
|
|
height = lines_sending;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bufsize = (int)(s->p - p);
|
|
|
|
|