diff --git a/protocols/rdp/src/guac_handlers.c b/protocols/rdp/src/guac_handlers.c index 94f274cf..2d1bc20c 100644 --- a/protocols/rdp/src/guac_handlers.c +++ b/protocols/rdp/src/guac_handlers.c @@ -79,13 +79,13 @@ int rdp_guac_client_handle_messages(guac_client* client) { fd_set rfds, wfds; /* get rdp fds */ - if (freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) { + if (!freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count)) { guac_client_log_error(client, "Unable to read RDP file descriptors."); return 1; } /* get channel fds */ - if (freerdp_channels_get_fds(channels, rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) { + if (!freerdp_channels_get_fds(channels, rdp_inst, read_fds, &read_count, write_fds, &write_count)) { guac_client_log_error(client, "Unable to read RDP channel file descriptors."); return 1; } @@ -128,14 +128,14 @@ int rdp_guac_client_handle_messages(guac_client* client) { } } - /* check the libfreerdp fds */ - if (freerdp_check_fds(rdp_inst) != 0) { + /* Check the libfreerdp fds */ + if (!freerdp_check_fds(rdp_inst)) { guac_client_log_error(client, "Error handling RDP file descriptors."); return 1; } - /* check channel fds */ - if (freerdp_channels_check_fds(channels, rdp_inst) != 0) { + /* Check channel fds */ + if (!freerdp_channels_check_fds(channels, rdp_inst)) { guac_client_log_error(client, "Error handling RDP channel file descriptors."); return 1; } diff --git a/protocols/rdp/src/rdp_bitmap.c b/protocols/rdp/src/rdp_bitmap.c index cb597551..8be3b98d 100644 --- a/protocols/rdp/src/rdp_bitmap.c +++ b/protocols/rdp/src/rdp_bitmap.c @@ -93,14 +93,31 @@ void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) { /* Store buffer reference in bitmap */ ((guac_rdp_bitmap*) bitmap)->layer = buffer; + guac_client_log_info(client, "guac_rdp_bitmap_new()"); + } void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap) { - /* STUB */ + + guac_client* client = ((rdp_freerdp_context*) context)->client; + guac_socket* socket = client->socket; + + /* Copy image data from buffer to visible layer */ + guac_protocol_send_copy(socket, + ((guac_rdp_bitmap*) bitmap)->layer, + 0, 0, bitmap->width, bitmap->height, + GUAC_COMP_OVER, + GUAC_DEFAULT_LAYER, bitmap->left, bitmap->top); + + guac_client_log_info(client, "guac_rdp_bitmap_paint()"); + } void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) { guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client_free_buffer(client, ((guac_rdp_bitmap*) bitmap)->layer); + + guac_client_log_info(client, "guac_rdp_bitmap_free()"); + }