From fef6cd212b768631f41e9878adec6c070b452ff6 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 5 Jul 2015 18:14:10 -0700 Subject: [PATCH] GUAC-1172: Associate guac_object with RDP filesystem. --- src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c | 7 +++++++ src/protocols/rdp/rdp_fs.c | 4 ++++ src/protocols/rdp/rdp_fs.h | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c b/src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c index 027d0744..5ba08c03 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c @@ -30,6 +30,8 @@ #include #include +#include +#include #ifdef ENABLE_WINPR #include @@ -152,5 +154,10 @@ void guac_rdpdr_register_fs(guac_rdpdrPlugin* rdpdr) { /* Init data */ device->data = data->filesystem; + /* Announce filesystem to client */ + guac_protocol_send_filesystem(rdpdr->client->socket, + data->filesystem->object, "Shared Drive"); + guac_socket_flush(rdpdr->client->socket); + } diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c index 3c2685dc..b4dd9202 100644 --- a/src/protocols/rdp/rdp_fs.c +++ b/src/protocols/rdp/rdp_fs.c @@ -36,6 +36,7 @@ #include #include +#include #include guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) { @@ -43,6 +44,8 @@ guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) { guac_rdp_fs* fs = malloc(sizeof(guac_rdp_fs)); fs->client = client; + fs->object = guac_client_alloc_object(client); + fs->drive_path = strdup(drive_path); fs->file_id_pool = guac_pool_alloc(0); fs->open_files = 0; @@ -52,6 +55,7 @@ guac_rdp_fs* guac_rdp_fs_alloc(guac_client* client, const char* drive_path) { } void guac_rdp_fs_free(guac_rdp_fs* fs) { + guac_client_free_object(fs->client, fs->object); guac_pool_free(fs->file_id_pool); free(fs->drive_path); free(fs); diff --git a/src/protocols/rdp/rdp_fs.h b/src/protocols/rdp/rdp_fs.h index bfbb971a..50c388ea 100644 --- a/src/protocols/rdp/rdp_fs.h +++ b/src/protocols/rdp/rdp_fs.h @@ -38,6 +38,7 @@ #include "config.h" #include +#include #include #include @@ -272,6 +273,11 @@ typedef struct guac_rdp_fs { */ guac_client* client; + /** + * The underlying filesystem object. + */ + guac_object* object; + /** * The root of the filesystem. */