FreeRDP
include/freerdp/settings.h File Reference

This is the FreeRDP settings module. More...

#include <winpr/timezone.h>
#include <winpr/wlog.h>
#include <freerdp/api.h>
#include <freerdp/config.h>
#include <freerdp/types.h>
#include <freerdp/redirection.h>
#include <freerdp/settings_types_private.h>
#include <freerdp/settings_keys.h>
#include <freerdp/settings_types.h>
#include <freerdp/crypto/certificate.h>
#include <freerdp/crypto/privatekey.h>

Go to the source code of this file.

Macros

#define FREERDP_SETTINGS_SERVER_MODE   0x00000001
 
#define FREERDP_SETTINGS_REMOTE_MODE   0x00000002
 

Functions

FREERDP_API rdpSettings * freerdp_settings_new (DWORD flags)
 creates a new setting struct More...
 
FREERDP_API rdpSettings * freerdp_settings_clone (const rdpSettings *settings)
 Creates a deep copy of settings. More...
 
FREERDP_API BOOL freerdp_settings_copy (rdpSettings *dst, const rdpSettings *src)
 Deep copies settings from src to dst. More...
 
FREERDP_API BOOL freerdp_settings_copy_item (rdpSettings *dst, const rdpSettings *src, SSIZE_T id)
 copies one setting identified by id from src to dst More...
 
FREERDP_API void freerdp_settings_free (rdpSettings *settings)
 Free a settings struct with all data in it. More...
 
FREERDP_API void freerdp_settings_dump (wLog *log, DWORD level, const rdpSettings *settings)
 Dumps the contents of a settings struct to a WLog logger. More...
 
FREERDP_API BOOL freerdp_settings_print_diff (wLog *log, DWORD level, const rdpSettings *src, const rdpSettings *other)
 Dumps the difference between two settings structs to a WLog. More...
 
FREERDP_API ADDIN_ARGVfreerdp_addin_argv_new (size_t argc, const char *argv[])
 
FREERDP_API ADDIN_ARGVfreerdp_addin_argv_clone (const ADDIN_ARGV *args)
 
FREERDP_API void freerdp_addin_argv_free (ADDIN_ARGV *args)
 
FREERDP_API BOOL freerdp_addin_argv_add_argument (ADDIN_ARGV *args, const char *argument)
 
FREERDP_API BOOL freerdp_addin_argv_add_argument_ex (ADDIN_ARGV *args, const char *argument, size_t len)
 
FREERDP_API BOOL freerdp_addin_argv_del_argument (ADDIN_ARGV *args, const char *argument)
 
FREERDP_API int freerdp_addin_set_argument (ADDIN_ARGV *args, const char *argument)
 
FREERDP_API int freerdp_addin_replace_argument (ADDIN_ARGV *args, const char *previous, const char *argument)
 
FREERDP_API int freerdp_addin_set_argument_value (ADDIN_ARGV *args, const char *option, const char *value)
 
FREERDP_API int freerdp_addin_replace_argument_value (ADDIN_ARGV *args, const char *previous, const char *option, const char *value)
 
FREERDP_API BOOL freerdp_device_collection_add (rdpSettings *settings, RDPDR_DEVICE *device)
 
FREERDP_API BOOL freerdp_device_collection_del (rdpSettings *settings, const RDPDR_DEVICE *device)
 Removed a device from the settings, returns ownership of the allocated device to caller. More...
 
FREERDP_API RDPDR_DEVICEfreerdp_device_collection_find (rdpSettings *settings, const char *name)
 
FREERDP_API RDPDR_DEVICEfreerdp_device_collection_find_type (rdpSettings *settings, UINT32 type)
 
FREERDP_API void freerdp_device_free (RDPDR_DEVICE *device)
 
FREERDP_API RDPDR_DEVICEfreerdp_device_new (UINT32 Type, size_t count, const char *args[])
 
FREERDP_API RDPDR_DEVICEfreerdp_device_clone (const RDPDR_DEVICE *device)
 
FREERDP_API BOOL freerdp_device_equal (const RDPDR_DEVICE *one, const RDPDR_DEVICE *other)
 
FREERDP_API void freerdp_device_collection_free (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_static_channel_collection_add (rdpSettings *settings, ADDIN_ARGV *channel)
 
FREERDP_API BOOL freerdp_static_channel_collection_del (rdpSettings *settings, const char *name)
 
FREERDP_API ADDIN_ARGVfreerdp_static_channel_collection_find (rdpSettings *settings, const char *name)
 
FREERDP_API void freerdp_static_channel_collection_free (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_dynamic_channel_collection_add (rdpSettings *settings, ADDIN_ARGV *channel)
 
FREERDP_API BOOL freerdp_dynamic_channel_collection_del (rdpSettings *settings, const char *name)
 
FREERDP_API ADDIN_ARGVfreerdp_dynamic_channel_collection_find (const rdpSettings *settings, const char *name)
 
FREERDP_API void freerdp_dynamic_channel_collection_free (rdpSettings *settings)
 
FREERDP_API void freerdp_capability_buffer_free (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_capability_buffer_copy (rdpSettings *settings, const rdpSettings *src)
 
FREERDP_API void freerdp_server_license_issuers_free (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_server_license_issuers_copy (rdpSettings *settings, char **addresses, UINT32 count)
 
FREERDP_API void freerdp_target_net_addresses_free (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_target_net_addresses_copy (rdpSettings *settings, char **addresses, UINT32 count)
 
FREERDP_API void freerdp_performance_flags_make (rdpSettings *settings)
 
FREERDP_API void freerdp_performance_flags_split (rdpSettings *settings)
 
FREERDP_API BOOL freerdp_set_gateway_usage_method (rdpSettings *settings, UINT32 GatewayUsageMethod)
 
FREERDP_API void freerdp_update_gateway_usage_method (rdpSettings *settings, UINT32 GatewayEnabled, UINT32 GatewayBypassLocal)
 
FREERDP_API BOOL freerdp_settings_are_valid (const rdpSettings *settings)
 Returns TRUE if settings are in a valid state, FALSE otherwise. More...
 
FREERDP_API BOOL freerdp_settings_get_bool (const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
 Returns a boolean settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_bool (rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, BOOL param)
 Sets a BOOL settings value. More...
 
FREERDP_API INT16 freerdp_settings_get_int16 (const rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id)
 Returns a INT16 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_int16 (rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id, INT16 param)
 Sets a INT16 settings value. More...
 
FREERDP_API UINT16 freerdp_settings_get_uint16 (const rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id)
 Returns a UINT16 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_uint16 (rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id, UINT16 param)
 Sets a UINT16 settings value. More...
 
FREERDP_API INT32 freerdp_settings_get_int32 (const rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id)
 Returns a INT32 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_int32 (rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id, INT32 param)
 Sets a INT32 settings value. More...
 
FREERDP_API UINT32 freerdp_settings_get_uint32 (const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
 Returns a UINT32 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_uint32 (rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id, UINT32 param)
 Sets a UINT32 settings value. More...
 
FREERDP_API INT64 freerdp_settings_get_int64 (const rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id)
 Returns a INT64 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_int64 (rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id, INT64 param)
 Sets a INT64 settings value. More...
 
FREERDP_API UINT64 freerdp_settings_get_uint64 (const rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id)
 Returns a UINT64 settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_uint64 (rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id, UINT64 param)
 Sets a UINT64 settings value. More...
 
FREERDP_API const char * freerdp_settings_get_string (const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
 Returns a immutable string settings value. More...
 
FREERDP_API char * freerdp_settings_get_string_writable (rdpSettings *settings, FreeRDP_Settings_Keys_String id)
 Returns a string settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_string_len (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param, size_t len)
 Sets a string settings value. The param is copied. More...
 
FREERDP_API BOOL freerdp_settings_set_string (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param)
 Sets a string settings value. The param is copied. More...
 
FREERDP_API BOOL freerdp_settings_append_string (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *separator, const char *param)
 appends a string to a settings value. The param is copied. If the initial value of the setting was not empty, <old value><separator> is created More...
 
FREERDP_API BOOL freerdp_settings_set_string_from_utf16 (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const WCHAR *param)
 Sets a string settings value. The param is converted to UTF-8 and the copy stored. More...
 
FREERDP_API BOOL freerdp_settings_set_string_from_utf16N (rdpSettings *settings, FreeRDP_Settings_Keys_String id, const WCHAR *param, size_t length)
 Sets a string settings value. The param is converted to UTF-8 and the copy stored. More...
 
FREERDP_API WCHAR * freerdp_settings_get_string_as_utf16 (const rdpSettings *settings, FreeRDP_Settings_Keys_String id, size_t *pCharLen)
 Return an allocated UTF16 string. More...
 
FREERDP_API const void * freerdp_settings_get_pointer (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
 Returns a immutable pointer settings value. More...
 
FREERDP_API void * freerdp_settings_get_pointer_writable (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
 Returns a mutable pointer settings value. More...
 
FREERDP_API BOOL freerdp_settings_set_pointer (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data)
 Set a pointer to value data. More...
 
FREERDP_API BOOL freerdp_settings_set_pointer_len (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data, size_t len)
 Set a pointer to value data. More...
 
FREERDP_API const void * freerdp_settings_get_pointer_array (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset)
 
FREERDP_API void * freerdp_settings_get_pointer_array_writable (const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset)
 
FREERDP_API BOOL freerdp_settings_set_pointer_array (rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, size_t offset, const void *data)
 
FREERDP_API BOOL freerdp_settings_set_value_for_name (rdpSettings *settings, const char *name, const char *value)
 
FREERDP_API SSIZE_T freerdp_settings_get_key_for_name (const char *value)
 Get a key index for the name string of that key. More...
 
FREERDP_API SSIZE_T freerdp_settings_get_type_for_name (const char *value)
 Get a key type for the name string of that key. More...
 
FREERDP_API SSIZE_T freerdp_settings_get_type_for_key (SSIZE_T key)
 Get a key type for the key index. More...
 
FREERDP_API const char * freerdp_settings_get_type_name_for_key (SSIZE_T key)
 Returns the type name for a key. More...
 
FREERDP_API const char * freerdp_settings_get_type_name_for_type (SSIZE_T type)
 Returns the type name for a type. More...
 
FREERDP_API const char * freerdp_settings_get_name_for_key (SSIZE_T key)
 Returns the type name for a key. More...
 
FREERDP_API UINT32 freerdp_settings_get_codecs_flags (const rdpSettings *settings)
 helper function to get a mask of supported codec flags. More...
 
FREERDP_API BOOL freerdp_settings_update_from_caps (rdpSettings *settings, const BYTE *capsFlags, const BYTE **capsData, const UINT32 *capsSizes, UINT32 capsCount, BOOL serverReceivedCaps)
 Parse capability data and apply to settings. More...
 
FREERDP_API const char * freerdp_settings_get_server_name (const rdpSettings *settings)
 A helper function to return the correct server name. More...
 
FREERDP_API char * freerdp_rail_support_flags_to_string (UINT32 flags, char *buffer, size_t length)
 Returns a stringified representation of RAIL support flags. More...
 
FREERDP_API const char * freerdp_rdp_version_string (UINT32 version)
 Returns a stringified representation of the RDP protocol version. More...
 
FREERDP_API const char * freerdp_rdpdr_dtyp_string (UINT32 type)
 Returns a string representation of RDPDR_DTYP_*. More...
 
FREERDP_API const char * freerdp_encryption_level_string (UINT32 EncryptionLevel)
 
FREERDP_API const char * freerdp_encryption_methods_string (UINT32 EncryptionLevel, char *buffer, size_t size)
 
FREERDP_API const char * freerdp_supported_color_depths_string (UINT16 mask, char *buffer, size_t size)
 returns a string representation of RNS_UD_XXBPP_SUPPORT values More...
 
FREERDP_API char * freerdp_settings_get_config_path (void)
 return the configuration directory for the library
 

Detailed Description

This is the FreeRDP settings module.

FreeRDP: A Remote Desktop Protocol Implementation RDP Settings

Copyright 2009-2011 Jay Sorg Copyright 2010-2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@gm.nosp@m.ail..nosp@m.com Copyright 2023 Armin Novak anova.nosp@m.k@th.nosp@m.incas.nosp@m.t.co.nosp@m.m Copyright 2023 Thincast Technologies GmbH

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.

Settings are used to store configuration data for an RDP connection. There are 3 different settings for each client and server:

  1. The initial connection supplied by the user
  2. The settings sent from client or server during capability exchange
  3. The settings merged from the capability exchange and the initial configuration.

The lifetime of the settings is as follows:

  1. Initial configuration is saved and will be valid for the whole application lifecycle
  2. The client or server settings from the other end are valid from capability exchange until the connection is ended (disconnect/redirect/...)
  3. The merged settings are created from the initial configuration and server settings and have the same lifetime, until the connection ends

So, when accessing the settings always ensure to know which one you are operating on! (this is especially important for the proxy where you have a RDP client and RDP server in the same application context)

Definition in file include/freerdp/settings.h.

Macro Definition Documentation

◆ FREERDP_SETTINGS_SERVER_MODE

#define FREERDP_SETTINGS_SERVER_MODE   0x00000001

rdpSettings creation flags

Definition at line 78 of file include/freerdp/settings.h.

Function Documentation

◆ freerdp_device_collection_del()

FREERDP_API BOOL freerdp_device_collection_del ( rdpSettings *  settings,
const RDPDR_DEVICE device 
)

Removed a device from the settings, returns ownership of the allocated device to caller.

Parameters
settingsthe settings to remove the device from
devicethe device to remove
Returns
TRUE if the device was removed, FALSE if device was not found or is NULL

Definition at line 240 of file common/settings.c.

241 {
242  WINPR_ASSERT(settings);
243 
244  if (!device)
245  return FALSE;
246 
247  const UINT32 count = settings->DeviceCount;
248  for (size_t x = 0; x < count; x++)
249  {
250  const RDPDR_DEVICE* cur = settings->DeviceArray[x];
251  if (cur == device)
252  {
253  for (size_t y = x + 1; y < count; y++)
254  {
255  RDPDR_DEVICE* next = settings->DeviceArray[y];
256  settings->DeviceArray[y - 1] = next;
257  }
258  settings->DeviceArray[count - 1] = NULL;
259  settings->DeviceCount--;
260  return TRUE;
261  }
262  }
263 
264  return FALSE;
265 }

◆ freerdp_rail_support_flags_to_string()

FREERDP_API char* freerdp_rail_support_flags_to_string ( UINT32  flags,
char *  buffer,
size_t  length 
)

Returns a stringified representation of RAIL support flags.

Parameters
flagsThe flags to stringify
bufferA pointer to the string buffer to write to
lengthThe size of the string buffer
Returns
A pointer to buffer for success, NULL otherwise

Definition at line 1951 of file common/settings.c.

1952 {
1953  const UINT32 mask =
1954  RAIL_LEVEL_SUPPORTED | RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED |
1955  RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED |
1956  RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED | RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED |
1957  RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED | RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED;
1958 
1959  if (flags & RAIL_LEVEL_SUPPORTED)
1960  winpr_str_append("RAIL_LEVEL_SUPPORTED", buffer, length, "|");
1961  if (flags & RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED)
1962  winpr_str_append("RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED", buffer, length, "|");
1963  if (flags & RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED)
1964  winpr_str_append("RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED", buffer, length, "|");
1965  if (flags & RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED)
1966  winpr_str_append("RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED", buffer, length, "|");
1967  if (flags & RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED)
1968  winpr_str_append("RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED", buffer, length, "|");
1969  if (flags & RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED)
1970  winpr_str_append("RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED", buffer, length, "|");
1971  if (flags & RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED)
1972  winpr_str_append("RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED", buffer, length, "|");
1973  if (flags & RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED)
1974  winpr_str_append("RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED", buffer, length, "|");
1975  if (flags & RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED)
1976  winpr_str_append("RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED", buffer, length, "|");
1977  if ((flags & ~mask) != 0)
1978  {
1979  char tbuffer[64] = { 0 };
1980  (void)_snprintf(tbuffer, sizeof(tbuffer), "RAIL_FLAG_UNKNOWN 0x%08" PRIx32, flags & mask);
1981  winpr_str_append(tbuffer, buffer, length, "|");
1982  }
1983  return buffer;
1984 }

◆ freerdp_rdp_version_string()

FREERDP_API const char* freerdp_rdp_version_string ( UINT32  version)

Returns a stringified representation of the RDP protocol version.

Parameters
versionThe RDP protocol version number.
Returns
A string representation of the protocol version as "RDP_VERSION_10_11" or "RDP_VERSION_UNKNOWN" for invalid/unknown versions

Definition at line 2011 of file common/settings.c.

2012 {
2013  switch (version)
2014  {
2015  case RDP_VERSION_4:
2016  return "RDP_VERSION_4";
2017  case RDP_VERSION_5_PLUS:
2018  return "RDP_VERSION_5_PLUS";
2019  case RDP_VERSION_10_0:
2020  return "RDP_VERSION_10_0";
2021  case RDP_VERSION_10_1:
2022  return "RDP_VERSION_10_1";
2023  case RDP_VERSION_10_2:
2024  return "RDP_VERSION_10_2";
2025  case RDP_VERSION_10_3:
2026  return "RDP_VERSION_10_3";
2027  case RDP_VERSION_10_4:
2028  return "RDP_VERSION_10_4";
2029  case RDP_VERSION_10_5:
2030  return "RDP_VERSION_10_5";
2031  case RDP_VERSION_10_6:
2032  return "RDP_VERSION_10_6";
2033  case RDP_VERSION_10_7:
2034  return "RDP_VERSION_10_7";
2035  case RDP_VERSION_10_8:
2036  return "RDP_VERSION_10_8";
2037  case RDP_VERSION_10_9:
2038  return "RDP_VERSION_10_9";
2039  case RDP_VERSION_10_10:
2040  return "RDP_VERSION_10_10";
2041  case RDP_VERSION_10_11:
2042  return "RDP_VERSION_10_11";
2043  case RDP_VERSION_10_12:
2044  return "RDP_VERSION_10_12";
2045  default:
2046  return "RDP_VERSION_UNKNOWN";
2047  }
2048 }

◆ freerdp_rdpdr_dtyp_string()

FREERDP_API const char* freerdp_rdpdr_dtyp_string ( UINT32  type)

Returns a string representation of RDPDR_DTYP_*.

Parameters
typeThe integer of the RDPDR_DTYP_* to stringify
Returns
A string representation of the RDPDR_DTYP_* or "RDPDR_DTYP_UNKNOWN"

Definition at line 2101 of file common/settings.c.

2102 {
2103  switch (type)
2104  {
2105  case RDPDR_DTYP_FILESYSTEM:
2106  return "RDPDR_DTYP_FILESYSTEM";
2107  case RDPDR_DTYP_PARALLEL:
2108  return "RDPDR_DTYP_PARALLEL";
2109  case RDPDR_DTYP_PRINT:
2110  return "RDPDR_DTYP_PRINT";
2111  case RDPDR_DTYP_SERIAL:
2112  return "RDPDR_DTYP_SERIAL";
2113  case RDPDR_DTYP_SMARTCARD:
2114  return "RDPDR_DTYP_SMARTCARD";
2115  default:
2116  return "RDPDR_DTYP_UNKNOWN";
2117  }
2118 }

◆ freerdp_set_gateway_usage_method()

FREERDP_API BOOL freerdp_set_gateway_usage_method ( rdpSettings *  settings,
UINT32  GatewayUsageMethod 
)

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

Definition at line 1008 of file common/settings.c.

1009 {
1010  if (!freerdp_settings_set_uint32(settings, FreeRDP_GatewayUsageMethod, GatewayUsageMethod))
1011  return FALSE;
1012 
1013  if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DIRECT)
1014  {
1015  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1016  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1017  return FALSE;
1018  }
1019  else if (GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
1020  {
1021  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, TRUE) ||
1022  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1023  return FALSE;
1024  }
1025  else if (GatewayUsageMethod == TSC_PROXY_MODE_DETECT)
1026  {
1027  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, TRUE) ||
1028  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, TRUE))
1029  return FALSE;
1030  }
1031  else if (GatewayUsageMethod == TSC_PROXY_MODE_DEFAULT)
1032  {
1038  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1039  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1040  return FALSE;
1041  }
1042  else if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
1043  {
1044  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1045  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1046  return FALSE;
1047  }
1048 
1049  return TRUE;
1050 }
FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id, UINT32 param)
Sets a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, BOOL param)
Sets a BOOL settings value.

References freerdp_settings_set_uint32().

Here is the call graph for this function:

◆ freerdp_settings_append_string()

FREERDP_API BOOL freerdp_settings_append_string ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const char *  separator,
const char *  param 
)

appends a string to a settings value. The param is copied. If the initial value of the setting was not empty, <old value><separator> is created

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
separatorThe separator string to use. May be NULL (no separator)
paramThe value to append
Returns
TRUE for success, FALSE for failure

Definition at line 2192 of file common/settings.c.

2194 {
2195  const char* old = freerdp_settings_get_string(settings, id);
2196 
2197  size_t len = 0;
2198  char* str = NULL;
2199 
2200  if (!old)
2201  winpr_asprintf(&str, &len, "%s", param);
2202  else if (!separator)
2203  winpr_asprintf(&str, &len, "%s%s", old, param);
2204  else
2205  winpr_asprintf(&str, &len, "%s%s%s", old, separator, param);
2206 
2207  const BOOL rc = freerdp_settings_set_string_len(settings, id, str, len);
2208  free(str);
2209  return rc;
2210 }
FREERDP_API const char * freerdp_settings_get_string(const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a immutable string settings value.
FREERDP_API BOOL freerdp_settings_set_string_len(rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param, size_t len)
Sets a string settings value. The param is copied.

References freerdp_settings_get_string(), and freerdp_settings_set_string_len().

Here is the call graph for this function:

◆ freerdp_settings_are_valid()

FREERDP_API BOOL freerdp_settings_are_valid ( const rdpSettings *  settings)

Returns TRUE if settings are in a valid state, FALSE otherwise.

This function is meant to replace tideous return checks for freerdp_settings_set_* with a single check after these calls.

Parameters
settingsthe settings instance to check
Returns
TRUE if valid, FALSE otherwise

Definition at line 2212 of file common/settings.c.

2213 {
2214  return settings != NULL;
2215 }

◆ freerdp_settings_clone()

FREERDP_API rdpSettings* freerdp_settings_clone ( const rdpSettings *  settings)

Creates a deep copy of settings.

Parameters
settingsA pointer to a settings struct to copy. May be NULL (returns NULL)
Returns
A newly allocated copy of settings or NULL

Definition at line 1156 of file core/settings.c.

1157 {
1158  rdpSettings* _settings = (rdpSettings*)calloc(1, sizeof(rdpSettings));
1159 
1160  if (!freerdp_settings_copy(_settings, settings))
1161  goto out_fail;
1162 
1163  return _settings;
1164 out_fail:
1165  freerdp_settings_free(_settings);
1166  return NULL;
1167 }
FREERDP_API void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.
FREERDP_API BOOL freerdp_settings_copy(rdpSettings *dst, const rdpSettings *src)
Deep copies settings from src to dst.

References freerdp_settings_copy(), and freerdp_settings_free().

Here is the call graph for this function:

◆ freerdp_settings_copy()

FREERDP_API BOOL freerdp_settings_copy ( rdpSettings *  dst,
const rdpSettings *  src 
)

Deep copies settings from src to dst.

The function frees up all allocated data in dst before copying the data from src

Parameters
dstA pointer for the settings to copy data to. May be NULL (fails copy)
srcA pointer to the settings to copy. May be NULL (fails copy)
Returns
TRUE for success, FALSE for failure.

Definition at line 1101 of file core/settings.c.

1102 {
1103  BOOL rc = 0;
1104 
1105  if (!settings || !_settings)
1106  return FALSE;
1107 
1108  /* This is required to free all non string buffers */
1109  freerdp_settings_free_internal(_settings);
1110  /* This copies everything except allocated non string buffers. reset all allocated buffers to
1111  * NULL to fix issues during cleanup */
1112  rc = freerdp_settings_clone_keys(_settings, settings);
1113 
1114  _settings->LoadBalanceInfo = NULL;
1115  _settings->ServerRandom = NULL;
1116  _settings->ClientRandom = NULL;
1117  _settings->ServerCertificate = NULL;
1118  _settings->RdpServerCertificate = NULL;
1119  _settings->RdpServerRsaKey = NULL;
1120  _settings->ChannelDefArray = NULL;
1121  _settings->MonitorDefArray = NULL;
1122  _settings->MonitorIds = NULL;
1123  _settings->OrderSupport = NULL;
1124  _settings->BitmapCacheV2CellInfo = NULL;
1125  _settings->GlyphCache = NULL;
1126  _settings->FragCache = NULL;
1127  _settings->ClientAutoReconnectCookie = NULL;
1128  _settings->ServerAutoReconnectCookie = NULL;
1129  _settings->ClientTimeZone = NULL;
1130  _settings->RedirectionPassword = NULL;
1131  _settings->RedirectionTsvUrl = NULL;
1132  _settings->TargetNetAddresses = NULL;
1133  _settings->TargetNetPorts = NULL;
1134  _settings->DeviceArray = NULL;
1135  _settings->StaticChannelArray = NULL;
1136  _settings->DynamicChannelArray = NULL;
1137  _settings->ReceivedCapabilities = NULL;
1138  _settings->ReceivedCapabilityData = NULL;
1139  _settings->ReceivedCapabilityDataSizes = NULL;
1140 
1141  _settings->ServerLicenseProductIssuersCount = 0;
1142  _settings->ServerLicenseProductIssuers = NULL;
1143 
1144  if (!rc)
1145  goto out_fail;
1146 
1147  /* Begin copying */
1148  if (!freerdp_settings_int_buffer_copy(_settings, settings))
1149  goto out_fail;
1150  return TRUE;
1151 out_fail:
1152  freerdp_settings_free_internal(_settings);
1153  return FALSE;
1154 }

Referenced by freerdp_settings_clone().

Here is the caller graph for this function:

◆ freerdp_settings_copy_item()

FREERDP_API BOOL freerdp_settings_copy_item ( rdpSettings *  dst,
const rdpSettings *  src,
SSIZE_T  id 
)

copies one setting identified by id from src to dst

The function frees up all allocated data in dst before copying the data from src

Parameters
dstA pointer for the settings to copy data to. May be NULL (fails copy)
srcA pointer to the settings to copy. May be NULL (fails copy)
idThe settings identifier to copy
Returns
TRUE for success, FALSE for failure.

Definition at line 421 of file settings_str.c.

422 {
423  WINPR_ASSERT(dst);
424  WINPR_ASSERT(src);
425 
426  const SSIZE_T key = freerdp_settings_get_type_for_key(id);
427  switch (key)
428  {
429  case FREERDP_SETTINGS_TYPE_BOOL:
430  {
431  const BOOL val = freerdp_settings_get_bool(src, (FreeRDP_Settings_Keys_Bool)id);
432  return freerdp_settings_set_bool(dst, (FreeRDP_Settings_Keys_Bool)id, val);
433  }
434  case FREERDP_SETTINGS_TYPE_INT16:
435  {
436  const INT16 val = freerdp_settings_get_int16(src, (FreeRDP_Settings_Keys_Int16)id);
437  return freerdp_settings_set_int16(dst, (FreeRDP_Settings_Keys_Int16)id, val);
438  }
439  case FREERDP_SETTINGS_TYPE_INT32:
440  {
441  const INT32 val = freerdp_settings_get_int32(src, (FreeRDP_Settings_Keys_Int32)id);
442  return freerdp_settings_set_int32(dst, (FreeRDP_Settings_Keys_Int32)id, val);
443  }
444  case FREERDP_SETTINGS_TYPE_INT64:
445  {
446  const INT64 val = freerdp_settings_get_int64(src, (FreeRDP_Settings_Keys_Int64)id);
447  return freerdp_settings_set_int64(dst, (FreeRDP_Settings_Keys_Int64)id, val);
448  }
449  case FREERDP_SETTINGS_TYPE_UINT16:
450  {
451  const UINT16 val = freerdp_settings_get_uint16(src, (FreeRDP_Settings_Keys_UInt16)id);
452  return freerdp_settings_set_uint16(dst, (FreeRDP_Settings_Keys_UInt16)id, val);
453  }
454  case FREERDP_SETTINGS_TYPE_UINT32:
455  {
456  const UINT32 val = freerdp_settings_get_uint32(src, (FreeRDP_Settings_Keys_UInt32)id);
457  return freerdp_settings_set_uint32(dst, (FreeRDP_Settings_Keys_UInt32)id, val);
458  }
459  case FREERDP_SETTINGS_TYPE_UINT64:
460  {
461  const UINT64 val = freerdp_settings_get_uint64(src, (FreeRDP_Settings_Keys_UInt64)id);
462  return freerdp_settings_set_uint64(dst, (FreeRDP_Settings_Keys_UInt64)id, val);
463  }
464  case FREERDP_SETTINGS_TYPE_STRING:
465  {
466  const char* val = freerdp_settings_get_string(src, (FreeRDP_Settings_Keys_String)id);
467  return freerdp_settings_set_string(dst, (FreeRDP_Settings_Keys_String)id, val);
468  }
469  case FREERDP_SETTINGS_TYPE_POINTER:
470  {
471  const void* val = freerdp_settings_get_pointer(src, (FreeRDP_Settings_Keys_Pointer)id);
472  return freerdp_settings_set_pointer(dst, (FreeRDP_Settings_Keys_Pointer)id, val);
473  }
474  default:
475  return FALSE;
476  }
477 }
FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_set_string(rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param)
Sets a string settings value. The param is copied.
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.
FREERDP_API const void * freerdp_settings_get_pointer(const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a immutable pointer settings value.
FREERDP_API INT64 freerdp_settings_get_int64(const rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id)
Returns a INT64 settings value.
FREERDP_API SSIZE_T freerdp_settings_get_type_for_key(SSIZE_T key)
Get a key type for the key index.
Definition: settings_str.c:399
FREERDP_API UINT64 freerdp_settings_get_uint64(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id)
Returns a UINT64 settings value.
FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id, INT32 param)
Sets a INT32 settings value.
FREERDP_API UINT16 freerdp_settings_get_uint16(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id)
Returns a UINT16 settings value.
FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id, UINT64 param)
Sets a UINT64 settings value.
FREERDP_API BOOL freerdp_settings_set_int16(rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id, INT16 param)
Sets a INT16 settings value.
FREERDP_API BOOL freerdp_settings_set_int64(rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id, INT64 param)
Sets a INT64 settings value.
FREERDP_API BOOL freerdp_settings_set_pointer(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data)
Set a pointer to value data.
FREERDP_API INT32 freerdp_settings_get_int32(const rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id)
Returns a INT32 settings value.
FREERDP_API BOOL freerdp_settings_set_uint16(rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id, UINT16 param)
Sets a UINT16 settings value.
FREERDP_API INT16 freerdp_settings_get_int16(const rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id)
Returns a INT16 settings value.

References freerdp_settings_get_bool(), freerdp_settings_get_int16(), freerdp_settings_get_int32(), freerdp_settings_get_int64(), freerdp_settings_get_pointer(), freerdp_settings_get_string(), freerdp_settings_get_type_for_key(), freerdp_settings_get_uint16(), freerdp_settings_get_uint32(), freerdp_settings_get_uint64(), freerdp_settings_set_bool(), freerdp_settings_set_int16(), freerdp_settings_set_int32(), freerdp_settings_set_int64(), freerdp_settings_set_pointer(), freerdp_settings_set_string(), freerdp_settings_set_uint16(), freerdp_settings_set_uint32(), and freerdp_settings_set_uint64().

Here is the call graph for this function:

◆ freerdp_settings_dump()

FREERDP_API void freerdp_settings_dump ( wLog *  log,
DWORD  level,
const rdpSettings *  settings 
)

Dumps the contents of a settings struct to a WLog logger.

Parameters
logThe logger to write to, must not be NULL
levelThe WLog level to use for the log entries
settingsA pointer to the settings to dump. May be NULL.

Definition at line 242 of file settings_str.c.

243 {
244  WINPR_ASSERT(log);
245  WINPR_ASSERT(settings);
246 
247  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
248  {
249  const struct settings_str_entry* cur = &settings_map[x];
250  switch (cur->type)
251  {
252  case FREERDP_SETTINGS_TYPE_BOOL: /* bool */
253  {
254  BOOL sval =
255  freerdp_settings_get_bool(settings, (FreeRDP_Settings_Keys_Bool)cur->id);
256  WLog_Print(log, level, "%s [BOOL]: %s", cur->str, sval ? "TRUE" : "FALSE");
257  }
258  break;
259  case FREERDP_SETTINGS_TYPE_UINT16: /* UINT16 */
260  {
261  UINT16 sval =
262  freerdp_settings_get_uint16(settings, (FreeRDP_Settings_Keys_UInt16)cur->id);
263  WLog_Print(log, level, "%s [UINT16]: %" PRIu16, cur->str, sval);
264  }
265  break;
266  case FREERDP_SETTINGS_TYPE_INT16: /* INT16 */
267  {
268  INT16 sval =
269  freerdp_settings_get_int16(settings, (FreeRDP_Settings_Keys_Int16)cur->id);
270  WLog_Print(log, level, "%s [INT16]: %" PRId16, cur->str, sval);
271  }
272  break;
273  case FREERDP_SETTINGS_TYPE_UINT32: /* UINT32 */
274  {
275  UINT32 sval =
276  freerdp_settings_get_uint32(settings, (FreeRDP_Settings_Keys_UInt32)cur->id);
277  WLog_Print(log, level, "%s [UINT32]: %" PRIu32, cur->str, sval);
278  }
279  break;
280  case FREERDP_SETTINGS_TYPE_INT32: /* INT32 */
281  {
282  INT32 sval =
283  freerdp_settings_get_int32(settings, (FreeRDP_Settings_Keys_Int32)cur->id);
284  WLog_Print(log, level, "%s [INT32]: %" PRId32, cur->str, sval);
285  }
286  break;
287  case FREERDP_SETTINGS_TYPE_UINT64: /* UINT64 */
288  {
289  UINT64 sval =
290  freerdp_settings_get_uint64(settings, (FreeRDP_Settings_Keys_UInt64)cur->id);
291  WLog_Print(log, level, "%s [UINT64]: %" PRIu64, cur->str, sval);
292  }
293  break;
294  case FREERDP_SETTINGS_TYPE_INT64: /* INT64 */
295  {
296  INT64 sval =
297  freerdp_settings_get_int64(settings, (FreeRDP_Settings_Keys_Int64)cur->id);
298  WLog_Print(log, level, "%s [INT64]: %" PRId64, cur->str, sval);
299  }
300  break;
301  case FREERDP_SETTINGS_TYPE_STRING: /* strings */
302  {
303  const char* sval =
304  freerdp_settings_get_string(settings, (FreeRDP_Settings_Keys_String)cur->id);
305  WLog_Print(log, level, "%s [STRING]: '%s'", cur->str, sval);
306  }
307  break;
308  case FREERDP_SETTINGS_TYPE_POINTER: /* pointer */
309  {
310  const void* sval =
311  freerdp_settings_get_pointer(settings, (FreeRDP_Settings_Keys_Pointer)cur->id);
312  WLog_Print(log, level, "%s [POINTER]: '%p'", cur->str, sval);
313  }
314  break;
315  }
316  }
317 }
Definition: settings_str.h:27

References freerdp_settings_get_bool(), freerdp_settings_get_int16(), freerdp_settings_get_int32(), freerdp_settings_get_int64(), freerdp_settings_get_pointer(), freerdp_settings_get_string(), freerdp_settings_get_uint16(), freerdp_settings_get_uint32(), and freerdp_settings_get_uint64().

Here is the call graph for this function:

◆ freerdp_settings_free()

FREERDP_API void freerdp_settings_free ( rdpSettings *  settings)

Free a settings struct with all data in it.

Parameters
settingsA pointer to the settings to free, May be NULL

Definition at line 852 of file core/settings.c.

853 {
854  if (!settings)
855  return;
856 
857  freerdp_settings_free_internal(settings);
858  free(settings);
859 }

Referenced by freerdp_settings_clone().

Here is the caller graph for this function:

◆ freerdp_settings_get_bool()

FREERDP_API BOOL freerdp_settings_get_bool ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_Bool  id 
)

Returns a boolean settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the boolean key

Definition at line 54 of file settings_getters.c.

55 {
56  WINPR_ASSERT(settings);
57 
58  switch (id)
59  {
60  case FreeRDP_AadSecurity:
61  return settings->AadSecurity;
62 
63  case FreeRDP_AllowCacheWaitingList:
64  return settings->AllowCacheWaitingList;
65 
66  case FreeRDP_AllowDesktopComposition:
67  return settings->AllowDesktopComposition;
68 
69  case FreeRDP_AllowFontSmoothing:
70  return settings->AllowFontSmoothing;
71 
72  case FreeRDP_AllowUnanouncedOrdersFromServer:
73  return settings->AllowUnanouncedOrdersFromServer;
74 
75  case FreeRDP_AltSecFrameMarkerSupport:
76  return settings->AltSecFrameMarkerSupport;
77 
78  case FreeRDP_AsyncChannels:
79  return settings->AsyncChannels;
80 
81  case FreeRDP_AsyncUpdate:
82  return settings->AsyncUpdate;
83 
84  case FreeRDP_AudioCapture:
85  return settings->AudioCapture;
86 
87  case FreeRDP_AudioPlayback:
88  return settings->AudioPlayback;
89 
90  case FreeRDP_Authentication:
91  return settings->Authentication;
92 
93  case FreeRDP_AuthenticationOnly:
94  return settings->AuthenticationOnly;
95 
96  case FreeRDP_AutoAcceptCertificate:
97  return settings->AutoAcceptCertificate;
98 
99  case FreeRDP_AutoDenyCertificate:
100  return settings->AutoDenyCertificate;
101 
102  case FreeRDP_AutoLogonEnabled:
103  return settings->AutoLogonEnabled;
104 
105  case FreeRDP_AutoReconnectionEnabled:
106  return settings->AutoReconnectionEnabled;
107 
108  case FreeRDP_AutoReconnectionPacketSupported:
109  return settings->AutoReconnectionPacketSupported;
110 
111  case FreeRDP_BitmapCacheEnabled:
112  return settings->BitmapCacheEnabled;
113 
114  case FreeRDP_BitmapCachePersistEnabled:
115  return settings->BitmapCachePersistEnabled;
116 
117  case FreeRDP_BitmapCacheV3Enabled:
118  return settings->BitmapCacheV3Enabled;
119 
120  case FreeRDP_BitmapCompressionDisabled:
121  return settings->BitmapCompressionDisabled;
122 
123  case FreeRDP_CertificateCallbackPreferPEM:
124  return settings->CertificateCallbackPreferPEM;
125 
126  case FreeRDP_CompressionEnabled:
127  return settings->CompressionEnabled;
128 
129  case FreeRDP_ConnectChildSession:
130  return settings->ConnectChildSession;
131 
132  case FreeRDP_ConsoleSession:
133  return settings->ConsoleSession;
134 
135  case FreeRDP_CredentialsFromStdin:
136  return settings->CredentialsFromStdin;
137 
138  case FreeRDP_DeactivateClientDecoding:
139  return settings->DeactivateClientDecoding;
140 
141  case FreeRDP_Decorations:
142  return settings->Decorations;
143 
144  case FreeRDP_DesktopResize:
145  return settings->DesktopResize;
146 
147  case FreeRDP_DeviceRedirection:
148  return settings->DeviceRedirection;
149 
150  case FreeRDP_DisableCredentialsDelegation:
151  return settings->DisableCredentialsDelegation;
152 
153  case FreeRDP_DisableCtrlAltDel:
154  return settings->DisableCtrlAltDel;
155 
156  case FreeRDP_DisableCursorBlinking:
157  return settings->DisableCursorBlinking;
158 
159  case FreeRDP_DisableCursorShadow:
160  return settings->DisableCursorShadow;
161 
162  case FreeRDP_DisableFullWindowDrag:
163  return settings->DisableFullWindowDrag;
164 
165  case FreeRDP_DisableMenuAnims:
166  return settings->DisableMenuAnims;
167 
168  case FreeRDP_DisableRemoteAppCapsCheck:
169  return settings->DisableRemoteAppCapsCheck;
170 
171  case FreeRDP_DisableThemes:
172  return settings->DisableThemes;
173 
174  case FreeRDP_DisableWallpaper:
175  return settings->DisableWallpaper;
176 
177  case FreeRDP_DrawAllowColorSubsampling:
178  return settings->DrawAllowColorSubsampling;
179 
180  case FreeRDP_DrawAllowDynamicColorFidelity:
181  return settings->DrawAllowDynamicColorFidelity;
182 
183  case FreeRDP_DrawAllowSkipAlpha:
184  return settings->DrawAllowSkipAlpha;
185 
186  case FreeRDP_DrawGdiPlusCacheEnabled:
187  return settings->DrawGdiPlusCacheEnabled;
188 
189  case FreeRDP_DrawGdiPlusEnabled:
190  return settings->DrawGdiPlusEnabled;
191 
192  case FreeRDP_DrawNineGridEnabled:
193  return settings->DrawNineGridEnabled;
194 
195  case FreeRDP_DumpRemoteFx:
196  return settings->DumpRemoteFx;
197 
198  case FreeRDP_DynamicDaylightTimeDisabled:
199  return settings->DynamicDaylightTimeDisabled;
200 
201  case FreeRDP_DynamicResolutionUpdate:
202  return settings->DynamicResolutionUpdate;
203 
204  case FreeRDP_EmbeddedWindow:
205  return settings->EmbeddedWindow;
206 
207  case FreeRDP_EnableWindowsKey:
208  return settings->EnableWindowsKey;
209 
210  case FreeRDP_EncomspVirtualChannel:
211  return settings->EncomspVirtualChannel;
212 
213  case FreeRDP_ExtSecurity:
214  return settings->ExtSecurity;
215 
216  case FreeRDP_ExternalCertificateManagement:
217  return settings->ExternalCertificateManagement;
218 
219  case FreeRDP_FIPSMode:
220  return settings->FIPSMode;
221 
222  case FreeRDP_FastPathInput:
223  return settings->FastPathInput;
224 
225  case FreeRDP_FastPathOutput:
226  return settings->FastPathOutput;
227 
228  case FreeRDP_ForceEncryptedCsPdu:
229  return settings->ForceEncryptedCsPdu;
230 
231  case FreeRDP_ForceMultimon:
232  return settings->ForceMultimon;
233 
234  case FreeRDP_FrameMarkerCommandEnabled:
235  return settings->FrameMarkerCommandEnabled;
236 
237  case FreeRDP_Fullscreen:
238  return settings->Fullscreen;
239 
240  case FreeRDP_GatewayArmTransport:
241  return settings->GatewayArmTransport;
242 
243  case FreeRDP_GatewayBypassLocal:
244  return settings->GatewayBypassLocal;
245 
246  case FreeRDP_GatewayEnabled:
247  return settings->GatewayEnabled;
248 
249  case FreeRDP_GatewayHttpExtAuthSspiNtlm:
250  return settings->GatewayHttpExtAuthSspiNtlm;
251 
252  case FreeRDP_GatewayHttpTransport:
253  return settings->GatewayHttpTransport;
254 
255  case FreeRDP_GatewayHttpUseWebsockets:
256  return settings->GatewayHttpUseWebsockets;
257 
258  case FreeRDP_GatewayIgnoreRedirectionPolicy:
259  return settings->GatewayIgnoreRedirectionPolicy;
260 
261  case FreeRDP_GatewayRpcTransport:
262  return settings->GatewayRpcTransport;
263 
264  case FreeRDP_GatewayUdpTransport:
265  return settings->GatewayUdpTransport;
266 
267  case FreeRDP_GatewayUseSameCredentials:
268  return settings->GatewayUseSameCredentials;
269 
270  case FreeRDP_GfxAVC444:
271  return settings->GfxAVC444;
272 
273  case FreeRDP_GfxAVC444v2:
274  return settings->GfxAVC444v2;
275 
276  case FreeRDP_GfxH264:
277  return settings->GfxH264;
278 
279  case FreeRDP_GfxPlanar:
280  return settings->GfxPlanar;
281 
282  case FreeRDP_GfxProgressive:
283  return settings->GfxProgressive;
284 
285  case FreeRDP_GfxProgressiveV2:
286  return settings->GfxProgressiveV2;
287 
288  case FreeRDP_GfxSendQoeAck:
289  return settings->GfxSendQoeAck;
290 
291  case FreeRDP_GfxSmallCache:
292  return settings->GfxSmallCache;
293 
294  case FreeRDP_GfxSuspendFrameAck:
295  return settings->GfxSuspendFrameAck;
296 
297  case FreeRDP_GfxThinClient:
298  return settings->GfxThinClient;
299 
300  case FreeRDP_GrabKeyboard:
301  return settings->GrabKeyboard;
302 
303  case FreeRDP_GrabMouse:
304  return settings->GrabMouse;
305 
306  case FreeRDP_HasExtendedMouseEvent:
307  return settings->HasExtendedMouseEvent;
308 
309  case FreeRDP_HasHorizontalWheel:
310  return settings->HasHorizontalWheel;
311 
312  case FreeRDP_HasMonitorAttributes:
313  return settings->HasMonitorAttributes;
314 
315  case FreeRDP_HasQoeEvent:
316  return settings->HasQoeEvent;
317 
318  case FreeRDP_HasRelativeMouseEvent:
319  return settings->HasRelativeMouseEvent;
320 
321  case FreeRDP_HiDefRemoteApp:
322  return settings->HiDefRemoteApp;
323 
324  case FreeRDP_IPv6Enabled:
325  return settings->IPv6Enabled;
326 
327  case FreeRDP_IgnoreCertificate:
328  return settings->IgnoreCertificate;
329 
330  case FreeRDP_IgnoreInvalidDevices:
331  return settings->IgnoreInvalidDevices;
332 
333  case FreeRDP_JpegCodec:
334  return settings->JpegCodec;
335 
336  case FreeRDP_KerberosRdgIsProxy:
337  return settings->KerberosRdgIsProxy;
338 
339  case FreeRDP_ListMonitors:
340  return settings->ListMonitors;
341 
342  case FreeRDP_LocalConnection:
343  return settings->LocalConnection;
344 
345  case FreeRDP_LogonErrors:
346  return settings->LogonErrors;
347 
348  case FreeRDP_LogonNotify:
349  return settings->LogonNotify;
350 
351  case FreeRDP_LongCredentialsSupported:
352  return settings->LongCredentialsSupported;
353 
354  case FreeRDP_LyncRdpMode:
355  return settings->LyncRdpMode;
356 
357  case FreeRDP_MaximizeShell:
358  return settings->MaximizeShell;
359 
360  case FreeRDP_MouseAttached:
361  return settings->MouseAttached;
362 
363  case FreeRDP_MouseHasWheel:
364  return settings->MouseHasWheel;
365 
366  case FreeRDP_MouseMotion:
367  return settings->MouseMotion;
368 
369  case FreeRDP_MouseUseRelativeMove:
370  return settings->MouseUseRelativeMove;
371 
372  case FreeRDP_MstscCookieMode:
373  return settings->MstscCookieMode;
374 
375  case FreeRDP_MultiTouchGestures:
376  return settings->MultiTouchGestures;
377 
378  case FreeRDP_MultiTouchInput:
379  return settings->MultiTouchInput;
380 
381  case FreeRDP_NSCodec:
382  return settings->NSCodec;
383 
384  case FreeRDP_NSCodecAllowDynamicColorFidelity:
385  return settings->NSCodecAllowDynamicColorFidelity;
386 
387  case FreeRDP_NSCodecAllowSubsampling:
388  return settings->NSCodecAllowSubsampling;
389 
390  case FreeRDP_NegotiateSecurityLayer:
391  return settings->NegotiateSecurityLayer;
392 
393  case FreeRDP_NetworkAutoDetect:
394  return settings->NetworkAutoDetect;
395 
396  case FreeRDP_NlaSecurity:
397  return settings->NlaSecurity;
398 
399  case FreeRDP_NoBitmapCompressionHeader:
400  return settings->NoBitmapCompressionHeader;
401 
402  case FreeRDP_OldLicenseBehaviour:
403  return settings->OldLicenseBehaviour;
404 
405  case FreeRDP_PasswordIsSmartcardPin:
406  return settings->PasswordIsSmartcardPin;
407 
408  case FreeRDP_PercentScreenUseHeight:
409  return settings->PercentScreenUseHeight;
410 
411  case FreeRDP_PercentScreenUseWidth:
412  return settings->PercentScreenUseWidth;
413 
414  case FreeRDP_PlayRemoteFx:
415  return settings->PlayRemoteFx;
416 
417  case FreeRDP_PreferIPv6OverIPv4:
418  return settings->PreferIPv6OverIPv4;
419 
420  case FreeRDP_PrintReconnectCookie:
421  return settings->PrintReconnectCookie;
422 
423  case FreeRDP_PromptForCredentials:
424  return settings->PromptForCredentials;
425 
426  case FreeRDP_RdpSecurity:
427  return settings->RdpSecurity;
428 
429  case FreeRDP_RdstlsSecurity:
430  return settings->RdstlsSecurity;
431 
432  case FreeRDP_RedirectClipboard:
433  return settings->RedirectClipboard;
434 
435  case FreeRDP_RedirectDrives:
436  return settings->RedirectDrives;
437 
438  case FreeRDP_RedirectHomeDrive:
439  return settings->RedirectHomeDrive;
440 
441  case FreeRDP_RedirectParallelPorts:
442  return settings->RedirectParallelPorts;
443 
444  case FreeRDP_RedirectPrinters:
445  return settings->RedirectPrinters;
446 
447  case FreeRDP_RedirectSerialPorts:
448  return settings->RedirectSerialPorts;
449 
450  case FreeRDP_RedirectSmartCards:
451  return settings->RedirectSmartCards;
452 
453  case FreeRDP_RedirectWebAuthN:
454  return settings->RedirectWebAuthN;
455 
456  case FreeRDP_RefreshRect:
457  return settings->RefreshRect;
458 
459  case FreeRDP_RemdeskVirtualChannel:
460  return settings->RemdeskVirtualChannel;
461 
462  case FreeRDP_RemoteAppLanguageBarSupported:
463  return settings->RemoteAppLanguageBarSupported;
464 
465  case FreeRDP_RemoteApplicationMode:
466  return settings->RemoteApplicationMode;
467 
468  case FreeRDP_RemoteAssistanceMode:
469  return settings->RemoteAssistanceMode;
470 
471  case FreeRDP_RemoteAssistanceRequestControl:
472  return settings->RemoteAssistanceRequestControl;
473 
474  case FreeRDP_RemoteConsoleAudio:
475  return settings->RemoteConsoleAudio;
476 
477  case FreeRDP_RemoteCredentialGuard:
478  return settings->RemoteCredentialGuard;
479 
480  case FreeRDP_RemoteFxCodec:
481  return settings->RemoteFxCodec;
482 
483  case FreeRDP_RemoteFxImageCodec:
484  return settings->RemoteFxImageCodec;
485 
486  case FreeRDP_RemoteFxOnly:
487  return settings->RemoteFxOnly;
488 
489  case FreeRDP_RestrictedAdminModeRequired:
490  return settings->RestrictedAdminModeRequired;
491 
492  case FreeRDP_SaltedChecksum:
493  return settings->SaltedChecksum;
494 
495  case FreeRDP_SendPreconnectionPdu:
496  return settings->SendPreconnectionPdu;
497 
498  case FreeRDP_ServerLicenseRequired:
499  return settings->ServerLicenseRequired;
500 
501  case FreeRDP_ServerMode:
502  return settings->ServerMode;
503 
504  case FreeRDP_SmartSizing:
505  return settings->SmartSizing;
506 
507  case FreeRDP_SmartcardEmulation:
508  return settings->SmartcardEmulation;
509 
510  case FreeRDP_SmartcardLogon:
511  return settings->SmartcardLogon;
512 
513  case FreeRDP_SoftwareGdi:
514  return settings->SoftwareGdi;
515 
516  case FreeRDP_SoundBeepsEnabled:
517  return settings->SoundBeepsEnabled;
518 
519  case FreeRDP_SpanMonitors:
520  return settings->SpanMonitors;
521 
522  case FreeRDP_SupportAsymetricKeys:
523  return settings->SupportAsymetricKeys;
524 
525  case FreeRDP_SupportDisplayControl:
526  return settings->SupportDisplayControl;
527 
528  case FreeRDP_SupportDynamicChannels:
529  return settings->SupportDynamicChannels;
530 
531  case FreeRDP_SupportDynamicTimeZone:
532  return settings->SupportDynamicTimeZone;
533 
534  case FreeRDP_SupportEchoChannel:
535  return settings->SupportEchoChannel;
536 
537  case FreeRDP_SupportEdgeActionV1:
538  return settings->SupportEdgeActionV1;
539 
540  case FreeRDP_SupportEdgeActionV2:
541  return settings->SupportEdgeActionV2;
542 
543  case FreeRDP_SupportErrorInfoPdu:
544  return settings->SupportErrorInfoPdu;
545 
546  case FreeRDP_SupportGeometryTracking:
547  return settings->SupportGeometryTracking;
548 
549  case FreeRDP_SupportGraphicsPipeline:
550  return settings->SupportGraphicsPipeline;
551 
552  case FreeRDP_SupportHeartbeatPdu:
553  return settings->SupportHeartbeatPdu;
554 
555  case FreeRDP_SupportMonitorLayoutPdu:
556  return settings->SupportMonitorLayoutPdu;
557 
558  case FreeRDP_SupportMultitransport:
559  return settings->SupportMultitransport;
560 
561  case FreeRDP_SupportSSHAgentChannel:
562  return settings->SupportSSHAgentChannel;
563 
564  case FreeRDP_SupportSkipChannelJoin:
565  return settings->SupportSkipChannelJoin;
566 
567  case FreeRDP_SupportStatusInfoPdu:
568  return settings->SupportStatusInfoPdu;
569 
570  case FreeRDP_SupportVideoOptimized:
571  return settings->SupportVideoOptimized;
572 
573  case FreeRDP_SuppressOutput:
574  return settings->SuppressOutput;
575 
576  case FreeRDP_SurfaceCommandsEnabled:
577  return settings->SurfaceCommandsEnabled;
578 
579  case FreeRDP_SurfaceFrameMarkerEnabled:
580  return settings->SurfaceFrameMarkerEnabled;
581 
582  case FreeRDP_SuspendInput:
583  return settings->SuspendInput;
584 
585  case FreeRDP_SynchronousDynamicChannels:
586  return settings->SynchronousDynamicChannels;
587 
588  case FreeRDP_SynchronousStaticChannels:
589  return settings->SynchronousStaticChannels;
590 
591  case FreeRDP_TcpKeepAlive:
592  return settings->TcpKeepAlive;
593 
594  case FreeRDP_TlsSecurity:
595  return settings->TlsSecurity;
596 
597  case FreeRDP_ToggleFullscreen:
598  return settings->ToggleFullscreen;
599 
600  case FreeRDP_TransportDump:
601  return settings->TransportDump;
602 
603  case FreeRDP_TransportDumpReplay:
604  return settings->TransportDumpReplay;
605 
606  case FreeRDP_TransportDumpReplayNodelay:
607  return settings->TransportDumpReplayNodelay;
608 
609  case FreeRDP_UnicodeInput:
610  return settings->UnicodeInput;
611 
612  case FreeRDP_UnmapButtons:
613  return settings->UnmapButtons;
614 
615  case FreeRDP_UseCommonStdioCallbacks:
616  return settings->UseCommonStdioCallbacks;
617 
618  case FreeRDP_UseMultimon:
619  return settings->UseMultimon;
620 
621  case FreeRDP_UseRdpSecurityLayer:
622  return settings->UseRdpSecurityLayer;
623 
624  case FreeRDP_UsingSavedCredentials:
625  return settings->UsingSavedCredentials;
626 
627  case FreeRDP_VideoDisable:
628  return settings->VideoDisable;
629 
630  case FreeRDP_VmConnectMode:
631  return settings->VmConnectMode;
632 
633  case FreeRDP_WaitForOutputBufferFlush:
634  return settings->WaitForOutputBufferFlush;
635 
636  case FreeRDP_Workarea:
637  return settings->Workarea;
638 
639  default:
640  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
643  WINPR_ASSERT(FALSE);
644  return FALSE;
645  }
646 }
FREERDP_API const char * freerdp_settings_get_type_name_for_key(SSIZE_T key)
Returns the type name for a key.
Definition: settings_str.c:366
FREERDP_API const char * freerdp_settings_get_name_for_key(SSIZE_T key)
Returns the type name for a key.
Definition: settings_str.c:410

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), freerdp_settings_print_diff(), and AppDelegate::rdpConnectError:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_codecs_flags()

FREERDP_API UINT32 freerdp_settings_get_codecs_flags ( const rdpSettings *  settings)

helper function to get a mask of supported codec flags.

This function checks various settings to create a mask of supported codecs FreeRDP_CodecFlags defines the codecs

Parameters
settingsthe settings to check
Returns
a mask of supported codecs

Definition at line 1805 of file common/settings.c.

1806 {
1807  UINT32 flags = FREERDP_CODEC_ALL;
1808  if (settings->RemoteFxCodec == FALSE)
1809  {
1810  flags &= ~FREERDP_CODEC_REMOTEFX;
1811  }
1812  if (settings->NSCodec == FALSE)
1813  {
1814  flags &= ~FREERDP_CODEC_NSCODEC;
1815  }
1816  /*TODO: check other codecs flags */
1817  return flags;
1818 }

◆ freerdp_settings_get_int16()

FREERDP_API INT16 freerdp_settings_get_int16 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_Int16  id 
)

Returns a INT16 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the INT16 key

Definition at line 1574 of file settings_getters.c.

1575 {
1576  WINPR_ASSERT(settings);
1577 
1578  switch (id)
1579  {
1580  default:
1581  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
1584  WINPR_ASSERT(FALSE);
1585  return 0;
1586  }
1587 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_int32()

FREERDP_API INT32 freerdp_settings_get_int32 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_Int32  id 
)

Returns a INT32 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the INT32 key

Definition at line 2534 of file settings_getters.c.

2535 {
2536  WINPR_ASSERT(settings);
2537 
2538  switch (id)
2539  {
2540  case FreeRDP_XPan:
2541  return settings->XPan;
2542 
2543  case FreeRDP_YPan:
2544  return settings->YPan;
2545 
2546  default:
2547  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2550  WINPR_ASSERT(FALSE);
2551  return 0;
2552  }
2553 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_int64()

FREERDP_API INT64 freerdp_settings_get_int64 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_Int64  id 
)

Returns a INT64 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the INT64 key

Definition at line 2633 of file settings_getters.c.

2634 {
2635  WINPR_ASSERT(settings);
2636 
2637  switch (id)
2638  {
2639  default:
2640  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2643  WINPR_ASSERT(FALSE);
2644  return 0;
2645  }
2646 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_key_for_name()

FREERDP_API SSIZE_T freerdp_settings_get_key_for_name ( const char *  value)

Get a key index for the name string of that key.

Parameters
valueA key name string like FreeRDP_ServerMode
Returns
The key index or -1 in case of an error (e.g. name does not exist)

Definition at line 340 of file settings_str.c.

341 {
342  WINPR_ASSERT(value);
343 
344  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
345  {
346  const struct settings_str_entry* cur = &settings_map[x];
347  if (strcmp(value, cur->str) == 0)
348  return cur->id;
349  }
350  return -1;
351 }

◆ freerdp_settings_get_name_for_key()

FREERDP_API const char* freerdp_settings_get_name_for_key ( SSIZE_T  key)

Returns the type name for a key.

Parameters
keythe key number to stringify
Returns
the name of the key or NULL

Definition at line 410 of file settings_str.c.

411 {
412  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
413  {
414  const struct settings_str_entry* cur = &settings_map[x];
415  if (cur->id == key)
416  return cur->str;
417  }
418  return NULL;
419 }

Referenced by freerdp_settings_get_bool(), freerdp_settings_get_int16(), freerdp_settings_get_int32(), freerdp_settings_get_int64(), freerdp_settings_get_pointer_writable(), freerdp_settings_get_string(), freerdp_settings_get_string_writable(), freerdp_settings_get_uint16(), freerdp_settings_get_uint32(), freerdp_settings_get_uint64(), freerdp_settings_set_bool(), freerdp_settings_set_int16(), freerdp_settings_set_int32(), freerdp_settings_set_int64(), freerdp_settings_set_pointer(), freerdp_settings_set_uint16(), freerdp_settings_set_uint32(), and freerdp_settings_set_uint64().

Here is the caller graph for this function:

◆ freerdp_settings_get_pointer()

FREERDP_API const void* freerdp_settings_get_pointer ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_Pointer  id 
)

Returns a immutable pointer settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the immutable pointer value

Definition at line 1289 of file common/settings.c.

1291 {
1292  union
1293  {
1294  const rdpSettings* pc;
1295  rdpSettings* p;
1296  } cnv;
1297  cnv.pc = settings;
1298  return freerdp_settings_get_pointer_writable(cnv.p, id);
1299 }
FREERDP_API void * freerdp_settings_get_pointer_writable(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a mutable pointer settings value.

References freerdp_settings_get_pointer_writable().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_pointer_writable()

FREERDP_API void* freerdp_settings_get_pointer_writable ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Pointer  id 
)

Returns a mutable pointer settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the mutable pointer value

Definition at line 3949 of file settings_getters.c.

3950 {
3951  WINPR_ASSERT(settings);
3952 
3953  switch (id)
3954  {
3955  case FreeRDP_BitmapCacheV2CellInfo:
3956  return settings->BitmapCacheV2CellInfo;
3957 
3958  case FreeRDP_ChannelDefArray:
3959  return settings->ChannelDefArray;
3960 
3961  case FreeRDP_ClientAutoReconnectCookie:
3962  return settings->ClientAutoReconnectCookie;
3963 
3964  case FreeRDP_ClientRandom:
3965  return settings->ClientRandom;
3966 
3967  case FreeRDP_ClientTimeZone:
3968  return settings->ClientTimeZone;
3969 
3970  case FreeRDP_DeviceArray:
3971  return settings->DeviceArray;
3972 
3973  case FreeRDP_DynamicChannelArray:
3974  return settings->DynamicChannelArray;
3975 
3976  case FreeRDP_FragCache:
3977  return settings->FragCache;
3978 
3979  case FreeRDP_GlyphCache:
3980  return settings->GlyphCache;
3981 
3982  case FreeRDP_LoadBalanceInfo:
3983  return settings->LoadBalanceInfo;
3984 
3985  case FreeRDP_MonitorDefArray:
3986  return settings->MonitorDefArray;
3987 
3988  case FreeRDP_MonitorIds:
3989  return settings->MonitorIds;
3990 
3991  case FreeRDP_OrderSupport:
3992  return settings->OrderSupport;
3993 
3994  case FreeRDP_Password51:
3995  return settings->Password51;
3996 
3997  case FreeRDP_RdpServerCertificate:
3998  return settings->RdpServerCertificate;
3999 
4000  case FreeRDP_RdpServerRsaKey:
4001  return settings->RdpServerRsaKey;
4002 
4003  case FreeRDP_ReceivedCapabilities:
4004  return settings->ReceivedCapabilities;
4005 
4006  case FreeRDP_ReceivedCapabilityData:
4007  return settings->ReceivedCapabilityData;
4008 
4009  case FreeRDP_ReceivedCapabilityDataSizes:
4010  return settings->ReceivedCapabilityDataSizes;
4011 
4012  case FreeRDP_RedirectionGuid:
4013  return settings->RedirectionGuid;
4014 
4015  case FreeRDP_RedirectionPassword:
4016  return settings->RedirectionPassword;
4017 
4018  case FreeRDP_RedirectionTargetCertificate:
4019  return settings->RedirectionTargetCertificate;
4020 
4021  case FreeRDP_RedirectionTsvUrl:
4022  return settings->RedirectionTsvUrl;
4023 
4024  case FreeRDP_ServerAutoReconnectCookie:
4025  return settings->ServerAutoReconnectCookie;
4026 
4027  case FreeRDP_ServerCertificate:
4028  return settings->ServerCertificate;
4029 
4030  case FreeRDP_ServerLicenseProductIssuers:
4031  return settings->ServerLicenseProductIssuers;
4032 
4033  case FreeRDP_ServerRandom:
4034  return settings->ServerRandom;
4035 
4036  case FreeRDP_StaticChannelArray:
4037  return settings->StaticChannelArray;
4038 
4039  case FreeRDP_TargetNetAddresses:
4040  return settings->TargetNetAddresses;
4041 
4042  case FreeRDP_TargetNetPorts:
4043  return settings->TargetNetPorts;
4044 
4045  case FreeRDP_instance:
4046  return settings->instance;
4047 
4048  default:
4049  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
4052  WINPR_ASSERT(FALSE);
4053  return NULL;
4054  }
4055 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_get_pointer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_server_name()

FREERDP_API const char* freerdp_settings_get_server_name ( const rdpSettings *  settings)

A helper function to return the correct server name.

The server name might be in key FreeRDP_ServerHostname or if used in FreeRDP_UserSpecifiedServerName. This function returns the correct name to use.

Parameters
settingsThe settings to query, must not be NULL.
Returns
A string pointer or NULL in case of failure.

Definition at line 1820 of file common/settings.c.

1821 {
1822  WINPR_ASSERT(settings);
1823  const char* hostname = settings->ServerHostname;
1824 
1825  if (settings->UserSpecifiedServerName)
1826  hostname = settings->UserSpecifiedServerName;
1827 
1828  return hostname;
1829 }

◆ freerdp_settings_get_string()

FREERDP_API const char* freerdp_settings_get_string ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id 
)

Returns a immutable string settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the immutable string pointer

Definition at line 2672 of file settings_getters.c.

2674 {
2675  WINPR_ASSERT(settings);
2676 
2677  switch (id)
2678  {
2679  case FreeRDP_AadServerHostname:
2680  return settings->AadServerHostname;
2681 
2682  case FreeRDP_AcceptedCert:
2683  return settings->AcceptedCert;
2684 
2685  case FreeRDP_ActionScript:
2686  return settings->ActionScript;
2687 
2688  case FreeRDP_AllowedTlsCiphers:
2689  return settings->AllowedTlsCiphers;
2690 
2691  case FreeRDP_AlternateShell:
2692  return settings->AlternateShell;
2693 
2694  case FreeRDP_AssistanceFile:
2695  return settings->AssistanceFile;
2696 
2697  case FreeRDP_AuthenticationPackageList:
2698  return settings->AuthenticationPackageList;
2699 
2700  case FreeRDP_AuthenticationServiceClass:
2701  return settings->AuthenticationServiceClass;
2702 
2703  case FreeRDP_BitmapCachePersistFile:
2704  return settings->BitmapCachePersistFile;
2705 
2706  case FreeRDP_CardName:
2707  return settings->CardName;
2708 
2709  case FreeRDP_CertificateAcceptedFingerprints:
2710  return settings->CertificateAcceptedFingerprints;
2711 
2712  case FreeRDP_CertificateName:
2713  return settings->CertificateName;
2714 
2715  case FreeRDP_ClientAddress:
2716  return settings->ClientAddress;
2717 
2718  case FreeRDP_ClientDir:
2719  return settings->ClientDir;
2720 
2721  case FreeRDP_ClientHostname:
2722  return settings->ClientHostname;
2723 
2724  case FreeRDP_ClientProductId:
2725  return settings->ClientProductId;
2726 
2727  case FreeRDP_ClipboardUseSelection:
2728  return settings->ClipboardUseSelection;
2729 
2730  case FreeRDP_ComputerName:
2731  return settings->ComputerName;
2732 
2733  case FreeRDP_ConfigPath:
2734  return settings->ConfigPath;
2735 
2736  case FreeRDP_ConnectionFile:
2737  return settings->ConnectionFile;
2738 
2739  case FreeRDP_ContainerName:
2740  return settings->ContainerName;
2741 
2742  case FreeRDP_CspName:
2743  return settings->CspName;
2744 
2745  case FreeRDP_CurrentPath:
2746  return settings->CurrentPath;
2747 
2748  case FreeRDP_Domain:
2749  return settings->Domain;
2750 
2751  case FreeRDP_DrivesToRedirect:
2752  return settings->DrivesToRedirect;
2753 
2754  case FreeRDP_DumpRemoteFxFile:
2755  return settings->DumpRemoteFxFile;
2756 
2757  case FreeRDP_DynamicDSTTimeZoneKeyName:
2758  return settings->DynamicDSTTimeZoneKeyName;
2759 
2760  case FreeRDP_GatewayAcceptedCert:
2761  return settings->GatewayAcceptedCert;
2762 
2763  case FreeRDP_GatewayAccessToken:
2764  return settings->GatewayAccessToken;
2765 
2766  case FreeRDP_GatewayAvdAadtenantid:
2767  return settings->GatewayAvdAadtenantid;
2768 
2769  case FreeRDP_GatewayAvdActivityhint:
2770  return settings->GatewayAvdActivityhint;
2771 
2772  case FreeRDP_GatewayAvdArmpath:
2773  return settings->GatewayAvdArmpath;
2774 
2775  case FreeRDP_GatewayAvdDiagnosticserviceurl:
2776  return settings->GatewayAvdDiagnosticserviceurl;
2777 
2778  case FreeRDP_GatewayAvdGeo:
2779  return settings->GatewayAvdGeo;
2780 
2781  case FreeRDP_GatewayAvdHubdiscoverygeourl:
2782  return settings->GatewayAvdHubdiscoverygeourl;
2783 
2784  case FreeRDP_GatewayAvdWvdEndpointPool:
2785  return settings->GatewayAvdWvdEndpointPool;
2786 
2787  case FreeRDP_GatewayDomain:
2788  return settings->GatewayDomain;
2789 
2790  case FreeRDP_GatewayHostname:
2791  return settings->GatewayHostname;
2792 
2793  case FreeRDP_GatewayHttpExtAuthBearer:
2794  return settings->GatewayHttpExtAuthBearer;
2795 
2796  case FreeRDP_GatewayPassword:
2797  return settings->GatewayPassword;
2798 
2799  case FreeRDP_GatewayUrl:
2800  return settings->GatewayUrl;
2801 
2802  case FreeRDP_GatewayUsername:
2803  return settings->GatewayUsername;
2804 
2805  case FreeRDP_HomePath:
2806  return settings->HomePath;
2807 
2808  case FreeRDP_ImeFileName:
2809  return settings->ImeFileName;
2810 
2811  case FreeRDP_KerberosArmor:
2812  return settings->KerberosArmor;
2813 
2814  case FreeRDP_KerberosCache:
2815  return settings->KerberosCache;
2816 
2817  case FreeRDP_KerberosKdcUrl:
2818  return settings->KerberosKdcUrl;
2819 
2820  case FreeRDP_KerberosKeytab:
2821  return settings->KerberosKeytab;
2822 
2823  case FreeRDP_KerberosLifeTime:
2824  return settings->KerberosLifeTime;
2825 
2826  case FreeRDP_KerberosRealm:
2827  return settings->KerberosRealm;
2828 
2829  case FreeRDP_KerberosRenewableLifeTime:
2830  return settings->KerberosRenewableLifeTime;
2831 
2832  case FreeRDP_KerberosStartTime:
2833  return settings->KerberosStartTime;
2834 
2835  case FreeRDP_KeyboardPipeName:
2836  return settings->KeyboardPipeName;
2837 
2838  case FreeRDP_KeyboardRemappingList:
2839  return settings->KeyboardRemappingList;
2840 
2841  case FreeRDP_NtlmSamFile:
2842  return settings->NtlmSamFile;
2843 
2844  case FreeRDP_Password:
2845  return settings->Password;
2846 
2847  case FreeRDP_PasswordHash:
2848  return settings->PasswordHash;
2849 
2850  case FreeRDP_Pkcs11Module:
2851  return settings->Pkcs11Module;
2852 
2853  case FreeRDP_PkinitAnchors:
2854  return settings->PkinitAnchors;
2855 
2856  case FreeRDP_PlayRemoteFxFile:
2857  return settings->PlayRemoteFxFile;
2858 
2859  case FreeRDP_PreconnectionBlob:
2860  return settings->PreconnectionBlob;
2861 
2862  case FreeRDP_ProxyHostname:
2863  return settings->ProxyHostname;
2864 
2865  case FreeRDP_ProxyPassword:
2866  return settings->ProxyPassword;
2867 
2868  case FreeRDP_ProxyUsername:
2869  return settings->ProxyUsername;
2870 
2871  case FreeRDP_RDP2TCPArgs:
2872  return settings->RDP2TCPArgs;
2873 
2874  case FreeRDP_ReaderName:
2875  return settings->ReaderName;
2876 
2877  case FreeRDP_RedirectionAcceptedCert:
2878  return settings->RedirectionAcceptedCert;
2879 
2880  case FreeRDP_RedirectionDomain:
2881  return settings->RedirectionDomain;
2882 
2883  case FreeRDP_RedirectionTargetFQDN:
2884  return settings->RedirectionTargetFQDN;
2885 
2886  case FreeRDP_RedirectionTargetNetBiosName:
2887  return settings->RedirectionTargetNetBiosName;
2888 
2889  case FreeRDP_RedirectionUsername:
2890  return settings->RedirectionUsername;
2891 
2892  case FreeRDP_RemoteApplicationCmdLine:
2893  return settings->RemoteApplicationCmdLine;
2894 
2895  case FreeRDP_RemoteApplicationFile:
2896  return settings->RemoteApplicationFile;
2897 
2898  case FreeRDP_RemoteApplicationGuid:
2899  return settings->RemoteApplicationGuid;
2900 
2901  case FreeRDP_RemoteApplicationIcon:
2902  return settings->RemoteApplicationIcon;
2903 
2904  case FreeRDP_RemoteApplicationName:
2905  return settings->RemoteApplicationName;
2906 
2907  case FreeRDP_RemoteApplicationProgram:
2908  return settings->RemoteApplicationProgram;
2909 
2910  case FreeRDP_RemoteApplicationWorkingDir:
2911  return settings->RemoteApplicationWorkingDir;
2912 
2913  case FreeRDP_RemoteAssistancePassStub:
2914  return settings->RemoteAssistancePassStub;
2915 
2916  case FreeRDP_RemoteAssistancePassword:
2917  return settings->RemoteAssistancePassword;
2918 
2919  case FreeRDP_RemoteAssistanceRCTicket:
2920  return settings->RemoteAssistanceRCTicket;
2921 
2922  case FreeRDP_RemoteAssistanceSessionId:
2923  return settings->RemoteAssistanceSessionId;
2924 
2925  case FreeRDP_ServerHostname:
2926  return settings->ServerHostname;
2927 
2928  case FreeRDP_ServerLicenseCompanyName:
2929  return settings->ServerLicenseCompanyName;
2930 
2931  case FreeRDP_ServerLicenseProductName:
2932  return settings->ServerLicenseProductName;
2933 
2934  case FreeRDP_ShellWorkingDirectory:
2935  return settings->ShellWorkingDirectory;
2936 
2937  case FreeRDP_SmartcardCertificate:
2938  return settings->SmartcardCertificate;
2939 
2940  case FreeRDP_SmartcardPrivateKey:
2941  return settings->SmartcardPrivateKey;
2942 
2943  case FreeRDP_SspiModule:
2944  return settings->SspiModule;
2945 
2946  case FreeRDP_TargetNetAddress:
2947  return settings->TargetNetAddress;
2948 
2949  case FreeRDP_TerminalDescriptor:
2950  return settings->TerminalDescriptor;
2951 
2952  case FreeRDP_TlsSecretsFile:
2953  return settings->TlsSecretsFile;
2954 
2955  case FreeRDP_TransportDumpFile:
2956  return settings->TransportDumpFile;
2957 
2958  case FreeRDP_UserSpecifiedServerName:
2959  return settings->UserSpecifiedServerName;
2960 
2961  case FreeRDP_Username:
2962  return settings->Username;
2963 
2964  case FreeRDP_WinSCardModule:
2965  return settings->WinSCardModule;
2966 
2967  case FreeRDP_WindowTitle:
2968  return settings->WindowTitle;
2969 
2970  case FreeRDP_WmClass:
2971  return settings->WmClass;
2972 
2973  default:
2974  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2977  WINPR_ASSERT(FALSE);
2978  return NULL;
2979  }
2980 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_append_string(), freerdp_settings_copy_item(), freerdp_settings_dump(), freerdp_settings_get_string_as_utf16(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_string_as_utf16()

FREERDP_API WCHAR* freerdp_settings_get_string_as_utf16 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
size_t *  pCharLen 
)

Return an allocated UTF16 string.

Parameters
settingsA pointer to the settings struct to use
idThe settings identifier
Returns
An allocated, '\0' terminated WCHAR string or NULL

Definition at line 2090 of file common/settings.c.

2092 {
2093  const char* str = freerdp_settings_get_string(settings, id);
2094  if (pCharLen)
2095  *pCharLen = 0;
2096  if (!str)
2097  return NULL;
2098  return ConvertUtf8ToWCharAlloc(str, pCharLen);
2099 }

References freerdp_settings_get_string().

Here is the call graph for this function:

◆ freerdp_settings_get_string_writable()

FREERDP_API char* freerdp_settings_get_string_writable ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id 
)

Returns a string settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the string pointer

Definition at line 2982 of file settings_getters.c.

2983 {
2984  WINPR_ASSERT(settings);
2985 
2986  switch (id)
2987  {
2988  case FreeRDP_AadServerHostname:
2989  return settings->AadServerHostname;
2990 
2991  case FreeRDP_AcceptedCert:
2992  return settings->AcceptedCert;
2993 
2994  case FreeRDP_ActionScript:
2995  return settings->ActionScript;
2996 
2997  case FreeRDP_AllowedTlsCiphers:
2998  return settings->AllowedTlsCiphers;
2999 
3000  case FreeRDP_AlternateShell:
3001  return settings->AlternateShell;
3002 
3003  case FreeRDP_AssistanceFile:
3004  return settings->AssistanceFile;
3005 
3006  case FreeRDP_AuthenticationPackageList:
3007  return settings->AuthenticationPackageList;
3008 
3009  case FreeRDP_AuthenticationServiceClass:
3010  return settings->AuthenticationServiceClass;
3011 
3012  case FreeRDP_BitmapCachePersistFile:
3013  return settings->BitmapCachePersistFile;
3014 
3015  case FreeRDP_CardName:
3016  return settings->CardName;
3017 
3018  case FreeRDP_CertificateAcceptedFingerprints:
3019  return settings->CertificateAcceptedFingerprints;
3020 
3021  case FreeRDP_CertificateName:
3022  return settings->CertificateName;
3023 
3024  case FreeRDP_ClientAddress:
3025  return settings->ClientAddress;
3026 
3027  case FreeRDP_ClientDir:
3028  return settings->ClientDir;
3029 
3030  case FreeRDP_ClientHostname:
3031  return settings->ClientHostname;
3032 
3033  case FreeRDP_ClientProductId:
3034  return settings->ClientProductId;
3035 
3036  case FreeRDP_ClipboardUseSelection:
3037  return settings->ClipboardUseSelection;
3038 
3039  case FreeRDP_ComputerName:
3040  return settings->ComputerName;
3041 
3042  case FreeRDP_ConfigPath:
3043  return settings->ConfigPath;
3044 
3045  case FreeRDP_ConnectionFile:
3046  return settings->ConnectionFile;
3047 
3048  case FreeRDP_ContainerName:
3049  return settings->ContainerName;
3050 
3051  case FreeRDP_CspName:
3052  return settings->CspName;
3053 
3054  case FreeRDP_CurrentPath:
3055  return settings->CurrentPath;
3056 
3057  case FreeRDP_Domain:
3058  return settings->Domain;
3059 
3060  case FreeRDP_DrivesToRedirect:
3061  return settings->DrivesToRedirect;
3062 
3063  case FreeRDP_DumpRemoteFxFile:
3064  return settings->DumpRemoteFxFile;
3065 
3066  case FreeRDP_DynamicDSTTimeZoneKeyName:
3067  return settings->DynamicDSTTimeZoneKeyName;
3068 
3069  case FreeRDP_GatewayAcceptedCert:
3070  return settings->GatewayAcceptedCert;
3071 
3072  case FreeRDP_GatewayAccessToken:
3073  return settings->GatewayAccessToken;
3074 
3075  case FreeRDP_GatewayAvdAadtenantid:
3076  return settings->GatewayAvdAadtenantid;
3077 
3078  case FreeRDP_GatewayAvdActivityhint:
3079  return settings->GatewayAvdActivityhint;
3080 
3081  case FreeRDP_GatewayAvdArmpath:
3082  return settings->GatewayAvdArmpath;
3083 
3084  case FreeRDP_GatewayAvdDiagnosticserviceurl:
3085  return settings->GatewayAvdDiagnosticserviceurl;
3086 
3087  case FreeRDP_GatewayAvdGeo:
3088  return settings->GatewayAvdGeo;
3089 
3090  case FreeRDP_GatewayAvdHubdiscoverygeourl:
3091  return settings->GatewayAvdHubdiscoverygeourl;
3092 
3093  case FreeRDP_GatewayAvdWvdEndpointPool:
3094  return settings->GatewayAvdWvdEndpointPool;
3095 
3096  case FreeRDP_GatewayDomain:
3097  return settings->GatewayDomain;
3098 
3099  case FreeRDP_GatewayHostname:
3100  return settings->GatewayHostname;
3101 
3102  case FreeRDP_GatewayHttpExtAuthBearer:
3103  return settings->GatewayHttpExtAuthBearer;
3104 
3105  case FreeRDP_GatewayPassword:
3106  return settings->GatewayPassword;
3107 
3108  case FreeRDP_GatewayUrl:
3109  return settings->GatewayUrl;
3110 
3111  case FreeRDP_GatewayUsername:
3112  return settings->GatewayUsername;
3113 
3114  case FreeRDP_HomePath:
3115  return settings->HomePath;
3116 
3117  case FreeRDP_ImeFileName:
3118  return settings->ImeFileName;
3119 
3120  case FreeRDP_KerberosArmor:
3121  return settings->KerberosArmor;
3122 
3123  case FreeRDP_KerberosCache:
3124  return settings->KerberosCache;
3125 
3126  case FreeRDP_KerberosKdcUrl:
3127  return settings->KerberosKdcUrl;
3128 
3129  case FreeRDP_KerberosKeytab:
3130  return settings->KerberosKeytab;
3131 
3132  case FreeRDP_KerberosLifeTime:
3133  return settings->KerberosLifeTime;
3134 
3135  case FreeRDP_KerberosRealm:
3136  return settings->KerberosRealm;
3137 
3138  case FreeRDP_KerberosRenewableLifeTime:
3139  return settings->KerberosRenewableLifeTime;
3140 
3141  case FreeRDP_KerberosStartTime:
3142  return settings->KerberosStartTime;
3143 
3144  case FreeRDP_KeyboardPipeName:
3145  return settings->KeyboardPipeName;
3146 
3147  case FreeRDP_KeyboardRemappingList:
3148  return settings->KeyboardRemappingList;
3149 
3150  case FreeRDP_NtlmSamFile:
3151  return settings->NtlmSamFile;
3152 
3153  case FreeRDP_Password:
3154  return settings->Password;
3155 
3156  case FreeRDP_PasswordHash:
3157  return settings->PasswordHash;
3158 
3159  case FreeRDP_Pkcs11Module:
3160  return settings->Pkcs11Module;
3161 
3162  case FreeRDP_PkinitAnchors:
3163  return settings->PkinitAnchors;
3164 
3165  case FreeRDP_PlayRemoteFxFile:
3166  return settings->PlayRemoteFxFile;
3167 
3168  case FreeRDP_PreconnectionBlob:
3169  return settings->PreconnectionBlob;
3170 
3171  case FreeRDP_ProxyHostname:
3172  return settings->ProxyHostname;
3173 
3174  case FreeRDP_ProxyPassword:
3175  return settings->ProxyPassword;
3176 
3177  case FreeRDP_ProxyUsername:
3178  return settings->ProxyUsername;
3179 
3180  case FreeRDP_RDP2TCPArgs:
3181  return settings->RDP2TCPArgs;
3182 
3183  case FreeRDP_ReaderName:
3184  return settings->ReaderName;
3185 
3186  case FreeRDP_RedirectionAcceptedCert:
3187  return settings->RedirectionAcceptedCert;
3188 
3189  case FreeRDP_RedirectionDomain:
3190  return settings->RedirectionDomain;
3191 
3192  case FreeRDP_RedirectionTargetFQDN:
3193  return settings->RedirectionTargetFQDN;
3194 
3195  case FreeRDP_RedirectionTargetNetBiosName:
3196  return settings->RedirectionTargetNetBiosName;
3197 
3198  case FreeRDP_RedirectionUsername:
3199  return settings->RedirectionUsername;
3200 
3201  case FreeRDP_RemoteApplicationCmdLine:
3202  return settings->RemoteApplicationCmdLine;
3203 
3204  case FreeRDP_RemoteApplicationFile:
3205  return settings->RemoteApplicationFile;
3206 
3207  case FreeRDP_RemoteApplicationGuid:
3208  return settings->RemoteApplicationGuid;
3209 
3210  case FreeRDP_RemoteApplicationIcon:
3211  return settings->RemoteApplicationIcon;
3212 
3213  case FreeRDP_RemoteApplicationName:
3214  return settings->RemoteApplicationName;
3215 
3216  case FreeRDP_RemoteApplicationProgram:
3217  return settings->RemoteApplicationProgram;
3218 
3219  case FreeRDP_RemoteApplicationWorkingDir:
3220  return settings->RemoteApplicationWorkingDir;
3221 
3222  case FreeRDP_RemoteAssistancePassStub:
3223  return settings->RemoteAssistancePassStub;
3224 
3225  case FreeRDP_RemoteAssistancePassword:
3226  return settings->RemoteAssistancePassword;
3227 
3228  case FreeRDP_RemoteAssistanceRCTicket:
3229  return settings->RemoteAssistanceRCTicket;
3230 
3231  case FreeRDP_RemoteAssistanceSessionId:
3232  return settings->RemoteAssistanceSessionId;
3233 
3234  case FreeRDP_ServerHostname:
3235  return settings->ServerHostname;
3236 
3237  case FreeRDP_ServerLicenseCompanyName:
3238  return settings->ServerLicenseCompanyName;
3239 
3240  case FreeRDP_ServerLicenseProductName:
3241  return settings->ServerLicenseProductName;
3242 
3243  case FreeRDP_ShellWorkingDirectory:
3244  return settings->ShellWorkingDirectory;
3245 
3246  case FreeRDP_SmartcardCertificate:
3247  return settings->SmartcardCertificate;
3248 
3249  case FreeRDP_SmartcardPrivateKey:
3250  return settings->SmartcardPrivateKey;
3251 
3252  case FreeRDP_SspiModule:
3253  return settings->SspiModule;
3254 
3255  case FreeRDP_TargetNetAddress:
3256  return settings->TargetNetAddress;
3257 
3258  case FreeRDP_TerminalDescriptor:
3259  return settings->TerminalDescriptor;
3260 
3261  case FreeRDP_TlsSecretsFile:
3262  return settings->TlsSecretsFile;
3263 
3264  case FreeRDP_TransportDumpFile:
3265  return settings->TransportDumpFile;
3266 
3267  case FreeRDP_UserSpecifiedServerName:
3268  return settings->UserSpecifiedServerName;
3269 
3270  case FreeRDP_Username:
3271  return settings->Username;
3272 
3273  case FreeRDP_WinSCardModule:
3274  return settings->WinSCardModule;
3275 
3276  case FreeRDP_WindowTitle:
3277  return settings->WindowTitle;
3278 
3279  case FreeRDP_WmClass:
3280  return settings->WmClass;
3281 
3282  default:
3283  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
3286  WINPR_ASSERT(FALSE);
3287  return NULL;
3288  }
3289 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Here is the call graph for this function:

◆ freerdp_settings_get_type_for_key()

FREERDP_API SSIZE_T freerdp_settings_get_type_for_key ( SSIZE_T  key)

Get a key type for the key index.

Parameters
keyThe key index like FreeRDP_ServerMode
Returns
The key type (e.g. FREERDP_SETTINGS_TYPE_BOOL) or -1 in case of an error (e.g. name does not exist)

Definition at line 399 of file settings_str.c.

400 {
401  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
402  {
403  const struct settings_str_entry* cur = &settings_map[x];
404  if (cur->id == key)
405  return cur->type;
406  }
407  return -1;
408 }

Referenced by freerdp_settings_copy_item(), and freerdp_settings_get_type_name_for_key().

Here is the caller graph for this function:

◆ freerdp_settings_get_type_for_name()

FREERDP_API SSIZE_T freerdp_settings_get_type_for_name ( const char *  value)

Get a key type for the name string of that key.

Parameters
valueA key name string like FreeRDP_ServerMode
Returns
The key type (e.g. FREERDP_SETTINGS_TYPE_BOOL) or -1 in case of an error (e.g. name does not exist)

Definition at line 353 of file settings_str.c.

354 {
355  WINPR_ASSERT(value);
356 
357  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
358  {
359  const struct settings_str_entry* cur = &settings_map[x];
360  if (strcmp(value, cur->str) == 0)
361  return cur->type;
362  }
363  return -1;
364 }

◆ freerdp_settings_get_type_name_for_key()

FREERDP_API const char* freerdp_settings_get_type_name_for_key ( SSIZE_T  key)

Returns the type name for a key.

Parameters
keythe key number to stringify
Returns
the type name of the key or FREERDP_SETTINGS_TYPE_UNKNOWN

Definition at line 366 of file settings_str.c.

367 {
368  const SSIZE_T type = freerdp_settings_get_type_for_key(key);
370 }
FREERDP_API const char * freerdp_settings_get_type_name_for_type(SSIZE_T type)
Returns the type name for a type.
Definition: settings_str.c:372

References freerdp_settings_get_type_for_key(), and freerdp_settings_get_type_name_for_type().

Referenced by freerdp_settings_get_bool(), freerdp_settings_get_int16(), freerdp_settings_get_int32(), freerdp_settings_get_int64(), freerdp_settings_get_pointer_writable(), freerdp_settings_get_string(), freerdp_settings_get_string_writable(), freerdp_settings_get_uint16(), freerdp_settings_get_uint32(), freerdp_settings_get_uint64(), freerdp_settings_set_bool(), freerdp_settings_set_int16(), freerdp_settings_set_int32(), freerdp_settings_set_int64(), freerdp_settings_set_pointer(), freerdp_settings_set_uint16(), freerdp_settings_set_uint32(), and freerdp_settings_set_uint64().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_type_name_for_type()

FREERDP_API const char* freerdp_settings_get_type_name_for_type ( SSIZE_T  type)

Returns the type name for a type.

Parameters
typethe type to stringify
Returns
the name of the key or FREERDP_SETTINGS_TYPE_UNKNOWN

Definition at line 372 of file settings_str.c.

373 {
374  switch (type)
375  {
376  case FREERDP_SETTINGS_TYPE_BOOL:
377  return "FREERDP_SETTINGS_TYPE_BOOL";
378  case FREERDP_SETTINGS_TYPE_UINT16:
379  return "FREERDP_SETTINGS_TYPE_UINT16";
380  case FREERDP_SETTINGS_TYPE_INT16:
381  return "FREERDP_SETTINGS_TYPE_INT16";
382  case FREERDP_SETTINGS_TYPE_UINT32:
383  return "FREERDP_SETTINGS_TYPE_UINT32";
384  case FREERDP_SETTINGS_TYPE_INT32:
385  return "FREERDP_SETTINGS_TYPE_INT32";
386  case FREERDP_SETTINGS_TYPE_UINT64:
387  return "FREERDP_SETTINGS_TYPE_UINT64";
388  case FREERDP_SETTINGS_TYPE_INT64:
389  return "FREERDP_SETTINGS_TYPE_INT64";
390  case FREERDP_SETTINGS_TYPE_STRING:
391  return "FREERDP_SETTINGS_TYPE_STRING";
392  case FREERDP_SETTINGS_TYPE_POINTER:
393  return "FREERDP_SETTINGS_TYPE_POINTER";
394  default:
395  return "FREERDP_SETTINGS_TYPE_UNKNOWN";
396  }
397 }

Referenced by freerdp_settings_get_type_name_for_key().

Here is the caller graph for this function:

◆ freerdp_settings_get_uint16()

FREERDP_API UINT16 freerdp_settings_get_uint16 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt16  id 
)

Returns a UINT16 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the UINT16 key

Definition at line 1444 of file settings_getters.c.

1445 {
1446  WINPR_ASSERT(settings);
1447 
1448  switch (id)
1449  {
1450  case FreeRDP_CapsGeneralCompressionLevel:
1451  return settings->CapsGeneralCompressionLevel;
1452 
1453  case FreeRDP_CapsGeneralCompressionTypes:
1454  return settings->CapsGeneralCompressionTypes;
1455 
1456  case FreeRDP_CapsProtocolVersion:
1457  return settings->CapsProtocolVersion;
1458 
1459  case FreeRDP_CapsRemoteUnshareFlag:
1460  return settings->CapsRemoteUnshareFlag;
1461 
1462  case FreeRDP_CapsUpdateCapabilityFlag:
1463  return settings->CapsUpdateCapabilityFlag;
1464 
1465  case FreeRDP_DesktopOrientation:
1466  return settings->DesktopOrientation;
1467 
1468  case FreeRDP_OrderSupportFlags:
1469  return settings->OrderSupportFlags;
1470 
1471  case FreeRDP_OrderSupportFlagsEx:
1472  return settings->OrderSupportFlagsEx;
1473 
1474  case FreeRDP_ProxyPort:
1475  return settings->ProxyPort;
1476 
1477  case FreeRDP_SupportedColorDepths:
1478  return settings->SupportedColorDepths;
1479 
1480  case FreeRDP_TLSMaxVersion:
1481  return settings->TLSMaxVersion;
1482 
1483  case FreeRDP_TLSMinVersion:
1484  return settings->TLSMinVersion;
1485 
1486  case FreeRDP_TextANSICodePage:
1487  return settings->TextANSICodePage;
1488 
1489  default:
1490  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
1493  WINPR_ASSERT(FALSE);
1494  return 0;
1495  }
1496 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_uint32()

FREERDP_API UINT32 freerdp_settings_get_uint32 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt32  id 
)

Returns a UINT32 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the UINT32 key

Definition at line 1613 of file settings_getters.c.

1614 {
1615  WINPR_ASSERT(settings);
1616 
1617  switch (id)
1618  {
1619  case FreeRDP_AcceptedCertLength:
1620  return settings->AcceptedCertLength;
1621 
1622  case FreeRDP_AuthenticationLevel:
1623  return settings->AuthenticationLevel;
1624 
1625  case FreeRDP_AutoReconnectMaxRetries:
1626  return settings->AutoReconnectMaxRetries;
1627 
1628  case FreeRDP_BitmapCacheV2NumCells:
1629  return settings->BitmapCacheV2NumCells;
1630 
1631  case FreeRDP_BitmapCacheV3CodecId:
1632  return settings->BitmapCacheV3CodecId;
1633 
1634  case FreeRDP_BitmapCacheVersion:
1635  return settings->BitmapCacheVersion;
1636 
1637  case FreeRDP_BrushSupportLevel:
1638  return settings->BrushSupportLevel;
1639 
1640  case FreeRDP_ChannelCount:
1641  return settings->ChannelCount;
1642 
1643  case FreeRDP_ChannelDefArraySize:
1644  return settings->ChannelDefArraySize;
1645 
1646  case FreeRDP_ClientBuild:
1647  return settings->ClientBuild;
1648 
1649  case FreeRDP_ClientRandomLength:
1650  return settings->ClientRandomLength;
1651 
1652  case FreeRDP_ClientSessionId:
1653  return settings->ClientSessionId;
1654 
1655  case FreeRDP_ClipboardFeatureMask:
1656  return settings->ClipboardFeatureMask;
1657 
1658  case FreeRDP_ClusterInfoFlags:
1659  return settings->ClusterInfoFlags;
1660 
1661  case FreeRDP_ColorDepth:
1662  return settings->ColorDepth;
1663 
1664  case FreeRDP_ColorPointerCacheSize:
1665  return settings->ColorPointerCacheSize;
1666 
1667  case FreeRDP_CompDeskSupportLevel:
1668  return settings->CompDeskSupportLevel;
1669 
1670  case FreeRDP_CompressionLevel:
1671  return settings->CompressionLevel;
1672 
1673  case FreeRDP_ConnectionType:
1674  return settings->ConnectionType;
1675 
1676  case FreeRDP_CookieMaxLength:
1677  return settings->CookieMaxLength;
1678 
1679  case FreeRDP_DesktopHeight:
1680  return settings->DesktopHeight;
1681 
1682  case FreeRDP_DesktopPhysicalHeight:
1683  return settings->DesktopPhysicalHeight;
1684 
1685  case FreeRDP_DesktopPhysicalWidth:
1686  return settings->DesktopPhysicalWidth;
1687 
1688  case FreeRDP_DesktopPosX:
1689  return settings->DesktopPosX;
1690 
1691  case FreeRDP_DesktopPosY:
1692  return settings->DesktopPosY;
1693 
1694  case FreeRDP_DesktopScaleFactor:
1695  return settings->DesktopScaleFactor;
1696 
1697  case FreeRDP_DesktopWidth:
1698  return settings->DesktopWidth;
1699 
1700  case FreeRDP_DeviceArraySize:
1701  return settings->DeviceArraySize;
1702 
1703  case FreeRDP_DeviceCount:
1704  return settings->DeviceCount;
1705 
1706  case FreeRDP_DeviceScaleFactor:
1707  return settings->DeviceScaleFactor;
1708 
1709  case FreeRDP_DrawNineGridCacheEntries:
1710  return settings->DrawNineGridCacheEntries;
1711 
1712  case FreeRDP_DrawNineGridCacheSize:
1713  return settings->DrawNineGridCacheSize;
1714 
1715  case FreeRDP_DynamicChannelArraySize:
1716  return settings->DynamicChannelArraySize;
1717 
1718  case FreeRDP_DynamicChannelCount:
1719  return settings->DynamicChannelCount;
1720 
1721  case FreeRDP_EarlyCapabilityFlags:
1722  return settings->EarlyCapabilityFlags;
1723 
1724  case FreeRDP_EncryptionLevel:
1725  return settings->EncryptionLevel;
1726 
1727  case FreeRDP_EncryptionMethods:
1728  return settings->EncryptionMethods;
1729 
1730  case FreeRDP_ExtEncryptionMethods:
1731  return settings->ExtEncryptionMethods;
1732 
1733  case FreeRDP_FakeMouseMotionInterval:
1734  return settings->FakeMouseMotionInterval;
1735 
1736  case FreeRDP_Floatbar:
1737  return settings->Floatbar;
1738 
1739  case FreeRDP_ForceIPvX:
1740  return settings->ForceIPvX;
1741 
1742  case FreeRDP_FrameAcknowledge:
1743  return settings->FrameAcknowledge;
1744 
1745  case FreeRDP_GatewayAcceptedCertLength:
1746  return settings->GatewayAcceptedCertLength;
1747 
1748  case FreeRDP_GatewayCredentialsSource:
1749  return settings->GatewayCredentialsSource;
1750 
1751  case FreeRDP_GatewayPort:
1752  return settings->GatewayPort;
1753 
1754  case FreeRDP_GatewayUsageMethod:
1755  return settings->GatewayUsageMethod;
1756 
1757  case FreeRDP_GfxCapsFilter:
1758  return settings->GfxCapsFilter;
1759 
1760  case FreeRDP_GlyphSupportLevel:
1761  return settings->GlyphSupportLevel;
1762 
1763  case FreeRDP_JpegCodecId:
1764  return settings->JpegCodecId;
1765 
1766  case FreeRDP_JpegQuality:
1767  return settings->JpegQuality;
1768 
1769  case FreeRDP_KeySpec:
1770  return settings->KeySpec;
1771 
1772  case FreeRDP_KeyboardCodePage:
1773  return settings->KeyboardCodePage;
1774 
1775  case FreeRDP_KeyboardFunctionKey:
1776  return settings->KeyboardFunctionKey;
1777 
1778  case FreeRDP_KeyboardHook:
1779  return settings->KeyboardHook;
1780 
1781  case FreeRDP_KeyboardLayout:
1782  return settings->KeyboardLayout;
1783 
1784  case FreeRDP_KeyboardSubType:
1785  return settings->KeyboardSubType;
1786 
1787  case FreeRDP_KeyboardType:
1788  return settings->KeyboardType;
1789 
1790  case FreeRDP_LargePointerFlag:
1791  return settings->LargePointerFlag;
1792 
1793  case FreeRDP_LoadBalanceInfoLength:
1794  return settings->LoadBalanceInfoLength;
1795 
1796  case FreeRDP_MonitorAttributeFlags:
1797  return settings->MonitorAttributeFlags;
1798 
1799  case FreeRDP_MonitorCount:
1800  return settings->MonitorCount;
1801 
1802  case FreeRDP_MonitorDefArraySize:
1803  return settings->MonitorDefArraySize;
1804 
1805  case FreeRDP_MonitorFlags:
1806  return settings->MonitorFlags;
1807 
1808  case FreeRDP_MonitorLocalShiftX:
1809  return settings->MonitorLocalShiftX;
1810 
1811  case FreeRDP_MonitorLocalShiftY:
1812  return settings->MonitorLocalShiftY;
1813 
1814  case FreeRDP_MultifragMaxRequestSize:
1815  return settings->MultifragMaxRequestSize;
1816 
1817  case FreeRDP_MultitransportFlags:
1818  return settings->MultitransportFlags;
1819 
1820  case FreeRDP_NSCodecColorLossLevel:
1821  return settings->NSCodecColorLossLevel;
1822 
1823  case FreeRDP_NSCodecId:
1824  return settings->NSCodecId;
1825 
1826  case FreeRDP_NegotiationFlags:
1827  return settings->NegotiationFlags;
1828 
1829  case FreeRDP_NumMonitorIds:
1830  return settings->NumMonitorIds;
1831 
1832  case FreeRDP_OffscreenCacheEntries:
1833  return settings->OffscreenCacheEntries;
1834 
1835  case FreeRDP_OffscreenCacheSize:
1836  return settings->OffscreenCacheSize;
1837 
1838  case FreeRDP_OffscreenSupportLevel:
1839  return settings->OffscreenSupportLevel;
1840 
1841  case FreeRDP_OsMajorType:
1842  return settings->OsMajorType;
1843 
1844  case FreeRDP_OsMinorType:
1845  return settings->OsMinorType;
1846 
1847  case FreeRDP_Password51Length:
1848  return settings->Password51Length;
1849 
1850  case FreeRDP_PduSource:
1851  return settings->PduSource;
1852 
1853  case FreeRDP_PercentScreen:
1854  return settings->PercentScreen;
1855 
1856  case FreeRDP_PerformanceFlags:
1857  return settings->PerformanceFlags;
1858 
1859  case FreeRDP_PointerCacheSize:
1860  return settings->PointerCacheSize;
1861 
1862  case FreeRDP_PreconnectionId:
1863  return settings->PreconnectionId;
1864 
1865  case FreeRDP_ProxyType:
1866  return settings->ProxyType;
1867 
1868  case FreeRDP_RdpVersion:
1869  return settings->RdpVersion;
1870 
1871  case FreeRDP_ReceivedCapabilitiesSize:
1872  return settings->ReceivedCapabilitiesSize;
1873 
1874  case FreeRDP_RedirectedSessionId:
1875  return settings->RedirectedSessionId;
1876 
1877  case FreeRDP_RedirectionAcceptedCertLength:
1878  return settings->RedirectionAcceptedCertLength;
1879 
1880  case FreeRDP_RedirectionFlags:
1881  return settings->RedirectionFlags;
1882 
1883  case FreeRDP_RedirectionGuidLength:
1884  return settings->RedirectionGuidLength;
1885 
1886  case FreeRDP_RedirectionPasswordLength:
1887  return settings->RedirectionPasswordLength;
1888 
1889  case FreeRDP_RedirectionPreferType:
1890  return settings->RedirectionPreferType;
1891 
1892  case FreeRDP_RedirectionTsvUrlLength:
1893  return settings->RedirectionTsvUrlLength;
1894 
1895  case FreeRDP_RemoteAppNumIconCacheEntries:
1896  return settings->RemoteAppNumIconCacheEntries;
1897 
1898  case FreeRDP_RemoteAppNumIconCaches:
1899  return settings->RemoteAppNumIconCaches;
1900 
1901  case FreeRDP_RemoteApplicationExpandCmdLine:
1902  return settings->RemoteApplicationExpandCmdLine;
1903 
1904  case FreeRDP_RemoteApplicationExpandWorkingDir:
1905  return settings->RemoteApplicationExpandWorkingDir;
1906 
1907  case FreeRDP_RemoteApplicationSupportLevel:
1908  return settings->RemoteApplicationSupportLevel;
1909 
1910  case FreeRDP_RemoteApplicationSupportMask:
1911  return settings->RemoteApplicationSupportMask;
1912 
1913  case FreeRDP_RemoteFxCaptureFlags:
1914  return settings->RemoteFxCaptureFlags;
1915 
1916  case FreeRDP_RemoteFxCodecId:
1917  return settings->RemoteFxCodecId;
1918 
1919  case FreeRDP_RemoteFxCodecMode:
1920  return settings->RemoteFxCodecMode;
1921 
1922  case FreeRDP_RemoteFxRlgrMode:
1923  return settings->RemoteFxRlgrMode;
1924 
1925  case FreeRDP_RemoteWndSupportLevel:
1926  return settings->RemoteWndSupportLevel;
1927 
1928  case FreeRDP_RequestedProtocols:
1929  return settings->RequestedProtocols;
1930 
1931  case FreeRDP_SelectedProtocol:
1932  return settings->SelectedProtocol;
1933 
1934  case FreeRDP_ServerCertificateLength:
1935  return settings->ServerCertificateLength;
1936 
1937  case FreeRDP_ServerLicenseProductIssuersCount:
1938  return settings->ServerLicenseProductIssuersCount;
1939 
1940  case FreeRDP_ServerLicenseProductVersion:
1941  return settings->ServerLicenseProductVersion;
1942 
1943  case FreeRDP_ServerPort:
1944  return settings->ServerPort;
1945 
1946  case FreeRDP_ServerRandomLength:
1947  return settings->ServerRandomLength;
1948 
1949  case FreeRDP_ShareId:
1950  return settings->ShareId;
1951 
1952  case FreeRDP_SmartSizingHeight:
1953  return settings->SmartSizingHeight;
1954 
1955  case FreeRDP_SmartSizingWidth:
1956  return settings->SmartSizingWidth;
1957 
1958  case FreeRDP_StaticChannelArraySize:
1959  return settings->StaticChannelArraySize;
1960 
1961  case FreeRDP_StaticChannelCount:
1962  return settings->StaticChannelCount;
1963 
1964  case FreeRDP_SurfaceCommandsSupported:
1965  return settings->SurfaceCommandsSupported;
1966 
1967  case FreeRDP_TargetNetAddressCount:
1968  return settings->TargetNetAddressCount;
1969 
1970  case FreeRDP_TcpAckTimeout:
1971  return settings->TcpAckTimeout;
1972 
1973  case FreeRDP_TcpConnectTimeout:
1974  return settings->TcpConnectTimeout;
1975 
1976  case FreeRDP_TcpKeepAliveDelay:
1977  return settings->TcpKeepAliveDelay;
1978 
1979  case FreeRDP_TcpKeepAliveInterval:
1980  return settings->TcpKeepAliveInterval;
1981 
1982  case FreeRDP_TcpKeepAliveRetries:
1983  return settings->TcpKeepAliveRetries;
1984 
1985  case FreeRDP_ThreadingFlags:
1986  return settings->ThreadingFlags;
1987 
1988  case FreeRDP_TlsSecLevel:
1989  return settings->TlsSecLevel;
1990 
1991  case FreeRDP_VCChunkSize:
1992  return settings->VCChunkSize;
1993 
1994  case FreeRDP_VCFlags:
1995  return settings->VCFlags;
1996 
1997  default:
1998  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2001  WINPR_ASSERT(FALSE);
2002  return 0;
2003  }
2004 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), freerdp_settings_print_diff(), and AppDelegate::rdpConnectError:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_get_uint64()

FREERDP_API UINT64 freerdp_settings_get_uint64 ( const rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt64  id 
)

Returns a UINT64 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
Returns
the value of the UINT64 key

Definition at line 2587 of file settings_getters.c.

2588 {
2589  WINPR_ASSERT(settings);
2590 
2591  switch (id)
2592  {
2593  case FreeRDP_ParentWindowId:
2594  return settings->ParentWindowId;
2595 
2596  default:
2597  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2600  WINPR_ASSERT(FALSE);
2601  return 0;
2602  }
2603 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item(), freerdp_settings_dump(), and freerdp_settings_print_diff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_new()

FREERDP_API rdpSettings* freerdp_settings_new ( DWORD  flags)

creates a new setting struct

Parameters
flagsFlags for creation, use FREERDP_SETTINGS_SERVER_MODE for server settings, 0 for client.
Returns
A newly allocated settings struct or NULL

Definition at line 384 of file core/settings.c.

385 {
386  char* issuers[] = { "FreeRDP", "FreeRDP-licenser" };
387  const BOOL server = (flags & FREERDP_SETTINGS_SERVER_MODE) != 0 ? TRUE : FALSE;
388  const BOOL remote = (flags & FREERDP_SETTINGS_REMOTE_MODE) != 0 ? TRUE : FALSE;
389  rdpSettings* settings = (rdpSettings*)calloc(1, sizeof(rdpSettings));
390 
391  if (!settings)
392  return NULL;
393 
394  if (!freerdp_settings_set_uint32(settings, FreeRDP_SurfaceCommandsSupported,
395  SURFCMDS_SET_SURFACE_BITS | SURFCMDS_STREAM_SURFACE_BITS |
396  SURFCMDS_FRAME_MARKER))
397  goto out_fail;
398 
399  if (!freerdp_settings_set_uint32(settings, FreeRDP_RemoteFxRlgrMode, RLGR3))
400  goto out_fail;
401 
402  if (!freerdp_settings_set_uint16(settings, FreeRDP_CapsProtocolVersion,
403  TS_CAPS_PROTOCOLVERSION))
404  goto out_fail;
405 
406  if (!freerdp_settings_set_uint32(settings, FreeRDP_ClipboardFeatureMask,
407  CLIPRDR_FLAG_DEFAULT_MASK))
408  goto out_fail;
409  if (!freerdp_settings_set_string(settings, FreeRDP_ServerLicenseCompanyName, "FreeRDP"))
410  goto out_fail;
411  if (!freerdp_settings_set_string(settings, FreeRDP_ServerLicenseProductName,
412  "FreeRDP-licensing-server"))
413  goto out_fail;
414  if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerLicenseProductVersion, 1))
415  goto out_fail;
416  if (!freerdp_server_license_issuers_copy(settings, issuers, ARRAYSIZE(issuers)))
417  goto out_fail;
418 
419  if (!freerdp_settings_set_uint16(settings, FreeRDP_SupportedColorDepths,
420  RNS_UD_32BPP_SUPPORT | RNS_UD_24BPP_SUPPORT |
421  RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT))
422  goto out_fail;
423 
424  if (!freerdp_settings_set_bool(settings, FreeRDP_UnicodeInput, TRUE) ||
425  !freerdp_settings_set_bool(settings, FreeRDP_HasHorizontalWheel, TRUE) ||
426  !freerdp_settings_set_bool(settings, FreeRDP_HasExtendedMouseEvent, TRUE) ||
427  !freerdp_settings_set_bool(settings, FreeRDP_HasQoeEvent, TRUE) ||
428  !freerdp_settings_set_bool(settings, FreeRDP_HasRelativeMouseEvent, TRUE) ||
429  !freerdp_settings_set_bool(settings, FreeRDP_HiDefRemoteApp, TRUE) ||
431  settings, FreeRDP_RemoteApplicationSupportMask,
432  RAIL_LEVEL_SUPPORTED | RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED |
433  RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED |
434  RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED |
435  RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED | RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED |
436  RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED) ||
437  !freerdp_settings_set_uint16(settings, FreeRDP_TextANSICodePage, CP_UTF8) ||
438  !freerdp_settings_set_uint16(settings, FreeRDP_OrderSupportFlags,
439  NEGOTIATE_ORDER_SUPPORT | ZERO_BOUNDS_DELTA_SUPPORT |
440  COLOR_INDEX_SUPPORT) ||
441  !freerdp_settings_set_bool(settings, FreeRDP_SupportHeartbeatPdu, TRUE) ||
442  !freerdp_settings_set_bool(settings, FreeRDP_ServerMode, server) ||
443  !freerdp_settings_set_bool(settings, FreeRDP_WaitForOutputBufferFlush, TRUE) ||
444  !freerdp_settings_set_uint32(settings, FreeRDP_ClusterInfoFlags, REDIRECTION_SUPPORTED) ||
445  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1024) ||
446  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 768) ||
447  !freerdp_settings_set_bool(settings, FreeRDP_Workarea, FALSE) ||
448  !freerdp_settings_set_bool(settings, FreeRDP_Fullscreen, FALSE) ||
449  !freerdp_settings_set_bool(settings, FreeRDP_GrabKeyboard, TRUE) ||
450  !freerdp_settings_set_bool(settings, FreeRDP_Decorations, TRUE) ||
451  !freerdp_settings_set_uint32(settings, FreeRDP_RdpVersion, RDP_VERSION_10_12) ||
452  !freerdp_settings_set_uint32(settings, FreeRDP_ColorDepth, 32) ||
453  !freerdp_settings_set_bool(settings, FreeRDP_AadSecurity, FALSE) ||
454  !freerdp_settings_set_bool(settings, FreeRDP_ExtSecurity, FALSE) ||
455  !freerdp_settings_set_bool(settings, FreeRDP_NlaSecurity, TRUE) ||
456  !freerdp_settings_set_bool(settings, FreeRDP_TlsSecurity, TRUE) ||
457  !freerdp_settings_set_bool(settings, FreeRDP_RdpSecurity, TRUE) ||
458  !freerdp_settings_set_bool(settings, FreeRDP_RdstlsSecurity, FALSE) ||
459  !freerdp_settings_set_bool(settings, FreeRDP_NegotiateSecurityLayer, TRUE) ||
460  !freerdp_settings_set_bool(settings, FreeRDP_RestrictedAdminModeRequired, FALSE) ||
461  !freerdp_settings_set_bool(settings, FreeRDP_MstscCookieMode, FALSE) ||
462  !freerdp_settings_set_uint32(settings, FreeRDP_CookieMaxLength,
463  DEFAULT_COOKIE_MAX_LENGTH) ||
464  !freerdp_settings_set_uint32(settings, FreeRDP_ClientBuild,
465  18363) || /* Windows 10, Version 1909 */
466  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardType, 4) ||
467  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardSubType, 0) ||
468  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardFunctionKey, 12) ||
469  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardLayout, 0) ||
470  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardHook,
471  KEYBOARD_HOOK_FULLSCREEN_ONLY) ||
472  !freerdp_settings_set_bool(settings, FreeRDP_UseRdpSecurityLayer, FALSE) ||
473  !freerdp_settings_set_bool(settings, FreeRDP_SaltedChecksum, TRUE) ||
474  !freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, 3389) ||
475  !freerdp_settings_set_uint32(settings, FreeRDP_GatewayPort, 443) ||
476  !freerdp_settings_set_bool(settings, FreeRDP_DesktopResize, TRUE) ||
477  !freerdp_settings_set_bool(settings, FreeRDP_ToggleFullscreen, TRUE) ||
478  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopPosX, UINT32_MAX) ||
479  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopPosY, UINT32_MAX) ||
480  !freerdp_settings_set_bool(settings, FreeRDP_SoftwareGdi, TRUE) ||
481  !freerdp_settings_set_bool(settings, FreeRDP_UnmapButtons, FALSE) ||
482  !freerdp_settings_set_uint32(settings, FreeRDP_PerformanceFlags, PERF_FLAG_NONE) ||
483  !freerdp_settings_set_bool(settings, FreeRDP_AllowFontSmoothing, TRUE) ||
484  !freerdp_settings_set_bool(settings, FreeRDP_AllowDesktopComposition, FALSE) ||
485  !freerdp_settings_set_bool(settings, FreeRDP_DisableWallpaper, FALSE) ||
486  !freerdp_settings_set_bool(settings, FreeRDP_DisableFullWindowDrag, TRUE) ||
487  !freerdp_settings_set_bool(settings, FreeRDP_DisableMenuAnims, TRUE) ||
488  !freerdp_settings_set_bool(settings, FreeRDP_DisableThemes, FALSE) ||
489  !freerdp_settings_set_uint32(settings, FreeRDP_ConnectionType,
490  CONNECTION_TYPE_AUTODETECT) ||
491  !freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, TRUE) ||
492  !freerdp_settings_set_uint32(settings, FreeRDP_EncryptionMethods, ENCRYPTION_METHOD_NONE) ||
493  !freerdp_settings_set_uint32(settings, FreeRDP_EncryptionLevel, ENCRYPTION_LEVEL_NONE) ||
494  !freerdp_settings_set_bool(settings, FreeRDP_FIPSMode, FALSE) ||
495  !freerdp_settings_set_bool(settings, FreeRDP_CompressionEnabled, TRUE) ||
496  !freerdp_settings_set_bool(settings, FreeRDP_LogonNotify, TRUE) ||
497  !freerdp_settings_set_uint32(settings, FreeRDP_BrushSupportLevel, BRUSH_COLOR_FULL) ||
498  !freerdp_settings_set_uint32(settings, FreeRDP_CompressionLevel, PACKET_COMPR_TYPE_RDP61) ||
499  !freerdp_settings_set_bool(settings, FreeRDP_Authentication, TRUE) ||
500  !freerdp_settings_set_bool(settings, FreeRDP_AuthenticationOnly, FALSE) ||
501  !freerdp_settings_set_bool(settings, FreeRDP_CredentialsFromStdin, FALSE) ||
502  !freerdp_settings_set_bool(settings, FreeRDP_DisableCredentialsDelegation, FALSE) ||
503  !freerdp_settings_set_uint32(settings, FreeRDP_AuthenticationLevel, 2) ||
504  !freerdp_settings_set_uint32(settings, FreeRDP_ChannelCount, 0) ||
505  !freerdp_settings_set_bool(settings, FreeRDP_CertificateCallbackPreferPEM, FALSE) ||
506  !freerdp_settings_set_uint32(settings, FreeRDP_KeySpec, AT_KEYEXCHANGE))
507  goto out_fail;
508 
509  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ChannelDefArray, NULL,
510  CHANNEL_MAX_COUNT))
511  goto out_fail;
512 
513  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportMonitorLayoutPdu, FALSE))
514  goto out_fail;
515 
516  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorCount, 0))
517  goto out_fail;
518 
519  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorDefArray, NULL, 32))
520  goto out_fail;
521 
522  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftX, 0))
523  goto out_fail;
524 
525  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftY, 0))
526  goto out_fail;
527 
528  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, NULL, 0))
529  goto out_fail;
530 
531  if (!freerdp_settings_set_uint32(settings, FreeRDP_MultitransportFlags,
532  TRANSPORT_TYPE_UDP_FECR))
533  goto out_fail;
534  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportMultitransport, TRUE))
535  goto out_fail;
536 
537  if (!settings_get_computer_name(settings))
538  goto out_fail;
539 
540  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerCertificate, NULL, 1))
541  goto out_fail;
542 
543  if (!freerdp_capability_buffer_allocate(settings, 32))
544  goto out_fail;
545 
546  {
547  char tmp[32] = { 0 };
548  if (!freerdp_settings_set_string_len(settings, FreeRDP_ClientProductId, tmp, sizeof(tmp)))
549  goto out_fail;
550  }
551 
552  {
553  char ClientHostname[33] = { 0 };
554  DWORD size = sizeof(ClientHostname) - 2;
555  GetComputerNameA(ClientHostname, &size);
556  if (!freerdp_settings_set_string(settings, FreeRDP_ClientHostname, ClientHostname))
557  goto out_fail;
558  }
559 
560  /* [MS-RDPBCGR] 2.2.7.1.5 Pointer Capability Set (TS_POINTER_CAPABILITYSET)
561  *
562  * if we are in server mode send a reasonable large cache size,
563  * if we are in client mode just set the value to the maximum we want to
564  * support and during capability exchange that size will be limited to the
565  * sizes the server supports
566  *
567  * We have chosen 128 cursors in cache which is at worst 128 * 576kB (384x384 pixel cursor with
568  * 32bit color depth)
569  * */
570  if (freerdp_settings_get_bool(settings, FreeRDP_ServerMode))
571  {
572  if (!freerdp_settings_set_uint32(settings, FreeRDP_PointerCacheSize, 25) ||
573  !freerdp_settings_set_uint32(settings, FreeRDP_ColorPointerCacheSize, 25))
574  goto out_fail;
575  }
576  else
577  {
578  if (!freerdp_settings_set_uint32(settings, FreeRDP_PointerCacheSize, 128) ||
579  !freerdp_settings_set_uint32(settings, FreeRDP_ColorPointerCacheSize, 128))
580  goto out_fail;
581  }
582 
583  if (!freerdp_settings_set_uint32(settings, FreeRDP_LargePointerFlag,
584  (LARGE_POINTER_FLAG_96x96 | LARGE_POINTER_FLAG_384x384)) ||
585  !freerdp_settings_set_bool(settings, FreeRDP_SoundBeepsEnabled, TRUE) ||
586  !freerdp_settings_set_bool(settings, FreeRDP_DrawGdiPlusEnabled, FALSE) ||
587  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowSkipAlpha, TRUE) ||
588  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowColorSubsampling, FALSE) ||
589  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowDynamicColorFidelity, TRUE) ||
590  !freerdp_settings_set_bool(settings, FreeRDP_FrameMarkerCommandEnabled, TRUE) ||
591  !freerdp_settings_set_bool(settings, FreeRDP_SurfaceFrameMarkerEnabled, TRUE) ||
592  !freerdp_settings_set_bool(settings, FreeRDP_AllowCacheWaitingList, TRUE) ||
593  !freerdp_settings_set_uint32(settings, FreeRDP_BitmapCacheV2NumCells, 5))
594  goto out_fail;
595  settings->BitmapCacheV2CellInfo =
597 
598  if (!settings->BitmapCacheV2CellInfo)
599  goto out_fail;
600 
601  {
602  BITMAP_CACHE_V2_CELL_INFO cache = { 0 };
603  cache.numEntries = 600;
604  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 0,
605  &cache) ||
606  !freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 1, &cache))
607  goto out_fail;
608  cache.numEntries = 2048;
609  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 2,
610  &cache) ||
611  !freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 4, &cache))
612  goto out_fail;
613  cache.numEntries = 4096;
614  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 3, &cache))
615  goto out_fail;
616  }
617  if (!freerdp_settings_set_bool(settings, FreeRDP_NoBitmapCompressionHeader, TRUE) ||
618  !freerdp_settings_set_bool(settings, FreeRDP_RefreshRect, TRUE) ||
619  !freerdp_settings_set_bool(settings, FreeRDP_SuppressOutput, TRUE) ||
620  !freerdp_settings_set_uint32(settings, FreeRDP_GlyphSupportLevel, GLYPH_SUPPORT_NONE))
621  goto out_fail;
622  settings->GlyphCache = calloc(10, sizeof(GLYPH_CACHE_DEFINITION));
623 
624  if (!settings->GlyphCache)
625  goto out_fail;
626 
627  settings->FragCache = calloc(1, sizeof(GLYPH_CACHE_DEFINITION));
628 
629  if (!settings->FragCache)
630  goto out_fail;
631 
632  for (size_t x = 0; x < 10; x++)
633  {
634  GLYPH_CACHE_DEFINITION cache = { 0 };
635  cache.cacheEntries = 254;
636  switch (x)
637  {
638  case 0:
639  case 1:
640  cache.cacheMaximumCellSize = 4;
641  break;
642  case 2:
643  case 3:
644  cache.cacheMaximumCellSize = 8;
645  break;
646  case 4:
647  cache.cacheMaximumCellSize = 16;
648  break;
649  case 5:
650  cache.cacheMaximumCellSize = 32;
651  break;
652  case 6:
653  cache.cacheMaximumCellSize = 64;
654  break;
655  case 7:
656  cache.cacheMaximumCellSize = 128;
657  break;
658  case 8:
659  cache.cacheMaximumCellSize = 256;
660  break;
661  case 9:
662  cache.cacheMaximumCellSize = 256;
663  break;
664  }
665 
666  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_GlyphCache, x, &cache))
667  goto out_fail;
668  }
669  {
670  GLYPH_CACHE_DEFINITION cache = { 0 };
671  cache.cacheEntries = 256;
672  cache.cacheMaximumCellSize = 256;
673  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_FragCache, 0, &cache))
674  goto out_fail;
675  }
676  if (!freerdp_settings_set_uint32(settings, FreeRDP_OffscreenSupportLevel, 0) ||
677  !freerdp_settings_set_uint32(settings, FreeRDP_OffscreenCacheSize, 7680) ||
678  !freerdp_settings_set_uint32(settings, FreeRDP_OffscreenCacheEntries, 2000) ||
679  !freerdp_settings_set_uint32(settings, FreeRDP_DrawNineGridCacheSize, 2560) ||
680  !freerdp_settings_set_uint32(settings, FreeRDP_DrawNineGridCacheEntries, 256) ||
681  !freerdp_settings_set_string(settings, FreeRDP_ClientDir, client_dll) ||
682  !freerdp_settings_get_string(settings, FreeRDP_ClientDir) ||
683  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteWndSupportLevel,
684  WINDOW_LEVEL_SUPPORTED | WINDOW_LEVEL_SUPPORTED_EX) ||
685  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteAppNumIconCaches, 3) ||
686  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteAppNumIconCacheEntries, 12) ||
687  !freerdp_settings_set_uint32(settings, FreeRDP_VCChunkSize,
688  (server && !remote) ? CHANNEL_CHUNK_MAX_LENGTH
689  : CHANNEL_CHUNK_LENGTH) ||
690  /* [MS-RDPBCGR] 2.2.7.2.7 Large Pointer Capability Set (TS_LARGE_POINTER_CAPABILITYSET)
691  requires at least this size */
692  !freerdp_settings_set_uint32(settings, FreeRDP_MultifragMaxRequestSize,
693  server ? 0 : 608299) ||
694  !freerdp_settings_set_bool(settings, FreeRDP_GatewayUseSameCredentials, FALSE) ||
695  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE) ||
696  !freerdp_settings_set_bool(settings, FreeRDP_GatewayRpcTransport, TRUE) ||
697  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpTransport, TRUE) ||
698  !freerdp_settings_set_bool(settings, FreeRDP_GatewayUdpTransport, TRUE) ||
699  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpUseWebsockets, TRUE) ||
700  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpExtAuthSspiNtlm, FALSE) ||
701  !freerdp_settings_set_bool(settings, FreeRDP_GatewayArmTransport, FALSE) ||
702  !freerdp_settings_set_bool(settings, FreeRDP_FastPathInput, TRUE) ||
703  !freerdp_settings_set_bool(settings, FreeRDP_FastPathOutput, TRUE) ||
704  !freerdp_settings_set_bool(settings, FreeRDP_LongCredentialsSupported, TRUE) ||
705  !freerdp_settings_set_uint32(settings, FreeRDP_FrameAcknowledge, 2) ||
706  !freerdp_settings_set_bool(settings, FreeRDP_MouseMotion, TRUE) ||
707  !freerdp_settings_set_uint32(settings, FreeRDP_NSCodecColorLossLevel, 3) ||
708  !freerdp_settings_set_bool(settings, FreeRDP_NSCodecAllowSubsampling, TRUE) ||
709  !freerdp_settings_set_bool(settings, FreeRDP_NSCodecAllowDynamicColorFidelity, TRUE) ||
710  !freerdp_settings_set_bool(settings, FreeRDP_AutoReconnectionEnabled, FALSE) ||
711  !freerdp_settings_set_uint32(settings, FreeRDP_AutoReconnectMaxRetries, 20) ||
712  !freerdp_settings_set_bool(settings, FreeRDP_GfxThinClient, FALSE) ||
713  !freerdp_settings_set_bool(settings, FreeRDP_GfxSmallCache, TRUE) ||
714  !freerdp_settings_set_bool(settings, FreeRDP_GfxProgressive, FALSE) ||
715  !freerdp_settings_set_bool(settings, FreeRDP_GfxProgressiveV2, FALSE) ||
716  !freerdp_settings_set_bool(settings, FreeRDP_GfxPlanar, TRUE) ||
717  !freerdp_settings_set_bool(settings, FreeRDP_GfxH264, FALSE) ||
718  !freerdp_settings_set_bool(settings, FreeRDP_GfxAVC444, FALSE) ||
719  !freerdp_settings_set_bool(settings, FreeRDP_GfxSendQoeAck, FALSE))
720  goto out_fail;
721  {
722  ARC_CS_PRIVATE_PACKET cookie = { 0 };
723  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ClientAutoReconnectCookie, &cookie,
724  1))
725  goto out_fail;
726  }
727  {
728  ARC_SC_PRIVATE_PACKET cookie = { 0 };
729  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ServerAutoReconnectCookie, &cookie,
730  1))
731  goto out_fail;
732  }
733 
734  settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION)calloc(1, sizeof(TIME_ZONE_INFORMATION));
735 
736  if (!settings->ClientTimeZone)
737  goto out_fail;
738 
739  if (!settings->ServerMode)
740  {
741  DYNAMIC_TIME_ZONE_INFORMATION dynamic = { 0 };
743  freerdp_settings_get_pointer_writable(settings, FreeRDP_ClientTimeZone);
744  WINPR_ASSERT(tz);
745 
746  GetTimeZoneInformation(tz);
747  GetDynamicTimeZoneInformation(&dynamic);
748 
749  if (!freerdp_settings_set_string_from_utf16N(settings, FreeRDP_DynamicDSTTimeZoneKeyName,
750  dynamic.TimeZoneKeyName,
751  ARRAYSIZE(dynamic.TimeZoneKeyName)))
752  goto out_fail;
753 
754  if (!freerdp_settings_set_bool(settings, FreeRDP_DynamicDaylightTimeDisabled,
755  dynamic.DynamicDaylightTimeDisabled))
756  goto out_fail;
757  }
758 
759  if (!freerdp_settings_set_bool(settings, FreeRDP_TcpKeepAlive, TRUE) ||
760  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveRetries, 3) ||
761  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveDelay, 5) ||
762  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveInterval, 2) ||
763  !freerdp_settings_set_uint32(settings, FreeRDP_TcpAckTimeout, 9000) ||
764  !freerdp_settings_set_uint32(settings, FreeRDP_TcpConnectTimeout, 15000))
765  goto out_fail;
766 
767  if (!freerdp_settings_get_bool(settings, FreeRDP_ServerMode))
768  {
769  BOOL rc = FALSE;
770  char* path = NULL;
771  if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectClipboard, TRUE))
772  goto out_fail;
773  /* these values are used only by the client part */
774  path = GetKnownPath(KNOWN_PATH_HOME);
775  rc = freerdp_settings_set_string(settings, FreeRDP_HomePath, path);
776  free(path);
777 
778  if (!rc || !freerdp_settings_get_string(settings, FreeRDP_HomePath))
779  goto out_fail;
780 
781  char* config = freerdp_settings_get_config_path();
782  rc = freerdp_settings_set_string(settings, FreeRDP_ConfigPath, config);
783  if (rc)
784  {
785  char* action = GetCombinedPath(config, "action.sh");
786  rc = freerdp_settings_set_string(settings, FreeRDP_ActionScript, action);
787  free(action);
788  }
789 
790  free(config);
791  if (!rc)
792  goto out_fail;
793  }
794 
795  settings_load_hkey_local_machine(settings);
796 
797  if (!freerdp_settings_set_bool(settings, FreeRDP_SmartcardLogon, FALSE))
798  goto out_fail;
799  if (!freerdp_settings_set_uint32(settings, FreeRDP_TlsSecLevel, 1))
800  goto out_fail;
801  settings->OrderSupport = calloc(1, 32);
802 
803  freerdp_settings_set_uint16(settings, FreeRDP_TLSMinVersion, TLS1_VERSION);
804  freerdp_settings_set_uint16(settings, FreeRDP_TLSMaxVersion, 0);
805 
806  if (!settings->OrderSupport)
807  goto out_fail;
808 
809  if (!freerdp_settings_set_default_order_support(settings))
810  goto out_fail;
811 
812  const BOOL enable = freerdp_settings_get_bool(settings, FreeRDP_ServerMode);
813 
814  {
815  const FreeRDP_Settings_Keys_Bool keys[] = { FreeRDP_SupportGraphicsPipeline,
816  FreeRDP_SupportStatusInfoPdu,
817  FreeRDP_SupportErrorInfoPdu,
818  FreeRDP_SupportAsymetricKeys };
819 
820  for (size_t x = 0; x < ARRAYSIZE(keys); x++)
821  {
822  if (!freerdp_settings_set_bool(settings, keys[x], enable))
823  goto out_fail;
824  }
825  }
826 
827  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportDynamicTimeZone, TRUE))
828  goto out_fail;
829  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportSkipChannelJoin, TRUE))
830  goto out_fail;
831 
832  return settings;
833 out_fail:
834  freerdp_settings_free(settings);
835  return NULL;
836 }
FREERDP_API BOOL freerdp_settings_set_string_from_utf16N(rdpSettings *settings, FreeRDP_Settings_Keys_String id, const WCHAR *param, size_t length)
Sets a string settings value. The param is converted to UTF-8 and the copy stored.
FREERDP_API BOOL freerdp_settings_set_pointer_len(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data, size_t len)
Set a pointer to value data.
FREERDP_API char * freerdp_settings_get_config_path(void)
return the configuration directory for the library
#define FREERDP_SETTINGS_SERVER_MODE

References FREERDP_SETTINGS_SERVER_MODE.

◆ freerdp_settings_print_diff()

FREERDP_API BOOL freerdp_settings_print_diff ( wLog *  log,
DWORD  level,
const rdpSettings *  src,
const rdpSettings *  other 
)

Dumps the difference between two settings structs to a WLog.

Parameters
logThe logger to write to, must not be NULL.
levelThe WLog level to use for the log entries.
srcA pointer to the settings to dump. May be NULL.
otherA pointer to the settings to dump. May be NULL.
Returns
TRUE if not equal, FALSE otherwise

Definition at line 94 of file settings_str.c.

96 {
97  BOOL rc = FALSE;
98 
99  WINPR_ASSERT(log);
100  WINPR_ASSERT(settings);
101  WINPR_ASSERT(other);
102 
103  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
104  {
105  const struct settings_str_entry* cur = &settings_map[x];
106  switch (cur->type)
107  {
108  case FREERDP_SETTINGS_TYPE_BOOL: /* bool */
109  {
110  BOOL sval =
111  freerdp_settings_get_bool(settings, (FreeRDP_Settings_Keys_Bool)cur->id);
112  BOOL cval = freerdp_settings_get_bool(other, (FreeRDP_Settings_Keys_Bool)cur->id);
113  if (sval != cval)
114  {
115  rc = TRUE;
116  WLog_Print(log, level, "%s [BOOL]: %s -> %s", cur->str, sval ? "TRUE" : "FALSE",
117  cval ? "TRUE" : "FALSE");
118  }
119  }
120  break;
121  case FREERDP_SETTINGS_TYPE_UINT16: /* UINT16 */
122  {
123  UINT16 sval =
124  freerdp_settings_get_uint16(settings, (FreeRDP_Settings_Keys_UInt16)cur->id);
125  UINT16 cval =
126  freerdp_settings_get_uint16(other, (FreeRDP_Settings_Keys_UInt16)cur->id);
127  if (sval != cval)
128  {
129  rc = TRUE;
130  WLog_Print(log, level, "%s [UINT16]: %" PRIu16 " -> %" PRIu16, cur->str, sval,
131  cval);
132  }
133  }
134  break;
135  case FREERDP_SETTINGS_TYPE_INT16: /* INT16 */
136  {
137  INT16 sval =
138  freerdp_settings_get_int16(settings, (FreeRDP_Settings_Keys_Int16)cur->id);
139  INT16 cval =
140  freerdp_settings_get_int16(other, (FreeRDP_Settings_Keys_Int16)cur->id);
141  if (sval != cval)
142  {
143  rc = TRUE;
144  WLog_Print(log, level, "%s [INT16]: %" PRId16 " -> %" PRId16, cur->str, sval,
145  cval);
146  }
147  }
148  break;
149  case FREERDP_SETTINGS_TYPE_UINT32: /* UINT32 */
150  {
151  UINT32 sval =
152  freerdp_settings_get_uint32(settings, (FreeRDP_Settings_Keys_UInt32)cur->id);
153  UINT32 cval =
154  freerdp_settings_get_uint32(other, (FreeRDP_Settings_Keys_UInt32)cur->id);
155  if (sval != cval)
156  {
157  rc = TRUE;
158  WLog_Print(log, level, "%s [UINT32]: %" PRIu32 " -> %" PRIu32, cur->str, sval,
159  cval);
160  }
161  }
162  break;
163  case FREERDP_SETTINGS_TYPE_INT32: /* INT32 */
164  {
165  INT32 sval =
166  freerdp_settings_get_int32(settings, (FreeRDP_Settings_Keys_Int32)cur->id);
167  INT32 cval =
168  freerdp_settings_get_int32(other, (FreeRDP_Settings_Keys_Int32)cur->id);
169  if (sval != cval)
170  {
171  rc = TRUE;
172  WLog_Print(log, level, "%s [INT32]: %" PRId32 " -> %" PRId32, cur->str, sval,
173  cval);
174  }
175  }
176  break;
177  case FREERDP_SETTINGS_TYPE_UINT64: /* UINT64 */
178  {
179  UINT64 sval =
180  freerdp_settings_get_uint64(settings, (FreeRDP_Settings_Keys_UInt64)cur->id);
181  UINT64 cval =
182  freerdp_settings_get_uint64(other, (FreeRDP_Settings_Keys_UInt64)cur->id);
183  if (sval != cval)
184  {
185  rc = TRUE;
186  WLog_Print(log, level, "%s [UINT64]: %" PRIu64 " -> %" PRIu64, cur->str, sval,
187  cval);
188  }
189  }
190  break;
191  case FREERDP_SETTINGS_TYPE_INT64: /* INT64 */
192  {
193  INT64 sval =
194  freerdp_settings_get_int64(settings, (FreeRDP_Settings_Keys_Int64)cur->id);
195  INT64 cval =
196  freerdp_settings_get_int64(other, (FreeRDP_Settings_Keys_Int64)cur->id);
197  if (sval != cval)
198  {
199  rc = TRUE;
200  WLog_Print(log, level, "%s [INT64]: %" PRId64 " -> %" PRId64, cur->str, sval,
201  cval);
202  }
203  }
204  break;
205  case FREERDP_SETTINGS_TYPE_STRING: /* strings */
206  {
207  const char* sval =
208  freerdp_settings_get_string(settings, (FreeRDP_Settings_Keys_String)cur->id);
209  const char* cval =
210  freerdp_settings_get_string(other, (FreeRDP_Settings_Keys_String)cur->id);
211  if (sval != cval)
212  {
213  if (!sval || !cval || (strcmp(sval, cval) != 0))
214  {
215  rc = TRUE;
216  WLog_Print(log, level, "%s [STRING]: '%s' -> '%s'", cur->str, sval, cval);
217  }
218  }
219  }
220  break;
221  case FREERDP_SETTINGS_TYPE_POINTER: /* pointer */
222  {
223  const void* sval =
224  freerdp_settings_get_pointer(settings, (FreeRDP_Settings_Keys_Pointer)cur->id);
225  const void* cval =
226  freerdp_settings_get_pointer(other, (FreeRDP_Settings_Keys_Pointer)cur->id);
227  if (sval != cval)
228  {
229  if ((sval && !cval) || (!sval && cval))
230  {
231  rc = TRUE;
232  WLog_Print(log, level, "%s [POINTER]: '%p' -> '%p'", cur->str, sval, cval);
233  }
234  }
235  }
236  break;
237  }
238  }
239  return rc;
240 }

References freerdp_settings_get_bool(), freerdp_settings_get_int16(), freerdp_settings_get_int32(), freerdp_settings_get_int64(), freerdp_settings_get_pointer(), freerdp_settings_get_string(), freerdp_settings_get_uint16(), freerdp_settings_get_uint32(), and freerdp_settings_get_uint64().

Here is the call graph for this function:

◆ freerdp_settings_set_bool()

FREERDP_API BOOL freerdp_settings_set_bool ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Bool  id,
BOOL  param 
)

Sets a BOOL settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 648 of file settings_getters.c.

649 {
650  union
651  {
652  void* v;
653  const void* cv;
654  BOOL c;
655  const BOOL cc;
656  } cnv;
657  WINPR_ASSERT(settings);
658 
659  cnv.c = val;
660 
661  switch (id)
662  {
663  case FreeRDP_AadSecurity:
664  settings->AadSecurity = cnv.c;
665  break;
666 
667  case FreeRDP_AllowCacheWaitingList:
668  settings->AllowCacheWaitingList = cnv.c;
669  break;
670 
671  case FreeRDP_AllowDesktopComposition:
672  settings->AllowDesktopComposition = cnv.c;
673  break;
674 
675  case FreeRDP_AllowFontSmoothing:
676  settings->AllowFontSmoothing = cnv.c;
677  break;
678 
679  case FreeRDP_AllowUnanouncedOrdersFromServer:
680  settings->AllowUnanouncedOrdersFromServer = cnv.c;
681  break;
682 
683  case FreeRDP_AltSecFrameMarkerSupport:
684  settings->AltSecFrameMarkerSupport = cnv.c;
685  break;
686 
687  case FreeRDP_AsyncChannels:
688  settings->AsyncChannels = cnv.c;
689  break;
690 
691  case FreeRDP_AsyncUpdate:
692  settings->AsyncUpdate = cnv.c;
693  break;
694 
695  case FreeRDP_AudioCapture:
696  settings->AudioCapture = cnv.c;
697  break;
698 
699  case FreeRDP_AudioPlayback:
700  settings->AudioPlayback = cnv.c;
701  break;
702 
703  case FreeRDP_Authentication:
704  settings->Authentication = cnv.c;
705  break;
706 
707  case FreeRDP_AuthenticationOnly:
708  settings->AuthenticationOnly = cnv.c;
709  break;
710 
711  case FreeRDP_AutoAcceptCertificate:
712  settings->AutoAcceptCertificate = cnv.c;
713  break;
714 
715  case FreeRDP_AutoDenyCertificate:
716  settings->AutoDenyCertificate = cnv.c;
717  break;
718 
719  case FreeRDP_AutoLogonEnabled:
720  settings->AutoLogonEnabled = cnv.c;
721  break;
722 
723  case FreeRDP_AutoReconnectionEnabled:
724  settings->AutoReconnectionEnabled = cnv.c;
725  break;
726 
727  case FreeRDP_AutoReconnectionPacketSupported:
728  settings->AutoReconnectionPacketSupported = cnv.c;
729  break;
730 
731  case FreeRDP_BitmapCacheEnabled:
732  settings->BitmapCacheEnabled = cnv.c;
733  break;
734 
735  case FreeRDP_BitmapCachePersistEnabled:
736  settings->BitmapCachePersistEnabled = cnv.c;
737  break;
738 
739  case FreeRDP_BitmapCacheV3Enabled:
740  settings->BitmapCacheV3Enabled = cnv.c;
741  break;
742 
743  case FreeRDP_BitmapCompressionDisabled:
744  settings->BitmapCompressionDisabled = cnv.c;
745  break;
746 
747  case FreeRDP_CertificateCallbackPreferPEM:
748  settings->CertificateCallbackPreferPEM = cnv.c;
749  break;
750 
751  case FreeRDP_CompressionEnabled:
752  settings->CompressionEnabled = cnv.c;
753  break;
754 
755  case FreeRDP_ConnectChildSession:
756  settings->ConnectChildSession = cnv.c;
757  break;
758 
759  case FreeRDP_ConsoleSession:
760  settings->ConsoleSession = cnv.c;
761  break;
762 
763  case FreeRDP_CredentialsFromStdin:
764  settings->CredentialsFromStdin = cnv.c;
765  break;
766 
767  case FreeRDP_DeactivateClientDecoding:
768  settings->DeactivateClientDecoding = cnv.c;
769  break;
770 
771  case FreeRDP_Decorations:
772  settings->Decorations = cnv.c;
773  break;
774 
775  case FreeRDP_DesktopResize:
776  settings->DesktopResize = cnv.c;
777  break;
778 
779  case FreeRDP_DeviceRedirection:
780  settings->DeviceRedirection = cnv.c;
781  break;
782 
783  case FreeRDP_DisableCredentialsDelegation:
784  settings->DisableCredentialsDelegation = cnv.c;
785  break;
786 
787  case FreeRDP_DisableCtrlAltDel:
788  settings->DisableCtrlAltDel = cnv.c;
789  break;
790 
791  case FreeRDP_DisableCursorBlinking:
792  settings->DisableCursorBlinking = cnv.c;
793  break;
794 
795  case FreeRDP_DisableCursorShadow:
796  settings->DisableCursorShadow = cnv.c;
797  break;
798 
799  case FreeRDP_DisableFullWindowDrag:
800  settings->DisableFullWindowDrag = cnv.c;
801  break;
802 
803  case FreeRDP_DisableMenuAnims:
804  settings->DisableMenuAnims = cnv.c;
805  break;
806 
807  case FreeRDP_DisableRemoteAppCapsCheck:
808  settings->DisableRemoteAppCapsCheck = cnv.c;
809  break;
810 
811  case FreeRDP_DisableThemes:
812  settings->DisableThemes = cnv.c;
813  break;
814 
815  case FreeRDP_DisableWallpaper:
816  settings->DisableWallpaper = cnv.c;
817  break;
818 
819  case FreeRDP_DrawAllowColorSubsampling:
820  settings->DrawAllowColorSubsampling = cnv.c;
821  break;
822 
823  case FreeRDP_DrawAllowDynamicColorFidelity:
824  settings->DrawAllowDynamicColorFidelity = cnv.c;
825  break;
826 
827  case FreeRDP_DrawAllowSkipAlpha:
828  settings->DrawAllowSkipAlpha = cnv.c;
829  break;
830 
831  case FreeRDP_DrawGdiPlusCacheEnabled:
832  settings->DrawGdiPlusCacheEnabled = cnv.c;
833  break;
834 
835  case FreeRDP_DrawGdiPlusEnabled:
836  settings->DrawGdiPlusEnabled = cnv.c;
837  break;
838 
839  case FreeRDP_DrawNineGridEnabled:
840  settings->DrawNineGridEnabled = cnv.c;
841  break;
842 
843  case FreeRDP_DumpRemoteFx:
844  settings->DumpRemoteFx = cnv.c;
845  break;
846 
847  case FreeRDP_DynamicDaylightTimeDisabled:
848  settings->DynamicDaylightTimeDisabled = cnv.c;
849  break;
850 
851  case FreeRDP_DynamicResolutionUpdate:
852  settings->DynamicResolutionUpdate = cnv.c;
853  break;
854 
855  case FreeRDP_EmbeddedWindow:
856  settings->EmbeddedWindow = cnv.c;
857  break;
858 
859  case FreeRDP_EnableWindowsKey:
860  settings->EnableWindowsKey = cnv.c;
861  break;
862 
863  case FreeRDP_EncomspVirtualChannel:
864  settings->EncomspVirtualChannel = cnv.c;
865  break;
866 
867  case FreeRDP_ExtSecurity:
868  settings->ExtSecurity = cnv.c;
869  break;
870 
871  case FreeRDP_ExternalCertificateManagement:
872  settings->ExternalCertificateManagement = cnv.c;
873  break;
874 
875  case FreeRDP_FIPSMode:
876  settings->FIPSMode = cnv.c;
877  break;
878 
879  case FreeRDP_FastPathInput:
880  settings->FastPathInput = cnv.c;
881  break;
882 
883  case FreeRDP_FastPathOutput:
884  settings->FastPathOutput = cnv.c;
885  break;
886 
887  case FreeRDP_ForceEncryptedCsPdu:
888  settings->ForceEncryptedCsPdu = cnv.c;
889  break;
890 
891  case FreeRDP_ForceMultimon:
892  settings->ForceMultimon = cnv.c;
893  break;
894 
895  case FreeRDP_FrameMarkerCommandEnabled:
896  settings->FrameMarkerCommandEnabled = cnv.c;
897  break;
898 
899  case FreeRDP_Fullscreen:
900  settings->Fullscreen = cnv.c;
901  break;
902 
903  case FreeRDP_GatewayArmTransport:
904  settings->GatewayArmTransport = cnv.c;
905  break;
906 
907  case FreeRDP_GatewayBypassLocal:
908  settings->GatewayBypassLocal = cnv.c;
909  break;
910 
911  case FreeRDP_GatewayEnabled:
912  settings->GatewayEnabled = cnv.c;
913  break;
914 
915  case FreeRDP_GatewayHttpExtAuthSspiNtlm:
916  settings->GatewayHttpExtAuthSspiNtlm = cnv.c;
917  break;
918 
919  case FreeRDP_GatewayHttpTransport:
920  settings->GatewayHttpTransport = cnv.c;
921  break;
922 
923  case FreeRDP_GatewayHttpUseWebsockets:
924  settings->GatewayHttpUseWebsockets = cnv.c;
925  break;
926 
927  case FreeRDP_GatewayIgnoreRedirectionPolicy:
928  settings->GatewayIgnoreRedirectionPolicy = cnv.c;
929  break;
930 
931  case FreeRDP_GatewayRpcTransport:
932  settings->GatewayRpcTransport = cnv.c;
933  break;
934 
935  case FreeRDP_GatewayUdpTransport:
936  settings->GatewayUdpTransport = cnv.c;
937  break;
938 
939  case FreeRDP_GatewayUseSameCredentials:
940  settings->GatewayUseSameCredentials = cnv.c;
941  break;
942 
943  case FreeRDP_GfxAVC444:
944  settings->GfxAVC444 = cnv.c;
945  break;
946 
947  case FreeRDP_GfxAVC444v2:
948  settings->GfxAVC444v2 = cnv.c;
949  break;
950 
951  case FreeRDP_GfxH264:
952  settings->GfxH264 = cnv.c;
953  break;
954 
955  case FreeRDP_GfxPlanar:
956  settings->GfxPlanar = cnv.c;
957  break;
958 
959  case FreeRDP_GfxProgressive:
960  settings->GfxProgressive = cnv.c;
961  break;
962 
963  case FreeRDP_GfxProgressiveV2:
964  settings->GfxProgressiveV2 = cnv.c;
965  break;
966 
967  case FreeRDP_GfxSendQoeAck:
968  settings->GfxSendQoeAck = cnv.c;
969  break;
970 
971  case FreeRDP_GfxSmallCache:
972  settings->GfxSmallCache = cnv.c;
973  break;
974 
975  case FreeRDP_GfxSuspendFrameAck:
976  settings->GfxSuspendFrameAck = cnv.c;
977  break;
978 
979  case FreeRDP_GfxThinClient:
980  settings->GfxThinClient = cnv.c;
981  break;
982 
983  case FreeRDP_GrabKeyboard:
984  settings->GrabKeyboard = cnv.c;
985  break;
986 
987  case FreeRDP_GrabMouse:
988  settings->GrabMouse = cnv.c;
989  break;
990 
991  case FreeRDP_HasExtendedMouseEvent:
992  settings->HasExtendedMouseEvent = cnv.c;
993  break;
994 
995  case FreeRDP_HasHorizontalWheel:
996  settings->HasHorizontalWheel = cnv.c;
997  break;
998 
999  case FreeRDP_HasMonitorAttributes:
1000  settings->HasMonitorAttributes = cnv.c;
1001  break;
1002 
1003  case FreeRDP_HasQoeEvent:
1004  settings->HasQoeEvent = cnv.c;
1005  break;
1006 
1007  case FreeRDP_HasRelativeMouseEvent:
1008  settings->HasRelativeMouseEvent = cnv.c;
1009  break;
1010 
1011  case FreeRDP_HiDefRemoteApp:
1012  settings->HiDefRemoteApp = cnv.c;
1013  break;
1014 
1015  case FreeRDP_IPv6Enabled:
1016  settings->IPv6Enabled = cnv.c;
1017  break;
1018 
1019  case FreeRDP_IgnoreCertificate:
1020  settings->IgnoreCertificate = cnv.c;
1021  break;
1022 
1023  case FreeRDP_IgnoreInvalidDevices:
1024  settings->IgnoreInvalidDevices = cnv.c;
1025  break;
1026 
1027  case FreeRDP_JpegCodec:
1028  settings->JpegCodec = cnv.c;
1029  break;
1030 
1031  case FreeRDP_KerberosRdgIsProxy:
1032  settings->KerberosRdgIsProxy = cnv.c;
1033  break;
1034 
1035  case FreeRDP_ListMonitors:
1036  settings->ListMonitors = cnv.c;
1037  break;
1038 
1039  case FreeRDP_LocalConnection:
1040  settings->LocalConnection = cnv.c;
1041  break;
1042 
1043  case FreeRDP_LogonErrors:
1044  settings->LogonErrors = cnv.c;
1045  break;
1046 
1047  case FreeRDP_LogonNotify:
1048  settings->LogonNotify = cnv.c;
1049  break;
1050 
1051  case FreeRDP_LongCredentialsSupported:
1052  settings->LongCredentialsSupported = cnv.c;
1053  break;
1054 
1055  case FreeRDP_LyncRdpMode:
1056  settings->LyncRdpMode = cnv.c;
1057  break;
1058 
1059  case FreeRDP_MaximizeShell:
1060  settings->MaximizeShell = cnv.c;
1061  break;
1062 
1063  case FreeRDP_MouseAttached:
1064  settings->MouseAttached = cnv.c;
1065  break;
1066 
1067  case FreeRDP_MouseHasWheel:
1068  settings->MouseHasWheel = cnv.c;
1069  break;
1070 
1071  case FreeRDP_MouseMotion:
1072  settings->MouseMotion = cnv.c;
1073  break;
1074 
1075  case FreeRDP_MouseUseRelativeMove:
1076  settings->MouseUseRelativeMove = cnv.c;
1077  break;
1078 
1079  case FreeRDP_MstscCookieMode:
1080  settings->MstscCookieMode = cnv.c;
1081  break;
1082 
1083  case FreeRDP_MultiTouchGestures:
1084  settings->MultiTouchGestures = cnv.c;
1085  break;
1086 
1087  case FreeRDP_MultiTouchInput:
1088  settings->MultiTouchInput = cnv.c;
1089  break;
1090 
1091  case FreeRDP_NSCodec:
1092  settings->NSCodec = cnv.c;
1093  break;
1094 
1095  case FreeRDP_NSCodecAllowDynamicColorFidelity:
1096  settings->NSCodecAllowDynamicColorFidelity = cnv.c;
1097  break;
1098 
1099  case FreeRDP_NSCodecAllowSubsampling:
1100  settings->NSCodecAllowSubsampling = cnv.c;
1101  break;
1102 
1103  case FreeRDP_NegotiateSecurityLayer:
1104  settings->NegotiateSecurityLayer = cnv.c;
1105  break;
1106 
1107  case FreeRDP_NetworkAutoDetect:
1108  settings->NetworkAutoDetect = cnv.c;
1109  break;
1110 
1111  case FreeRDP_NlaSecurity:
1112  settings->NlaSecurity = cnv.c;
1113  break;
1114 
1115  case FreeRDP_NoBitmapCompressionHeader:
1116  settings->NoBitmapCompressionHeader = cnv.c;
1117  break;
1118 
1119  case FreeRDP_OldLicenseBehaviour:
1120  settings->OldLicenseBehaviour = cnv.c;
1121  break;
1122 
1123  case FreeRDP_PasswordIsSmartcardPin:
1124  settings->PasswordIsSmartcardPin = cnv.c;
1125  break;
1126 
1127  case FreeRDP_PercentScreenUseHeight:
1128  settings->PercentScreenUseHeight = cnv.c;
1129  break;
1130 
1131  case FreeRDP_PercentScreenUseWidth:
1132  settings->PercentScreenUseWidth = cnv.c;
1133  break;
1134 
1135  case FreeRDP_PlayRemoteFx:
1136  settings->PlayRemoteFx = cnv.c;
1137  break;
1138 
1139  case FreeRDP_PreferIPv6OverIPv4:
1140  settings->PreferIPv6OverIPv4 = cnv.c;
1141  break;
1142 
1143  case FreeRDP_PrintReconnectCookie:
1144  settings->PrintReconnectCookie = cnv.c;
1145  break;
1146 
1147  case FreeRDP_PromptForCredentials:
1148  settings->PromptForCredentials = cnv.c;
1149  break;
1150 
1151  case FreeRDP_RdpSecurity:
1152  settings->RdpSecurity = cnv.c;
1153  break;
1154 
1155  case FreeRDP_RdstlsSecurity:
1156  settings->RdstlsSecurity = cnv.c;
1157  break;
1158 
1159  case FreeRDP_RedirectClipboard:
1160  settings->RedirectClipboard = cnv.c;
1161  break;
1162 
1163  case FreeRDP_RedirectDrives:
1164  settings->RedirectDrives = cnv.c;
1165  break;
1166 
1167  case FreeRDP_RedirectHomeDrive:
1168  settings->RedirectHomeDrive = cnv.c;
1169  break;
1170 
1171  case FreeRDP_RedirectParallelPorts:
1172  settings->RedirectParallelPorts = cnv.c;
1173  break;
1174 
1175  case FreeRDP_RedirectPrinters:
1176  settings->RedirectPrinters = cnv.c;
1177  break;
1178 
1179  case FreeRDP_RedirectSerialPorts:
1180  settings->RedirectSerialPorts = cnv.c;
1181  break;
1182 
1183  case FreeRDP_RedirectSmartCards:
1184  settings->RedirectSmartCards = cnv.c;
1185  break;
1186 
1187  case FreeRDP_RedirectWebAuthN:
1188  settings->RedirectWebAuthN = cnv.c;
1189  break;
1190 
1191  case FreeRDP_RefreshRect:
1192  settings->RefreshRect = cnv.c;
1193  break;
1194 
1195  case FreeRDP_RemdeskVirtualChannel:
1196  settings->RemdeskVirtualChannel = cnv.c;
1197  break;
1198 
1199  case FreeRDP_RemoteAppLanguageBarSupported:
1200  settings->RemoteAppLanguageBarSupported = cnv.c;
1201  break;
1202 
1203  case FreeRDP_RemoteApplicationMode:
1204  settings->RemoteApplicationMode = cnv.c;
1205  break;
1206 
1207  case FreeRDP_RemoteAssistanceMode:
1208  settings->RemoteAssistanceMode = cnv.c;
1209  break;
1210 
1211  case FreeRDP_RemoteAssistanceRequestControl:
1212  settings->RemoteAssistanceRequestControl = cnv.c;
1213  break;
1214 
1215  case FreeRDP_RemoteConsoleAudio:
1216  settings->RemoteConsoleAudio = cnv.c;
1217  break;
1218 
1219  case FreeRDP_RemoteCredentialGuard:
1220  settings->RemoteCredentialGuard = cnv.c;
1221  break;
1222 
1223  case FreeRDP_RemoteFxCodec:
1224  settings->RemoteFxCodec = cnv.c;
1225  break;
1226 
1227  case FreeRDP_RemoteFxImageCodec:
1228  settings->RemoteFxImageCodec = cnv.c;
1229  break;
1230 
1231  case FreeRDP_RemoteFxOnly:
1232  settings->RemoteFxOnly = cnv.c;
1233  break;
1234 
1235  case FreeRDP_RestrictedAdminModeRequired:
1236  settings->RestrictedAdminModeRequired = cnv.c;
1237  break;
1238 
1239  case FreeRDP_SaltedChecksum:
1240  settings->SaltedChecksum = cnv.c;
1241  break;
1242 
1243  case FreeRDP_SendPreconnectionPdu:
1244  settings->SendPreconnectionPdu = cnv.c;
1245  break;
1246 
1247  case FreeRDP_ServerLicenseRequired:
1248  settings->ServerLicenseRequired = cnv.c;
1249  break;
1250 
1251  case FreeRDP_ServerMode:
1252  settings->ServerMode = cnv.c;
1253  break;
1254 
1255  case FreeRDP_SmartSizing:
1256  settings->SmartSizing = cnv.c;
1257  break;
1258 
1259  case FreeRDP_SmartcardEmulation:
1260  settings->SmartcardEmulation = cnv.c;
1261  break;
1262 
1263  case FreeRDP_SmartcardLogon:
1264  settings->SmartcardLogon = cnv.c;
1265  break;
1266 
1267  case FreeRDP_SoftwareGdi:
1268  settings->SoftwareGdi = cnv.c;
1269  break;
1270 
1271  case FreeRDP_SoundBeepsEnabled:
1272  settings->SoundBeepsEnabled = cnv.c;
1273  break;
1274 
1275  case FreeRDP_SpanMonitors:
1276  settings->SpanMonitors = cnv.c;
1277  break;
1278 
1279  case FreeRDP_SupportAsymetricKeys:
1280  settings->SupportAsymetricKeys = cnv.c;
1281  break;
1282 
1283  case FreeRDP_SupportDisplayControl:
1284  settings->SupportDisplayControl = cnv.c;
1285  break;
1286 
1287  case FreeRDP_SupportDynamicChannels:
1288  settings->SupportDynamicChannels = cnv.c;
1289  break;
1290 
1291  case FreeRDP_SupportDynamicTimeZone:
1292  settings->SupportDynamicTimeZone = cnv.c;
1293  break;
1294 
1295  case FreeRDP_SupportEchoChannel:
1296  settings->SupportEchoChannel = cnv.c;
1297  break;
1298 
1299  case FreeRDP_SupportEdgeActionV1:
1300  settings->SupportEdgeActionV1 = cnv.c;
1301  break;
1302 
1303  case FreeRDP_SupportEdgeActionV2:
1304  settings->SupportEdgeActionV2 = cnv.c;
1305  break;
1306 
1307  case FreeRDP_SupportErrorInfoPdu:
1308  settings->SupportErrorInfoPdu = cnv.c;
1309  break;
1310 
1311  case FreeRDP_SupportGeometryTracking:
1312  settings->SupportGeometryTracking = cnv.c;
1313  break;
1314 
1315  case FreeRDP_SupportGraphicsPipeline:
1316  settings->SupportGraphicsPipeline = cnv.c;
1317  break;
1318 
1319  case FreeRDP_SupportHeartbeatPdu:
1320  settings->SupportHeartbeatPdu = cnv.c;
1321  break;
1322 
1323  case FreeRDP_SupportMonitorLayoutPdu:
1324  settings->SupportMonitorLayoutPdu = cnv.c;
1325  break;
1326 
1327  case FreeRDP_SupportMultitransport:
1328  settings->SupportMultitransport = cnv.c;
1329  break;
1330 
1331  case FreeRDP_SupportSSHAgentChannel:
1332  settings->SupportSSHAgentChannel = cnv.c;
1333  break;
1334 
1335  case FreeRDP_SupportSkipChannelJoin:
1336  settings->SupportSkipChannelJoin = cnv.c;
1337  break;
1338 
1339  case FreeRDP_SupportStatusInfoPdu:
1340  settings->SupportStatusInfoPdu = cnv.c;
1341  break;
1342 
1343  case FreeRDP_SupportVideoOptimized:
1344  settings->SupportVideoOptimized = cnv.c;
1345  break;
1346 
1347  case FreeRDP_SuppressOutput:
1348  settings->SuppressOutput = cnv.c;
1349  break;
1350 
1351  case FreeRDP_SurfaceCommandsEnabled:
1352  settings->SurfaceCommandsEnabled = cnv.c;
1353  break;
1354 
1355  case FreeRDP_SurfaceFrameMarkerEnabled:
1356  settings->SurfaceFrameMarkerEnabled = cnv.c;
1357  break;
1358 
1359  case FreeRDP_SuspendInput:
1360  settings->SuspendInput = cnv.c;
1361  break;
1362 
1363  case FreeRDP_SynchronousDynamicChannels:
1364  settings->SynchronousDynamicChannels = cnv.c;
1365  break;
1366 
1367  case FreeRDP_SynchronousStaticChannels:
1368  settings->SynchronousStaticChannels = cnv.c;
1369  break;
1370 
1371  case FreeRDP_TcpKeepAlive:
1372  settings->TcpKeepAlive = cnv.c;
1373  break;
1374 
1375  case FreeRDP_TlsSecurity:
1376  settings->TlsSecurity = cnv.c;
1377  break;
1378 
1379  case FreeRDP_ToggleFullscreen:
1380  settings->ToggleFullscreen = cnv.c;
1381  break;
1382 
1383  case FreeRDP_TransportDump:
1384  settings->TransportDump = cnv.c;
1385  break;
1386 
1387  case FreeRDP_TransportDumpReplay:
1388  settings->TransportDumpReplay = cnv.c;
1389  break;
1390 
1391  case FreeRDP_TransportDumpReplayNodelay:
1392  settings->TransportDumpReplayNodelay = cnv.c;
1393  break;
1394 
1395  case FreeRDP_UnicodeInput:
1396  settings->UnicodeInput = cnv.c;
1397  break;
1398 
1399  case FreeRDP_UnmapButtons:
1400  settings->UnmapButtons = cnv.c;
1401  break;
1402 
1403  case FreeRDP_UseCommonStdioCallbacks:
1404  settings->UseCommonStdioCallbacks = cnv.c;
1405  break;
1406 
1407  case FreeRDP_UseMultimon:
1408  settings->UseMultimon = cnv.c;
1409  break;
1410 
1411  case FreeRDP_UseRdpSecurityLayer:
1412  settings->UseRdpSecurityLayer = cnv.c;
1413  break;
1414 
1415  case FreeRDP_UsingSavedCredentials:
1416  settings->UsingSavedCredentials = cnv.c;
1417  break;
1418 
1419  case FreeRDP_VideoDisable:
1420  settings->VideoDisable = cnv.c;
1421  break;
1422 
1423  case FreeRDP_VmConnectMode:
1424  settings->VmConnectMode = cnv.c;
1425  break;
1426 
1427  case FreeRDP_WaitForOutputBufferFlush:
1428  settings->WaitForOutputBufferFlush = cnv.c;
1429  break;
1430 
1431  case FreeRDP_Workarea:
1432  settings->Workarea = cnv.c;
1433  break;
1434 
1435  default:
1436  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
1439  return FALSE;
1440  }
1441  return TRUE;
1442 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_int16()

FREERDP_API BOOL freerdp_settings_set_int16 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Int16  id,
INT16  param 
)

Sets a INT16 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 1589 of file settings_getters.c.

1590 {
1591  union
1592  {
1593  void* v;
1594  const void* cv;
1595  INT16 c;
1596  const INT16 cc;
1597  } cnv;
1598  WINPR_ASSERT(settings);
1599 
1600  cnv.c = val;
1601 
1602  switch (id)
1603  {
1604  default:
1605  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
1608  return FALSE;
1609  }
1610  return TRUE;
1611 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_int32()

FREERDP_API BOOL freerdp_settings_set_int32 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Int32  id,
INT32  param 
)

Sets a INT32 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 2555 of file settings_getters.c.

2556 {
2557  union
2558  {
2559  void* v;
2560  const void* cv;
2561  INT32 c;
2562  const INT32 cc;
2563  } cnv;
2564  WINPR_ASSERT(settings);
2565 
2566  cnv.c = val;
2567 
2568  switch (id)
2569  {
2570  case FreeRDP_XPan:
2571  settings->XPan = cnv.c;
2572  break;
2573 
2574  case FreeRDP_YPan:
2575  settings->YPan = cnv.c;
2576  break;
2577 
2578  default:
2579  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2582  return FALSE;
2583  }
2584  return TRUE;
2585 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_int64()

FREERDP_API BOOL freerdp_settings_set_int64 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Int64  id,
INT64  param 
)

Sets a INT64 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 2648 of file settings_getters.c.

2649 {
2650  union
2651  {
2652  void* v;
2653  const void* cv;
2654  INT64 c;
2655  const INT64 cc;
2656  } cnv;
2657  WINPR_ASSERT(settings);
2658 
2659  cnv.c = val;
2660 
2661  switch (id)
2662  {
2663  default:
2664  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2667  return FALSE;
2668  }
2669  return TRUE;
2670 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_pointer()

FREERDP_API BOOL freerdp_settings_set_pointer ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Pointer  id,
const void *  data 
)

Set a pointer to value data.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to update
dataThe data to set (direct update, no copy created, previous value overwritten)
Returns
TRUE for success, FALSE for failure

Definition at line 4057 of file settings_getters.c.

4059 {
4060  union
4061  {
4062  void* v;
4063  const void* cv;
4064  } cnv;
4065  WINPR_ASSERT(settings);
4066 
4067  cnv.cv = val;
4068 
4069  switch (id)
4070  {
4071  case FreeRDP_BitmapCacheV2CellInfo:
4072  settings->BitmapCacheV2CellInfo = cnv.v;
4073  break;
4074 
4075  case FreeRDP_ChannelDefArray:
4076  settings->ChannelDefArray = cnv.v;
4077  break;
4078 
4079  case FreeRDP_ClientAutoReconnectCookie:
4080  settings->ClientAutoReconnectCookie = cnv.v;
4081  break;
4082 
4083  case FreeRDP_ClientRandom:
4084  settings->ClientRandom = cnv.v;
4085  break;
4086 
4087  case FreeRDP_ClientTimeZone:
4088  settings->ClientTimeZone = cnv.v;
4089  break;
4090 
4091  case FreeRDP_DeviceArray:
4092  settings->DeviceArray = cnv.v;
4093  break;
4094 
4095  case FreeRDP_DynamicChannelArray:
4096  settings->DynamicChannelArray = cnv.v;
4097  break;
4098 
4099  case FreeRDP_FragCache:
4100  settings->FragCache = cnv.v;
4101  break;
4102 
4103  case FreeRDP_GlyphCache:
4104  settings->GlyphCache = cnv.v;
4105  break;
4106 
4107  case FreeRDP_LoadBalanceInfo:
4108  settings->LoadBalanceInfo = cnv.v;
4109  break;
4110 
4111  case FreeRDP_MonitorDefArray:
4112  settings->MonitorDefArray = cnv.v;
4113  break;
4114 
4115  case FreeRDP_MonitorIds:
4116  settings->MonitorIds = cnv.v;
4117  break;
4118 
4119  case FreeRDP_OrderSupport:
4120  settings->OrderSupport = cnv.v;
4121  break;
4122 
4123  case FreeRDP_Password51:
4124  settings->Password51 = cnv.v;
4125  break;
4126 
4127  case FreeRDP_RdpServerCertificate:
4128  settings->RdpServerCertificate = cnv.v;
4129  break;
4130 
4131  case FreeRDP_RdpServerRsaKey:
4132  settings->RdpServerRsaKey = cnv.v;
4133  break;
4134 
4135  case FreeRDP_ReceivedCapabilities:
4136  settings->ReceivedCapabilities = cnv.v;
4137  break;
4138 
4139  case FreeRDP_ReceivedCapabilityData:
4140  settings->ReceivedCapabilityData = cnv.v;
4141  break;
4142 
4143  case FreeRDP_ReceivedCapabilityDataSizes:
4144  settings->ReceivedCapabilityDataSizes = cnv.v;
4145  break;
4146 
4147  case FreeRDP_RedirectionGuid:
4148  settings->RedirectionGuid = cnv.v;
4149  break;
4150 
4151  case FreeRDP_RedirectionPassword:
4152  settings->RedirectionPassword = cnv.v;
4153  break;
4154 
4155  case FreeRDP_RedirectionTargetCertificate:
4156  settings->RedirectionTargetCertificate = cnv.v;
4157  break;
4158 
4159  case FreeRDP_RedirectionTsvUrl:
4160  settings->RedirectionTsvUrl = cnv.v;
4161  break;
4162 
4163  case FreeRDP_ServerAutoReconnectCookie:
4164  settings->ServerAutoReconnectCookie = cnv.v;
4165  break;
4166 
4167  case FreeRDP_ServerCertificate:
4168  settings->ServerCertificate = cnv.v;
4169  break;
4170 
4171  case FreeRDP_ServerLicenseProductIssuers:
4172  settings->ServerLicenseProductIssuers = cnv.v;
4173  break;
4174 
4175  case FreeRDP_ServerRandom:
4176  settings->ServerRandom = cnv.v;
4177  break;
4178 
4179  case FreeRDP_StaticChannelArray:
4180  settings->StaticChannelArray = cnv.v;
4181  break;
4182 
4183  case FreeRDP_TargetNetAddresses:
4184  settings->TargetNetAddresses = cnv.v;
4185  break;
4186 
4187  case FreeRDP_TargetNetPorts:
4188  settings->TargetNetPorts = cnv.v;
4189  break;
4190 
4191  case FreeRDP_instance:
4192  settings->instance = cnv.v;
4193  break;
4194 
4195  default:
4196  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
4199  return FALSE;
4200  }
4201  return TRUE;
4202 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_pointer_len()

FREERDP_API BOOL freerdp_settings_set_pointer_len ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Pointer  id,
const void *  data,
size_t  len 
)

Set a pointer to value data.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to update
dataThe data to set (copy created, previous value freed)
Returns
TRUE for success, FALSE for failure

Definition at line 1301 of file common/settings.c.

1303 {
1304  union
1305  {
1306  const void* cv;
1307  void* v;
1308  } cnv;
1309 
1310  cnv.cv = data;
1311  if (!settings)
1312  return FALSE;
1313 
1314  switch (id)
1315  {
1316  case FreeRDP_RdpServerCertificate:
1317  freerdp_certificate_free(settings->RdpServerCertificate);
1318 
1319  if (len > 1)
1320  {
1321  WLog_ERR(TAG, "FreeRDP_RdpServerCertificate::len must be 0 or 1");
1322  return FALSE;
1323  }
1324  settings->RdpServerCertificate = cnv.v;
1325  if (!settings->RdpServerCertificate && (len > 0))
1326  {
1327  settings->RdpServerCertificate = freerdp_certificate_new();
1328  if (!settings->RdpServerCertificate)
1329  return FALSE;
1330  }
1331  return TRUE;
1332  case FreeRDP_RdpServerRsaKey:
1333  freerdp_key_free(settings->RdpServerRsaKey);
1334  if (len > 1)
1335  {
1336  WLog_ERR(TAG, "FreeRDP_RdpServerRsaKey::len must be 0 or 1");
1337  return FALSE;
1338  }
1339  settings->RdpServerRsaKey = (rdpPrivateKey*)cnv.v;
1340  if (!settings->RdpServerRsaKey && (len > 0))
1341  {
1342  settings->RdpServerRsaKey = freerdp_key_new();
1343  if (!settings->RdpServerRsaKey)
1344  return FALSE;
1345  }
1346  return TRUE;
1347  case FreeRDP_RedirectionPassword:
1348  return freerdp_settings_set_pointer_len_(
1349  settings, id, FreeRDP_RedirectionPasswordLength, data, len, sizeof(char));
1350  case FreeRDP_RedirectionTsvUrl:
1351  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_RedirectionTsvUrlLength,
1352  data, len, sizeof(char));
1353  case FreeRDP_RedirectionTargetCertificate:
1354  freerdp_certificate_free(settings->RedirectionTargetCertificate);
1355 
1356  if (len > 1)
1357  {
1358  WLog_ERR(TAG, "FreeRDP_RedirectionTargetCertificate::len must be 0 or 1");
1359  return FALSE;
1360  }
1361  settings->RedirectionTargetCertificate = cnv.v;
1362  if (!settings->RedirectionTargetCertificate && (len > 0))
1363  {
1364  settings->RedirectionTargetCertificate = freerdp_certificate_new();
1365  if (!settings->RedirectionTargetCertificate)
1366  return FALSE;
1367  }
1368  return TRUE;
1369  case FreeRDP_RedirectionGuid:
1370  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_RedirectionGuidLength,
1371  data, len, sizeof(BYTE));
1372  case FreeRDP_LoadBalanceInfo:
1373  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_LoadBalanceInfoLength,
1374  data, len, sizeof(char));
1375  case FreeRDP_ServerRandom:
1376  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_ServerRandomLength, data,
1377  len, sizeof(char));
1378  case FreeRDP_ClientRandom:
1379  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_ClientRandomLength, data,
1380  len, sizeof(char));
1381  case FreeRDP_ServerCertificate:
1382  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_ServerCertificateLength,
1383  data, len, sizeof(char));
1384  case FreeRDP_TargetNetAddresses:
1385  if ((data == NULL) && (len == 0))
1386  {
1387  freerdp_target_net_addresses_free(settings);
1388  return TRUE;
1389  }
1390  WLog_WARN(
1391  TAG,
1392  "[BUG] FreeRDP_TargetNetAddresses must not be resized from outside the library!");
1393  return FALSE;
1394  case FreeRDP_ServerLicenseProductIssuers:
1395  if (data == NULL)
1396  freerdp_server_license_issuers_free(settings);
1397  return freerdp_settings_set_pointer_len_(settings, FreeRDP_ServerLicenseProductIssuers,
1398  FreeRDP_ServerLicenseProductIssuersCount, data,
1399  len, sizeof(char*));
1400  case FreeRDP_TargetNetPorts:
1401  if ((data == NULL) && (len == 0))
1402  {
1403  freerdp_target_net_addresses_free(settings);
1404  return TRUE;
1405  }
1406  WLog_WARN(TAG,
1407  "[BUG] FreeRDP_TargetNetPorts must not be resized from outside the library!");
1408  return FALSE;
1409  case FreeRDP_DeviceArray:
1410  if (data == NULL)
1411  freerdp_device_collection_free(settings);
1412  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_DeviceArraySize, data,
1413  len, sizeof(ADDIN_ARGV*));
1414  case FreeRDP_ChannelDefArray:
1415  if ((len > 0) && (len < CHANNEL_MAX_COUNT))
1416  WLog_WARN(TAG,
1417  "FreeRDP_ChannelDefArray::len expected to be >= %" PRIu32
1418  ", but have %" PRIu32,
1419  CHANNEL_MAX_COUNT, len);
1420  return freerdp_settings_set_pointer_len_(settings, FreeRDP_ChannelDefArray,
1421  FreeRDP_ChannelDefArraySize, data, len,
1422  sizeof(CHANNEL_DEF));
1423  case FreeRDP_MonitorDefArray:
1424  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_MonitorDefArraySize,
1425  data, len, sizeof(rdpMonitor));
1426  case FreeRDP_ClientAutoReconnectCookie:
1427  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len,
1428  sizeof(ARC_CS_PRIVATE_PACKET));
1429  case FreeRDP_ServerAutoReconnectCookie:
1430  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len,
1431  sizeof(ARC_SC_PRIVATE_PACKET));
1432  case FreeRDP_ClientTimeZone:
1433  if (len > 1)
1434  {
1435  WLog_ERR(TAG, "FreeRDP_ClientTimeZone::len must be 0 or 1");
1436  return FALSE;
1437  }
1438  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len,
1439  sizeof(TIME_ZONE_INFORMATION));
1440  case FreeRDP_BitmapCacheV2CellInfo:
1441  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_BitmapCacheV2NumCells,
1442  data, len, sizeof(BITMAP_CACHE_V2_CELL_INFO));
1443  case FreeRDP_GlyphCache:
1444  if ((len != 0) && (len != 10))
1445  {
1446  WLog_ERR(TAG, "FreeRDP_GlyphCache::len must be 0 or 10");
1447  return FALSE;
1448  }
1449  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len,
1450  sizeof(GLYPH_CACHE_DEFINITION));
1451  case FreeRDP_FragCache:
1452  if (len > 1)
1453  {
1454  WLog_ERR(TAG, "FreeRDP_FragCache::len must be 0 or 1");
1455  return FALSE;
1456  }
1457  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len,
1458  sizeof(GLYPH_CACHE_DEFINITION));
1459  case FreeRDP_StaticChannelArray:
1460  if (data == NULL)
1461  freerdp_static_channel_collection_free(settings);
1462  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_StaticChannelArraySize,
1463  data, len, sizeof(ADDIN_ARGV*));
1464  case FreeRDP_DynamicChannelArray:
1465  if (data == NULL)
1466  freerdp_dynamic_channel_collection_free(settings);
1467  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_DynamicChannelArraySize,
1468  data, len, sizeof(ADDIN_ARGV*));
1469  case FreeRDP_ReceivedCapabilityData:
1470  if (data == NULL)
1471  freerdp_capability_buffer_free(settings);
1472  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_ReceivedCapabilitiesSize,
1473  data, len, sizeof(BYTE*));
1474  case FreeRDP_ReceivedCapabilities:
1475  if (data == NULL)
1476  freerdp_capability_buffer_free(settings);
1477  return freerdp_settings_set_pointer_len_(settings, id, FreeRDP_ReceivedCapabilitiesSize,
1478  data, len, sizeof(char));
1479  case FreeRDP_OrderSupport:
1480  return freerdp_settings_set_pointer_len_(settings, id, -1, data, len, sizeof(char));
1481 
1482  case FreeRDP_MonitorIds:
1483  return freerdp_settings_set_pointer_len_(
1484  settings, FreeRDP_MonitorIds, FreeRDP_NumMonitorIds, data, len, sizeof(UINT32));
1485 
1486  default:
1487  if ((data == NULL) && (len == 0))
1488  {
1489  freerdp_settings_set_pointer(settings, id, NULL);
1490  }
1491  else
1492  WLog_WARN(TAG, "Invalid id %" PRIuz, id);
1493  return FALSE;
1494  }
1495 }

◆ freerdp_settings_set_string()

FREERDP_API BOOL freerdp_settings_set_string ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const char *  param 
)

Sets a string settings value. The param is copied.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set. If NULL removes the old entry, otherwise a copy is created.
Returns
TRUE for success, FALSE for failure

Definition at line 3616 of file settings_getters.c.

3618 {
3619  size_t len = 0;
3620  if (val)
3621  len = strlen(val);
3622  return freerdp_settings_set_string_copy_(settings, id, val, len, TRUE);
3623 }

Referenced by freerdp_settings_copy_item().

Here is the caller graph for this function:

◆ freerdp_settings_set_string_from_utf16()

FREERDP_API BOOL freerdp_settings_set_string_from_utf16 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const WCHAR *  param 
)

Sets a string settings value. The param is converted to UTF-8 and the copy stored.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set. If NULL removes the old entry, otherwise a copy is created.
Returns
TRUE for success, FALSE for failure

Definition at line 2050 of file common/settings.c.

2052 {
2053  WINPR_ASSERT(settings);
2054 
2055  if (!param)
2056  return freerdp_settings_set_string_copy_(settings, id, NULL, 0, TRUE);
2057 
2058  size_t len = 0;
2059 
2060  char* str = ConvertWCharToUtf8Alloc(param, &len);
2061  if (!str && (len != 0))
2062  return FALSE;
2063 
2064  return freerdp_settings_set_string_(settings, id, str, len);
2065 }

◆ freerdp_settings_set_string_from_utf16N()

FREERDP_API BOOL freerdp_settings_set_string_from_utf16N ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const WCHAR *  param,
size_t  length 
)

Sets a string settings value. The param is converted to UTF-8 and the copy stored.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set. If NULL removes the old entry, otherwise a copy is created.
lengthThe length of the WCHAR string in number of WCHAR characters
Returns
TRUE for success, FALSE for failure

Definition at line 2067 of file common/settings.c.

2069 {
2070  size_t len = 0;
2071 
2072  WINPR_ASSERT(settings);
2073 
2074  if (!param)
2075  return freerdp_settings_set_string_copy_(settings, id, NULL, length, TRUE);
2076 
2077  char* str = ConvertWCharNToUtf8Alloc(param, length, &len);
2078  if (!str && (length != 0))
2079  {
2080  /* If the input string is an empty string, but length > 0
2081  * consider the conversion a success */
2082  const size_t wlen = _wcsnlen(param, length);
2083  if (wlen != 0)
2084  return FALSE;
2085  }
2086 
2087  return freerdp_settings_set_string_(settings, id, str, len);
2088 }

◆ freerdp_settings_set_string_len()

FREERDP_API BOOL freerdp_settings_set_string_len ( rdpSettings *  settings,
FreeRDP_Settings_Keys_String  id,
const char *  param,
size_t  len 
)

Sets a string settings value. The param is copied.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set. If NULL allocates an empty string buffer of len size, otherwise a copy is created.
lenThe length of param, 0 to remove the old entry.
Returns
TRUE for success, FALSE for failure

Definition at line 3610 of file settings_getters.c.

3612 {
3613  return freerdp_settings_set_string_copy_(settings, id, val, len, TRUE);
3614 }

Referenced by freerdp_settings_append_string().

Here is the caller graph for this function:

◆ freerdp_settings_set_uint16()

FREERDP_API BOOL freerdp_settings_set_uint16 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt16  id,
UINT16  param 
)

Sets a UINT16 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 1498 of file settings_getters.c.

1499 {
1500  union
1501  {
1502  void* v;
1503  const void* cv;
1504  UINT16 c;
1505  const UINT16 cc;
1506  } cnv;
1507  WINPR_ASSERT(settings);
1508 
1509  cnv.c = val;
1510 
1511  switch (id)
1512  {
1513  case FreeRDP_CapsGeneralCompressionLevel:
1514  settings->CapsGeneralCompressionLevel = cnv.c;
1515  break;
1516 
1517  case FreeRDP_CapsGeneralCompressionTypes:
1518  settings->CapsGeneralCompressionTypes = cnv.c;
1519  break;
1520 
1521  case FreeRDP_CapsProtocolVersion:
1522  settings->CapsProtocolVersion = cnv.c;
1523  break;
1524 
1525  case FreeRDP_CapsRemoteUnshareFlag:
1526  settings->CapsRemoteUnshareFlag = cnv.c;
1527  break;
1528 
1529  case FreeRDP_CapsUpdateCapabilityFlag:
1530  settings->CapsUpdateCapabilityFlag = cnv.c;
1531  break;
1532 
1533  case FreeRDP_DesktopOrientation:
1534  settings->DesktopOrientation = cnv.c;
1535  break;
1536 
1537  case FreeRDP_OrderSupportFlags:
1538  settings->OrderSupportFlags = cnv.c;
1539  break;
1540 
1541  case FreeRDP_OrderSupportFlagsEx:
1542  settings->OrderSupportFlagsEx = cnv.c;
1543  break;
1544 
1545  case FreeRDP_ProxyPort:
1546  settings->ProxyPort = cnv.c;
1547  break;
1548 
1549  case FreeRDP_SupportedColorDepths:
1550  settings->SupportedColorDepths = cnv.c;
1551  break;
1552 
1553  case FreeRDP_TLSMaxVersion:
1554  settings->TLSMaxVersion = cnv.c;
1555  break;
1556 
1557  case FreeRDP_TLSMinVersion:
1558  settings->TLSMinVersion = cnv.c;
1559  break;
1560 
1561  case FreeRDP_TextANSICodePage:
1562  settings->TextANSICodePage = cnv.c;
1563  break;
1564 
1565  default:
1566  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
1569  return FALSE;
1570  }
1571  return TRUE;
1572 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_uint32()

FREERDP_API BOOL freerdp_settings_set_uint32 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt32  id,
UINT32  param 
)

Sets a UINT32 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 2006 of file settings_getters.c.

2007 {
2008  union
2009  {
2010  void* v;
2011  const void* cv;
2012  UINT32 c;
2013  const UINT32 cc;
2014  } cnv;
2015  WINPR_ASSERT(settings);
2016 
2017  cnv.c = val;
2018 
2019  switch (id)
2020  {
2021  case FreeRDP_AcceptedCertLength:
2022  settings->AcceptedCertLength = cnv.c;
2023  break;
2024 
2025  case FreeRDP_AuthenticationLevel:
2026  settings->AuthenticationLevel = cnv.c;
2027  break;
2028 
2029  case FreeRDP_AutoReconnectMaxRetries:
2030  settings->AutoReconnectMaxRetries = cnv.c;
2031  break;
2032 
2033  case FreeRDP_BitmapCacheV2NumCells:
2034  settings->BitmapCacheV2NumCells = cnv.c;
2035  break;
2036 
2037  case FreeRDP_BitmapCacheV3CodecId:
2038  settings->BitmapCacheV3CodecId = cnv.c;
2039  break;
2040 
2041  case FreeRDP_BitmapCacheVersion:
2042  settings->BitmapCacheVersion = cnv.c;
2043  break;
2044 
2045  case FreeRDP_BrushSupportLevel:
2046  settings->BrushSupportLevel = cnv.c;
2047  break;
2048 
2049  case FreeRDP_ChannelCount:
2050  settings->ChannelCount = cnv.c;
2051  break;
2052 
2053  case FreeRDP_ChannelDefArraySize:
2054  settings->ChannelDefArraySize = cnv.c;
2055  break;
2056 
2057  case FreeRDP_ClientBuild:
2058  settings->ClientBuild = cnv.c;
2059  break;
2060 
2061  case FreeRDP_ClientRandomLength:
2062  settings->ClientRandomLength = cnv.c;
2063  break;
2064 
2065  case FreeRDP_ClientSessionId:
2066  settings->ClientSessionId = cnv.c;
2067  break;
2068 
2069  case FreeRDP_ClipboardFeatureMask:
2070  settings->ClipboardFeatureMask = cnv.c;
2071  break;
2072 
2073  case FreeRDP_ClusterInfoFlags:
2074  settings->ClusterInfoFlags = cnv.c;
2075  break;
2076 
2077  case FreeRDP_ColorDepth:
2078  settings->ColorDepth = cnv.c;
2079  break;
2080 
2081  case FreeRDP_ColorPointerCacheSize:
2082  settings->ColorPointerCacheSize = cnv.c;
2083  break;
2084 
2085  case FreeRDP_CompDeskSupportLevel:
2086  settings->CompDeskSupportLevel = cnv.c;
2087  break;
2088 
2089  case FreeRDP_CompressionLevel:
2090  settings->CompressionLevel = cnv.c;
2091  break;
2092 
2093  case FreeRDP_ConnectionType:
2094  settings->ConnectionType = cnv.c;
2095  break;
2096 
2097  case FreeRDP_CookieMaxLength:
2098  settings->CookieMaxLength = cnv.c;
2099  break;
2100 
2101  case FreeRDP_DesktopHeight:
2102  settings->DesktopHeight = cnv.c;
2103  break;
2104 
2105  case FreeRDP_DesktopPhysicalHeight:
2106  settings->DesktopPhysicalHeight = cnv.c;
2107  break;
2108 
2109  case FreeRDP_DesktopPhysicalWidth:
2110  settings->DesktopPhysicalWidth = cnv.c;
2111  break;
2112 
2113  case FreeRDP_DesktopPosX:
2114  settings->DesktopPosX = cnv.c;
2115  break;
2116 
2117  case FreeRDP_DesktopPosY:
2118  settings->DesktopPosY = cnv.c;
2119  break;
2120 
2121  case FreeRDP_DesktopScaleFactor:
2122  settings->DesktopScaleFactor = cnv.c;
2123  break;
2124 
2125  case FreeRDP_DesktopWidth:
2126  settings->DesktopWidth = cnv.c;
2127  break;
2128 
2129  case FreeRDP_DeviceArraySize:
2130  settings->DeviceArraySize = cnv.c;
2131  break;
2132 
2133  case FreeRDP_DeviceCount:
2134  settings->DeviceCount = cnv.c;
2135  break;
2136 
2137  case FreeRDP_DeviceScaleFactor:
2138  settings->DeviceScaleFactor = cnv.c;
2139  break;
2140 
2141  case FreeRDP_DrawNineGridCacheEntries:
2142  settings->DrawNineGridCacheEntries = cnv.c;
2143  break;
2144 
2145  case FreeRDP_DrawNineGridCacheSize:
2146  settings->DrawNineGridCacheSize = cnv.c;
2147  break;
2148 
2149  case FreeRDP_DynamicChannelArraySize:
2150  settings->DynamicChannelArraySize = cnv.c;
2151  break;
2152 
2153  case FreeRDP_DynamicChannelCount:
2154  settings->DynamicChannelCount = cnv.c;
2155  break;
2156 
2157  case FreeRDP_EarlyCapabilityFlags:
2158  settings->EarlyCapabilityFlags = cnv.c;
2159  break;
2160 
2161  case FreeRDP_EncryptionLevel:
2162  settings->EncryptionLevel = cnv.c;
2163  break;
2164 
2165  case FreeRDP_EncryptionMethods:
2166  settings->EncryptionMethods = cnv.c;
2167  break;
2168 
2169  case FreeRDP_ExtEncryptionMethods:
2170  settings->ExtEncryptionMethods = cnv.c;
2171  break;
2172 
2173  case FreeRDP_FakeMouseMotionInterval:
2174  settings->FakeMouseMotionInterval = cnv.c;
2175  break;
2176 
2177  case FreeRDP_Floatbar:
2178  settings->Floatbar = cnv.c;
2179  break;
2180 
2181  case FreeRDP_ForceIPvX:
2182  settings->ForceIPvX = cnv.c;
2183  break;
2184 
2185  case FreeRDP_FrameAcknowledge:
2186  settings->FrameAcknowledge = cnv.c;
2187  break;
2188 
2189  case FreeRDP_GatewayAcceptedCertLength:
2190  settings->GatewayAcceptedCertLength = cnv.c;
2191  break;
2192 
2193  case FreeRDP_GatewayCredentialsSource:
2194  settings->GatewayCredentialsSource = cnv.c;
2195  break;
2196 
2197  case FreeRDP_GatewayPort:
2198  settings->GatewayPort = cnv.c;
2199  break;
2200 
2201  case FreeRDP_GatewayUsageMethod:
2202  settings->GatewayUsageMethod = cnv.c;
2203  break;
2204 
2205  case FreeRDP_GfxCapsFilter:
2206  settings->GfxCapsFilter = cnv.c;
2207  break;
2208 
2209  case FreeRDP_GlyphSupportLevel:
2210  settings->GlyphSupportLevel = cnv.c;
2211  break;
2212 
2213  case FreeRDP_JpegCodecId:
2214  settings->JpegCodecId = cnv.c;
2215  break;
2216 
2217  case FreeRDP_JpegQuality:
2218  settings->JpegQuality = cnv.c;
2219  break;
2220 
2221  case FreeRDP_KeySpec:
2222  settings->KeySpec = cnv.c;
2223  break;
2224 
2225  case FreeRDP_KeyboardCodePage:
2226  settings->KeyboardCodePage = cnv.c;
2227  break;
2228 
2229  case FreeRDP_KeyboardFunctionKey:
2230  settings->KeyboardFunctionKey = cnv.c;
2231  break;
2232 
2233  case FreeRDP_KeyboardHook:
2234  settings->KeyboardHook = cnv.c;
2235  break;
2236 
2237  case FreeRDP_KeyboardLayout:
2238  settings->KeyboardLayout = cnv.c;
2239  break;
2240 
2241  case FreeRDP_KeyboardSubType:
2242  settings->KeyboardSubType = cnv.c;
2243  break;
2244 
2245  case FreeRDP_KeyboardType:
2246  settings->KeyboardType = cnv.c;
2247  break;
2248 
2249  case FreeRDP_LargePointerFlag:
2250  settings->LargePointerFlag = cnv.c;
2251  break;
2252 
2253  case FreeRDP_LoadBalanceInfoLength:
2254  settings->LoadBalanceInfoLength = cnv.c;
2255  break;
2256 
2257  case FreeRDP_MonitorAttributeFlags:
2258  settings->MonitorAttributeFlags = cnv.c;
2259  break;
2260 
2261  case FreeRDP_MonitorCount:
2262  settings->MonitorCount = cnv.c;
2263  break;
2264 
2265  case FreeRDP_MonitorDefArraySize:
2266  settings->MonitorDefArraySize = cnv.c;
2267  break;
2268 
2269  case FreeRDP_MonitorFlags:
2270  settings->MonitorFlags = cnv.c;
2271  break;
2272 
2273  case FreeRDP_MonitorLocalShiftX:
2274  settings->MonitorLocalShiftX = cnv.c;
2275  break;
2276 
2277  case FreeRDP_MonitorLocalShiftY:
2278  settings->MonitorLocalShiftY = cnv.c;
2279  break;
2280 
2281  case FreeRDP_MultifragMaxRequestSize:
2282  settings->MultifragMaxRequestSize = cnv.c;
2283  break;
2284 
2285  case FreeRDP_MultitransportFlags:
2286  settings->MultitransportFlags = cnv.c;
2287  break;
2288 
2289  case FreeRDP_NSCodecColorLossLevel:
2290  settings->NSCodecColorLossLevel = cnv.c;
2291  break;
2292 
2293  case FreeRDP_NSCodecId:
2294  settings->NSCodecId = cnv.c;
2295  break;
2296 
2297  case FreeRDP_NegotiationFlags:
2298  settings->NegotiationFlags = cnv.c;
2299  break;
2300 
2301  case FreeRDP_NumMonitorIds:
2302  settings->NumMonitorIds = cnv.c;
2303  break;
2304 
2305  case FreeRDP_OffscreenCacheEntries:
2306  settings->OffscreenCacheEntries = cnv.c;
2307  break;
2308 
2309  case FreeRDP_OffscreenCacheSize:
2310  settings->OffscreenCacheSize = cnv.c;
2311  break;
2312 
2313  case FreeRDP_OffscreenSupportLevel:
2314  settings->OffscreenSupportLevel = cnv.c;
2315  break;
2316 
2317  case FreeRDP_OsMajorType:
2318  settings->OsMajorType = cnv.c;
2319  break;
2320 
2321  case FreeRDP_OsMinorType:
2322  settings->OsMinorType = cnv.c;
2323  break;
2324 
2325  case FreeRDP_Password51Length:
2326  settings->Password51Length = cnv.c;
2327  break;
2328 
2329  case FreeRDP_PduSource:
2330  settings->PduSource = cnv.c;
2331  break;
2332 
2333  case FreeRDP_PercentScreen:
2334  settings->PercentScreen = cnv.c;
2335  break;
2336 
2337  case FreeRDP_PerformanceFlags:
2338  settings->PerformanceFlags = cnv.c;
2339  break;
2340 
2341  case FreeRDP_PointerCacheSize:
2342  settings->PointerCacheSize = cnv.c;
2343  break;
2344 
2345  case FreeRDP_PreconnectionId:
2346  settings->PreconnectionId = cnv.c;
2347  break;
2348 
2349  case FreeRDP_ProxyType:
2350  settings->ProxyType = cnv.c;
2351  break;
2352 
2353  case FreeRDP_RdpVersion:
2354  settings->RdpVersion = cnv.c;
2355  break;
2356 
2357  case FreeRDP_ReceivedCapabilitiesSize:
2358  settings->ReceivedCapabilitiesSize = cnv.c;
2359  break;
2360 
2361  case FreeRDP_RedirectedSessionId:
2362  settings->RedirectedSessionId = cnv.c;
2363  break;
2364 
2365  case FreeRDP_RedirectionAcceptedCertLength:
2366  settings->RedirectionAcceptedCertLength = cnv.c;
2367  break;
2368 
2369  case FreeRDP_RedirectionFlags:
2370  settings->RedirectionFlags = cnv.c;
2371  break;
2372 
2373  case FreeRDP_RedirectionGuidLength:
2374  settings->RedirectionGuidLength = cnv.c;
2375  break;
2376 
2377  case FreeRDP_RedirectionPasswordLength:
2378  settings->RedirectionPasswordLength = cnv.c;
2379  break;
2380 
2381  case FreeRDP_RedirectionPreferType:
2382  settings->RedirectionPreferType = cnv.c;
2383  break;
2384 
2385  case FreeRDP_RedirectionTsvUrlLength:
2386  settings->RedirectionTsvUrlLength = cnv.c;
2387  break;
2388 
2389  case FreeRDP_RemoteAppNumIconCacheEntries:
2390  settings->RemoteAppNumIconCacheEntries = cnv.c;
2391  break;
2392 
2393  case FreeRDP_RemoteAppNumIconCaches:
2394  settings->RemoteAppNumIconCaches = cnv.c;
2395  break;
2396 
2397  case FreeRDP_RemoteApplicationExpandCmdLine:
2398  settings->RemoteApplicationExpandCmdLine = cnv.c;
2399  break;
2400 
2401  case FreeRDP_RemoteApplicationExpandWorkingDir:
2402  settings->RemoteApplicationExpandWorkingDir = cnv.c;
2403  break;
2404 
2405  case FreeRDP_RemoteApplicationSupportLevel:
2406  settings->RemoteApplicationSupportLevel = cnv.c;
2407  break;
2408 
2409  case FreeRDP_RemoteApplicationSupportMask:
2410  settings->RemoteApplicationSupportMask = cnv.c;
2411  break;
2412 
2413  case FreeRDP_RemoteFxCaptureFlags:
2414  settings->RemoteFxCaptureFlags = cnv.c;
2415  break;
2416 
2417  case FreeRDP_RemoteFxCodecId:
2418  settings->RemoteFxCodecId = cnv.c;
2419  break;
2420 
2421  case FreeRDP_RemoteFxCodecMode:
2422  settings->RemoteFxCodecMode = cnv.c;
2423  break;
2424 
2425  case FreeRDP_RemoteFxRlgrMode:
2426  settings->RemoteFxRlgrMode = cnv.c;
2427  break;
2428 
2429  case FreeRDP_RemoteWndSupportLevel:
2430  settings->RemoteWndSupportLevel = cnv.c;
2431  break;
2432 
2433  case FreeRDP_RequestedProtocols:
2434  settings->RequestedProtocols = cnv.c;
2435  break;
2436 
2437  case FreeRDP_SelectedProtocol:
2438  settings->SelectedProtocol = cnv.c;
2439  break;
2440 
2441  case FreeRDP_ServerCertificateLength:
2442  settings->ServerCertificateLength = cnv.c;
2443  break;
2444 
2445  case FreeRDP_ServerLicenseProductIssuersCount:
2446  settings->ServerLicenseProductIssuersCount = cnv.c;
2447  break;
2448 
2449  case FreeRDP_ServerLicenseProductVersion:
2450  settings->ServerLicenseProductVersion = cnv.c;
2451  break;
2452 
2453  case FreeRDP_ServerPort:
2454  settings->ServerPort = cnv.c;
2455  break;
2456 
2457  case FreeRDP_ServerRandomLength:
2458  settings->ServerRandomLength = cnv.c;
2459  break;
2460 
2461  case FreeRDP_ShareId:
2462  settings->ShareId = cnv.c;
2463  break;
2464 
2465  case FreeRDP_SmartSizingHeight:
2466  settings->SmartSizingHeight = cnv.c;
2467  break;
2468 
2469  case FreeRDP_SmartSizingWidth:
2470  settings->SmartSizingWidth = cnv.c;
2471  break;
2472 
2473  case FreeRDP_StaticChannelArraySize:
2474  settings->StaticChannelArraySize = cnv.c;
2475  break;
2476 
2477  case FreeRDP_StaticChannelCount:
2478  settings->StaticChannelCount = cnv.c;
2479  break;
2480 
2481  case FreeRDP_SurfaceCommandsSupported:
2482  settings->SurfaceCommandsSupported = cnv.c;
2483  break;
2484 
2485  case FreeRDP_TargetNetAddressCount:
2486  settings->TargetNetAddressCount = cnv.c;
2487  break;
2488 
2489  case FreeRDP_TcpAckTimeout:
2490  settings->TcpAckTimeout = cnv.c;
2491  break;
2492 
2493  case FreeRDP_TcpConnectTimeout:
2494  settings->TcpConnectTimeout = cnv.c;
2495  break;
2496 
2497  case FreeRDP_TcpKeepAliveDelay:
2498  settings->TcpKeepAliveDelay = cnv.c;
2499  break;
2500 
2501  case FreeRDP_TcpKeepAliveInterval:
2502  settings->TcpKeepAliveInterval = cnv.c;
2503  break;
2504 
2505  case FreeRDP_TcpKeepAliveRetries:
2506  settings->TcpKeepAliveRetries = cnv.c;
2507  break;
2508 
2509  case FreeRDP_ThreadingFlags:
2510  settings->ThreadingFlags = cnv.c;
2511  break;
2512 
2513  case FreeRDP_TlsSecLevel:
2514  settings->TlsSecLevel = cnv.c;
2515  break;
2516 
2517  case FreeRDP_VCChunkSize:
2518  settings->VCChunkSize = cnv.c;
2519  break;
2520 
2521  case FreeRDP_VCFlags:
2522  settings->VCFlags = cnv.c;
2523  break;
2524 
2525  default:
2526  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2529  return FALSE;
2530  }
2531  return TRUE;
2532 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_set_gateway_usage_method(), and freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_uint64()

FREERDP_API BOOL freerdp_settings_set_uint64 ( rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt64  id,
UINT64  param 
)

Sets a UINT64 settings value.

Parameters
settingsA pointer to the settings to query, must not be NULL.
idThe key to query
paramThe value to set.
Returns
TRUE for success, FALSE for failure

Definition at line 2605 of file settings_getters.c.

2606 {
2607  union
2608  {
2609  void* v;
2610  const void* cv;
2611  UINT64 c;
2612  const UINT64 cc;
2613  } cnv;
2614  WINPR_ASSERT(settings);
2615 
2616  cnv.c = val;
2617 
2618  switch (id)
2619  {
2620  case FreeRDP_ParentWindowId:
2621  settings->ParentWindowId = cnv.c;
2622  break;
2623 
2624  default:
2625  WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
2628  return FALSE;
2629  }
2630  return TRUE;
2631 }

References freerdp_settings_get_name_for_key(), and freerdp_settings_get_type_name_for_key().

Referenced by freerdp_settings_copy_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_update_from_caps()

FREERDP_API BOOL freerdp_settings_update_from_caps ( rdpSettings *  settings,
const BYTE *  capsFlags,
const BYTE **  capsData,
const UINT32 *  capsSizes,
UINT32  capsCount,
BOOL  serverReceivedCaps 
)

Parse capability data and apply to settings.

The capability message is stored in raw form in the settings, the data parsed and applied to the settings.

Parameters
settingsA pointer to the settings to use
capsFlagsA pointer to the capablity flags, must have capsCount fields
capsDataA pointer array to the RAW capability data, must have capsCount fields
capsSizesA pointer to an array of RAW capability sizes, must have capsCount fields
capsCountThe number of capabilities contained in the RAW data
serverReceivedCapsIndicates if the parser should assume to be a server or client instance
Returns
TRUE for success, FALSE in case of an error

Definition at line 1986 of file common/settings.c.

1989 {
1990  WINPR_ASSERT(settings);
1991  WINPR_ASSERT(capsFlags || (capsCount == 0));
1992  WINPR_ASSERT(capsData || (capsCount == 0));
1993  WINPR_ASSERT(capsSizes || (capsCount == 0));
1994  WINPR_ASSERT(capsCount <= UINT16_MAX);
1995 
1996  for (UINT32 x = 0; x < capsCount; x++)
1997  {
1998  if (capsFlags[x])
1999  {
2000  wStream buffer;
2001  wStream* sub = Stream_StaticConstInit(&buffer, capsData[x], capsSizes[x]);
2002 
2003  if (!rdp_read_capability_set(sub, (UINT16)x, settings, serverReceivedCaps))
2004  return FALSE;
2005  }
2006  }
2007 
2008  return TRUE;
2009 }

◆ freerdp_supported_color_depths_string()

FREERDP_API const char* freerdp_supported_color_depths_string ( UINT16  mask,
char *  buffer,
size_t  size 
)

returns a string representation of RNS_UD_XXBPP_SUPPORT values

return A string reprenentation of the bitmask.

Definition at line 2167 of file common/settings.c.

2168 {
2169  const UINT32 invalid = mask & ~(RNS_UD_32BPP_SUPPORT | RNS_UD_24BPP_SUPPORT |
2170  RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT);
2171 
2172  if (mask & RNS_UD_32BPP_SUPPORT)
2173  winpr_str_append("RNS_UD_32BPP_SUPPORT", buffer, size, "|");
2174  if (mask & RNS_UD_24BPP_SUPPORT)
2175  winpr_str_append("RNS_UD_24BPP_SUPPORT", buffer, size, "|");
2176  if (mask & RNS_UD_16BPP_SUPPORT)
2177  winpr_str_append("RNS_UD_16BPP_SUPPORT", buffer, size, "|");
2178  if (mask & RNS_UD_15BPP_SUPPORT)
2179  winpr_str_append("RNS_UD_15BPP_SUPPORT", buffer, size, "|");
2180 
2181  if (invalid != 0)
2182  {
2183  char str[32] = { 0 };
2184  (void)_snprintf(str, sizeof(str), "RNS_UD_INVALID[0x%04" PRIx32 "]", invalid);
2185  winpr_str_append(str, buffer, size, "|");
2186  }
2187  char hex[32] = { 0 };
2188  (void)_snprintf(hex, sizeof(hex), "[0x%04" PRIx16 "]", mask);
2189  return buffer;
2190 }