From 8bbc31eb53733e9665c9ca16739db3a54aac4505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Fri, 10 Oct 2025 13:43:43 +0200 Subject: [PATCH 1/5] [client,common] fix build without RDPEI channel Also fix existing error messages to mention CHANNEL_RDPEI_CLIENT instead of WITH_CHANNELS to be more specific. --- client/common/client.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/client/common/client.c b/client/common/client.c index 313981c7c..50b535f44 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1862,7 +1862,7 @@ static BOOL freerdp_handle_touch_up(rdpClientContext* cctx, const FreeRDP_TouchC } #else WLog_WARN(TAG, "Touch event detected but RDPEI support not compiled in. Recompile with " - "-DWITH_CHANNELS=ON"); + "-DCHANNEL_RDPEI_CLIENT=ON"); #endif return TRUE; @@ -1910,7 +1910,7 @@ static BOOL freerdp_handle_touch_down(rdpClientContext* cctx, const FreeRDP_Touc } #else WLog_WARN(TAG, "Touch event detected but RDPEI support not compiled in. Recompile with " - "-DWITH_CHANNELS=ON"); + "-DCHANNEL_RDPEI_CLIENT=ON"); #endif return TRUE; @@ -1955,7 +1955,7 @@ static BOOL freerdp_handle_touch_motion(rdpClientContext* cctx, const FreeRDP_To } #else WLog_WARN(TAG, "Touch event detected but RDPEI support not compiled in. Recompile with " - "-DWITH_CHANNELS=ON"); + "-DCHANNEL_RDPEI_CLIENT=ON"); #endif return TRUE; @@ -2098,6 +2098,7 @@ static BOOL freerdp_client_register_pen(rdpClientContext* cctx, UINT32 flags, IN BOOL freerdp_client_handle_pen(rdpClientContext* cctx, UINT32 flags, INT32 deviceid, ...) { +#if defined(CHANNEL_RDPEI_CLIENT) if ((flags & FREERDP_PEN_REGISTER) != 0) { va_list args; @@ -2248,6 +2249,11 @@ BOOL freerdp_client_handle_pen(rdpClientContext* cctx, UINT32 flags, INT32 devic } WLog_WARN(TAG, "Invalid pen %" PRId32 " flags 0x%08" PRIx32, deviceid, flags); +#else + WLog_WARN(TAG, "Pen event detected but RDPEI support not compiled in. Recompile with " + "-DCHANNEL_RDPEI_CLIENT=ON"); +#endif + return FALSE; } @@ -2255,6 +2261,7 @@ BOOL freerdp_client_pen_cancel_all(rdpClientContext* cctx) { WINPR_ASSERT(cctx); +#if defined(CHANNEL_RDPEI_CLIENT) RdpeiClientContext* rdpei = cctx->rdpei; if (!rdpei) @@ -2271,6 +2278,11 @@ BOOL freerdp_client_pen_cancel_all(rdpClientContext* cctx) } } return TRUE; +#else + WLog_WARN(TAG, "Pen event detected but RDPEI support not compiled in. Recompile with " + "-DCHANNEL_RDPEI_CLIENT=ON"); + return FALSE; +#endif } BOOL freerdp_client_is_pen(rdpClientContext* cctx, INT32 deviceid) From 85876844017530f9a4c7679b5f5ffd22c8ce27dd Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 10 Oct 2025 16:54:47 +0200 Subject: [PATCH 2/5] [client,common] fix build without client channels --- client/common/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/common/client.c b/client/common/client.c index 50b535f44..47a3bb3dd 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -148,7 +148,7 @@ rdpContext* freerdp_client_context_new(const RDP_CLIENT_ENTRY_POINTS* pEntryPoin context = instance->context; context->instance = instance; -#if defined(WITH_CHANNELS) +#if defined(WITH_CLIENT_CHANNELS) if (freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0) != CHANNEL_RC_OK) goto out_fail2; From 1a33e4dea33ce92aaab31a65b83c5cdcefeea69d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 14 Oct 2025 16:54:54 +0200 Subject: [PATCH 3/5] [client,common] do not attempt to load channels disabled at build time --- client/common/cmdline.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 113077263..fbe3db532 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -5972,28 +5972,54 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings) #if defined(CHANNEL_AINPUT_CLIENT) { FreeRDP_BOOL_UNUSED, AINPUT_CHANNEL_NAME, NULL }, /* always loaded */ #endif +#ifdef CHANNEL_AUDIN_CLIENT { FreeRDP_AudioCapture, AUDIN_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_RPDSND_CLIENT { FreeRDP_AudioPlayback, RDPSND_CHANNEL_NAME, NULL }, +#endif #ifdef CHANNEL_RDPEI_CLIENT { FreeRDP_MultiTouchInput, RDPEI_CHANNEL_NAME, NULL }, #endif +#ifdef CHANNEL_RDPGFX_CLIENT { FreeRDP_SupportGraphicsPipeline, RDPGFX_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_ECHO_CLIENT { FreeRDP_SupportEchoChannel, ECHO_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_SSHAGENT_CLIENT { FreeRDP_SupportSSHAgentChannel, "sshagent", NULL }, +#endif +#ifdef CHANNEL_DISP_CLIENT { FreeRDP_SupportDisplayControl, DISP_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_GEOMETRY_CLIENT { FreeRDP_SupportGeometryTracking, GEOMETRY_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_VIDEO_CLIENT { FreeRDP_SupportVideoOptimized, VIDEO_CHANNEL_NAME, NULL }, +#endif +#ifdef CHANNEL_RDPEAR_CLIENT { FreeRDP_RemoteCredentialGuard, RDPEAR_CHANNEL_NAME, NULL }, +#endif }; ChannelToLoad staticChannels[] = { +#if defined(CHANNEL_RPDSND_CLIENT) { FreeRDP_AudioPlayback, RDPSND_CHANNEL_NAME, NULL }, +#endif +#if defined(CHANNEL_CLIPRDR_CLIENT) { FreeRDP_RedirectClipboard, CLIPRDR_SVC_CHANNEL_NAME, NULL }, +#endif #if defined(CHANNEL_ENCOMSP_CLIENT) { FreeRDP_EncomspVirtualChannel, ENCOMSP_SVC_CHANNEL_NAME, settings }, #endif +#if defined(CHANNEL_REMDESK_CLIENT) { FreeRDP_RemdeskVirtualChannel, REMDESK_SVC_CHANNEL_NAME, settings }, +#endif +#if defined(CHANNEL_RAIL_CLIENT) { FreeRDP_RemoteApplicationMode, RAIL_SVC_CHANNEL_NAME, settings } +#endif }; /** From 859df133fc7f426751cf83ea0082c80f86c3e4e5 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 14 Oct 2025 16:56:04 +0200 Subject: [PATCH 4/5] [client,wayland] remove now unused rdpei include Fixes: d66b165b8ea2 ("[client,common] common touch handling") --- client/Wayland/wlf_input.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index b56d0a9a9..53f263b71 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -28,9 +28,6 @@ #include #include -#if defined(CHANNEL_RDPEI_CLIENT) -#include -#endif #include #include "wlfreerdp.h" From 87fe0d0d8eee09b05eeb54b11afdb71907354e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Tue, 14 Oct 2025 14:22:39 +0200 Subject: [PATCH 5/5] [channel,server] fix more unguarded use of functions This allows to set any -DCHANNEL_xxx_SERVER=OFF. --- channels/server/channels.c | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/channels/server/channels.c b/channels/server/channels.c index b684d7c1b..1e7c96ba7 100644 --- a/channels/server/channels.c +++ b/channels/server/channels.c @@ -41,20 +41,36 @@ #if defined(CHANNEL_AUDIN_SERVER) #include #endif +#if defined(CHANNEL_RDPSND_SERVER) #include +#endif +#if defined(CHANNEL_CLIPRDR_SERVER) #include +#endif +#if defined(CHANNEL_ECHO_SERVER) #include +#endif +#if defined(CHANNEL_RDPDR_SERVER) #include +#endif #if defined(CHANNEL_RDPEI_SERVER) #include #endif +#if defined(CHANNEL_DRDYNVC_SERVER) #include +#endif +#if defined(CHANNEL_REMDESK_SERVER) #include +#endif +#if defined(CHANNEL_ENCOMSP_SERVER) #include +#endif #if defined(CHANNEL_RAIL_SERVER) #include #endif +#if defined(CHANNEL_TELEMETRY_SERVER) #include +#endif #if defined(CHANNEL_RDPGFX_SERVER) #include #endif @@ -90,20 +106,36 @@ void freerdp_channels_dummy(void) #if defined(CHANNEL_AUDIN_SERVER) audin_server_context* audin = NULL; #endif +#if defined(CHANNEL_RDPSND_SERVER) RdpsndServerContext* rdpsnd = NULL; +#endif +#if defined(CHANNEL_CLIPRDR_SERVER) CliprdrServerContext* cliprdr = NULL; +#endif +#if defined(CHANNEL_ECHO_SERVER) echo_server_context* echo = NULL; +#endif +#if defined(CHANNEL_RDPDR_SERVER) RdpdrServerContext* rdpdr = NULL; +#endif +#if defined(CHANNEL_DRDYNVC_SERVER) DrdynvcServerContext* drdynvc = NULL; +#endif #if defined(CHANNEL_RDPEI_SERVER) RdpeiServerContext* rdpei = NULL; #endif +#if defined(CHANNEL_REMDESK_SERVER) RemdeskServerContext* remdesk = NULL; +#endif +#if defined(CHANNEL_ENCOMSP_SERVER) EncomspServerContext* encomsp = NULL; +#endif #if defined(CHANNEL_RAIL_SERVER) RailServerContext* rail = NULL; #endif +#if defined(CHANNEL_TELEMETRY_SERVER) TelemetryServerContext* telemetry = NULL; +#endif #if defined(CHANNEL_RDPGFX_SERVER) RdpgfxServerContext* rdpgfx = NULL; #endif @@ -129,30 +161,46 @@ void freerdp_channels_dummy(void) #if defined(CHANNEL_AUDIN_SERVER) audin_server_context_free(audin); #endif +#if defined(CHANNEL_RDPSND_SERVER) rdpsnd = rdpsnd_server_context_new(NULL); rdpsnd_server_context_free(rdpsnd); +#endif +#if defined(CHANNEL_CLIPRDR_SERVER) cliprdr = cliprdr_server_context_new(NULL); cliprdr_server_context_free(cliprdr); +#endif +#if defined(CHANNEL_ECHO_SERVER) echo = echo_server_context_new(NULL); echo_server_context_free(echo); +#endif +#if defined(CHANNEL_RDPDR_SERVER) rdpdr = rdpdr_server_context_new(NULL); rdpdr_server_context_free(rdpdr); +#endif +#if defined(CHANNEL_DRDYNVC_SERVER) drdynvc = drdynvc_server_context_new(NULL); drdynvc_server_context_free(drdynvc); +#endif #if defined(CHANNEL_RDPEI_SERVER) rdpei = rdpei_server_context_new(NULL); rdpei_server_context_free(rdpei); #endif +#if defined(CHANNEL_REMDESK_SERVER) remdesk = remdesk_server_context_new(NULL); remdesk_server_context_free(remdesk); +#endif +#if defined(CHANNEL_ENCOMSP_SERVER) encomsp = encomsp_server_context_new(NULL); encomsp_server_context_free(encomsp); +#endif #if defined(CHANNEL_RAIL_SERVER) rail = rail_server_context_new(NULL); rail_server_context_free(rail); #endif +#if defined(CHANNEL_TELEMETRY_SERVER) telemetry = telemetry_server_context_new(NULL); telemetry_server_context_free(telemetry); +#endif #if defined(CHANNEL_RDPGFX_SERVER) rdpgfx = rdpgfx_server_context_new(NULL); rdpgfx_server_context_free(rdpgfx);