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;
}
}
}
- /* 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;
}
/* 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()");
+
}