[cmdline] add prevent-session-lock cmdline argument and settings variable

This commit is contained in:
Mariusz Bialonczyk 2023-10-19 11:52:46 +02:00 committed by akallabeth
parent 9ebbefa5fe
commit c4c8571710
3 changed files with 23 additions and 1 deletions

View File

@ -2937,6 +2937,23 @@ static int freerdp_client_settings_parse_command_line_arguments_int(rdpSettings*
{
settings->DisableCredentialsDelegation = !enable;
}
CommandLineSwitchCase(arg, "prevent-session-lock")
{
if (!freerdp_settings_set_uint32(settings, FreeRDP_FakeMouseMotionInterval, 180))
return COMMAND_LINE_ERROR_MEMORY;
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{
LONGLONG val;
if (!value_to_int(arg->Value, &val, 1, UINT32_MAX))
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
if (!freerdp_settings_set_uint32(settings, FreeRDP_FakeMouseMotionInterval,
(UINT32)val))
return COMMAND_LINE_ERROR_MEMORY;
}
}
CommandLineSwitchCase(arg, "vmconnect")
{
settings->VmConnectMode = TRUE;

View File

@ -498,6 +498,9 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = {
"Print version" },
{ "video", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL,
"Video optimized remoting channel" },
{ "prevent-session-lock", COMMAND_LINE_VALUE_OPTIONAL, "<time in sec>", NULL, NULL, -1, NULL,
"Prevent session locking by injecting fake mouse motion events to the server "
"when the connection is idle (default interval: 180 seconds)" },
{ "vmconnect", COMMAND_LINE_VALUE_OPTIONAL, "<vmid>", NULL, NULL, -1, NULL,
"Hyper-V console (use port 2179, disable negotiation)" },
{ "w", COMMAND_LINE_VALUE_REQUIRED, "<width>", "1024", NULL, -1, NULL, "Width" },

View File

@ -946,6 +946,7 @@ extern "C"
#define FreeRDP_ActionScript (5195)
#define FreeRDP_Floatbar (5196)
#define FreeRDP_TcpConnectTimeout (5197)
#define FreeRDP_FakeMouseMotionInterval (5198)
/**
* FreeRDP Settings Data Structure
@ -1693,7 +1694,8 @@ extern "C"
ALIGN64 char* ActionScript; /* 5195 */
ALIGN64 UINT32 Floatbar; /* 5196 */
ALIGN64 UINT32 TcpConnectTimeout; /* 5197 */
UINT64 padding5312[5312 - 5198]; /* 5198 */
ALIGN64 UINT32 FakeMouseMotionInterval; /* 5198 */
UINT64 padding5312[5312 - 5199]; /* 5199 */
/**
* WARNING: End of ABI stable zone!