From f0709d00a9044c8eea3eb3cd4ad3e95123e3de7e Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 23 Oct 2023 12:17:23 +0200 Subject: [PATCH] [channel,rail] move client_rail_server_start_cmd the function needs access to channel internals, so move to channel --- channels/rail/client/CMakeLists.txt | 1 + .../common => channels/rail/client}/client_rails.c | 13 ++++++------- client/common/CMakeLists.txt | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) rename {client/common => channels/rail/client}/client_rails.c (94%) diff --git a/channels/rail/client/CMakeLists.txt b/channels/rail/client/CMakeLists.txt index cddf9b74d..ad274b0f2 100644 --- a/channels/rail/client/CMakeLists.txt +++ b/channels/rail/client/CMakeLists.txt @@ -20,6 +20,7 @@ define_channel_client("rail") set(${MODULE_PREFIX}_SRCS ../rail_common.h ../rail_common.c + client_rails.c rail_main.c rail_main.h rail_orders.c diff --git a/client/common/client_rails.c b/channels/rail/client/client_rails.c similarity index 94% rename from client/common/client_rails.c rename to channels/rail/client/client_rails.c index 1be4bbd06..30759651e 100644 --- a/client/common/client_rails.c +++ b/channels/rail/client/client_rails.c @@ -1,8 +1,9 @@ #include - #include +#include "rail_main.h" + UINT client_rail_server_start_cmd(RailClientContext* context) { UINT status; @@ -10,15 +11,13 @@ UINT client_rail_server_start_cmd(RailClientContext* context) RAIL_EXEC_ORDER exec = { 0 }; RAIL_SYSPARAM_ORDER sysparam = { 0 }; RAIL_CLIENT_STATUS_ORDER clientStatus = { 0 }; - rdpClientContext* ctx; - rdpSettings* settings; WINPR_ASSERT(context); + railPlugin* rail = context->handle; + WINPR_ASSERT(rail); + WINPR_ASSERT(rail->rdpcontext); - ctx = (rdpClientContext*)context->custom; - WINPR_ASSERT(ctx); - - settings = ctx->context.settings; + const rdpSettings* settings = rail->rdpcontext->settings; WINPR_ASSERT(settings); clientStatus.flags = TS_RAIL_CLIENTSTATUS_ALLOWLOCALMOVESIZE; diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index e1658e857..04d7d1c1d 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -27,7 +27,6 @@ endif() set(SRCS client.c - client_rails.c cmdline.c cmdline.h file.c