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