2012-11-18 09:08:03 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Settings Management
|
|
|
|
*
|
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2012-12-05 23:00:49 +04:00
|
|
|
#include <winpr/crt.h>
|
|
|
|
|
2012-11-18 09:08:03 +04:00
|
|
|
#include <freerdp/settings.h>
|
2013-04-25 00:33:43 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2014-09-12 16:36:29 +04:00
|
|
|
#include <freerdp/log.h>
|
|
|
|
|
|
|
|
#define TAG FREERDP_TAG("common")
|
2012-11-18 09:08:03 +04:00
|
|
|
|
2012-12-05 23:00:49 +04:00
|
|
|
int freerdp_addin_set_argument(ADDIN_ARGV* args, char* argument)
|
|
|
|
{
|
|
|
|
int i;
|
2015-03-11 08:52:24 +03:00
|
|
|
char **new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
for (i = 0; i < args->argc; i++)
|
|
|
|
{
|
|
|
|
if (strcmp(args->argv[i], argument) == 0)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-11 08:52:24 +03:00
|
|
|
new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1));
|
|
|
|
if (!new_argv)
|
|
|
|
return -1;
|
|
|
|
args->argv = new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
args->argc++;
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!(args->argv[args->argc - 1] = _strdup(argument)))
|
|
|
|
return -1;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_addin_replace_argument(ADDIN_ARGV* args, char* previous, char* argument)
|
|
|
|
{
|
|
|
|
int i;
|
2015-03-11 08:52:24 +03:00
|
|
|
char **new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
for (i = 0; i < args->argc; i++)
|
|
|
|
{
|
|
|
|
if (strcmp(args->argv[i], previous) == 0)
|
|
|
|
{
|
|
|
|
free(args->argv[i]);
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!(args->argv[i] = _strdup(argument)))
|
|
|
|
return -1;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-11 08:52:24 +03:00
|
|
|
new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1));
|
|
|
|
if (!new_argv)
|
|
|
|
return -1;
|
|
|
|
args->argv = new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
args->argc++;
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!(args->argv[args->argc - 1] = _strdup(argument)))
|
|
|
|
return -1;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_addin_set_argument_value(ADDIN_ARGV* args, char* option, char* value)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char* p;
|
|
|
|
char* str;
|
|
|
|
int length;
|
2015-03-11 08:52:24 +03:00
|
|
|
char **new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
length = strlen(option) + strlen(value) + 1;
|
|
|
|
str = (char*) malloc(length + 1);
|
2015-06-16 16:42:07 +03:00
|
|
|
if (!str)
|
|
|
|
return -1;
|
2012-12-05 23:00:49 +04:00
|
|
|
sprintf_s(str, length + 1, "%s:%s", option, value);
|
|
|
|
|
|
|
|
for (i = 0; i < args->argc; i++)
|
|
|
|
{
|
|
|
|
p = strchr(args->argv[i], ':');
|
|
|
|
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
if (strncmp(args->argv[i], option, p - args->argv[i]) == 0)
|
|
|
|
{
|
|
|
|
free(args->argv[i]);
|
|
|
|
args->argv[i] = str;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-11 08:52:24 +03:00
|
|
|
new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1));
|
|
|
|
if (!new_argv)
|
2015-06-23 22:29:21 +03:00
|
|
|
{
|
|
|
|
free(str);
|
2015-03-11 08:52:24 +03:00
|
|
|
return -1;
|
2015-06-23 22:29:21 +03:00
|
|
|
}
|
|
|
|
|
2015-03-11 08:52:24 +03:00
|
|
|
args->argv = new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
args->argc++;
|
|
|
|
args->argv[args->argc - 1] = str;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, char* previous, char* option, char* value)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char* str;
|
|
|
|
int length;
|
2015-03-11 08:52:24 +03:00
|
|
|
char **new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
|
|
|
|
length = strlen(option) + strlen(value) + 1;
|
|
|
|
str = (char*) malloc(length + 1);
|
2015-06-16 16:42:07 +03:00
|
|
|
if (!str)
|
|
|
|
return -1;
|
2012-12-05 23:00:49 +04:00
|
|
|
sprintf_s(str, length + 1, "%s:%s", option, value);
|
|
|
|
|
|
|
|
for (i = 0; i < args->argc; i++)
|
|
|
|
{
|
|
|
|
if (strcmp(args->argv[i], previous) == 0)
|
|
|
|
{
|
|
|
|
free(args->argv[i]);
|
|
|
|
args->argv[i] = str;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-11 08:52:24 +03:00
|
|
|
new_argv = (char**) realloc(args->argv, sizeof(char*) * (args->argc + 1));
|
|
|
|
if (!new_argv)
|
2015-06-23 22:29:21 +03:00
|
|
|
{
|
|
|
|
free(str);
|
2015-03-11 08:52:24 +03:00
|
|
|
return -1;
|
2015-06-23 22:29:21 +03:00
|
|
|
}
|
2015-03-11 08:52:24 +03:00
|
|
|
args->argv = new_argv;
|
2012-12-05 23:00:49 +04:00
|
|
|
args->argc++;
|
|
|
|
args->argv[args->argc - 1] = str;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-18 14:00:10 +03:00
|
|
|
BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device)
|
2012-11-18 09:08:03 +04:00
|
|
|
{
|
2015-03-10 15:10:39 +03:00
|
|
|
if (!settings->DeviceArray)
|
2015-06-18 14:00:10 +03:00
|
|
|
return FALSE;
|
2015-03-10 15:10:39 +03:00
|
|
|
|
2012-11-18 09:08:03 +04:00
|
|
|
if (settings->DeviceArraySize < (settings->DeviceCount + 1))
|
|
|
|
{
|
2015-03-11 08:52:24 +03:00
|
|
|
UINT32 new_size;
|
|
|
|
RDPDR_DEVICE **new_array;
|
|
|
|
|
|
|
|
new_size = settings->DeviceArraySize * 2;
|
|
|
|
new_array = (RDPDR_DEVICE**)
|
|
|
|
realloc(settings->DeviceArray, new_size * sizeof(RDPDR_DEVICE*));
|
|
|
|
if (!new_array)
|
2015-06-18 14:00:10 +03:00
|
|
|
return FALSE;
|
2015-03-11 08:52:24 +03:00
|
|
|
settings->DeviceArray = new_array;
|
|
|
|
settings->DeviceArraySize = new_size;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
settings->DeviceArray[settings->DeviceCount++] = device;
|
2015-06-18 14:00:10 +03:00
|
|
|
return TRUE;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
|
|
|
|
2013-02-15 04:38:45 +04:00
|
|
|
RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings, const char* name)
|
|
|
|
{
|
2014-02-11 07:12:13 +04:00
|
|
|
UINT32 index;
|
2013-02-15 04:38:45 +04:00
|
|
|
RDPDR_DEVICE* device;
|
|
|
|
|
|
|
|
for (index = 0; index < settings->DeviceCount; index++)
|
|
|
|
{
|
|
|
|
device = (RDPDR_DEVICE*) settings->DeviceArray[index];
|
|
|
|
|
2014-03-26 19:05:12 +04:00
|
|
|
if (!device->Name)
|
2013-09-06 14:35:33 +04:00
|
|
|
continue;
|
|
|
|
|
2013-02-15 04:38:45 +04:00
|
|
|
if (strcmp(device->Name, name) == 0)
|
|
|
|
return device;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-19 06:42:50 +04:00
|
|
|
RDPDR_DEVICE* freerdp_device_clone(RDPDR_DEVICE* device)
|
|
|
|
{
|
|
|
|
if (device->Type == RDPDR_DTYP_FILESYSTEM)
|
|
|
|
{
|
|
|
|
RDPDR_DRIVE* drive = (RDPDR_DRIVE*) device;
|
2014-03-26 19:05:12 +04:00
|
|
|
RDPDR_DRIVE* _drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE));
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_drive)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_drive->Id = drive->Id;
|
|
|
|
_drive->Type = drive->Type;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
2013-10-19 06:42:50 +04:00
|
|
|
_drive->Name = _strdup(drive->Name);
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_drive->Name)
|
|
|
|
goto out_fs_name_error;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
2013-10-19 06:42:50 +04:00
|
|
|
_drive->Path = _strdup(drive->Path);
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_drive->Path)
|
|
|
|
goto out_fs_path_error;
|
|
|
|
|
|
|
|
return (RDPDR_DEVICE*) _drive;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
2014-03-26 19:05:12 +04:00
|
|
|
out_fs_path_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_drive->Name);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_fs_name_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_drive);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
if (device->Type == RDPDR_DTYP_PRINT)
|
2013-10-19 06:42:50 +04:00
|
|
|
{
|
|
|
|
RDPDR_PRINTER* printer = (RDPDR_PRINTER*) device;
|
2014-03-26 19:05:12 +04:00
|
|
|
RDPDR_PRINTER* _printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER));
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_printer)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_printer->Id = printer->Id;
|
|
|
|
_printer->Type = printer->Type;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
|
|
|
if (printer->Name)
|
|
|
|
{
|
|
|
|
_printer->Name = _strdup(printer->Name);
|
|
|
|
if (!_printer->Name)
|
|
|
|
goto out_print_name_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (printer->DriverName)
|
|
|
|
{
|
|
|
|
_printer->DriverName = _strdup(printer->DriverName);
|
|
|
|
if (!_printer->DriverName)
|
|
|
|
goto out_print_path_error;
|
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
return (RDPDR_DEVICE*) _printer;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
2014-03-26 19:05:12 +04:00
|
|
|
out_print_path_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_printer->Name);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_print_name_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_printer);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
if (device->Type == RDPDR_DTYP_SMARTCARD)
|
2013-10-19 06:42:50 +04:00
|
|
|
{
|
|
|
|
RDPDR_SMARTCARD* smartcard = (RDPDR_SMARTCARD*) device;
|
2014-03-26 19:05:12 +04:00
|
|
|
RDPDR_SMARTCARD* _smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD));
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_smartcard)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_smartcard->Id = smartcard->Id;
|
|
|
|
_smartcard->Type = smartcard->Type;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
|
|
|
if (smartcard->Name)
|
|
|
|
{
|
|
|
|
_smartcard->Name = _strdup(smartcard->Name);
|
|
|
|
if (!_smartcard->Name)
|
|
|
|
goto out_smartc_name_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (smartcard->Path)
|
|
|
|
{
|
|
|
|
_smartcard->Path = _strdup(smartcard->Path);
|
|
|
|
if (!_smartcard->Path)
|
|
|
|
goto out_smartc_path_error;
|
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
return (RDPDR_DEVICE*) _smartcard;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
2014-03-26 19:05:12 +04:00
|
|
|
out_smartc_path_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_smartcard->Name);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_smartc_name_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_smartcard);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
if (device->Type == RDPDR_DTYP_SERIAL)
|
2013-10-19 06:42:50 +04:00
|
|
|
{
|
|
|
|
RDPDR_SERIAL* serial = (RDPDR_SERIAL*) device;
|
2014-03-26 19:05:12 +04:00
|
|
|
RDPDR_SERIAL* _serial = (RDPDR_SERIAL*) calloc(1, sizeof(RDPDR_SERIAL));
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_serial)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_serial->Id = serial->Id;
|
|
|
|
_serial->Type = serial->Type;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
|
|
|
if (serial->Name)
|
|
|
|
{
|
|
|
|
_serial->Name = _strdup(serial->Name);
|
|
|
|
if (!_serial->Name)
|
|
|
|
goto out_serial_name_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (serial->Path)
|
|
|
|
{
|
|
|
|
_serial->Path = _strdup(serial->Path);
|
|
|
|
if (!_serial->Path)
|
|
|
|
goto out_serial_path_error;
|
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
2014-06-18 20:20:21 +04:00
|
|
|
if (serial->Driver)
|
|
|
|
{
|
|
|
|
_serial->Driver = _strdup(serial->Driver);
|
|
|
|
if (!_serial->Driver)
|
|
|
|
goto out_serial_driver_error;
|
|
|
|
}
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
return (RDPDR_DEVICE*) _serial;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
2014-06-18 20:20:21 +04:00
|
|
|
out_serial_driver_error:
|
|
|
|
free(_serial->Path);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_serial_path_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_serial->Name);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_serial_name_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_serial);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
if (device->Type == RDPDR_DTYP_PARALLEL)
|
2013-10-19 06:42:50 +04:00
|
|
|
{
|
|
|
|
RDPDR_PARALLEL* parallel = (RDPDR_PARALLEL*) device;
|
2014-03-26 19:05:12 +04:00
|
|
|
RDPDR_PARALLEL* _parallel = (RDPDR_PARALLEL*) calloc(1, sizeof(RDPDR_PARALLEL));
|
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_parallel)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_parallel->Id = parallel->Id;
|
|
|
|
_parallel->Type = parallel->Type;
|
2014-03-26 19:05:12 +04:00
|
|
|
|
|
|
|
if (parallel->Name)
|
|
|
|
{
|
|
|
|
_parallel->Name = _strdup(parallel->Name);
|
|
|
|
if (!_parallel->Name)
|
|
|
|
goto out_parallel_name_error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parallel->Path)
|
|
|
|
{
|
|
|
|
_parallel->Path = _strdup(parallel->Path);
|
|
|
|
if (!_parallel->Path)
|
|
|
|
goto out_parallel_path_error;
|
|
|
|
}
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
return (RDPDR_DEVICE*) _parallel;
|
2014-03-26 19:05:12 +04:00
|
|
|
out_parallel_path_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_parallel->Name);
|
2014-03-26 19:05:12 +04:00
|
|
|
out_parallel_name_error:
|
2014-03-26 02:13:08 +04:00
|
|
|
free(_parallel);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "unknown device type %d", device->Type);
|
2014-03-26 02:13:08 +04:00
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
void freerdp_device_collection_free(rdpSettings* settings)
|
|
|
|
{
|
2014-02-11 07:12:13 +04:00
|
|
|
UINT32 index;
|
2012-11-19 22:26:56 +04:00
|
|
|
RDPDR_DEVICE* device;
|
|
|
|
|
|
|
|
for (index = 0; index < settings->DeviceCount; index++)
|
|
|
|
{
|
|
|
|
device = (RDPDR_DEVICE*) settings->DeviceArray[index];
|
|
|
|
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!device)
|
|
|
|
continue;
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
free(device->Name);
|
|
|
|
|
|
|
|
if (settings->DeviceArray[index]->Type == RDPDR_DTYP_FILESYSTEM)
|
|
|
|
{
|
|
|
|
free(((RDPDR_DRIVE*) device)->Path);
|
|
|
|
}
|
|
|
|
else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_PRINT)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_SMARTCARD)
|
|
|
|
{
|
|
|
|
free(((RDPDR_SMARTCARD*) device)->Path);
|
|
|
|
}
|
|
|
|
else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_SERIAL)
|
|
|
|
{
|
|
|
|
free(((RDPDR_SERIAL*) device)->Path);
|
2014-06-18 20:20:21 +04:00
|
|
|
free(((RDPDR_SERIAL*) device)->Driver);
|
2012-11-19 22:26:56 +04:00
|
|
|
}
|
|
|
|
else if (settings->DeviceArray[index]->Type == RDPDR_DTYP_PARALLEL)
|
|
|
|
{
|
|
|
|
free(((RDPDR_PARALLEL*) device)->Path);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(device);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(settings->DeviceArray);
|
|
|
|
|
|
|
|
settings->DeviceArraySize = 0;
|
|
|
|
settings->DeviceArray = NULL;
|
|
|
|
settings->DeviceCount = 0;
|
|
|
|
}
|
|
|
|
|
2015-06-16 16:42:07 +03:00
|
|
|
BOOL freerdp_static_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* channel)
|
2012-11-18 09:08:03 +04:00
|
|
|
{
|
2015-03-10 15:10:39 +03:00
|
|
|
if (!settings->StaticChannelArray)
|
2015-06-16 16:42:07 +03:00
|
|
|
return FALSE;
|
2015-03-10 15:10:39 +03:00
|
|
|
|
2012-11-18 09:08:03 +04:00
|
|
|
if (settings->StaticChannelArraySize < (settings->StaticChannelCount + 1))
|
|
|
|
{
|
2015-03-11 08:52:24 +03:00
|
|
|
UINT32 new_size;
|
|
|
|
ADDIN_ARGV **new_array;
|
|
|
|
|
|
|
|
new_size = settings->StaticChannelArraySize * 2;
|
|
|
|
new_array = (ADDIN_ARGV**)
|
|
|
|
realloc(settings->StaticChannelArray, new_size * sizeof(ADDIN_ARGV*));
|
|
|
|
if (!new_array)
|
2015-06-16 16:42:07 +03:00
|
|
|
return FALSE;
|
2015-03-11 08:52:24 +03:00
|
|
|
settings->StaticChannelArray = new_array;
|
|
|
|
settings->StaticChannelArraySize = new_size;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
settings->StaticChannelArray[settings->StaticChannelCount++] = channel;
|
2015-06-16 16:42:07 +03:00
|
|
|
return TRUE;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
|
|
|
|
2012-11-21 18:30:06 +04:00
|
|
|
ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings, const char* name)
|
|
|
|
{
|
2014-02-11 07:12:13 +04:00
|
|
|
UINT32 index;
|
2012-11-21 18:30:06 +04:00
|
|
|
ADDIN_ARGV* channel;
|
|
|
|
|
|
|
|
for (index = 0; index < settings->StaticChannelCount; index++)
|
|
|
|
{
|
|
|
|
channel = settings->StaticChannelArray[index];
|
|
|
|
|
|
|
|
if (strcmp(channel->argv[0], name) == 0)
|
|
|
|
return channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-19 06:42:50 +04:00
|
|
|
ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel)
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
ADDIN_ARGV* _channel = NULL;
|
|
|
|
|
|
|
|
_channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_channel)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_channel->argc = channel->argc;
|
2014-03-26 02:13:08 +04:00
|
|
|
_channel->argv = (char**) calloc(channel->argc, sizeof(char*));
|
|
|
|
if (!_channel->argv)
|
|
|
|
goto out_free;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
for (index = 0; index < _channel->argc; index++)
|
|
|
|
{
|
|
|
|
_channel->argv[index] = _strdup(channel->argv[index]);
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_channel->argv[index])
|
|
|
|
goto out_release_args;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return _channel;
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
out_release_args:
|
|
|
|
for (index = 0; _channel->argv[index]; index++)
|
|
|
|
free(_channel->argv[index]);
|
|
|
|
out_free:
|
|
|
|
free(_channel);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
void freerdp_static_channel_collection_free(rdpSettings* settings)
|
|
|
|
{
|
2014-02-11 07:12:13 +04:00
|
|
|
int j;
|
|
|
|
UINT32 i;
|
2012-11-19 22:26:56 +04:00
|
|
|
|
2013-01-29 03:42:32 +04:00
|
|
|
for (i = 0; i < settings->StaticChannelCount; i++)
|
2012-11-19 22:26:56 +04:00
|
|
|
{
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!settings->StaticChannelArray[i])
|
|
|
|
continue;
|
|
|
|
|
2013-01-29 03:42:32 +04:00
|
|
|
for (j = 0; j < settings->StaticChannelArray[i]->argc; j++)
|
|
|
|
free(settings->StaticChannelArray[i]->argv[j]);
|
|
|
|
|
|
|
|
free(settings->StaticChannelArray[i]->argv);
|
|
|
|
free(settings->StaticChannelArray[i]);
|
2012-11-19 22:26:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
free(settings->StaticChannelArray);
|
|
|
|
|
|
|
|
settings->StaticChannelArraySize = 0;
|
|
|
|
settings->StaticChannelArray = NULL;
|
|
|
|
settings->StaticChannelCount = 0;
|
|
|
|
}
|
|
|
|
|
2015-06-16 16:42:07 +03:00
|
|
|
BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* channel)
|
2012-11-18 09:08:03 +04:00
|
|
|
{
|
2015-03-10 15:10:39 +03:00
|
|
|
if (!settings->DynamicChannelArray)
|
2015-06-16 16:42:07 +03:00
|
|
|
return FALSE;
|
2015-03-10 15:10:39 +03:00
|
|
|
|
2012-11-18 09:08:03 +04:00
|
|
|
if (settings->DynamicChannelArraySize < (settings->DynamicChannelCount + 1))
|
|
|
|
{
|
2015-03-13 14:17:22 +03:00
|
|
|
ADDIN_ARGV **new_array;
|
|
|
|
|
2015-06-16 16:42:07 +03:00
|
|
|
new_array = realloc(settings->DynamicChannelArray, settings->DynamicChannelArraySize * sizeof(ADDIN_ARGV*) * 2);
|
2015-03-11 08:52:24 +03:00
|
|
|
if (!new_array)
|
2015-06-16 16:42:07 +03:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
settings->DynamicChannelArraySize *= 2;
|
2015-03-11 08:52:24 +03:00
|
|
|
settings->DynamicChannelArray = new_array;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
settings->DynamicChannelArray[settings->DynamicChannelCount++] = channel;
|
2015-06-16 16:42:07 +03:00
|
|
|
return TRUE;
|
2012-11-18 09:08:03 +04:00
|
|
|
}
|
2012-11-19 22:26:56 +04:00
|
|
|
|
2012-11-21 18:30:06 +04:00
|
|
|
ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, const char* name)
|
|
|
|
{
|
2014-02-11 07:12:13 +04:00
|
|
|
UINT32 index;
|
2012-11-21 18:30:06 +04:00
|
|
|
ADDIN_ARGV* channel;
|
|
|
|
|
|
|
|
for (index = 0; index < settings->DynamicChannelCount; index++)
|
|
|
|
{
|
|
|
|
channel = settings->DynamicChannelArray[index];
|
|
|
|
|
|
|
|
if (strcmp(channel->argv[0], name) == 0)
|
|
|
|
return channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-19 06:42:50 +04:00
|
|
|
ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel)
|
|
|
|
{
|
|
|
|
int index;
|
|
|
|
ADDIN_ARGV* _channel = NULL;
|
|
|
|
|
|
|
|
_channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
|
2015-02-07 01:35:14 +03:00
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_channel)
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
_channel->argc = channel->argc;
|
|
|
|
_channel->argv = (char**) malloc(sizeof(char*) * channel->argc);
|
2015-02-07 01:35:14 +03:00
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_channel->argv)
|
|
|
|
goto out_free;
|
2013-10-19 06:42:50 +04:00
|
|
|
|
|
|
|
for (index = 0; index < _channel->argc; index++)
|
|
|
|
{
|
|
|
|
_channel->argv[index] = _strdup(channel->argv[index]);
|
2015-02-07 01:35:14 +03:00
|
|
|
|
2014-03-26 02:13:08 +04:00
|
|
|
if (!_channel->argv[index])
|
|
|
|
goto out_release_args;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return _channel;
|
2014-03-26 02:13:08 +04:00
|
|
|
|
|
|
|
out_release_args:
|
|
|
|
for (index = 0; _channel->argv[index]; index++)
|
|
|
|
free(_channel->argv[index]);
|
|
|
|
out_free:
|
|
|
|
free(_channel);
|
|
|
|
return NULL;
|
2013-10-19 06:42:50 +04:00
|
|
|
}
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
void freerdp_dynamic_channel_collection_free(rdpSettings* settings)
|
|
|
|
{
|
2014-06-20 21:52:13 +04:00
|
|
|
int j;
|
|
|
|
UINT32 i;
|
2012-11-19 22:26:56 +04:00
|
|
|
|
2014-06-20 21:52:13 +04:00
|
|
|
for (i = 0; i < settings->DynamicChannelCount; i++)
|
2012-11-19 22:26:56 +04:00
|
|
|
{
|
2015-06-17 23:08:02 +03:00
|
|
|
if (!settings->DynamicChannelArray[i])
|
|
|
|
continue;
|
|
|
|
|
2014-06-20 21:52:13 +04:00
|
|
|
for (j = 0; j < settings->DynamicChannelArray[i]->argc; j++)
|
|
|
|
free(settings->DynamicChannelArray[i]->argv[j]);
|
|
|
|
|
|
|
|
free(settings->DynamicChannelArray[i]->argv);
|
|
|
|
free(settings->DynamicChannelArray[i]);
|
2012-11-19 22:26:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
free(settings->DynamicChannelArray);
|
|
|
|
|
|
|
|
settings->DynamicChannelArraySize = 0;
|
|
|
|
settings->DynamicChannelArray = NULL;
|
|
|
|
settings->DynamicChannelCount = 0;
|
|
|
|
}
|
2013-03-20 23:33:33 +04:00
|
|
|
|
2013-11-04 01:25:56 +04:00
|
|
|
void freerdp_target_net_addresses_free(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
UINT32 index;
|
|
|
|
|
|
|
|
for (index = 0; index < settings->TargetNetAddressCount; index++)
|
|
|
|
free(settings->TargetNetAddresses[index]);
|
|
|
|
|
|
|
|
free(settings->TargetNetAddresses);
|
2015-05-06 23:32:45 +03:00
|
|
|
free(settings->TargetNetPorts);
|
2013-11-04 01:25:56 +04:00
|
|
|
|
|
|
|
settings->TargetNetAddressCount = 0;
|
|
|
|
settings->TargetNetAddresses = NULL;
|
2015-05-06 23:32:45 +03:00
|
|
|
settings->TargetNetPorts = NULL;
|
2013-11-04 01:25:56 +04:00
|
|
|
}
|
|
|
|
|
2013-09-17 22:56:23 +04:00
|
|
|
void freerdp_performance_flags_make(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
settings->PerformanceFlags = PERF_FLAG_NONE;
|
|
|
|
|
|
|
|
if (settings->AllowFontSmoothing)
|
|
|
|
settings->PerformanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
|
|
|
|
|
|
|
|
if (settings->AllowDesktopComposition)
|
|
|
|
settings->PerformanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
|
|
|
|
|
|
|
|
if (settings->DisableWallpaper)
|
|
|
|
settings->PerformanceFlags |= PERF_DISABLE_WALLPAPER;
|
|
|
|
|
|
|
|
if (settings->DisableFullWindowDrag)
|
|
|
|
settings->PerformanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
|
|
|
|
|
|
|
|
if (settings->DisableMenuAnims)
|
|
|
|
settings->PerformanceFlags |= PERF_DISABLE_MENUANIMATIONS;
|
|
|
|
|
|
|
|
if (settings->DisableThemes)
|
|
|
|
settings->PerformanceFlags |= PERF_DISABLE_THEMING;
|
|
|
|
}
|
|
|
|
|
|
|
|
void freerdp_performance_flags_split(rdpSettings* settings)
|
|
|
|
{
|
|
|
|
settings->AllowFontSmoothing = (settings->PerformanceFlags & PERF_ENABLE_FONT_SMOOTHING) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
settings->AllowDesktopComposition = (settings->PerformanceFlags & PERF_ENABLE_DESKTOP_COMPOSITION) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
settings->DisableWallpaper = (settings->PerformanceFlags & PERF_DISABLE_WALLPAPER) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
settings->DisableFullWindowDrag = (settings->PerformanceFlags & PERF_DISABLE_FULLWINDOWDRAG) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
settings->DisableMenuAnims = (settings->PerformanceFlags & PERF_DISABLE_MENUANIMATIONS) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
settings->DisableThemes = (settings->PerformanceFlags & PERF_DISABLE_THEMING) ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
2014-04-25 01:05:10 +04:00
|
|
|
void freerdp_set_gateway_usage_method(rdpSettings* settings, UINT32 GatewayUsageMethod)
|
|
|
|
{
|
|
|
|
freerdp_set_param_uint32(settings, FreeRDP_GatewayUsageMethod, GatewayUsageMethod);
|
|
|
|
|
|
|
|
if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DIRECT)
|
|
|
|
{
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
|
|
}
|
|
|
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
|
|
|
|
{
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
|
|
}
|
|
|
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DETECT)
|
|
|
|
{
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, TRUE);
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, TRUE);
|
|
|
|
}
|
|
|
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_DEFAULT)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* This corresponds to "Automatically detect RD Gateway server settings",
|
|
|
|
* which means the client attempts to use gateway group policy settings
|
|
|
|
* http://technet.microsoft.com/en-us/library/cc770601.aspx
|
|
|
|
*/
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
|
|
}
|
|
|
|
else if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
|
|
|
|
{
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayEnabled, FALSE);
|
|
|
|
freerdp_set_param_bool(settings, FreeRDP_GatewayBypassLocal, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-30 20:55:17 +04:00
|
|
|
void freerdp_update_gateway_usage_method(rdpSettings* settings, UINT32 GatewayEnabled, UINT32 GatewayBypassLocal)
|
|
|
|
{
|
|
|
|
UINT32 GatewayUsageMethod = 0;
|
|
|
|
|
|
|
|
if (!GatewayEnabled && !GatewayBypassLocal)
|
|
|
|
GatewayUsageMethod = TSC_PROXY_MODE_NONE_DIRECT;
|
|
|
|
else if (GatewayEnabled && !GatewayBypassLocal)
|
|
|
|
GatewayUsageMethod = TSC_PROXY_MODE_DIRECT;
|
|
|
|
else if (GatewayEnabled && GatewayBypassLocal)
|
|
|
|
GatewayUsageMethod = TSC_PROXY_MODE_DETECT;
|
|
|
|
|
|
|
|
freerdp_set_gateway_usage_method(settings, GatewayUsageMethod);
|
|
|
|
}
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
/**
|
|
|
|
* Partially Generated Code
|
|
|
|
*/
|
|
|
|
|
|
|
|
BOOL freerdp_get_param_bool(rdpSettings* settings, int id)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ServerMode:
|
|
|
|
return settings->ServerMode;
|
|
|
|
|
|
|
|
case FreeRDP_NetworkAutoDetect:
|
|
|
|
return settings->NetworkAutoDetect;
|
|
|
|
|
|
|
|
case FreeRDP_SupportAsymetricKeys:
|
|
|
|
return settings->SupportAsymetricKeys;
|
|
|
|
|
|
|
|
case FreeRDP_SupportErrorInfoPdu:
|
|
|
|
return settings->SupportErrorInfoPdu;
|
|
|
|
|
|
|
|
case FreeRDP_SupportStatusInfoPdu:
|
|
|
|
return settings->SupportStatusInfoPdu;
|
|
|
|
|
|
|
|
case FreeRDP_SupportMonitorLayoutPdu:
|
|
|
|
return settings->SupportMonitorLayoutPdu;
|
|
|
|
|
|
|
|
case FreeRDP_SupportGraphicsPipeline:
|
|
|
|
return settings->SupportGraphicsPipeline;
|
|
|
|
|
|
|
|
case FreeRDP_SupportDynamicTimeZone:
|
|
|
|
return settings->SupportDynamicTimeZone;
|
|
|
|
|
Standard RDP Security Layer Levels/Method Overhaul
[MS-RDPBCGR] Section 5.3 describes the encryption level and method values for
standard RDP security.
Looking at the current usage of these values in the FreeRDP code gives me
reason to believe that there is a certain lack of understanding of how these
values should be handled.
The encryption level is only configured on the server side in the "Encryption
Level" setting found in the Remote Desktop Session Host Configuration RDP-Tcp
properties dialog and this value is never transferred from the client to the
server over the wire.
The possible options are "None", "Low", "Client Compatible", "High" and
"FIPS Compliant". The client receices this value in the Server Security Data
block (TS_UD_SC_SEC1), probably only for informational purposes and maybe to
give the client the possibility to verify if the server's decision for the
encryption method confirms to the server's encryption level.
The possible encryption methods are "NONE", "40BIT", "56BIT", "128BIT" and
"FIPS" and the RDP client advertises the ones it supports to the server in the
Client Security Data block (TS_UD_CS_SEC).
The server's configured encryption level value restricts the possible final
encryption method.
Something that I was not able to find in the documentation is the priority
level of the individual encryption methods based on which the server makes its
final method decision if there are several options.
My analysis with Windows Servers reveiled that the order is 128, 56, 40, FIPS.
The server only chooses FIPS if the level is "FIPS Comliant" or if it is the
only method advertised by the client.
Bottom line:
* FreeRDP's client side does not need to set settings->EncryptionLevel
(which was done quite frequently).
* FreeRDP's server side does not have to set the supported encryption methods
list in settings->EncryptionMethods
Changes in this commit:
Removed unnecessary/confusing changes of EncryptionLevel/Methods settings
Refactor settings->DisableEncryption
* This value actually means "Advanced RDP Encryption (NLA/TLS) is NOT used"
* The old name caused lots of confusion among developers
* Renamed it to "UseRdpSecurityLayer" (the compare logic stays untouched)
Any client's setting of settings->EncryptionMethods were annihilated
* All clients "want" to set all supported methods
* Some clients forgot 56bit because 56bit was not supported at the time the
code was written
* settings->EncryptionMethods was overwritten anyways in nego_connect()
* Removed all client side settings of settings->EncryptionMethods
The default is "None" (0)
* Changed nego_connect() to advertise all supported methods if
settings->EncryptionMethods is 0 (None)
* Added a commandline option /encryption-methods:comma separated list of the
values "40", "56", "128", "FIPS". E.g. /encryption-methods:56,128
* Print warning if server chooses non-advertised method
Verify received level and method in client's gcc_read_server_security_data
* Only accept valid/known encryption methods
* Verify encryption level/method combinations according to MS-RDPBCGR 5.3.2
Server implementations can now set settings->EncryptionLevel
* The default for settings->EncryptionLevel is 0 (None)
* nego_send_negotiation_response() changes it to ClientCompatible in that case
* default to ClientCompatible if the server implementation set an invalid level
Fix server's gcc_write_server_security_data
* Verify server encryption level value set by server implementations
* Choose rdp encryption method based on level and supported client methods
* Moved FIPS to the lowest priority (only used if other methods are possible)
Updated sample server
* Support RDP Security (RdpKeyFile was not set)
* Added commented sample code for setting the security level
2014-12-12 04:17:12 +03:00
|
|
|
case FreeRDP_UseRdpSecurityLayer:
|
|
|
|
return settings->UseRdpSecurityLayer;
|
2013-03-20 23:33:33 +04:00
|
|
|
|
|
|
|
case FreeRDP_ConsoleSession:
|
|
|
|
return settings->ConsoleSession;
|
|
|
|
|
|
|
|
case FreeRDP_SpanMonitors:
|
|
|
|
return settings->SpanMonitors;
|
|
|
|
|
|
|
|
case FreeRDP_UseMultimon:
|
|
|
|
return settings->UseMultimon;
|
|
|
|
|
|
|
|
case FreeRDP_ForceMultimon:
|
|
|
|
return settings->ForceMultimon;
|
|
|
|
|
|
|
|
case FreeRDP_AutoLogonEnabled:
|
|
|
|
return settings->AutoLogonEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_CompressionEnabled:
|
|
|
|
return settings->CompressionEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCtrlAltDel:
|
|
|
|
return settings->DisableCtrlAltDel;
|
|
|
|
|
|
|
|
case FreeRDP_EnableWindowsKey:
|
|
|
|
return settings->EnableWindowsKey;
|
|
|
|
|
|
|
|
case FreeRDP_MaximizeShell:
|
|
|
|
return settings->MaximizeShell;
|
|
|
|
|
|
|
|
case FreeRDP_LogonNotify:
|
|
|
|
return settings->LogonNotify;
|
|
|
|
|
|
|
|
case FreeRDP_LogonErrors:
|
|
|
|
return settings->LogonErrors;
|
|
|
|
|
|
|
|
case FreeRDP_MouseAttached:
|
|
|
|
return settings->MouseAttached;
|
|
|
|
|
|
|
|
case FreeRDP_MouseHasWheel:
|
|
|
|
return settings->MouseHasWheel;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteConsoleAudio:
|
|
|
|
return settings->RemoteConsoleAudio;
|
|
|
|
|
|
|
|
case FreeRDP_AudioPlayback:
|
|
|
|
return settings->AudioPlayback;
|
|
|
|
|
|
|
|
case FreeRDP_AudioCapture:
|
|
|
|
return settings->AudioCapture;
|
|
|
|
|
|
|
|
case FreeRDP_VideoDisable:
|
|
|
|
return settings->VideoDisable;
|
|
|
|
|
|
|
|
case FreeRDP_PasswordIsSmartcardPin:
|
|
|
|
return settings->PasswordIsSmartcardPin;
|
|
|
|
|
|
|
|
case FreeRDP_UsingSavedCredentials:
|
|
|
|
return settings->UsingSavedCredentials;
|
|
|
|
|
|
|
|
case FreeRDP_ForceEncryptedCsPdu:
|
|
|
|
return settings->ForceEncryptedCsPdu;
|
|
|
|
|
2013-10-10 06:38:26 +04:00
|
|
|
case FreeRDP_HiDefRemoteApp:
|
|
|
|
return settings->HiDefRemoteApp;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_IPv6Enabled:
|
|
|
|
return settings->IPv6Enabled;
|
|
|
|
|
|
|
|
case FreeRDP_AutoReconnectionEnabled:
|
|
|
|
return settings->AutoReconnectionEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicDaylightTimeDisabled:
|
|
|
|
return settings->DynamicDaylightTimeDisabled;
|
|
|
|
|
|
|
|
case FreeRDP_AllowFontSmoothing:
|
|
|
|
return settings->AllowFontSmoothing;
|
|
|
|
|
|
|
|
case FreeRDP_DisableWallpaper:
|
|
|
|
return settings->DisableWallpaper;
|
|
|
|
|
|
|
|
case FreeRDP_DisableFullWindowDrag:
|
|
|
|
return settings->DisableFullWindowDrag;
|
|
|
|
|
|
|
|
case FreeRDP_DisableMenuAnims:
|
|
|
|
return settings->DisableMenuAnims;
|
|
|
|
|
|
|
|
case FreeRDP_DisableThemes:
|
|
|
|
return settings->DisableThemes;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCursorShadow:
|
|
|
|
return settings->DisableCursorShadow;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCursorBlinking:
|
|
|
|
return settings->DisableCursorBlinking;
|
|
|
|
|
|
|
|
case FreeRDP_AllowDesktopComposition:
|
|
|
|
return settings->AllowDesktopComposition;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_RemoteAssistanceMode:
|
|
|
|
return settings->RemoteAssistanceMode;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_TlsSecurity:
|
|
|
|
return settings->TlsSecurity;
|
|
|
|
|
|
|
|
case FreeRDP_NlaSecurity:
|
|
|
|
return settings->NlaSecurity;
|
|
|
|
|
|
|
|
case FreeRDP_RdpSecurity:
|
|
|
|
return settings->RdpSecurity;
|
|
|
|
|
|
|
|
case FreeRDP_ExtSecurity:
|
|
|
|
return settings->ExtSecurity;
|
|
|
|
|
|
|
|
case FreeRDP_Authentication:
|
|
|
|
return settings->Authentication;
|
|
|
|
|
|
|
|
case FreeRDP_NegotiateSecurityLayer:
|
|
|
|
return settings->NegotiateSecurityLayer;
|
|
|
|
|
2013-11-06 10:51:55 +04:00
|
|
|
case FreeRDP_RestrictedAdminModeRequired:
|
|
|
|
return settings->RestrictedAdminModeRequired;
|
|
|
|
|
2014-02-14 09:43:31 +04:00
|
|
|
case FreeRDP_DisableCredentialsDelegation:
|
|
|
|
return settings->DisableCredentialsDelegation;
|
|
|
|
|
2014-05-11 01:28:34 +04:00
|
|
|
case FreeRDP_AuthenticationLevel:
|
|
|
|
return settings->AuthenticationLevel;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MstscCookieMode:
|
|
|
|
return settings->MstscCookieMode;
|
|
|
|
|
|
|
|
case FreeRDP_SendPreconnectionPdu:
|
|
|
|
return settings->SendPreconnectionPdu;
|
|
|
|
|
|
|
|
case FreeRDP_IgnoreCertificate:
|
|
|
|
return settings->IgnoreCertificate;
|
|
|
|
|
2013-11-18 22:54:33 +04:00
|
|
|
case FreeRDP_ExternalCertificateManagement:
|
|
|
|
return settings->ExternalCertificateManagement;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_Workarea:
|
|
|
|
return settings->Workarea;
|
|
|
|
|
|
|
|
case FreeRDP_Fullscreen:
|
|
|
|
return settings->Fullscreen;
|
|
|
|
|
|
|
|
case FreeRDP_GrabKeyboard:
|
|
|
|
return settings->GrabKeyboard;
|
|
|
|
|
|
|
|
case FreeRDP_Decorations:
|
|
|
|
return settings->Decorations;
|
|
|
|
|
2013-04-15 23:58:56 +04:00
|
|
|
case FreeRDP_SmartSizing:
|
|
|
|
return settings->SmartSizing;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MouseMotion:
|
|
|
|
return settings->MouseMotion;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncInput:
|
|
|
|
return settings->AsyncInput;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncUpdate:
|
|
|
|
return settings->AsyncUpdate;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncChannels:
|
|
|
|
return settings->AsyncChannels;
|
|
|
|
|
2014-05-11 07:18:43 +04:00
|
|
|
case FreeRDP_AsyncTransport:
|
|
|
|
return settings->AsyncTransport;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ToggleFullscreen:
|
|
|
|
return settings->ToggleFullscreen;
|
|
|
|
|
|
|
|
case FreeRDP_SoftwareGdi:
|
|
|
|
return settings->SoftwareGdi;
|
|
|
|
|
|
|
|
case FreeRDP_LocalConnection:
|
|
|
|
return settings->LocalConnection;
|
|
|
|
|
|
|
|
case FreeRDP_AuthenticationOnly:
|
|
|
|
return settings->AuthenticationOnly;
|
|
|
|
|
|
|
|
case FreeRDP_CredentialsFromStdin:
|
|
|
|
return settings->CredentialsFromStdin;
|
|
|
|
|
|
|
|
case FreeRDP_DumpRemoteFx:
|
|
|
|
return settings->DumpRemoteFx;
|
|
|
|
|
|
|
|
case FreeRDP_PlayRemoteFx:
|
|
|
|
return settings->PlayRemoteFx;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUseSameCredentials:
|
|
|
|
return settings->GatewayUseSameCredentials;
|
|
|
|
|
2013-07-03 23:07:12 +04:00
|
|
|
case FreeRDP_GatewayEnabled:
|
|
|
|
return settings->GatewayEnabled;
|
|
|
|
|
2014-03-24 22:44:18 +04:00
|
|
|
case FreeRDP_GatewayBypassLocal:
|
|
|
|
return settings->GatewayBypassLocal;
|
|
|
|
|
2015-03-19 18:44:47 +03:00
|
|
|
case FreeRDP_GatewayRpcTransport:
|
|
|
|
return settings->GatewayRpcTransport;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayHttpTransport:
|
|
|
|
return settings->GatewayHttpTransport;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUdpTransport:
|
|
|
|
return settings->GatewayUdpTransport;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_RemoteApplicationMode:
|
|
|
|
return settings->RemoteApplicationMode;
|
|
|
|
|
2013-09-17 23:42:36 +04:00
|
|
|
case FreeRDP_DisableRemoteAppCapsCheck:
|
|
|
|
return settings->DisableRemoteAppCapsCheck;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_RemoteAppLanguageBarSupported:
|
|
|
|
return settings->RemoteAppLanguageBarSupported;
|
|
|
|
|
|
|
|
case FreeRDP_RefreshRect:
|
|
|
|
return settings->RefreshRect;
|
|
|
|
|
|
|
|
case FreeRDP_SuppressOutput:
|
|
|
|
return settings->SuppressOutput;
|
|
|
|
|
|
|
|
case FreeRDP_FastPathOutput:
|
|
|
|
return settings->FastPathOutput;
|
|
|
|
|
|
|
|
case FreeRDP_SaltedChecksum:
|
|
|
|
return settings->SaltedChecksum;
|
|
|
|
|
|
|
|
case FreeRDP_LongCredentialsSupported:
|
|
|
|
return settings->LongCredentialsSupported;
|
|
|
|
|
|
|
|
case FreeRDP_NoBitmapCompressionHeader:
|
|
|
|
return settings->NoBitmapCompressionHeader;
|
|
|
|
|
2013-06-19 10:48:25 +04:00
|
|
|
case FreeRDP_BitmapCompressionDisabled:
|
|
|
|
return settings->BitmapCompressionDisabled;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_DesktopResize:
|
|
|
|
return settings->DesktopResize;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowDynamicColorFidelity:
|
|
|
|
return settings->DrawAllowDynamicColorFidelity;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowColorSubsampling:
|
|
|
|
return settings->DrawAllowColorSubsampling;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowSkipAlpha:
|
|
|
|
return settings->DrawAllowSkipAlpha;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV3Enabled:
|
|
|
|
return settings->BitmapCacheV3Enabled;
|
|
|
|
|
|
|
|
case FreeRDP_AltSecFrameMarkerSupport:
|
|
|
|
return settings->AltSecFrameMarkerSupport;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheEnabled:
|
|
|
|
return settings->BitmapCacheEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_AllowCacheWaitingList:
|
|
|
|
return settings->AllowCacheWaitingList;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCachePersistEnabled:
|
|
|
|
return settings->BitmapCachePersistEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_ColorPointerFlag:
|
|
|
|
return settings->ColorPointerFlag;
|
|
|
|
|
|
|
|
case FreeRDP_UnicodeInput:
|
|
|
|
return settings->UnicodeInput;
|
|
|
|
|
|
|
|
case FreeRDP_FastPathInput:
|
|
|
|
return settings->FastPathInput;
|
|
|
|
|
2013-05-09 06:14:16 +04:00
|
|
|
case FreeRDP_MultiTouchInput:
|
|
|
|
return settings->MultiTouchInput;
|
|
|
|
|
2013-06-20 02:43:24 +04:00
|
|
|
case FreeRDP_MultiTouchGestures:
|
|
|
|
return settings->MultiTouchGestures;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_SoundBeepsEnabled:
|
|
|
|
return settings->SoundBeepsEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_SurfaceCommandsEnabled:
|
|
|
|
return settings->SurfaceCommandsEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_FrameMarkerCommandEnabled:
|
|
|
|
return settings->FrameMarkerCommandEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxOnly:
|
|
|
|
return settings->RemoteFxOnly;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodec:
|
|
|
|
return settings->RemoteFxCodec;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxImageCodec:
|
|
|
|
return settings->RemoteFxImageCodec;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodec:
|
|
|
|
return settings->NSCodec;
|
|
|
|
|
2014-09-21 23:40:27 +04:00
|
|
|
case FreeRDP_NSCodecAllowSubsampling:
|
|
|
|
return settings->NSCodecAllowSubsampling;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecAllowDynamicColorFidelity:
|
|
|
|
return settings->NSCodecAllowDynamicColorFidelity;
|
2013-03-20 23:33:33 +04:00
|
|
|
|
|
|
|
case FreeRDP_JpegCodec:
|
|
|
|
return settings->JpegCodec;
|
|
|
|
|
2014-07-03 22:35:03 +04:00
|
|
|
case FreeRDP_GfxThinClient:
|
|
|
|
return settings->GfxThinClient;
|
|
|
|
|
|
|
|
case FreeRDP_GfxSmallCache:
|
|
|
|
return settings->GfxSmallCache;
|
|
|
|
|
|
|
|
case FreeRDP_GfxProgressive:
|
|
|
|
return settings->GfxProgressive;
|
|
|
|
|
|
|
|
case FreeRDP_GfxProgressiveV2:
|
|
|
|
return settings->GfxProgressiveV2;
|
|
|
|
|
|
|
|
case FreeRDP_GfxH264:
|
|
|
|
return settings->GfxH264;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_DrawNineGridEnabled:
|
|
|
|
return settings->DrawNineGridEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_DrawGdiPlusEnabled:
|
|
|
|
return settings->DrawGdiPlusEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_DrawGdiPlusCacheEnabled:
|
|
|
|
return settings->DrawGdiPlusCacheEnabled;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceRedirection:
|
|
|
|
return settings->DeviceRedirection;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectDrives:
|
|
|
|
return settings->RedirectDrives;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectHomeDrive:
|
|
|
|
return settings->RedirectHomeDrive;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectSmartCards:
|
|
|
|
return settings->RedirectSmartCards;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectPrinters:
|
|
|
|
return settings->RedirectPrinters;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectSerialPorts:
|
|
|
|
return settings->RedirectSerialPorts;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectParallelPorts:
|
|
|
|
return settings->RedirectParallelPorts;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectClipboard:
|
|
|
|
return settings->RedirectClipboard;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_get_param_bool: unknown id: %d", id);
|
2013-03-20 23:33:33 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ServerMode:
|
|
|
|
settings->ServerMode = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NetworkAutoDetect:
|
|
|
|
settings->NetworkAutoDetect = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportAsymetricKeys:
|
|
|
|
settings->SupportAsymetricKeys = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportErrorInfoPdu:
|
|
|
|
settings->SupportErrorInfoPdu = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportStatusInfoPdu:
|
|
|
|
settings->SupportStatusInfoPdu = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportMonitorLayoutPdu:
|
|
|
|
settings->SupportMonitorLayoutPdu = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportGraphicsPipeline:
|
|
|
|
settings->SupportGraphicsPipeline = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SupportDynamicTimeZone:
|
|
|
|
settings->SupportDynamicTimeZone = param;
|
|
|
|
break;
|
|
|
|
|
Standard RDP Security Layer Levels/Method Overhaul
[MS-RDPBCGR] Section 5.3 describes the encryption level and method values for
standard RDP security.
Looking at the current usage of these values in the FreeRDP code gives me
reason to believe that there is a certain lack of understanding of how these
values should be handled.
The encryption level is only configured on the server side in the "Encryption
Level" setting found in the Remote Desktop Session Host Configuration RDP-Tcp
properties dialog and this value is never transferred from the client to the
server over the wire.
The possible options are "None", "Low", "Client Compatible", "High" and
"FIPS Compliant". The client receices this value in the Server Security Data
block (TS_UD_SC_SEC1), probably only for informational purposes and maybe to
give the client the possibility to verify if the server's decision for the
encryption method confirms to the server's encryption level.
The possible encryption methods are "NONE", "40BIT", "56BIT", "128BIT" and
"FIPS" and the RDP client advertises the ones it supports to the server in the
Client Security Data block (TS_UD_CS_SEC).
The server's configured encryption level value restricts the possible final
encryption method.
Something that I was not able to find in the documentation is the priority
level of the individual encryption methods based on which the server makes its
final method decision if there are several options.
My analysis with Windows Servers reveiled that the order is 128, 56, 40, FIPS.
The server only chooses FIPS if the level is "FIPS Comliant" or if it is the
only method advertised by the client.
Bottom line:
* FreeRDP's client side does not need to set settings->EncryptionLevel
(which was done quite frequently).
* FreeRDP's server side does not have to set the supported encryption methods
list in settings->EncryptionMethods
Changes in this commit:
Removed unnecessary/confusing changes of EncryptionLevel/Methods settings
Refactor settings->DisableEncryption
* This value actually means "Advanced RDP Encryption (NLA/TLS) is NOT used"
* The old name caused lots of confusion among developers
* Renamed it to "UseRdpSecurityLayer" (the compare logic stays untouched)
Any client's setting of settings->EncryptionMethods were annihilated
* All clients "want" to set all supported methods
* Some clients forgot 56bit because 56bit was not supported at the time the
code was written
* settings->EncryptionMethods was overwritten anyways in nego_connect()
* Removed all client side settings of settings->EncryptionMethods
The default is "None" (0)
* Changed nego_connect() to advertise all supported methods if
settings->EncryptionMethods is 0 (None)
* Added a commandline option /encryption-methods:comma separated list of the
values "40", "56", "128", "FIPS". E.g. /encryption-methods:56,128
* Print warning if server chooses non-advertised method
Verify received level and method in client's gcc_read_server_security_data
* Only accept valid/known encryption methods
* Verify encryption level/method combinations according to MS-RDPBCGR 5.3.2
Server implementations can now set settings->EncryptionLevel
* The default for settings->EncryptionLevel is 0 (None)
* nego_send_negotiation_response() changes it to ClientCompatible in that case
* default to ClientCompatible if the server implementation set an invalid level
Fix server's gcc_write_server_security_data
* Verify server encryption level value set by server implementations
* Choose rdp encryption method based on level and supported client methods
* Moved FIPS to the lowest priority (only used if other methods are possible)
Updated sample server
* Support RDP Security (RdpKeyFile was not set)
* Added commented sample code for setting the security level
2014-12-12 04:17:12 +03:00
|
|
|
case FreeRDP_UseRdpSecurityLayer:
|
|
|
|
settings->UseRdpSecurityLayer = param;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ConsoleSession:
|
|
|
|
settings->ConsoleSession = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SpanMonitors:
|
|
|
|
settings->SpanMonitors = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_UseMultimon:
|
|
|
|
settings->UseMultimon = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ForceMultimon:
|
|
|
|
settings->ForceMultimon = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AutoLogonEnabled:
|
|
|
|
settings->AutoLogonEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CompressionEnabled:
|
|
|
|
settings->CompressionEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCtrlAltDel:
|
|
|
|
settings->DisableCtrlAltDel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_EnableWindowsKey:
|
|
|
|
settings->EnableWindowsKey = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_MaximizeShell:
|
|
|
|
settings->MaximizeShell = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LogonNotify:
|
|
|
|
settings->LogonNotify = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LogonErrors:
|
|
|
|
settings->LogonErrors = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_MouseAttached:
|
|
|
|
settings->MouseAttached = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_MouseHasWheel:
|
|
|
|
settings->MouseHasWheel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteConsoleAudio:
|
|
|
|
settings->RemoteConsoleAudio = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AudioPlayback:
|
|
|
|
settings->AudioPlayback = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AudioCapture:
|
|
|
|
settings->AudioCapture = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_VideoDisable:
|
|
|
|
settings->VideoDisable = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PasswordIsSmartcardPin:
|
|
|
|
settings->PasswordIsSmartcardPin = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_UsingSavedCredentials:
|
|
|
|
settings->UsingSavedCredentials = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ForceEncryptedCsPdu:
|
|
|
|
settings->ForceEncryptedCsPdu = param;
|
|
|
|
break;
|
|
|
|
|
2013-10-10 06:38:26 +04:00
|
|
|
case FreeRDP_HiDefRemoteApp:
|
|
|
|
settings->HiDefRemoteApp = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_IPv6Enabled:
|
|
|
|
settings->IPv6Enabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AutoReconnectionEnabled:
|
|
|
|
settings->AutoReconnectionEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicDaylightTimeDisabled:
|
|
|
|
settings->DynamicDaylightTimeDisabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AllowFontSmoothing:
|
|
|
|
settings->AllowFontSmoothing = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableWallpaper:
|
|
|
|
settings->DisableWallpaper = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableFullWindowDrag:
|
|
|
|
settings->DisableFullWindowDrag = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableMenuAnims:
|
|
|
|
settings->DisableMenuAnims = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableThemes:
|
|
|
|
settings->DisableThemes = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCursorShadow:
|
|
|
|
settings->DisableCursorShadow = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DisableCursorBlinking:
|
|
|
|
settings->DisableCursorBlinking = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AllowDesktopComposition:
|
|
|
|
settings->AllowDesktopComposition = param;
|
|
|
|
break;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_RemoteAssistanceMode:
|
|
|
|
settings->RemoteAssistanceMode = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_TlsSecurity:
|
|
|
|
settings->TlsSecurity = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NlaSecurity:
|
|
|
|
settings->NlaSecurity = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RdpSecurity:
|
|
|
|
settings->RdpSecurity = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ExtSecurity:
|
|
|
|
settings->ExtSecurity = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Authentication:
|
|
|
|
settings->Authentication = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NegotiateSecurityLayer:
|
|
|
|
settings->NegotiateSecurityLayer = param;
|
|
|
|
break;
|
|
|
|
|
2013-11-06 10:51:55 +04:00
|
|
|
case FreeRDP_RestrictedAdminModeRequired:
|
|
|
|
settings->RestrictedAdminModeRequired = param;
|
|
|
|
break;
|
|
|
|
|
2014-02-14 09:43:31 +04:00
|
|
|
case FreeRDP_DisableCredentialsDelegation:
|
|
|
|
settings->DisableCredentialsDelegation = param;
|
|
|
|
break;
|
|
|
|
|
2014-05-11 01:28:34 +04:00
|
|
|
case FreeRDP_AuthenticationLevel:
|
|
|
|
settings->AuthenticationLevel = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MstscCookieMode:
|
|
|
|
settings->MstscCookieMode = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SendPreconnectionPdu:
|
|
|
|
settings->SendPreconnectionPdu = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_IgnoreCertificate:
|
|
|
|
settings->IgnoreCertificate = param;
|
|
|
|
break;
|
|
|
|
|
2013-11-18 22:54:33 +04:00
|
|
|
case FreeRDP_ExternalCertificateManagement:
|
|
|
|
settings->ExternalCertificateManagement = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_Workarea:
|
|
|
|
settings->Workarea = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Fullscreen:
|
|
|
|
settings->Fullscreen = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GrabKeyboard:
|
|
|
|
settings->GrabKeyboard = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Decorations:
|
|
|
|
settings->Decorations = param;
|
|
|
|
break;
|
|
|
|
|
2013-04-15 23:58:56 +04:00
|
|
|
case FreeRDP_SmartSizing:
|
|
|
|
settings->SmartSizing = param;
|
2014-12-01 13:56:44 +03:00
|
|
|
break;
|
2013-04-15 23:58:56 +04:00
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MouseMotion:
|
|
|
|
settings->MouseMotion = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncInput:
|
|
|
|
settings->AsyncInput = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncUpdate:
|
|
|
|
settings->AsyncUpdate = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AsyncChannels:
|
|
|
|
settings->AsyncChannels = param;
|
|
|
|
break;
|
|
|
|
|
2014-05-11 07:18:43 +04:00
|
|
|
case FreeRDP_AsyncTransport:
|
|
|
|
settings->AsyncTransport = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ToggleFullscreen:
|
|
|
|
settings->ToggleFullscreen = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SoftwareGdi:
|
|
|
|
settings->SoftwareGdi = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LocalConnection:
|
|
|
|
settings->LocalConnection = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AuthenticationOnly:
|
|
|
|
settings->AuthenticationOnly = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CredentialsFromStdin:
|
|
|
|
settings->CredentialsFromStdin = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DumpRemoteFx:
|
|
|
|
settings->DumpRemoteFx = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PlayRemoteFx:
|
|
|
|
settings->PlayRemoteFx = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUseSameCredentials:
|
|
|
|
settings->GatewayUseSameCredentials = param;
|
|
|
|
break;
|
|
|
|
|
2013-07-03 23:07:12 +04:00
|
|
|
case FreeRDP_GatewayEnabled:
|
|
|
|
settings->GatewayEnabled = param;
|
|
|
|
break;
|
|
|
|
|
2014-03-24 22:44:18 +04:00
|
|
|
case FreeRDP_GatewayBypassLocal:
|
|
|
|
settings->GatewayBypassLocal = param;
|
|
|
|
break;
|
|
|
|
|
2015-03-19 18:44:47 +03:00
|
|
|
case FreeRDP_GatewayRpcTransport:
|
|
|
|
settings->GatewayRpcTransport = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayHttpTransport:
|
|
|
|
settings->GatewayHttpTransport = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUdpTransport:
|
|
|
|
settings->GatewayUdpTransport = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_RemoteApplicationMode:
|
|
|
|
settings->RemoteApplicationMode = param;
|
|
|
|
break;
|
|
|
|
|
2013-09-17 23:42:36 +04:00
|
|
|
case FreeRDP_DisableRemoteAppCapsCheck:
|
|
|
|
settings->DisableRemoteAppCapsCheck = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_RemoteAppLanguageBarSupported:
|
|
|
|
settings->RemoteAppLanguageBarSupported = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RefreshRect:
|
|
|
|
settings->RefreshRect = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SuppressOutput:
|
|
|
|
settings->SuppressOutput = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_FastPathOutput:
|
|
|
|
settings->FastPathOutput = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SaltedChecksum:
|
|
|
|
settings->SaltedChecksum = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LongCredentialsSupported:
|
|
|
|
settings->LongCredentialsSupported = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NoBitmapCompressionHeader:
|
|
|
|
settings->NoBitmapCompressionHeader = param;
|
|
|
|
break;
|
|
|
|
|
2013-06-19 10:48:25 +04:00
|
|
|
case FreeRDP_BitmapCompressionDisabled:
|
|
|
|
settings->BitmapCompressionDisabled = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_DesktopResize:
|
|
|
|
settings->DesktopResize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowDynamicColorFidelity:
|
|
|
|
settings->DrawAllowDynamicColorFidelity = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowColorSubsampling:
|
|
|
|
settings->DrawAllowColorSubsampling = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawAllowSkipAlpha:
|
|
|
|
settings->DrawAllowSkipAlpha = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV3Enabled:
|
|
|
|
settings->BitmapCacheV3Enabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AltSecFrameMarkerSupport:
|
|
|
|
settings->AltSecFrameMarkerSupport = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheEnabled:
|
|
|
|
settings->BitmapCacheEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AllowCacheWaitingList:
|
|
|
|
settings->AllowCacheWaitingList = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCachePersistEnabled:
|
|
|
|
settings->BitmapCachePersistEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ColorPointerFlag:
|
|
|
|
settings->ColorPointerFlag = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_UnicodeInput:
|
|
|
|
settings->UnicodeInput = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_FastPathInput:
|
|
|
|
settings->FastPathInput = param;
|
|
|
|
break;
|
|
|
|
|
2013-05-09 06:14:16 +04:00
|
|
|
case FreeRDP_MultiTouchInput:
|
|
|
|
settings->MultiTouchInput = param;
|
|
|
|
break;
|
|
|
|
|
2013-06-20 02:43:24 +04:00
|
|
|
case FreeRDP_MultiTouchGestures:
|
|
|
|
settings->MultiTouchGestures = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_SoundBeepsEnabled:
|
|
|
|
settings->SoundBeepsEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SurfaceCommandsEnabled:
|
|
|
|
settings->SurfaceCommandsEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_FrameMarkerCommandEnabled:
|
|
|
|
settings->FrameMarkerCommandEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxOnly:
|
|
|
|
settings->RemoteFxOnly = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodec:
|
|
|
|
settings->RemoteFxCodec = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxImageCodec:
|
|
|
|
settings->RemoteFxImageCodec = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodec:
|
|
|
|
settings->NSCodec = param;
|
|
|
|
break;
|
|
|
|
|
2014-09-21 23:40:27 +04:00
|
|
|
case FreeRDP_NSCodecAllowSubsampling:
|
|
|
|
settings->NSCodecAllowSubsampling = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecAllowDynamicColorFidelity:
|
|
|
|
settings->NSCodecAllowDynamicColorFidelity = param;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_JpegCodec:
|
|
|
|
settings->JpegCodec = param;
|
|
|
|
break;
|
|
|
|
|
2014-07-03 22:35:03 +04:00
|
|
|
case FreeRDP_GfxThinClient:
|
|
|
|
settings->GfxThinClient = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GfxSmallCache:
|
|
|
|
settings->GfxSmallCache = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GfxProgressive:
|
|
|
|
settings->GfxProgressive = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GfxProgressiveV2:
|
|
|
|
settings->GfxProgressiveV2 = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GfxH264:
|
|
|
|
settings->GfxH264 = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_DrawNineGridEnabled:
|
|
|
|
settings->DrawNineGridEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawGdiPlusEnabled:
|
|
|
|
settings->DrawGdiPlusEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawGdiPlusCacheEnabled:
|
|
|
|
settings->DrawGdiPlusCacheEnabled = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceRedirection:
|
|
|
|
settings->DeviceRedirection = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectDrives:
|
|
|
|
settings->RedirectDrives = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectHomeDrive:
|
|
|
|
settings->RedirectHomeDrive = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectSmartCards:
|
|
|
|
settings->RedirectSmartCards = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectPrinters:
|
|
|
|
settings->RedirectPrinters = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectSerialPorts:
|
|
|
|
settings->RedirectSerialPorts = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectParallelPorts:
|
|
|
|
settings->RedirectParallelPorts = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectClipboard:
|
|
|
|
settings->RedirectClipboard = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_set_param_bool: unknown id %d (param = %d)", id, param);
|
2013-03-20 23:33:33 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-10-13 06:58:09 +04:00
|
|
|
/* Mark field as modified */
|
2013-10-17 06:55:51 +04:00
|
|
|
settings->SettingsModified[id] = 1;
|
2013-06-16 01:39:45 +04:00
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-06-27 05:56:37 +04:00
|
|
|
int freerdp_get_param_int(rdpSettings* settings, int id)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_XPan:
|
|
|
|
return settings->XPan;
|
|
|
|
|
|
|
|
case FreeRDP_YPan:
|
|
|
|
return settings->YPan;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_get_param_int: unknown id: %d", id);
|
2013-06-27 05:56:37 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_set_param_int(rdpSettings* settings, int id, int param)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_XPan:
|
|
|
|
settings->XPan = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_YPan:
|
|
|
|
settings->YPan = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_set_param_int: unknown id %d (param = %d)", id, param);
|
2013-06-27 05:56:37 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-10-17 06:55:51 +04:00
|
|
|
settings->SettingsModified[id] = 1;
|
2013-06-27 05:56:37 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ShareId:
|
|
|
|
return settings->ShareId;
|
|
|
|
|
|
|
|
case FreeRDP_PduSource:
|
|
|
|
return settings->PduSource;
|
|
|
|
|
|
|
|
case FreeRDP_ServerPort:
|
|
|
|
return settings->ServerPort;
|
|
|
|
|
|
|
|
case FreeRDP_RdpVersion:
|
|
|
|
return settings->RdpVersion;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopWidth:
|
|
|
|
return settings->DesktopWidth;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopHeight:
|
|
|
|
return settings->DesktopHeight;
|
|
|
|
|
|
|
|
case FreeRDP_ColorDepth:
|
|
|
|
return settings->ColorDepth;
|
|
|
|
|
|
|
|
case FreeRDP_ConnectionType:
|
|
|
|
return settings->ConnectionType;
|
|
|
|
|
|
|
|
case FreeRDP_ClientBuild:
|
|
|
|
return settings->ClientBuild;
|
|
|
|
|
2013-04-10 06:35:52 +04:00
|
|
|
case FreeRDP_EarlyCapabilityFlags:
|
|
|
|
return settings->EarlyCapabilityFlags;
|
2013-03-20 23:33:33 +04:00
|
|
|
|
|
|
|
case FreeRDP_EncryptionMethods:
|
|
|
|
return settings->EncryptionMethods;
|
|
|
|
|
|
|
|
case FreeRDP_ExtEncryptionMethods:
|
|
|
|
return settings->ExtEncryptionMethods;
|
|
|
|
|
|
|
|
case FreeRDP_EncryptionLevel:
|
|
|
|
return settings->EncryptionLevel;
|
|
|
|
|
2014-08-11 19:23:23 +04:00
|
|
|
case FreeRDP_ServerRandomLength:
|
|
|
|
return settings->ServerRandomLength;
|
|
|
|
|
|
|
|
case FreeRDP_ClientRandomLength:
|
|
|
|
return settings->ClientRandomLength;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ChannelCount:
|
|
|
|
return settings->ChannelCount;
|
|
|
|
|
|
|
|
case FreeRDP_ChannelDefArraySize:
|
|
|
|
return settings->ChannelDefArraySize;
|
|
|
|
|
|
|
|
case FreeRDP_ClusterInfoFlags:
|
|
|
|
return settings->ClusterInfoFlags;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectedSessionId:
|
|
|
|
return settings->RedirectedSessionId;
|
|
|
|
|
|
|
|
case FreeRDP_MonitorDefArraySize:
|
|
|
|
return settings->MonitorDefArraySize;
|
|
|
|
|
2013-04-29 00:27:23 +04:00
|
|
|
case FreeRDP_DesktopPosX:
|
|
|
|
return settings->DesktopPosX;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopPosY:
|
|
|
|
return settings->DesktopPosY;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MultitransportFlags:
|
|
|
|
return settings->MultitransportFlags;
|
|
|
|
|
2014-03-10 19:16:36 +04:00
|
|
|
case FreeRDP_CompressionLevel:
|
|
|
|
return settings->CompressionLevel;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_AutoReconnectMaxRetries:
|
|
|
|
return settings->AutoReconnectMaxRetries;
|
|
|
|
|
|
|
|
case FreeRDP_PerformanceFlags:
|
|
|
|
return settings->PerformanceFlags;
|
|
|
|
|
|
|
|
case FreeRDP_RequestedProtocols:
|
|
|
|
return settings->RequestedProtocols;
|
|
|
|
|
|
|
|
case FreeRDP_SelectedProtocol:
|
|
|
|
return settings->SelectedProtocol;
|
|
|
|
|
|
|
|
case FreeRDP_NegotiationFlags:
|
|
|
|
return settings->NegotiationFlags;
|
|
|
|
|
|
|
|
case FreeRDP_CookieMaxLength:
|
|
|
|
return settings->CookieMaxLength;
|
|
|
|
|
|
|
|
case FreeRDP_PreconnectionId:
|
|
|
|
return settings->PreconnectionId;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionFlags:
|
|
|
|
return settings->RedirectionFlags;
|
|
|
|
|
|
|
|
case FreeRDP_LoadBalanceInfoLength:
|
|
|
|
return settings->LoadBalanceInfoLength;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionPasswordLength:
|
|
|
|
return settings->RedirectionPasswordLength;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionTsvUrlLength:
|
|
|
|
return settings->RedirectionTsvUrlLength;
|
|
|
|
|
|
|
|
case FreeRDP_TargetNetAddressCount:
|
|
|
|
return settings->TargetNetAddressCount;
|
|
|
|
|
|
|
|
case FreeRDP_PercentScreen:
|
|
|
|
return settings->PercentScreen;
|
|
|
|
|
2013-07-03 23:07:12 +04:00
|
|
|
case FreeRDP_GatewayUsageMethod:
|
|
|
|
return settings->GatewayUsageMethod;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_GatewayPort:
|
|
|
|
return settings->GatewayPort;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayCredentialsSource:
|
|
|
|
return settings->GatewayCredentialsSource;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAppNumIconCaches:
|
|
|
|
return settings->RemoteAppNumIconCaches;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAppNumIconCacheEntries:
|
|
|
|
return settings->RemoteAppNumIconCacheEntries;
|
|
|
|
|
|
|
|
case FreeRDP_ReceivedCapabilitiesSize:
|
|
|
|
return settings->ReceivedCapabilitiesSize;
|
|
|
|
|
|
|
|
case FreeRDP_OsMajorType:
|
|
|
|
return settings->OsMajorType;
|
|
|
|
|
|
|
|
case FreeRDP_OsMinorType:
|
|
|
|
return settings->OsMinorType;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheVersion:
|
|
|
|
return settings->BitmapCacheVersion;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV2NumCells:
|
|
|
|
return settings->BitmapCacheV2NumCells;
|
|
|
|
|
|
|
|
case FreeRDP_PointerCacheSize:
|
|
|
|
return settings->PointerCacheSize;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardLayout:
|
|
|
|
return settings->KeyboardLayout;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardType:
|
|
|
|
return settings->KeyboardType;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardSubType:
|
|
|
|
return settings->KeyboardSubType;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardFunctionKey:
|
|
|
|
return settings->KeyboardFunctionKey;
|
|
|
|
|
2014-07-09 00:32:28 +04:00
|
|
|
case FreeRDP_KeyboardHook:
|
|
|
|
return settings->KeyboardHook;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_BrushSupportLevel:
|
|
|
|
return settings->BrushSupportLevel;
|
|
|
|
|
|
|
|
case FreeRDP_GlyphSupportLevel:
|
|
|
|
return settings->GlyphSupportLevel;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenSupportLevel:
|
|
|
|
return settings->OffscreenSupportLevel;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenCacheSize:
|
|
|
|
return settings->OffscreenCacheSize;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenCacheEntries:
|
|
|
|
return settings->OffscreenCacheEntries;
|
|
|
|
|
|
|
|
case FreeRDP_VirtualChannelCompressionFlags:
|
|
|
|
return settings->VirtualChannelCompressionFlags;
|
|
|
|
|
|
|
|
case FreeRDP_VirtualChannelChunkSize:
|
|
|
|
return settings->VirtualChannelChunkSize;
|
|
|
|
|
|
|
|
case FreeRDP_MultifragMaxRequestSize:
|
|
|
|
return settings->MultifragMaxRequestSize;
|
|
|
|
|
|
|
|
case FreeRDP_LargePointerFlag:
|
|
|
|
return settings->LargePointerFlag;
|
|
|
|
|
|
|
|
case FreeRDP_CompDeskSupportLevel:
|
|
|
|
return settings->CompDeskSupportLevel;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodecId:
|
|
|
|
return settings->RemoteFxCodecId;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodecMode:
|
|
|
|
return settings->RemoteFxCodecMode;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecId:
|
|
|
|
return settings->NSCodecId;
|
|
|
|
|
2014-09-21 23:40:27 +04:00
|
|
|
case FreeRDP_FrameAcknowledge:
|
|
|
|
return settings->FrameAcknowledge;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecColorLossLevel:
|
|
|
|
return settings->NSCodecColorLossLevel;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_JpegCodecId:
|
|
|
|
return settings->JpegCodecId;
|
|
|
|
|
|
|
|
case FreeRDP_JpegQuality:
|
|
|
|
return settings->JpegQuality;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV3CodecId:
|
|
|
|
return settings->BitmapCacheV3CodecId;
|
|
|
|
|
|
|
|
case FreeRDP_DrawNineGridCacheSize:
|
|
|
|
return settings->DrawNineGridCacheSize;
|
|
|
|
|
|
|
|
case FreeRDP_DrawNineGridCacheEntries:
|
|
|
|
return settings->DrawNineGridCacheEntries;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceCount:
|
|
|
|
return settings->DeviceCount;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceArraySize:
|
|
|
|
return settings->DeviceArraySize;
|
|
|
|
|
|
|
|
case FreeRDP_StaticChannelCount:
|
|
|
|
return settings->StaticChannelCount;
|
|
|
|
|
|
|
|
case FreeRDP_StaticChannelArraySize:
|
|
|
|
return settings->StaticChannelArraySize;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicChannelCount:
|
|
|
|
return settings->DynamicChannelCount;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicChannelArraySize:
|
|
|
|
return settings->DynamicChannelArraySize;
|
|
|
|
|
2014-12-01 13:56:44 +03:00
|
|
|
case FreeRDP_SmartSizingWidth:
|
|
|
|
return settings->SmartSizingWidth;
|
|
|
|
|
|
|
|
case FreeRDP_SmartSizingHeight:
|
|
|
|
return settings->SmartSizingHeight;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_get_param_uint32: unknown id: %d", id);
|
2013-03-20 23:33:33 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ShareId:
|
|
|
|
settings->ShareId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PduSource:
|
|
|
|
settings->PduSource = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ServerPort:
|
|
|
|
settings->ServerPort = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RdpVersion:
|
|
|
|
settings->RdpVersion = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopWidth:
|
|
|
|
settings->DesktopWidth = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopHeight:
|
|
|
|
settings->DesktopHeight = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ColorDepth:
|
|
|
|
settings->ColorDepth = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ConnectionType:
|
|
|
|
settings->ConnectionType = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClientBuild:
|
|
|
|
settings->ClientBuild = param;
|
|
|
|
break;
|
|
|
|
|
2013-04-10 06:35:52 +04:00
|
|
|
case FreeRDP_EarlyCapabilityFlags:
|
|
|
|
settings->EarlyCapabilityFlags = param;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_EncryptionMethods:
|
|
|
|
settings->EncryptionMethods = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ExtEncryptionMethods:
|
|
|
|
settings->ExtEncryptionMethods = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_EncryptionLevel:
|
|
|
|
settings->EncryptionLevel = param;
|
|
|
|
break;
|
|
|
|
|
2014-08-11 19:23:23 +04:00
|
|
|
case FreeRDP_ServerRandomLength:
|
|
|
|
settings->ServerRandomLength = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClientRandomLength:
|
|
|
|
settings->ClientRandomLength = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ChannelCount:
|
|
|
|
settings->ChannelCount = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ChannelDefArraySize:
|
|
|
|
settings->ChannelDefArraySize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClusterInfoFlags:
|
|
|
|
settings->ClusterInfoFlags = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectedSessionId:
|
|
|
|
settings->RedirectedSessionId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_MonitorDefArraySize:
|
|
|
|
settings->MonitorDefArraySize = param;
|
|
|
|
break;
|
|
|
|
|
2013-04-29 00:27:23 +04:00
|
|
|
case FreeRDP_DesktopPosX:
|
|
|
|
settings->DesktopPosX = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DesktopPosY:
|
|
|
|
settings->DesktopPosY = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_MultitransportFlags:
|
|
|
|
settings->MultitransportFlags = param;
|
|
|
|
break;
|
|
|
|
|
2014-03-10 19:16:36 +04:00
|
|
|
case FreeRDP_CompressionLevel:
|
|
|
|
settings->CompressionLevel = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_AutoReconnectMaxRetries:
|
|
|
|
settings->AutoReconnectMaxRetries = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PerformanceFlags:
|
|
|
|
settings->PerformanceFlags = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RequestedProtocols:
|
|
|
|
settings->RequestedProtocols = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_SelectedProtocol:
|
|
|
|
settings->SelectedProtocol = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NegotiationFlags:
|
|
|
|
settings->NegotiationFlags = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CookieMaxLength:
|
|
|
|
settings->CookieMaxLength = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PreconnectionId:
|
|
|
|
settings->PreconnectionId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionFlags:
|
|
|
|
settings->RedirectionFlags = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LoadBalanceInfoLength:
|
|
|
|
settings->LoadBalanceInfoLength = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionPasswordLength:
|
|
|
|
settings->RedirectionPasswordLength = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RedirectionTsvUrlLength:
|
|
|
|
settings->RedirectionTsvUrlLength = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_TargetNetAddressCount:
|
|
|
|
settings->TargetNetAddressCount = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PercentScreen:
|
|
|
|
settings->PercentScreen = param;
|
|
|
|
break;
|
|
|
|
|
2013-07-03 23:07:12 +04:00
|
|
|
case FreeRDP_GatewayUsageMethod:
|
|
|
|
settings->GatewayUsageMethod = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_GatewayPort:
|
|
|
|
settings->GatewayPort = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayCredentialsSource:
|
|
|
|
settings->GatewayCredentialsSource = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAppNumIconCaches:
|
|
|
|
settings->RemoteAppNumIconCaches = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAppNumIconCacheEntries:
|
|
|
|
settings->RemoteAppNumIconCacheEntries = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ReceivedCapabilitiesSize:
|
|
|
|
settings->ReceivedCapabilitiesSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_OsMajorType:
|
|
|
|
settings->OsMajorType = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_OsMinorType:
|
|
|
|
settings->OsMinorType = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheVersion:
|
|
|
|
settings->BitmapCacheVersion = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV2NumCells:
|
|
|
|
settings->BitmapCacheV2NumCells = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PointerCacheSize:
|
|
|
|
settings->PointerCacheSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardLayout:
|
|
|
|
settings->KeyboardLayout = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardType:
|
|
|
|
settings->KeyboardType = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardSubType:
|
|
|
|
settings->KeyboardSubType = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KeyboardFunctionKey:
|
|
|
|
settings->KeyboardFunctionKey = param;
|
|
|
|
break;
|
|
|
|
|
2014-07-09 00:32:28 +04:00
|
|
|
case FreeRDP_KeyboardHook:
|
|
|
|
settings->KeyboardHook = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_BrushSupportLevel:
|
|
|
|
settings->BrushSupportLevel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GlyphSupportLevel:
|
|
|
|
settings->GlyphSupportLevel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenSupportLevel:
|
|
|
|
settings->OffscreenSupportLevel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenCacheSize:
|
|
|
|
settings->OffscreenCacheSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_OffscreenCacheEntries:
|
|
|
|
settings->OffscreenCacheEntries = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_VirtualChannelCompressionFlags:
|
|
|
|
settings->VirtualChannelCompressionFlags = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_VirtualChannelChunkSize:
|
|
|
|
settings->VirtualChannelChunkSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_MultifragMaxRequestSize:
|
|
|
|
settings->MultifragMaxRequestSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_LargePointerFlag:
|
|
|
|
settings->LargePointerFlag = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CompDeskSupportLevel:
|
|
|
|
settings->CompDeskSupportLevel = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodecId:
|
|
|
|
settings->RemoteFxCodecId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteFxCodecMode:
|
|
|
|
settings->RemoteFxCodecMode = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecId:
|
|
|
|
settings->NSCodecId = param;
|
|
|
|
break;
|
|
|
|
|
2014-09-21 23:40:27 +04:00
|
|
|
case FreeRDP_FrameAcknowledge:
|
|
|
|
settings->FrameAcknowledge = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_NSCodecColorLossLevel:
|
|
|
|
settings->NSCodecColorLossLevel = param;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_JpegCodecId:
|
|
|
|
settings->JpegCodecId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_JpegQuality:
|
|
|
|
settings->JpegQuality = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_BitmapCacheV3CodecId:
|
|
|
|
settings->BitmapCacheV3CodecId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawNineGridCacheSize:
|
|
|
|
settings->DrawNineGridCacheSize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrawNineGridCacheEntries:
|
|
|
|
settings->DrawNineGridCacheEntries = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceCount:
|
|
|
|
settings->DeviceCount = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DeviceArraySize:
|
|
|
|
settings->DeviceArraySize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_StaticChannelCount:
|
|
|
|
settings->StaticChannelCount = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_StaticChannelArraySize:
|
|
|
|
settings->StaticChannelArraySize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicChannelCount:
|
|
|
|
settings->DynamicChannelCount = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicChannelArraySize:
|
|
|
|
settings->DynamicChannelArraySize = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_set_param_uint32: unknown id %d (param = %u)", id, param);
|
2013-03-20 23:33:33 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-10-13 06:58:09 +04:00
|
|
|
/* Mark field as modified */
|
2013-10-17 06:55:51 +04:00
|
|
|
settings->SettingsModified[id] = 1;
|
2014-12-01 13:56:44 +03:00
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-04-06 03:08:37 +04:00
|
|
|
UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ParentWindowId:
|
|
|
|
return settings->ParentWindowId;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_get_param_uint64: unknown id: %d", id);
|
2013-04-06 03:08:37 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ParentWindowId:
|
|
|
|
settings->ParentWindowId = param;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_set_param_uint64: unknown id %d (param = %u)", id, (UINT32) param);
|
2013-04-06 03:08:37 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2013-10-13 06:58:09 +04:00
|
|
|
/* Mark field as modified */
|
2013-10-17 06:55:51 +04:00
|
|
|
settings->SettingsModified[id] = 1;
|
2014-12-01 13:56:44 +03:00
|
|
|
|
2013-04-06 03:08:37 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
char* freerdp_get_param_string(rdpSettings* settings, int id)
|
|
|
|
{
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ServerHostname:
|
|
|
|
return settings->ServerHostname;
|
|
|
|
|
|
|
|
case FreeRDP_Username:
|
|
|
|
return settings->Username;
|
|
|
|
|
|
|
|
case FreeRDP_Password:
|
|
|
|
return settings->Password;
|
|
|
|
|
|
|
|
case FreeRDP_Domain:
|
|
|
|
return settings->Domain;
|
|
|
|
|
2013-11-06 19:02:58 +04:00
|
|
|
case FreeRDP_PasswordHash:
|
|
|
|
return settings->PasswordHash;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ClientHostname:
|
|
|
|
return settings->ClientHostname;
|
|
|
|
|
|
|
|
case FreeRDP_ClientProductId:
|
|
|
|
return settings->ClientProductId;
|
|
|
|
|
|
|
|
case FreeRDP_AlternateShell:
|
|
|
|
return settings->AlternateShell;
|
|
|
|
|
|
|
|
case FreeRDP_ShellWorkingDirectory:
|
|
|
|
return settings->ShellWorkingDirectory;
|
|
|
|
|
|
|
|
case FreeRDP_ClientAddress:
|
|
|
|
return settings->ClientAddress;
|
|
|
|
|
|
|
|
case FreeRDP_ClientDir:
|
|
|
|
return settings->ClientDir;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicDSTTimeZoneKeyName:
|
|
|
|
return settings->DynamicDSTTimeZoneKeyName;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_RemoteAssistanceSessionId:
|
|
|
|
return settings->RemoteAssistanceSessionId;
|
|
|
|
|
2014-06-30 20:51:27 +04:00
|
|
|
case FreeRDP_RemoteAssistancePassStub:
|
|
|
|
return settings->RemoteAssistancePassStub;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAssistancePassword:
|
|
|
|
return settings->RemoteAssistancePassword;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAssistanceRCTicket:
|
|
|
|
return settings->RemoteAssistanceRCTicket;
|
|
|
|
|
2014-02-12 09:43:02 +04:00
|
|
|
case FreeRDP_AuthenticationServiceClass:
|
|
|
|
return settings->AuthenticationServiceClass;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_PreconnectionBlob:
|
|
|
|
return settings->PreconnectionBlob;
|
|
|
|
|
|
|
|
case FreeRDP_KerberosKdc:
|
|
|
|
return settings->KerberosKdc;
|
|
|
|
|
|
|
|
case FreeRDP_KerberosRealm:
|
|
|
|
return settings->KerberosRealm;
|
|
|
|
|
|
|
|
case FreeRDP_CertificateName:
|
|
|
|
return settings->CertificateName;
|
|
|
|
|
|
|
|
case FreeRDP_CertificateFile:
|
|
|
|
return settings->CertificateFile;
|
|
|
|
|
|
|
|
case FreeRDP_PrivateKeyFile:
|
|
|
|
return settings->PrivateKeyFile;
|
|
|
|
|
|
|
|
case FreeRDP_RdpKeyFile:
|
|
|
|
return settings->RdpKeyFile;
|
|
|
|
|
2016-01-21 02:17:59 +03:00
|
|
|
case FreeRDP_CertificateContent:
|
|
|
|
return settings->CertificateContent;
|
|
|
|
|
|
|
|
case FreeRDP_PrivateKeyContent:
|
|
|
|
return settings->PrivateKeyContent;
|
|
|
|
|
|
|
|
case FreeRDP_RdpKeyContent:
|
|
|
|
return settings->RdpKeyContent;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_WindowTitle:
|
|
|
|
return settings->WindowTitle;
|
|
|
|
|
|
|
|
case FreeRDP_ComputerName:
|
|
|
|
return settings->ComputerName;
|
|
|
|
|
|
|
|
case FreeRDP_ConnectionFile:
|
|
|
|
return settings->ConnectionFile;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_AssistanceFile:
|
|
|
|
return settings->AssistanceFile;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_HomePath:
|
|
|
|
return settings->HomePath;
|
|
|
|
|
|
|
|
case FreeRDP_ConfigPath:
|
|
|
|
return settings->ConfigPath;
|
|
|
|
|
|
|
|
case FreeRDP_CurrentPath:
|
|
|
|
return settings->CurrentPath;
|
|
|
|
|
|
|
|
case FreeRDP_DumpRemoteFxFile:
|
|
|
|
return settings->DumpRemoteFxFile;
|
|
|
|
|
|
|
|
case FreeRDP_PlayRemoteFxFile:
|
|
|
|
return settings->PlayRemoteFxFile;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayHostname:
|
|
|
|
return settings->GatewayHostname;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUsername:
|
|
|
|
return settings->GatewayUsername;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayPassword:
|
|
|
|
return settings->GatewayPassword;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayDomain:
|
|
|
|
return settings->GatewayDomain;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationName:
|
|
|
|
return settings->RemoteApplicationName;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationIcon:
|
|
|
|
return settings->RemoteApplicationIcon;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationProgram:
|
|
|
|
return settings->RemoteApplicationProgram;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationFile:
|
|
|
|
return settings->RemoteApplicationFile;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationGuid:
|
|
|
|
return settings->RemoteApplicationGuid;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationCmdLine:
|
|
|
|
return settings->RemoteApplicationCmdLine;
|
|
|
|
|
|
|
|
case FreeRDP_ImeFileName:
|
|
|
|
return settings->ImeFileName;
|
|
|
|
|
|
|
|
case FreeRDP_DrivesToRedirect:
|
|
|
|
return settings->DrivesToRedirect;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "freerdp_get_param_string: unknown id: %d", id);
|
2013-03-20 23:33:33 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-02 22:33:46 +04:00
|
|
|
int freerdp_set_param_string(rdpSettings* settings, int id, const char* param)
|
2013-03-20 23:33:33 +04:00
|
|
|
{
|
2015-06-22 19:52:13 +03:00
|
|
|
char **tmp = NULL;
|
|
|
|
|
|
|
|
if (!param)
|
|
|
|
return -1;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case FreeRDP_ServerHostname:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ServerHostname;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Username:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->Username;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Password:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->Password;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_Domain:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->Domain;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
2013-11-06 19:02:58 +04:00
|
|
|
case FreeRDP_PasswordHash:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->PasswordHash;
|
2013-11-06 19:02:58 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_ClientHostname:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ClientHostname;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClientProductId:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ClientProductId;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_AlternateShell:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->AlternateShell;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ShellWorkingDirectory:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ShellWorkingDirectory;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClientAddress:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ClientAddress;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ClientDir:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ClientDir;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DynamicDSTTimeZoneKeyName:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->DynamicDSTTimeZoneKeyName;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_RemoteAssistanceSessionId:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteAssistanceSessionId;
|
2014-06-29 02:33:46 +04:00
|
|
|
break;
|
|
|
|
|
2014-06-30 20:51:27 +04:00
|
|
|
case FreeRDP_RemoteAssistancePassStub:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteAssistancePassStub;
|
2014-06-30 20:51:27 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAssistancePassword:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteAssistancePassword;
|
2014-06-30 20:51:27 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteAssistanceRCTicket:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteAssistanceRCTicket;
|
2014-06-30 20:51:27 +04:00
|
|
|
break;
|
|
|
|
|
2014-02-12 09:43:02 +04:00
|
|
|
case FreeRDP_AuthenticationServiceClass:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->AuthenticationServiceClass;
|
2014-02-12 09:43:02 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_PreconnectionBlob:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->PreconnectionBlob;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KerberosKdc:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->KerberosKdc;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_KerberosRealm:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->KerberosRealm;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CertificateName:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->CertificateName;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CertificateFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->CertificateFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PrivateKeyFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->PrivateKeyFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
2016-01-21 02:17:59 +03:00
|
|
|
case FreeRDP_CertificateContent:
|
|
|
|
tmp = &settings->CertificateContent;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PrivateKeyContent:
|
|
|
|
tmp = &settings->PrivateKeyContent;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RdpKeyContent:
|
|
|
|
tmp = &settings->RdpKeyContent;
|
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_RdpKeyFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RdpKeyFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_WindowTitle:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->WindowTitle;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ComputerName:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ComputerName;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ConnectionFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ConnectionFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
2014-06-29 02:33:46 +04:00
|
|
|
case FreeRDP_AssistanceFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->AssistanceFile;
|
2014-06-29 02:33:46 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
case FreeRDP_HomePath:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->HomePath;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ConfigPath:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ConfigPath;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_CurrentPath:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->CurrentPath;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DumpRemoteFxFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->DumpRemoteFxFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_PlayRemoteFxFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->PlayRemoteFxFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayHostname:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->GatewayHostname;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayUsername:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->GatewayUsername;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayPassword:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->GatewayPassword;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_GatewayDomain:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->GatewayDomain;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationName:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationName;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationIcon:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationIcon;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationProgram:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationProgram;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationFile:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationFile;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationGuid:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationGuid;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_RemoteApplicationCmdLine:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->RemoteApplicationCmdLine;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_ImeFileName:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->ImeFileName;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FreeRDP_DrivesToRedirect:
|
2015-06-22 19:52:13 +03:00
|
|
|
tmp = &settings->DrivesToRedirect;
|
2013-03-20 23:33:33 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "unknown id %d (param = %s)", id, param);
|
2013-03-20 23:33:33 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-06-22 19:52:13 +03:00
|
|
|
free(*tmp);
|
|
|
|
if (!(*tmp = _strdup(param)))
|
|
|
|
return -1;
|
|
|
|
|
2013-10-13 06:58:09 +04:00
|
|
|
/* Mark field as modified */
|
2013-10-17 06:55:51 +04:00
|
|
|
settings->SettingsModified[id] = 1;
|
2013-06-16 01:39:45 +04:00
|
|
|
|
2013-03-20 23:33:33 +04:00
|
|
|
return 0;
|
|
|
|
}
|