/* Process a bitmap capability set */ static void rdp_process_bitmap_caps(STREAM s) { uint16 width, height, depth; in_uint16_le(s, depth); in_uint8s(s, 6); in_uint16_le(s, width); in_uint16_le(s, height); __android_log_print(ANDROID_LOG_INFO,"JNIMsg","setting desktop size and depth to: %dx%dx%d", width, height, depth); /* * The server may limit depth and change the size of the desktop (for * example when shadowing another session). */ if (g_server_depth != depth) { __android_log_print(ANDROID_LOG_WARN,"JNIMsg","Remote desktop does not support colour depth %d; falling back to %d",g_server_depth, depth); g_server_depth = depth; } if (g_width != width || g_height != height) { __android_log_print(ANDROID_LOG_WARN,"JNIMsg","Remote desktop changed from %dx%d to %dx%d.", g_width,g_height, width, height); g_width = width; g_height = height; ui_resize_window(); } }
/* Process a bitmap capability set */ static void rdp_process_bitmap_caps(STREAM s) { uint16 width, height, depth; in_uint16_le(s, depth); in_uint8s(s, 6); in_uint16_le(s, width); in_uint16_le(s, height); DEBUG(("setting desktop size and depth to: %dx%dx%d\n", width, height, depth)); /* * The server may limit depth and change the size of the desktop (for * example when shadowing another session). */ if (g_server_depth != depth) { warning("Remote desktop does not support colour depth %d; falling back to %d\n", g_server_depth, depth); g_server_depth = depth; } if (g_width != width || g_height != height) { warning("Remote desktop changed from %dx%d to %dx%d.\n", g_width, g_height, width, height); g_width = width; g_height = height; ui_resize_window(); } }
void rdp_process_bitmap_capset(rdpRdp * rdp, STREAM s) { uint16 preferredBitsPerPixel; uint16 desktopWidth; uint16 desktopHeight; uint16 desktopResizeFlag; uint16 bitmapCompressionFlag; uint8 drawingFlags; /* * preferredBitsPerPixel (2 bytes): * A 16-bit, unsigned integer. Color depth of the remote session. In RDP 4.0 and 5.0, * this field MUST be set to 8 (even for a 16-color session) */ in_uint16_le(s, preferredBitsPerPixel); /* preferredBitsPerPixel */ in_uint8s(s, 6); /* Ignore receive1BitPerPixel, receive4BitPerPixel, receive8BitPerPixel */ in_uint16_le(s, desktopWidth); /* desktopWidth */ in_uint16_le(s, desktopHeight); /* desktopHeight */ in_uint8s(s, 2); /* pad */ in_uint16_le(s, desktopResizeFlag); /* desktopResizeFlag */ in_uint16_le(s, bitmapCompressionFlag); /* bitmapCompressionFlag */ in_uint8s(s, 1); /* Ignore highColorFlags */ in_uint8(s, drawingFlags); /* drawingFlags */ /* * The server may limit depth and change the size of the desktop (for * example when shadowing another session). */ if (rdp->settings->server_depth != preferredBitsPerPixel) { ui_warning(rdp->inst, "Remote desktop does not support color depth %d; falling back to %d\n", rdp->settings->server_depth, preferredBitsPerPixel); rdp->settings->server_depth = preferredBitsPerPixel; ui_resize_window(rdp->inst); } if (rdp->settings->width != desktopWidth || rdp->settings->height != desktopHeight) { ui_warning(rdp->inst, "Remote desktop changed from %dx%d to %dx%d.\n", rdp->settings->width, rdp->settings->height, desktopWidth, desktopHeight); rdp->settings->width = desktopWidth; rdp->settings->height = desktopHeight; ui_resize_window(rdp->inst); } }