44 |
extern BOOL g_use_rdp5; |
extern BOOL g_use_rdp5; |
45 |
extern uint16 g_server_rdp_version; |
extern uint16 g_server_rdp_version; |
46 |
extern uint32 g_rdp5_performanceflags; |
extern uint32 g_rdp5_performanceflags; |
47 |
extern int g_server_bpp; |
extern int g_server_depth; |
48 |
extern int g_width; |
extern int g_width; |
49 |
extern int g_height; |
extern int g_height; |
50 |
extern BOOL g_bitmap_cache; |
extern BOOL g_bitmap_cache; |
620 |
out_uint16_le(s, RDP_CAPSET_BITMAP); |
out_uint16_le(s, RDP_CAPSET_BITMAP); |
621 |
out_uint16_le(s, RDP_CAPLEN_BITMAP); |
out_uint16_le(s, RDP_CAPLEN_BITMAP); |
622 |
|
|
623 |
out_uint16_le(s, g_server_bpp); /* Preferred BPP */ |
out_uint16_le(s, g_server_depth); /* Preferred colour depth */ |
624 |
out_uint16_le(s, 1); /* Receive 1 BPP */ |
out_uint16_le(s, 1); /* Receive 1 BPP */ |
625 |
out_uint16_le(s, 1); /* Receive 4 BPP */ |
out_uint16_le(s, 1); /* Receive 4 BPP */ |
626 |
out_uint16_le(s, 1); /* Receive 8 BPP */ |
out_uint16_le(s, 1); /* Receive 8 BPP */ |
684 |
out_uint16_le(s, RDP_CAPSET_BMPCACHE); |
out_uint16_le(s, RDP_CAPSET_BMPCACHE); |
685 |
out_uint16_le(s, RDP_CAPLEN_BMPCACHE); |
out_uint16_le(s, RDP_CAPLEN_BMPCACHE); |
686 |
|
|
687 |
Bpp = (g_server_bpp + 7) / 8; |
Bpp = (g_server_depth + 7) / 8; /* bytes per pixel */ |
688 |
out_uint8s(s, 24); /* unused */ |
out_uint8s(s, 24); /* unused */ |
689 |
out_uint16_le(s, 0x258); /* entries */ |
out_uint16_le(s, 0x258); /* entries */ |
690 |
out_uint16_le(s, 0x100 * Bpp); /* max cell size */ |
out_uint16_le(s, 0x100 * Bpp); /* max cell size */ |
881 |
static void |
static void |
882 |
rdp_process_bitmap_caps(STREAM s) |
rdp_process_bitmap_caps(STREAM s) |
883 |
{ |
{ |
884 |
uint16 width, height, bpp; |
uint16 width, height, depth; |
885 |
|
|
886 |
in_uint16_le(s, bpp); |
in_uint16_le(s, depth); |
887 |
in_uint8s(s, 6); |
in_uint8s(s, 6); |
888 |
|
|
889 |
in_uint16_le(s, width); |
in_uint16_le(s, width); |
890 |
in_uint16_le(s, height); |
in_uint16_le(s, height); |
891 |
|
|
892 |
DEBUG(("setting desktop size and bpp to: %dx%dx%d\n", width, height, bpp)); |
DEBUG(("setting desktop size and depth to: %dx%dx%d\n", width, height, depth)); |
893 |
|
|
894 |
/* |
/* |
895 |
* The server may limit bpp and change the size of the desktop (for |
* The server may limit depth and change the size of the desktop (for |
896 |
* example when shadowing another session). |
* example when shadowing another session). |
897 |
*/ |
*/ |
898 |
if (g_server_bpp != bpp) |
if (g_server_depth != depth) |
899 |
{ |
{ |
900 |
warning("colour depth changed from %d to %d\n", g_server_bpp, bpp); |
warning("Remote desktop does not support colour depth %d; falling back to %d\n", |
901 |
g_server_bpp = bpp; |
g_server_depth, depth); |
902 |
|
g_server_depth = depth; |
903 |
} |
} |
904 |
if (g_width != width || g_height != height) |
if (g_width != width || g_height != height) |
905 |
{ |
{ |
906 |
warning("screen size changed from %dx%d to %dx%d\n", g_width, g_height, |
warning("Remote desktop changed from %dx%d to %dx%d.\n", g_width, g_height, |
907 |
width, height); |
width, height); |
908 |
g_width = width; |
g_width = width; |
909 |
g_height = height; |
g_height = height; |