From: kubistika Date: Mon, 19 Aug 2019 13:06:42 +0000 (+0300) Subject: server: proxy: use new hooks api X-Git-Tag: 2.0.0~364 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04e1708df1979b13a11f4b9b4a0ebf24ec0bc45a;p=platform%2Fupstream%2Ffreerdp.git server: proxy: use new hooks api --- diff --git a/server/proxy/pf_channels.c b/server/proxy/pf_channels.c index 37102ce..d17f6d4 100644 --- a/server/proxy/pf_channels.c +++ b/server/proxy/pf_channels.c @@ -39,6 +39,7 @@ #include "pf_cliprdr.h" #include "pf_disp.h" #include "pf_log.h" +#include "pf_modules.h" #define TAG PROXY_TAG("channels") @@ -151,7 +152,7 @@ BOOL pf_server_channels_init(pServerContext* ps) return FALSE; } - return TRUE; + return pf_modules_run_hook(HOOK_TYPE_SERVER_CHANNELS_INIT, context); } void pf_server_channels_free(pServerContext* ps) @@ -173,4 +174,6 @@ void pf_server_channels_free(pServerContext* ps) cliprdr_server_context_free(ps->cliprdr); ps->cliprdr = NULL; } + + pf_modules_run_hook(HOOK_TYPE_SERVER_CHANNELS_FREE, (rdpContext*) ps); } diff --git a/server/proxy/pf_client.c b/server/proxy/pf_client.c index f465311..5ba201f 100644 --- a/server/proxy/pf_client.c +++ b/server/proxy/pf_client.c @@ -49,6 +49,7 @@ #include "pf_context.h" #include "pf_update.h" #include "pf_log.h" +#include "pf_modules.h" #define TAG PROXY_TAG("client") @@ -94,6 +95,9 @@ static BOOL pf_client_pre_connect(freerdp* instance) pServerContext* ps = pc->pdata->ps; rdpSettings* settings = instance->settings; + if (!pf_modules_run_hook(HOOK_TYPE_CLIENT_PRE_CONNECT, (rdpContext*)ps)) + return FALSE; + /* * as the client's settings are copied from the server's, GlyphSupportLevel might not be * GLYPH_SUPPORT_NONE. the proxy currently do not support GDI & GLYPH_SUPPORT_CACHE, so diff --git a/server/proxy/pf_input.c b/server/proxy/pf_input.c index 01b8862..5e273cd 100644 --- a/server/proxy/pf_input.c +++ b/server/proxy/pf_input.c @@ -21,6 +21,7 @@ #include "pf_input.h" #include "pf_context.h" +#include "pf_modules.h" static BOOL pf_server_synchronize_event(rdpInput* input, UINT32 flags) { @@ -32,7 +33,6 @@ static BOOL pf_server_synchronize_event(rdpInput* input, UINT32 flags) static BOOL pf_server_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) { - BOOL result = FALSE; pServerContext* ps = (pServerContext*)input->context; pClientContext* pc = ps->pdata->pc; rdpContext* context = (rdpContext*) pc; @@ -45,9 +45,10 @@ static BOOL pf_server_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) event.flags = flags; event.rdp_scan_code = code; - RUN_FILTER(config->Filters, FILTER_TYPE_KEYBOARD, ps->pdata->info, &event, result, - freerdp_input_send_keyboard_event, context->input, flags, code); - return result; + if (pf_modules_run_filter(FILTER_TYPE_KEYBOARD, input->context, &event)) + return freerdp_input_send_keyboard_event(context->input, flags, code); + + return TRUE; } static BOOL pf_server_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code) @@ -65,7 +66,6 @@ static BOOL pf_server_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT static BOOL pf_server_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y) { - BOOL result = FALSE; pServerContext* ps = (pServerContext*)input->context; pClientContext* pc = ps->pdata->pc; rdpContext* context = (rdpContext*) pc; @@ -79,9 +79,10 @@ static BOOL pf_server_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT1 event.x = x; event.y = y; - RUN_FILTER(config->Filters, FILTER_TYPE_MOUSE, ps->pdata->info, &event, result, - freerdp_input_send_mouse_event, context->input, flags, x, y); - return result; + if (pf_modules_run_filter(FILTER_TYPE_MOUSE, input->context, &event)) + return freerdp_input_send_mouse_event(context->input, flags, x, y); + + return TRUE; } static BOOL pf_server_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x,