From eaf0bd8a69164bf0625df9624c3a3909e4c0d2ff Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 25 Jul 2024 11:15:52 +0200 Subject: [PATCH] [server,proxy] automatic intercept for drdynvc * By default no special treatment for drdynvc * If any of the configuration options requires drdynvc intercept do that independently of the intercept/passthrough lists --- server/proxy/pf_context.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/server/proxy/pf_context.c b/server/proxy/pf_context.c index 04433d9dc..8c6b107c4 100644 --- a/server/proxy/pf_context.c +++ b/server/proxy/pf_context.c @@ -26,6 +26,7 @@ #include #include +#include #include "pf_client.h" #include "pf_utils.h" @@ -52,6 +53,31 @@ static BOOL ChannelId_Compare(const void* pv1, const void* pv2) return (*v1 == *v2); } +static BOOL dyn_intercept(pServerContext* ps, const char* name) +{ + if (strncmp(DRDYNVC_SVC_CHANNEL_NAME, name, sizeof(DRDYNVC_SVC_CHANNEL_NAME)) != 0) + return FALSE; + + WINPR_ASSERT(ps); + WINPR_ASSERT(ps->pdata); + + const proxyConfig* cfg = ps->pdata->config; + WINPR_ASSERT(cfg); + if (!cfg->GFX) + return TRUE; + if (!cfg->AudioOutput) + return TRUE; + if (!cfg->AudioInput) + return TRUE; + if (!cfg->Multitouch) + return TRUE; + if (!cfg->VideoRedirection) + return TRUE; + if (!cfg->CameraRedirection) + return TRUE; + return FALSE; +} + pServerStaticChannelContext* StaticChannelContext_new(pServerContext* ps, const char* name, UINT32 id) { @@ -77,6 +103,8 @@ pServerStaticChannelContext* StaticChannelContext_new(pServerContext* ps, const &channel) && channel.intercept) ret->channelMode = PF_UTILS_CHANNEL_INTERCEPT; + else if (dyn_intercept(ps, name)) + ret->channelMode = PF_UTILS_CHANNEL_INTERCEPT; else ret->channelMode = pf_utils_get_channel_mode(ps->pdata->config, name); return ret;