server: proxy: use new hooks api

This commit is contained in:
kubistika 2019-08-19 16:06:42 +03:00 committed by akallabeth
parent 32fff644da
commit 04e1708df1
3 changed files with 17 additions and 9 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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,