From e1610a75241083d714bb71cff91daa9332eb9c9d Mon Sep 17 00:00:00 2001 From: Richard Dymond Date: Thu, 2 Jun 2022 08:34:07 -0300 Subject: [PATCH] Add WTSChannelGetOptions --- include/freerdp/channels/wtsvc.h | 1 + libfreerdp/core/server.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/freerdp/channels/wtsvc.h b/include/freerdp/channels/wtsvc.h index 4011e5dfa..28ecd87f7 100644 --- a/include/freerdp/channels/wtsvc.h +++ b/include/freerdp/channels/wtsvc.h @@ -80,6 +80,7 @@ extern "C" FREERDP_API void* WTSChannelGetHandleById(freerdp_peer* client, const UINT16 channel_id); FREERDP_API const char* WTSChannelGetName(freerdp_peer* client, UINT16 channel_id); FREERDP_API char** WTSGetAcceptedChannelNames(freerdp_peer* client, size_t* count); + FREERDP_API INT64 WTSChannelGetOptions(freerdp_peer* client, UINT16 channel_id); #ifdef __cplusplus } diff --git a/libfreerdp/core/server.c b/libfreerdp/core/server.c index 52c1c5b9b..9c4f0c4c8 100644 --- a/libfreerdp/core/server.c +++ b/libfreerdp/core/server.c @@ -805,6 +805,21 @@ char** WTSGetAcceptedChannelNames(freerdp_peer* client, size_t* count) return names; } +INT64 WTSChannelGetOptions(freerdp_peer* client, UINT16 channel_id) +{ + rdpMcsChannel* channel; + + if (!client || !client->context || !client->context->rdp) + return -1; + + channel = wts_get_joined_channel_by_id(client->context->rdp->mcs, channel_id); + + if (!channel) + return -1; + + return (INT64)channel->options; +} + BOOL WINAPI FreeRDP_WTSStartRemoteControlSessionW(LPWSTR pTargetServerName, ULONG TargetLogonId, BYTE HotkeyVk, USHORT HotkeyModifiers) {