Added new command line swith for automatich assistance control.

This commit is contained in:
Armin Novak 2019-11-25 09:54:56 +01:00
parent 2691532061
commit c5e261e066
7 changed files with 69 additions and 14 deletions

View File

@ -28,6 +28,23 @@
#include "wlf_disp.h"
#include "wlfreerdp.h"
BOOL encomsp_toggle_control(EncomspClientContext* encomsp, BOOL control)
{
ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu;
if (!encomsp)
return FALSE;
pdu.ParticipantId = 0;
pdu.Flags = ENCOMSP_REQUEST_VIEW;
if (control)
pdu.Flags |= ENCOMSP_REQUEST_INTERACT;
encomsp->ChangeParticipantControlLevel(encomsp, &pdu);
return TRUE;
}
/**
* Function description
*
@ -37,6 +54,27 @@ static UINT
wlf_encomsp_participant_created(EncomspClientContext* context,
const ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated)
{
wlfContext* wlf;
rdpSettings* settings;
BOOL request;
if (!context || !context->custom || !participantCreated)
return ERROR_INVALID_PARAMETER;
wlf = (wlfContext*)context->custom;
settings = wlf->context.settings;
if (!settings)
return ERROR_INVALID_PARAMETER;
request = freerdp_settings_get_bool(settings, FreeRDP_RemoteAssistanceRequestControl);
if (request && (participantCreated->Flags & ENCOMSP_MAY_VIEW) &&
!(participantCreated->Flags & ENCOMSP_MAY_INTERACT))
{
if (!encomsp_toggle_control(context, TRUE))
return ERROR_INTERNAL_ERROR;
}
return CHANNEL_RC_OK;
}

View File

@ -773,11 +773,10 @@ xf_encomsp_participant_created(EncomspClientContext* context,
if (!settings)
return ERROR_INVALID_PARAMETER;
#if 0 // TODO
request = freerdp_settings_get_bool(settings, FreeRDP_RequestControl);
if (request && (participantCreated->Flags & ENCOMSP_MAY_VIEW) && !(participantCreated->Flags & ENCOMSP_MAY_INTERACT))
request = freerdp_settings_get_bool(settings, FreeRDP_RemoteAssistanceRequestControl);
if (request && (participantCreated->Flags & ENCOMSP_MAY_VIEW) &&
!(participantCreated->Flags & ENCOMSP_MAY_INTERACT))
xf_toggle_control(xfc);
#endif
return CHANNEL_RC_OK;
}

View File

@ -2893,6 +2893,12 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
else
settings->MaxTimeInCheckLoop = (UINT32)val;
}
CommandLineSwitchCase(arg, "auto-request-control")
{
if (!freerdp_settings_set_bool(settings, FreeRDP_RemoteAssistanceRequestControl,
enable))
return COMMAND_LINE_ERROR;
}
CommandLineSwitchCase(arg, "async-input")
{
settings->AsyncInput = enable;

View File

@ -46,6 +46,8 @@ static const COMMAND_LINE_ARGUMENT_A args[] = {
"Remote application workspace path" },
{ "assistance", COMMAND_LINE_VALUE_REQUIRED, "<password>", NULL, NULL, -1, NULL,
"Remote assistance password" },
{ "auto-request-control", COMMAND_LINE_VALUE_FLAG, "", NULL, NULL, -1, NULL,
"Automatically request remote assistance input control" },
{ "async-channels", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,
"Asynchronous channels (experimental)" },
{ "async-input", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,

View File

@ -633,6 +633,7 @@ typedef struct _RDPDR_PARALLEL RDPDR_PARALLEL;
#define FreeRDP_EncomspVirtualChannel (1029)
#define FreeRDP_RemdeskVirtualChannel (1030)
#define FreeRDP_LyncRdpMode (1031)
#define FreeRDP_RemoteAssistanceRequestControl (1032)
#define FreeRDP_TlsSecurity (1088)
#define FreeRDP_NlaSecurity (1089)
#define FreeRDP_RdpSecurity (1090)
@ -1071,7 +1072,8 @@ struct rdp_settings
ALIGN64 BOOL EncomspVirtualChannel; /* 1029 */
ALIGN64 BOOL RemdeskVirtualChannel; /* 1030 */
ALIGN64 BOOL LyncRdpMode; /* 1031 */
UINT64 padding1088[1088 - 1032]; /* 1032 */
ALIGN64 BOOL RemoteAssistanceRequestControl; /* 1032 */
UINT64 padding1088[1088 - 1033]; /* 1033 */
/**
* X.224 Connection Request/Confirm

View File

@ -165,6 +165,9 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, size_t id)
case FreeRDP_LyncRdpMode:
return settings->LyncRdpMode;
case FreeRDP_RemoteAssistanceRequestControl:
return settings->RemoteAssistanceRequestControl;
case FreeRDP_TlsSecurity:
return settings->TlsSecurity;
@ -715,6 +718,10 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL val)
settings->LyncRdpMode = val;
break;
case FreeRDP_RemoteAssistanceRequestControl:
settings->RemoteAssistanceRequestControl = val;
break;
case FreeRDP_TlsSecurity:
settings->TlsSecurity = val;
break;

View File

@ -54,6 +54,7 @@ static const size_t bool_list_indices[] = {
FreeRDP_EncomspVirtualChannel,
FreeRDP_RemdeskVirtualChannel,
FreeRDP_LyncRdpMode,
FreeRDP_RemoteAssistanceRequestControl,
FreeRDP_TlsSecurity,
FreeRDP_NlaSecurity,
FreeRDP_RdpSecurity,