From 11deb82bcb6bbc22f864c5b54325d879d9d2f6d1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 18 Jun 2013 14:02:38 -0700 Subject: [PATCH] Associated client with RDPDR, add logging to stubs. --- src/protocols/rdp/client.c | 2 +- src/protocols/rdp/guac_rdpdr/rdpdr_service.c | 16 ++++++++++++++-- src/protocols/rdp/guac_rdpdr/rdpdr_service.h | 5 +++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c index 6e7fba1f..6cffe311 100644 --- a/src/protocols/rdp/client.c +++ b/src/protocols/rdp/client.c @@ -191,7 +191,7 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) { /* Load RDPDR plugin */ if (freerdp_channels_load_plugin(channels, instance->settings, - "guac_rdpdr", NULL)) + "guac_rdpdr", client)) guac_client_log_error(client, "Failed to load guac_rdpdr plugin."); diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_service.c b/src/protocols/rdp/guac_rdpdr/rdpdr_service.c index a7dab24c..f0ea202a 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_service.c +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_service.c @@ -62,7 +62,18 @@ DEFINE_SVC_PLUGIN(guac_rdpdr, "rdpdr", void guac_rdpdr_process_connect(rdpSvcPlugin* plugin) { - /* STUB - init */ + /* Get RDPDR plugin */ + guac_rdpdrPlugin* rdpdr = (guac_rdpdrPlugin*) plugin; + + /* Get client from plugin */ + guac_client* client = (guac_client*) + plugin->channel_entry_points.pExtendedData; + + /* Init plugin */ + rdpdr->client = client; + + /* Log that printing, etc. has been loaded */ + guac_client_log_info(client, "guac_rdpdr connected."); } @@ -77,9 +88,10 @@ void guac_rdpdr_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event) { void guac_rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* input_stream) { - /*guac_rdpdrPlugin* rdpdr = (guac_rdpdrPlugin*) plugin;*/ + guac_rdpdrPlugin* rdpdr = (guac_rdpdrPlugin*) plugin; /* STUB - read packet type, dispatch based on type */ + guac_client_log_info(rdpdr->client, "STUB - RDPDR data received."); } diff --git a/src/protocols/rdp/guac_rdpdr/rdpdr_service.h b/src/protocols/rdp/guac_rdpdr/rdpdr_service.h index 15a9acba..ebb6e1db 100644 --- a/src/protocols/rdp/guac_rdpdr/rdpdr_service.h +++ b/src/protocols/rdp/guac_rdpdr/rdpdr_service.h @@ -51,6 +51,11 @@ typedef struct guac_rdpdrPlugin { */ rdpSvcPlugin plugin; + /** + * Reference to the client owning this instance of the RDPDR plugin. + */ + guac_client* client; + /* STUB */ } guac_rdpdrPlugin;