FreeRDP
rdpSettings

This is the FreeRDP settings module. More...

Data Structures

struct  TARGET_NET_ADDRESS
 
struct  ARC_CS_PRIVATE_PACKET
 
struct  ARC_SC_PRIVATE_PACKET
 
struct  ADDIN_ARGV
 
struct  rdp_ext_set
 
struct  BITMAP_CACHE_CELL_INFO
 
struct  BITMAP_CACHE_V2_CELL_INFO
 
struct  GLYPH_CACHE_DEFINITION
 
struct  MONITOR_DEF
 
struct  MONITOR_ATTRIBUTES
 
struct  rdpMonitor
 
struct  RDPDR_DEVICE
 
struct  RDPDR_DRIVE
 
struct  RDPDR_PRINTER
 
struct  RDPDR_SMARTCARD
 
struct  RDPDR_SERIAL
 
struct  RDPDR_PARALLEL
 
struct  rdpSettings
 

Macros

#define FREERDP_SETTINGS_SERVER_MODE   0x00000001
 
#define FREERDP_SETTINGS_REMOTE_MODE   0x00000002
 
#define SURFCMDS_SET_SURFACE_BITS   0x00000002 /** @since version 3.7.0 */
 
#define SURFCMDS_FRAME_MARKER   0x00000010 /** @since version 3.7.0 */
 
#define SURFCMDS_STREAM_SURFACE_BITS   0x00000040 /** @since version 3.7.0 */
 
#define RAIL_LEVEL_SUPPORTED   0x00000001
 
#define RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED   0x00000002
 
#define RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED   0x00000004
 
#define RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED   0x00000008
 
#define RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED   0x00000010
 
#define RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED   0x00000020
 
#define RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED   0x00000040
 
#define RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED   0x00000080
 
#define PERF_FLAG_NONE   0x00000000
 
#define PERF_DISABLE_WALLPAPER   0x00000001
 
#define PERF_DISABLE_FULLWINDOWDRAG   0x00000002
 
#define PERF_DISABLE_MENUANIMATIONS   0x00000004
 
#define PERF_DISABLE_THEMING   0x00000008
 
#define PERF_DISABLE_CURSOR_SHADOW   0x00000020
 
#define PERF_DISABLE_CURSORSETTINGS   0x00000040
 
#define PERF_ENABLE_FONT_SMOOTHING   0x00000080
 
#define PERF_ENABLE_DESKTOP_COMPOSITION   0x00000100
 
#define CONNECTION_TYPE_INVALID
 
#define CONNECTION_TYPE_MODEM   0x01
 
#define CONNECTION_TYPE_BROADBAND_LOW   0x02
 
#define CONNECTION_TYPE_SATELLITE   0x03
 
#define CONNECTION_TYPE_BROADBAND_HIGH   0x04
 
#define CONNECTION_TYPE_WAN   0x05
 
#define CONNECTION_TYPE_LAN   0x06
 
#define CONNECTION_TYPE_AUTODETECT   0x07
 
#define CS_CORE   0xC001
 
#define CS_SECURITY   0xC002
 
#define CS_NET   0xC003
 
#define CS_CLUSTER   0xC004
 
#define CS_MONITOR   0xC005
 
#define CS_MCS_MSGCHANNEL   0xC006
 
#define CS_MONITOR_EX   0xC008
 
#define CS_UNUSED1   0xC00C
 
#define CS_MULTITRANSPORT   0xC00A
 
#define SC_CORE   0x0C01
 
#define SC_SECURITY   0x0C02
 
#define SC_NET   0x0C03
 
#define SC_MCS_MSGCHANNEL   0x0C04
 
#define SC_MULTITRANSPORT   0x0C08
 
#define RNS_UD_COLOR_4BPP   0xCA00
 
#define RNS_UD_COLOR_8BPP   0xCA01
 
#define RNS_UD_COLOR_16BPP_555   0xCA02
 
#define RNS_UD_COLOR_16BPP_565   0xCA03
 
#define RNS_UD_COLOR_24BPP   0xCA04
 
#define RNS_UD_SAS_DEL   0xAA03
 
#define RNS_UD_24BPP_SUPPORT   0x0001
 
#define RNS_UD_16BPP_SUPPORT   0x0002
 
#define RNS_UD_15BPP_SUPPORT   0x0004
 
#define RNS_UD_32BPP_SUPPORT   0x0008
 
#define AUDIO_MODE_REDIRECT   0 /* Bring to this computer */
 
#define AUDIO_MODE_PLAY_ON_SERVER   1 /* Leave at remote computer */
 
#define AUDIO_MODE_NONE   2 /* Do not play */
 
#define RNS_UD_CS_SUPPORT_ERRINFO_PDU   0x0001
 
#define RNS_UD_CS_WANT_32BPP_SESSION   0x0002
 
#define RNS_UD_CS_SUPPORT_STATUSINFO_PDU   0x0004
 
#define RNS_UD_CS_STRONG_ASYMMETRIC_KEYS   0x0008
 
#define RNS_UD_CS_RELATIVE_MOUSE_INPUT   0x0010
 
#define RNS_UD_CS_VALID_CONNECTION_TYPE   0x0020
 
#define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU   0x0040
 
#define RNS_UD_CS_SUPPORT_NETCHAR_AUTODETECT   0x0080
 
#define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL   0x0100
 
#define RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE   0x0200
 
#define RNS_UD_CS_SUPPORT_HEARTBEAT_PDU   0x0400
 
#define RNS_UD_CS_SUPPORT_SKIP_CHANNELJOIN   0x0800
 
#define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V1   0x00000001
 
#define RNS_UD_SC_DYNAMIC_DST_SUPPORTED   0x00000002
 
#define RNS_UD_SC_EDGE_ACTIONS_SUPPORTED_V2   0x00000004
 
#define RNS_UD_SC_SKIP_CHANNELJOIN_SUPPORTED   0x00000008
 
#define REDIRECTION_SUPPORTED   0x00000001
 
#define REDIRECTED_SESSIONID_FIELD_VALID   0x00000002
 
#define REDIRECTED_SMARTCARD   0x00000040
 
#define ServerSessionRedirectionVersionMask   0x0000003c
 
#define REDIRECTION_VERSION1   0x00
 
#define REDIRECTION_VERSION2   0x01
 
#define REDIRECTION_VERSION3   0x02
 
#define REDIRECTION_VERSION4   0x03
 
#define REDIRECTION_VERSION5   0x04
 
#define REDIRECTION_VERSION6   0x05
 
#define MONITOR_PRIMARY   0x00000001
 
#define ENCRYPTION_METHOD_NONE   0x00000000
 
#define ENCRYPTION_METHOD_40BIT   0x00000001
 
#define ENCRYPTION_METHOD_128BIT   0x00000002
 
#define ENCRYPTION_METHOD_56BIT   0x00000008
 
#define ENCRYPTION_METHOD_FIPS   0x00000010
 
#define ENCRYPTION_LEVEL_NONE   0x00000000
 
#define ENCRYPTION_LEVEL_LOW   0x00000001
 
#define ENCRYPTION_LEVEL_CLIENT_COMPATIBLE   0x00000002
 
#define ENCRYPTION_LEVEL_HIGH   0x00000003
 
#define ENCRYPTION_LEVEL_FIPS   0x00000004
 
#define TRANSPORT_TYPE_UDP_FECR   0x00000001
 
#define TRANSPORT_TYPE_UDP_FECL   0x00000004
 
#define TRANSPORT_TYPE_UDP_PREFERRED   0x00000100
 
#define SOFTSYNC_TCP_TO_UDP   0x00000200
 
#define CHANNEL_OPTION_INITIALIZED   0x80000000
 
#define CHANNEL_OPTION_ENCRYPT_RDP   0x40000000
 
#define CHANNEL_OPTION_ENCRYPT_SC   0x20000000
 
#define CHANNEL_OPTION_ENCRYPT_CS   0x10000000
 
#define CHANNEL_OPTION_PRI_HIGH   0x08000000
 
#define CHANNEL_OPTION_PRI_MED   0x04000000
 
#define CHANNEL_OPTION_PRI_LOW   0x02000000
 
#define CHANNEL_OPTION_COMPRESS_RDP   0x00800000
 
#define CHANNEL_OPTION_COMPRESS   0x00400000
 
#define CHANNEL_OPTION_SHOW_PROTOCOL   0x00200000
 
#define CHANNEL_REMOTE_CONTROL_PERSISTENT   0x00100000
 
#define VCCAPS_NO_COMPR   0x00000000
 
#define VCCAPS_COMPR_SC   0x00000001
 
#define VCCAPS_COMPR_CS_8K   0x00000002
 
#define LARGE_POINTER_FLAG_96x96   0x00000001
 
#define LARGE_POINTER_FLAG_384x384   0x00000002
 
#define AUTO_RECONNECT_VERSION_1   0x00000001
 
#define MSTSC_COOKIE_MAX_LENGTH   9
 
#define DEFAULT_COOKIE_MAX_LENGTH   0xFF
 
#define TS_CAPS_PROTOCOLVERSION   0x200 /** @since version 3.6.0 */
 
#define NEG_DSTBLT_INDEX   0x00
 
#define NEG_PATBLT_INDEX   0x01
 
#define NEG_SCRBLT_INDEX   0x02
 
#define NEG_MEMBLT_INDEX   0x03
 
#define NEG_MEM3BLT_INDEX   0x04
 
#define NEG_ATEXTOUT_INDEX   0x05
 
#define NEG_AEXTTEXTOUT_INDEX   0x06 /* Must be ignored */
 
#define NEG_DRAWNINEGRID_INDEX   0x07 /* Must be ignored */
 
#define NEG_LINETO_INDEX   0x08
 
#define NEG_MULTI_DRAWNINEGRID_INDEX   0x09
 
#define NEG_OPAQUE_RECT_INDEX   0x0A /* Must be ignored */
 
#define NEG_SAVEBITMAP_INDEX   0x0B
 
#define NEG_WTEXTOUT_INDEX   0x0C /* Must be ignored */
 
#define NEG_MEMBLT_V2_INDEX   0x0D /* Must be ignored */
 
#define NEG_MEM3BLT_V2_INDEX   0x0E /* Must be ignored */
 
#define NEG_MULTIDSTBLT_INDEX   0x0F
 
#define NEG_MULTIPATBLT_INDEX   0x10
 
#define NEG_MULTISCRBLT_INDEX   0x11
 
#define NEG_MULTIOPAQUERECT_INDEX   0x12
 
#define NEG_FAST_INDEX_INDEX   0x13
 
#define NEG_POLYGON_SC_INDEX   0x14
 
#define NEG_POLYGON_CB_INDEX   0x15
 
#define NEG_POLYLINE_INDEX   0x16
 
#define NEG_UNUSED23_INDEX   0x17 /* Must be ignored */
 
#define NEG_FAST_GLYPH_INDEX   0x18
 
#define NEG_ELLIPSE_SC_INDEX   0x19
 
#define NEG_ELLIPSE_CB_INDEX   0x1A
 
#define NEG_GLYPH_INDEX_INDEX   0x1B
 
#define NEG_GLYPH_WEXTTEXTOUT_INDEX   0x1C /* Must be ignored */
 
#define NEG_GLYPH_WLONGTEXTOUT_INDEX   0x1D /* Must be ignored */
 
#define NEG_GLYPH_WLONGEXTTEXTOUT_INDEX   0x1E /* Must be ignored */
 
#define NEG_UNUSED31_INDEX   0x1F /* Must be ignored */
 
#define GLYPH_SUPPORT_NONE   0x0000
 
#define GLYPH_SUPPORT_PARTIAL   0x0001
 
#define GLYPH_SUPPORT_FULL   0x0002
 
#define GLYPH_SUPPORT_ENCODE   0x0003
 
#define TSC_PROXY_MODE_NONE_DIRECT   0x0
 
#define TSC_PROXY_MODE_DIRECT   0x1
 
#define TSC_PROXY_MODE_DETECT   0x2
 
#define TSC_PROXY_MODE_DEFAULT   0x3
 
#define TSC_PROXY_MODE_NONE_DETECT   0x4
 
#define TSC_PROXY_CREDS_MODE_USERPASS   0x0
 
#define TSC_PROXY_CREDS_MODE_SMARTCARD   0x1
 
#define TSC_PROXY_CREDS_MODE_ANY   0x2
 
#define KEYBOARD_HOOK_LOCAL   0
 
#define KEYBOARD_HOOK_REMOTE   1
 
#define KEYBOARD_HOOK_FULLSCREEN_ONLY   2
 
#define LOGON_MSG_DISCONNECT_REFUSED   0xFFFFFFF9
 
#define LOGON_MSG_NO_PERMISSION   0xFFFFFFFA
 
#define LOGON_MSG_BUMP_OPTIONS   0xFFFFFFFB
 
#define LOGON_MSG_RECONNECT_OPTIONS   0xFFFFFFFC
 
#define LOGON_MSG_SESSION_TERMINATE   0xFFFFFFFD
 
#define LOGON_MSG_SESSION_CONTINUE   0xFFFFFFFE
 
#define LOGON_FAILED_BAD_PASSWORD   0x00000000
 
#define LOGON_FAILED_UPDATE_PASSWORD   0x00000001
 
#define LOGON_FAILED_OTHER   0x00000002
 
#define LOGON_WARNING   0x00000003
 
#define STATUS_FINDING_DESTINATION   0x00000401
 
#define STATUS_LOADING_DESTINATION   0x00000402
 
#define STATUS_BRINGING_SESSION_ONLINE   0x00000403
 
#define STATUS_REDIRECTING_TO_DESTINATION   0x00000404
 
#define STATUS_VM_LOADING   0x00000501
 
#define STATUS_VM_WAKING   0x00000502
 
#define STATUS_VM_BOOTING   0x00000503
 
#define PACKET_COMPR_TYPE_8K   0x00
 
#define PACKET_COMPR_TYPE_64K   0x01
 
#define PACKET_COMPR_TYPE_RDP6   0x02
 
#define PACKET_COMPR_TYPE_RDP61   0x03
 
#define PACKET_COMPR_TYPE_RDP8   0x04
 
#define ORIENTATION_LANDSCAPE   0
 
#define ORIENTATION_PORTRAIT   90
 
#define ORIENTATION_LANDSCAPE_FLIPPED   180
 
#define ORIENTATION_PORTRAIT_FLIPPED   270
 
#define CLIPRDR_FLAG_LOCAL_TO_REMOTE   0x01
 
#define CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES   0x02
 
#define CLIPRDR_FLAG_REMOTE_TO_LOCAL   0x10
 
#define CLIPRDR_FLAG_REMOTE_TO_LOCAL_FILES   0x20
 
#define CLIPRDR_FLAG_DEFAULT_MASK
 
#define RDPDR_DTYP_SERIAL   0x00000001
 
#define RDPDR_DTYP_PARALLEL   0x00000002
 
#define RDPDR_DTYP_PRINT   0x00000004
 
#define RDPDR_DTYP_FILESYSTEM   0x00000008
 
#define RDPDR_DTYP_SMARTCARD   0x00000020
 
#define PROXY_TYPE_NONE   0
 
#define PROXY_TYPE_HTTP   1
 
#define PROXY_TYPE_SOCKS   2
 
#define PROXY_TYPE_IGNORE   0xFFFF
 
#define THREADING_FLAGS_DISABLE_THREADS   0x00000001
 
#define FREERDP_SETTINGS_SERVER_MODE   0x00000001
 
#define SETTINGS_DEPRECATED(x)   WINPR_DEPRECATED(x)
 

Enumerations

enum  RDP_VERSION {
  RDP_VERSION_4 = 0x00080001 , RDP_VERSION_5_PLUS = 0x00080004 , RDP_VERSION_10_0 = 0x00080005 , RDP_VERSION_10_1 = 0x00080006 ,
  RDP_VERSION_10_2 = 0x00080007 , RDP_VERSION_10_3 = 0x00080008 , RDP_VERSION_10_4 = 0x00080009 , RDP_VERSION_10_5 = 0x0008000a ,
  RDP_VERSION_10_6 = 0x0008000b , RDP_VERSION_10_7 = 0x0008000C , RDP_VERSION_10_8 = 0x0008000D , RDP_VERSION_10_9 = 0x0008000E ,
  RDP_VERSION_10_10 = 0x0008000F , RDP_VERSION_10_11 = 0x00080010 , RDP_VERSION_10_12 = 0x00080011
}
 
enum  rdp_settings_type {
  RDP_SETTINGS_TYPE_BOOL , RDP_SETTINGS_TYPE_UINT16 , RDP_SETTINGS_TYPE_INT16 , RDP_SETTINGS_TYPE_UINT32 ,
  RDP_SETTINGS_TYPE_INT32 , RDP_SETTINGS_TYPE_UINT64 , RDP_SETTINGS_TYPE_INT64 , RDP_SETTINGS_TYPE_STRING ,
  RDP_SETTINGS_TYPE_POINTER
}
 

Functions

FREERDP_API void freerdp_settings_free (rdpSettings *settings)
 Free a settings struct with all data in it. More...
 
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_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 void freerdp_addin_argv_free (ADDIN_ARGV *args)
 
FREERDP_API ADDIN_ARGVfreerdp_addin_argv_new (size_t argc, const char *const argv[])
 
FREERDP_API ADDIN_ARGVfreerdp_addin_argv_clone (const 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 *const 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, 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 const 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 More...
 

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)

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.

FreeRDP: A Remote Desktop Protocol Implementation Internal settings header for functions not exported

Copyright 2018 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2018 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.


Data Structure Documentation

◆ TARGET_NET_ADDRESS

struct TARGET_NET_ADDRESS

Definition at line 290 of file settings_types.h.

Data Fields
LPWSTR Address
UINT32 Length

◆ ARC_CS_PRIVATE_PACKET

struct ARC_CS_PRIVATE_PACKET

Definition at line 342 of file settings_types.h.

Data Fields
UINT32 cbLen
UINT32 logonId
BYTE securityVerifier[16]
UINT32 version

◆ ARC_SC_PRIVATE_PACKET

struct ARC_SC_PRIVATE_PACKET

Definition at line 351 of file settings_types.h.

Data Fields
BYTE arcRandomBits[16]
UINT32 cbLen
UINT32 logonId
UINT32 version

◆ ADDIN_ARGV

struct ADDIN_ARGV

Definition at line 361 of file settings_types.h.

Data Fields
int argc
char ** argv

◆ rdp_ext_set

struct rdp_ext_set

Definition at line 369 of file settings_types.h.

Data Fields
void * data
char name[256]

◆ BITMAP_CACHE_CELL_INFO

struct BITMAP_CACHE_CELL_INFO

Definition at line 377 of file settings_types.h.

Data Fields
UINT16 maxSize
UINT16 numEntries

◆ BITMAP_CACHE_V2_CELL_INFO

struct BITMAP_CACHE_V2_CELL_INFO

Definition at line 383 of file settings_types.h.

Data Fields
UINT32 numEntries
BOOL persistent

◆ GLYPH_CACHE_DEFINITION

struct GLYPH_CACHE_DEFINITION

Definition at line 391 of file settings_types.h.

Data Fields
UINT16 cacheEntries
UINT16 cacheMaximumCellSize

◆ MONITOR_DEF

struct MONITOR_DEF

Definition at line 399 of file settings_types.h.

Data Fields
INT32 bottom
UINT32 flags
INT32 left
INT32 right
INT32 top

◆ MONITOR_ATTRIBUTES

struct MONITOR_ATTRIBUTES

Definition at line 408 of file settings_types.h.

Data Fields
UINT32 desktopScaleFactor
UINT32 deviceScaleFactor
UINT32 orientation
UINT32 physicalHeight
UINT32 physicalWidth

◆ rdpMonitor

struct rdpMonitor

Definition at line 417 of file settings_types.h.

Collaboration diagram for rdpMonitor:
Data Fields
MONITOR_ATTRIBUTES attributes
INT32 height
UINT32 is_primary
UINT32 orig_screen
INT32 width
INT32 x
INT32 y

◆ RDPDR_DEVICE

struct RDPDR_DEVICE

Definition at line 435 of file settings_types.h.

Data Fields
UINT32 Id
char * Name
UINT32 Type

◆ RDPDR_DRIVE

struct RDPDR_DRIVE

Definition at line 442 of file settings_types.h.

Collaboration diagram for RDPDR_DRIVE:
Data Fields
BOOL automount
RDPDR_DEVICE device
char * Path

◆ RDPDR_PRINTER

struct RDPDR_PRINTER

Definition at line 449 of file settings_types.h.

Collaboration diagram for RDPDR_PRINTER:
Data Fields
RDPDR_DEVICE device
char * DriverName
BOOL IsDefault

◆ RDPDR_SMARTCARD

struct RDPDR_SMARTCARD

Definition at line 456 of file settings_types.h.

Collaboration diagram for RDPDR_SMARTCARD:
Data Fields
RDPDR_DEVICE device

◆ RDPDR_SERIAL

struct RDPDR_SERIAL

Definition at line 461 of file settings_types.h.

Collaboration diagram for RDPDR_SERIAL:
Data Fields
RDPDR_DEVICE device
char * Driver
char * Path
char * Permissive

◆ RDPDR_PARALLEL

struct RDPDR_PARALLEL

Definition at line 469 of file settings_types.h.

Collaboration diagram for RDPDR_PARALLEL:
Data Fields
RDPDR_DEVICE device
char * Path

Macro Definition Documentation

◆ CLIPRDR_FLAG_DEFAULT_MASK

#define CLIPRDR_FLAG_DEFAULT_MASK
Value:
(CLIPRDR_FLAG_LOCAL_TO_REMOTE | CLIPRDR_FLAG_LOCAL_TO_REMOTE_FILES | \
CLIPRDR_FLAG_REMOTE_TO_LOCAL | CLIPRDR_FLAG_REMOTE_TO_LOCAL_FILES)

Definition at line 337 of file settings_types.h.

◆ CONNECTION_TYPE_INVALID

#define CONNECTION_TYPE_INVALID
Value:
0x00

Definition at line 74 of file settings_types.h.

◆ FREERDP_SETTINGS_SERVER_MODE [1/2]

#define FREERDP_SETTINGS_SERVER_MODE   0x00000001

rdpSettings creation flags

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

◆ FREERDP_SETTINGS_SERVER_MODE [2/2]

#define FREERDP_SETTINGS_SERVER_MODE   0x00000001

rdpSettings creation flags

Definition at line 499 of file settings_types.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
Since
version 3.4.0
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 const 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 1983 of file common/settings.c.

1984 {
1985  const UINT32 mask =
1986  RAIL_LEVEL_SUPPORTED | RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED |
1987  RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED |
1988  RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED | RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED |
1989  RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED | RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED;
1990 
1991  if (flags & RAIL_LEVEL_SUPPORTED)
1992  winpr_str_append("RAIL_LEVEL_SUPPORTED", buffer, length, "|");
1993  if (flags & RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED)
1994  winpr_str_append("RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED", buffer, length, "|");
1995  if (flags & RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED)
1996  winpr_str_append("RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED", buffer, length, "|");
1997  if (flags & RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED)
1998  winpr_str_append("RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED", buffer, length, "|");
1999  if (flags & RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED)
2000  winpr_str_append("RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED", buffer, length, "|");
2001  if (flags & RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED)
2002  winpr_str_append("RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED", buffer, length, "|");
2003  if (flags & RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED)
2004  winpr_str_append("RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED", buffer, length, "|");
2005  if (flags & RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED)
2006  winpr_str_append("RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED", buffer, length, "|");
2007  if (flags & RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED)
2008  winpr_str_append("RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED", buffer, length, "|");
2009  if ((flags & ~mask) != 0)
2010  {
2011  char tbuffer[64] = { 0 };
2012  (void)_snprintf(tbuffer, sizeof(tbuffer), "RAIL_FLAG_UNKNOWN 0x%08" PRIx32, flags & mask);
2013  winpr_str_append(tbuffer, buffer, length, "|");
2014  }
2015  return buffer;
2016 }

◆ 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 2043 of file common/settings.c.

2044 {
2045  switch (version)
2046  {
2047  case RDP_VERSION_4:
2048  return "RDP_VERSION_4";
2049  case RDP_VERSION_5_PLUS:
2050  return "RDP_VERSION_5_PLUS";
2051  case RDP_VERSION_10_0:
2052  return "RDP_VERSION_10_0";
2053  case RDP_VERSION_10_1:
2054  return "RDP_VERSION_10_1";
2055  case RDP_VERSION_10_2:
2056  return "RDP_VERSION_10_2";
2057  case RDP_VERSION_10_3:
2058  return "RDP_VERSION_10_3";
2059  case RDP_VERSION_10_4:
2060  return "RDP_VERSION_10_4";
2061  case RDP_VERSION_10_5:
2062  return "RDP_VERSION_10_5";
2063  case RDP_VERSION_10_6:
2064  return "RDP_VERSION_10_6";
2065  case RDP_VERSION_10_7:
2066  return "RDP_VERSION_10_7";
2067  case RDP_VERSION_10_8:
2068  return "RDP_VERSION_10_8";
2069  case RDP_VERSION_10_9:
2070  return "RDP_VERSION_10_9";
2071  case RDP_VERSION_10_10:
2072  return "RDP_VERSION_10_10";
2073  case RDP_VERSION_10_11:
2074  return "RDP_VERSION_10_11";
2075  case RDP_VERSION_10_12:
2076  return "RDP_VERSION_10_12";
2077  default:
2078  return "RDP_VERSION_UNKNOWN";
2079  }
2080 }

◆ 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 2133 of file common/settings.c.

2134 {
2135  switch (type)
2136  {
2137  case RDPDR_DTYP_FILESYSTEM:
2138  return "RDPDR_DTYP_FILESYSTEM";
2139  case RDPDR_DTYP_PARALLEL:
2140  return "RDPDR_DTYP_PARALLEL";
2141  case RDPDR_DTYP_PRINT:
2142  return "RDPDR_DTYP_PRINT";
2143  case RDPDR_DTYP_SERIAL:
2144  return "RDPDR_DTYP_SERIAL";
2145  case RDPDR_DTYP_SMARTCARD:
2146  return "RDPDR_DTYP_SMARTCARD";
2147  default:
2148  return "RDPDR_DTYP_UNKNOWN";
2149  }
2150 }

◆ 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 1018 of file common/settings.c.

1019 {
1020  if (!freerdp_settings_set_uint32(settings, FreeRDP_GatewayUsageMethod, GatewayUsageMethod))
1021  return FALSE;
1022 
1023  if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DIRECT)
1024  {
1025  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1026  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1027  return FALSE;
1028  }
1029  else if (GatewayUsageMethod == TSC_PROXY_MODE_DIRECT)
1030  {
1031  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, TRUE) ||
1032  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1033  return FALSE;
1034  }
1035  else if (GatewayUsageMethod == TSC_PROXY_MODE_DETECT)
1036  {
1037  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, TRUE) ||
1038  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, TRUE))
1039  return FALSE;
1040  }
1041  else if (GatewayUsageMethod == TSC_PROXY_MODE_DEFAULT)
1042  {
1048  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1049  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1050  return FALSE;
1051  }
1052  else if (GatewayUsageMethod == TSC_PROXY_MODE_NONE_DETECT)
1053  {
1054  if (!freerdp_settings_set_bool(settings, FreeRDP_GatewayEnabled, FALSE) ||
1055  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE))
1056  return FALSE;
1057  }
1058 
1059  return TRUE;
1060 }
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><param>

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 2224 of file common/settings.c.

2226 {
2227  const char* old = freerdp_settings_get_string(settings, id);
2228 
2229  size_t len = 0;
2230  char* str = NULL;
2231 
2232  if (!old)
2233  winpr_asprintf(&str, &len, "%s", param);
2234  else if (!separator)
2235  winpr_asprintf(&str, &len, "%s%s", old, param);
2236  else
2237  winpr_asprintf(&str, &len, "%s%s%s", old, separator, param);
2238 
2239  const BOOL rc = freerdp_settings_set_string_len(settings, id, str, len);
2240  free(str);
2241  return rc;
2242 }
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 2244 of file common/settings.c.

2245 {
2246  return settings != NULL;
2247 }

◆ 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 1542 of file core/settings.c.

1543 {
1544  rdpSettings* _settings = (rdpSettings*)calloc(1, sizeof(rdpSettings));
1545 
1546  if (!freerdp_settings_copy(_settings, settings))
1547  goto out_fail;
1548 
1549  return _settings;
1550 out_fail:
1551  WINPR_PRAGMA_DIAG_PUSH
1552  WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
1553  freerdp_settings_free(_settings);
1554  WINPR_PRAGMA_DIAG_POP
1555  return NULL;
1556 }
void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.
BOOL freerdp_settings_copy(rdpSettings *_settings, const rdpSettings *settings)
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 1487 of file core/settings.c.

1488 {
1489  BOOL rc = 0;
1490 
1491  if (!settings || !_settings)
1492  return FALSE;
1493 
1494  /* This is required to free all non string buffers */
1495  freerdp_settings_free_internal(_settings);
1496  /* This copies everything except allocated non string buffers. reset all allocated buffers to
1497  * NULL to fix issues during cleanup */
1498  rc = freerdp_settings_clone_keys(_settings, settings);
1499 
1500  _settings->LoadBalanceInfo = NULL;
1501  _settings->ServerRandom = NULL;
1502  _settings->ClientRandom = NULL;
1503  _settings->ServerCertificate = NULL;
1504  _settings->RdpServerCertificate = NULL;
1505  _settings->RdpServerRsaKey = NULL;
1506  _settings->ChannelDefArray = NULL;
1507  _settings->MonitorDefArray = NULL;
1508  _settings->MonitorIds = NULL;
1509  _settings->OrderSupport = NULL;
1510  _settings->BitmapCacheV2CellInfo = NULL;
1511  _settings->GlyphCache = NULL;
1512  _settings->FragCache = NULL;
1513  _settings->ClientAutoReconnectCookie = NULL;
1514  _settings->ServerAutoReconnectCookie = NULL;
1515  _settings->ClientTimeZone = NULL;
1516  _settings->RedirectionPassword = NULL;
1517  _settings->RedirectionTsvUrl = NULL;
1518  _settings->TargetNetAddresses = NULL;
1519  _settings->TargetNetPorts = NULL;
1520  _settings->DeviceArray = NULL;
1521  _settings->StaticChannelArray = NULL;
1522  _settings->DynamicChannelArray = NULL;
1523  _settings->ReceivedCapabilities = NULL;
1524  _settings->ReceivedCapabilityData = NULL;
1525  _settings->ReceivedCapabilityDataSizes = NULL;
1526 
1527  _settings->ServerLicenseProductIssuersCount = 0;
1528  _settings->ServerLicenseProductIssuers = NULL;
1529 
1530  if (!rc)
1531  goto out_fail;
1532 
1533  /* Begin copying */
1534  if (!freerdp_settings_int_buffer_copy(_settings, settings))
1535  goto out_fail;
1536  return TRUE;
1537 out_fail:
1538  freerdp_settings_free_internal(_settings);
1539  return FALSE;
1540 }

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 429 of file settings_str.c.

430 {
431  WINPR_ASSERT(dst);
432  WINPR_ASSERT(src);
433 
434  const SSIZE_T key = freerdp_settings_get_type_for_key(id);
435  switch (key)
436  {
437  case FREERDP_SETTINGS_TYPE_BOOL:
438  {
439  const BOOL val = freerdp_settings_get_bool(src, (FreeRDP_Settings_Keys_Bool)id);
440  return freerdp_settings_set_bool(dst, (FreeRDP_Settings_Keys_Bool)id, val);
441  }
442  case FREERDP_SETTINGS_TYPE_INT16:
443  {
444  const INT16 val = freerdp_settings_get_int16(src, (FreeRDP_Settings_Keys_Int16)id);
445  return freerdp_settings_set_int16(dst, (FreeRDP_Settings_Keys_Int16)id, val);
446  }
447  case FREERDP_SETTINGS_TYPE_INT32:
448  {
449  const INT32 val = freerdp_settings_get_int32(src, (FreeRDP_Settings_Keys_Int32)id);
450  return freerdp_settings_set_int32(dst, (FreeRDP_Settings_Keys_Int32)id, val);
451  }
452  case FREERDP_SETTINGS_TYPE_INT64:
453  {
454  const INT64 val = freerdp_settings_get_int64(src, (FreeRDP_Settings_Keys_Int64)id);
455  return freerdp_settings_set_int64(dst, (FreeRDP_Settings_Keys_Int64)id, val);
456  }
457  case FREERDP_SETTINGS_TYPE_UINT16:
458  {
459  const UINT16 val = freerdp_settings_get_uint16(src, (FreeRDP_Settings_Keys_UInt16)id);
460  return freerdp_settings_set_uint16(dst, (FreeRDP_Settings_Keys_UInt16)id, val);
461  }
462  case FREERDP_SETTINGS_TYPE_UINT32:
463  {
464  const UINT32 val = freerdp_settings_get_uint32(src, (FreeRDP_Settings_Keys_UInt32)id);
465  return freerdp_settings_set_uint32(dst, (FreeRDP_Settings_Keys_UInt32)id, val);
466  }
467  case FREERDP_SETTINGS_TYPE_UINT64:
468  {
469  const UINT64 val = freerdp_settings_get_uint64(src, (FreeRDP_Settings_Keys_UInt64)id);
470  return freerdp_settings_set_uint64(dst, (FreeRDP_Settings_Keys_UInt64)id, val);
471  }
472  case FREERDP_SETTINGS_TYPE_STRING:
473  {
474  const char* val = freerdp_settings_get_string(src, (FreeRDP_Settings_Keys_String)id);
475  return freerdp_settings_set_string(dst, (FreeRDP_Settings_Keys_String)id, val);
476  }
477  case FREERDP_SETTINGS_TYPE_POINTER:
478  {
479  const void* val = freerdp_settings_get_pointer(src, (FreeRDP_Settings_Keys_Pointer)id);
480  return freerdp_settings_set_pointer(dst, (FreeRDP_Settings_Keys_Pointer)id, val);
481  }
482  default:
483  return FALSE;
484  }
485 }
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.
SSIZE_T freerdp_settings_get_type_for_key(SSIZE_T key)
Get a key type for the key index.
Definition: settings_str.c:407
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 246 of file settings_str.c.

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

1239 {
1240  if (!settings)
1241  return;
1242 
1243  freerdp_settings_free_internal(settings);
1244  free(settings);
1245 }

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:374
FREERDP_API const char * freerdp_settings_get_name_for_key(SSIZE_T key)
Returns the type name for a key.
Definition: settings_str.c:418

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 1837 of file common/settings.c.

1838 {
1839  UINT32 flags = FREERDP_CODEC_ALL;
1840  if (settings->RemoteFxCodec == FALSE)
1841  {
1842  flags &= ~FREERDP_CODEC_REMOTEFX;
1843  }
1844  if (settings->NSCodec == FALSE)
1845  {
1846  flags &= ~FREERDP_CODEC_NSCODEC;
1847  }
1848  /*TODO: check other codecs flags */
1849  return flags;
1850 }

◆ freerdp_settings_get_config_path()

FREERDP_API char* freerdp_settings_get_config_path ( void  )

return the configuration directory for the library

Returns
The current configuration path or NULL
Since
version 3.6.0

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

731 {
732  char* path = NULL;
733  /* For default FreeRDP continue using same config directory
734  * as in old releases.
735  * Custom builds use <Vendor>/<Product> as config folder. */
736 #if !defined(WITH_FULL_CONFIG_PATH)
737  if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING) == 0)
738  return freerdp_settings_get_legacy_config_path();
739 #endif
740 
741  char* base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, FREERDP_VENDOR_STRING);
742  if (base)
743  path = GetCombinedPath(base, FREERDP_PRODUCT_STRING);
744  free(base);
745 
746  return path;
747 }

◆ 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 348 of file settings_str.c.

349 {
350  WINPR_ASSERT(value);
351 
352  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
353  {
354  const struct settings_str_entry* cur = &settings_map[x];
355  if (strcmp(value, cur->str) == 0)
356  return cur->id;
357  }
358  return -1;
359 }

◆ 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 418 of file settings_str.c.

419 {
420  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
421  {
422  const struct settings_str_entry* cur = &settings_map[x];
423  if (cur->id == key)
424  return cur->str;
425  }
426  return NULL;
427 }

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 1321 of file common/settings.c.

1323 {
1324  union
1325  {
1326  const rdpSettings* pc;
1327  rdpSettings* p;
1328  } cnv;
1329  cnv.pc = settings;
1330  return freerdp_settings_get_pointer_writable(cnv.p, id);
1331 }
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 1852 of file common/settings.c.

1853 {
1854  WINPR_ASSERT(settings);
1855  const char* hostname = settings->ServerHostname;
1856 
1857  if (settings->UserSpecifiedServerName)
1858  hostname = settings->UserSpecifiedServerName;
1859 
1860  return hostname;
1861 }

◆ 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 2122 of file common/settings.c.

2124 {
2125  const char* str = freerdp_settings_get_string(settings, id);
2126  if (pCharLen)
2127  *pCharLen = 0;
2128  if (!str)
2129  return NULL;
2130  return ConvertUtf8ToWCharAlloc(str, pCharLen);
2131 }

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 407 of file settings_str.c.

408 {
409  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
410  {
411  const struct settings_str_entry* cur = &settings_map[x];
412  if (cur->id == key)
413  return cur->type;
414  }
415  return -1;
416 }

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 361 of file settings_str.c.

362 {
363  WINPR_ASSERT(value);
364 
365  for (size_t x = 0; x < ARRAYSIZE(settings_map); x++)
366  {
367  const struct settings_str_entry* cur = &settings_map[x];
368  if (strcmp(value, cur->str) == 0)
369  return cur->type;
370  }
371  return -1;
372 }

◆ 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 374 of file settings_str.c.

375 {
376  const SSIZE_T type = freerdp_settings_get_type_for_key(key);
378 }
const char * freerdp_settings_get_type_name_for_type(SSIZE_T type)
Returns the type name for a type.
Definition: settings_str.c:380

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 380 of file settings_str.c.

381 {
382  switch (type)
383  {
384  case FREERDP_SETTINGS_TYPE_BOOL:
385  return "FREERDP_SETTINGS_TYPE_BOOL";
386  case FREERDP_SETTINGS_TYPE_UINT16:
387  return "FREERDP_SETTINGS_TYPE_UINT16";
388  case FREERDP_SETTINGS_TYPE_INT16:
389  return "FREERDP_SETTINGS_TYPE_INT16";
390  case FREERDP_SETTINGS_TYPE_UINT32:
391  return "FREERDP_SETTINGS_TYPE_UINT32";
392  case FREERDP_SETTINGS_TYPE_INT32:
393  return "FREERDP_SETTINGS_TYPE_INT32";
394  case FREERDP_SETTINGS_TYPE_UINT64:
395  return "FREERDP_SETTINGS_TYPE_UINT64";
396  case FREERDP_SETTINGS_TYPE_INT64:
397  return "FREERDP_SETTINGS_TYPE_INT64";
398  case FREERDP_SETTINGS_TYPE_STRING:
399  return "FREERDP_SETTINGS_TYPE_STRING";
400  case FREERDP_SETTINGS_TYPE_POINTER:
401  return "FREERDP_SETTINGS_TYPE_POINTER";
402  default:
403  return "FREERDP_SETTINGS_TYPE_UNKNOWN";
404  }
405 }

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 749 of file core/settings.c.

750 {
751  char* issuers[] = { "FreeRDP", "FreeRDP-licenser" };
752  const BOOL server = (flags & FREERDP_SETTINGS_SERVER_MODE) != 0 ? TRUE : FALSE;
753  const BOOL remote = (flags & FREERDP_SETTINGS_REMOTE_MODE) != 0 ? TRUE : FALSE;
754  rdpSettings* settings = (rdpSettings*)calloc(1, sizeof(rdpSettings));
755 
756  if (!settings)
757  return NULL;
758 
759  if (!server && !remote)
760  {
761  if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopPhysicalWidth, 1000))
762  goto out_fail;
763  if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopPhysicalHeight, 1000))
764  goto out_fail;
765  if (!freerdp_settings_set_uint16(settings, FreeRDP_DesktopOrientation,
766  ORIENTATION_LANDSCAPE))
767  goto out_fail;
768  if (!freerdp_settings_set_uint32(settings, FreeRDP_DeviceScaleFactor, 100))
769  goto out_fail;
770  if (!freerdp_settings_set_uint32(settings, FreeRDP_DesktopScaleFactor, 100))
771  goto out_fail;
772  }
773  if (!freerdp_settings_set_uint32(settings, FreeRDP_SurfaceCommandsSupported,
774  SURFCMDS_SET_SURFACE_BITS | SURFCMDS_STREAM_SURFACE_BITS |
775  SURFCMDS_FRAME_MARKER))
776  goto out_fail;
777 
778  if (!freerdp_settings_set_uint32(settings, FreeRDP_RemoteFxRlgrMode, RLGR3))
779  goto out_fail;
780 
781  if (!freerdp_settings_set_uint16(settings, FreeRDP_CapsProtocolVersion,
782  TS_CAPS_PROTOCOLVERSION))
783  goto out_fail;
784 
785  if (!freerdp_settings_set_uint32(settings, FreeRDP_ClipboardFeatureMask,
786  CLIPRDR_FLAG_DEFAULT_MASK))
787  goto out_fail;
788  if (!freerdp_settings_set_string(settings, FreeRDP_ServerLicenseCompanyName, "FreeRDP"))
789  goto out_fail;
790  if (!freerdp_settings_set_string(settings, FreeRDP_ServerLicenseProductName,
791  "FreeRDP-licensing-server"))
792  goto out_fail;
793  if (!freerdp_settings_set_uint32(settings, FreeRDP_ServerLicenseProductVersion, 1))
794  goto out_fail;
795  if (!freerdp_server_license_issuers_copy(settings, issuers, ARRAYSIZE(issuers)))
796  goto out_fail;
797 
798  if (!freerdp_settings_set_uint16(settings, FreeRDP_SupportedColorDepths,
799  RNS_UD_32BPP_SUPPORT | RNS_UD_24BPP_SUPPORT |
800  RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT))
801  goto out_fail;
802 
803  if (!freerdp_settings_set_bool(settings, FreeRDP_UnicodeInput, TRUE) ||
804  !freerdp_settings_set_bool(settings, FreeRDP_HasHorizontalWheel, TRUE) ||
805  !freerdp_settings_set_bool(settings, FreeRDP_HasExtendedMouseEvent, TRUE) ||
806  !freerdp_settings_set_bool(settings, FreeRDP_HasQoeEvent, TRUE) ||
807  !freerdp_settings_set_bool(settings, FreeRDP_HasRelativeMouseEvent, TRUE) ||
808  !freerdp_settings_set_bool(settings, FreeRDP_HiDefRemoteApp, TRUE) ||
810  settings, FreeRDP_RemoteApplicationSupportMask,
811  RAIL_LEVEL_SUPPORTED | RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED |
812  RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED | RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED |
813  RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED |
814  RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED | RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED |
815  RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED) ||
816  !freerdp_settings_set_uint16(settings, FreeRDP_TextANSICodePage, CP_UTF8) ||
817  !freerdp_settings_set_uint16(settings, FreeRDP_OrderSupportFlags,
818  NEGOTIATE_ORDER_SUPPORT | ZERO_BOUNDS_DELTA_SUPPORT |
819  COLOR_INDEX_SUPPORT) ||
820  !freerdp_settings_set_bool(settings, FreeRDP_SupportHeartbeatPdu, TRUE) ||
821  !freerdp_settings_set_bool(settings, FreeRDP_ServerMode, server) ||
822  !freerdp_settings_set_bool(settings, FreeRDP_WaitForOutputBufferFlush, TRUE) ||
823  !freerdp_settings_set_uint32(settings, FreeRDP_ClusterInfoFlags, REDIRECTION_SUPPORTED) ||
824  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1024) ||
825  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 768) ||
826  !freerdp_settings_set_bool(settings, FreeRDP_Workarea, FALSE) ||
827  !freerdp_settings_set_bool(settings, FreeRDP_Fullscreen, FALSE) ||
828  !freerdp_settings_set_bool(settings, FreeRDP_GrabKeyboard, TRUE) ||
829  !freerdp_settings_set_bool(settings, FreeRDP_Decorations, TRUE) ||
830  !freerdp_settings_set_uint32(settings, FreeRDP_RdpVersion, RDP_VERSION_10_12) ||
831  !freerdp_settings_set_uint32(settings, FreeRDP_ColorDepth, 32) ||
832  !freerdp_settings_set_bool(settings, FreeRDP_AadSecurity, FALSE) ||
833  !freerdp_settings_set_bool(settings, FreeRDP_ExtSecurity, FALSE) ||
834  !freerdp_settings_set_bool(settings, FreeRDP_NlaSecurity, TRUE) ||
835  !freerdp_settings_set_bool(settings, FreeRDP_TlsSecurity, TRUE) ||
836  !freerdp_settings_set_bool(settings, FreeRDP_RdpSecurity, TRUE) ||
837  !freerdp_settings_set_bool(settings, FreeRDP_RdstlsSecurity, FALSE) ||
838  !freerdp_settings_set_bool(settings, FreeRDP_NegotiateSecurityLayer, TRUE) ||
839  !freerdp_settings_set_bool(settings, FreeRDP_RestrictedAdminModeRequired, FALSE) ||
840  !freerdp_settings_set_bool(settings, FreeRDP_MstscCookieMode, FALSE) ||
841  !freerdp_settings_set_uint32(settings, FreeRDP_CookieMaxLength,
842  DEFAULT_COOKIE_MAX_LENGTH) ||
843  !freerdp_settings_set_uint32(settings, FreeRDP_ClientBuild,
844  18363) || /* Windows 10, Version 1909 */
845  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardType, 4) ||
846  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardSubType, 0) ||
847  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardFunctionKey, 12) ||
848  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardLayout, 0) ||
849  !freerdp_settings_set_uint32(settings, FreeRDP_KeyboardHook,
850  KEYBOARD_HOOK_FULLSCREEN_ONLY) ||
851  !freerdp_settings_set_bool(settings, FreeRDP_UseRdpSecurityLayer, FALSE) ||
852  !freerdp_settings_set_bool(settings, FreeRDP_SaltedChecksum, TRUE) ||
853  !freerdp_settings_set_uint32(settings, FreeRDP_ServerPort, 3389) ||
854  !freerdp_settings_set_uint32(settings, FreeRDP_GatewayPort, 443) ||
855  !freerdp_settings_set_bool(settings, FreeRDP_DesktopResize, TRUE) ||
856  !freerdp_settings_set_bool(settings, FreeRDP_ToggleFullscreen, TRUE) ||
857  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopPosX, UINT32_MAX) ||
858  !freerdp_settings_set_uint32(settings, FreeRDP_DesktopPosY, UINT32_MAX) ||
859  !freerdp_settings_set_bool(settings, FreeRDP_SoftwareGdi, TRUE) ||
860  !freerdp_settings_set_bool(settings, FreeRDP_UnmapButtons, FALSE) ||
861  !freerdp_settings_set_uint32(settings, FreeRDP_PerformanceFlags, PERF_FLAG_NONE) ||
862  !freerdp_settings_set_bool(settings, FreeRDP_AllowFontSmoothing, TRUE) ||
863  !freerdp_settings_set_bool(settings, FreeRDP_AllowDesktopComposition, FALSE) ||
864  !freerdp_settings_set_bool(settings, FreeRDP_DisableWallpaper, FALSE) ||
865  !freerdp_settings_set_bool(settings, FreeRDP_DisableFullWindowDrag, TRUE) ||
866  !freerdp_settings_set_bool(settings, FreeRDP_DisableMenuAnims, TRUE) ||
867  !freerdp_settings_set_bool(settings, FreeRDP_DisableThemes, FALSE) ||
868  !freerdp_settings_set_uint32(settings, FreeRDP_ConnectionType,
869  CONNECTION_TYPE_AUTODETECT) ||
870  !freerdp_settings_set_bool(settings, FreeRDP_NetworkAutoDetect, TRUE) ||
871  !freerdp_settings_set_uint32(settings, FreeRDP_EncryptionMethods, ENCRYPTION_METHOD_NONE) ||
872  !freerdp_settings_set_uint32(settings, FreeRDP_EncryptionLevel, ENCRYPTION_LEVEL_NONE) ||
873  !freerdp_settings_set_bool(settings, FreeRDP_FIPSMode, FALSE) ||
874  !freerdp_settings_set_bool(settings, FreeRDP_CompressionEnabled, TRUE) ||
875  !freerdp_settings_set_bool(settings, FreeRDP_LogonNotify, TRUE) ||
876  !freerdp_settings_set_uint32(settings, FreeRDP_BrushSupportLevel, BRUSH_COLOR_FULL) ||
877  !freerdp_settings_set_uint32(settings, FreeRDP_CompressionLevel, PACKET_COMPR_TYPE_RDP61) ||
878  !freerdp_settings_set_bool(settings, FreeRDP_Authentication, TRUE) ||
879  !freerdp_settings_set_bool(settings, FreeRDP_AuthenticationOnly, FALSE) ||
880  !freerdp_settings_set_bool(settings, FreeRDP_CredentialsFromStdin, FALSE) ||
881  !freerdp_settings_set_bool(settings, FreeRDP_DisableCredentialsDelegation, FALSE) ||
882  !freerdp_settings_set_uint32(settings, FreeRDP_AuthenticationLevel, 2) ||
883  !freerdp_settings_set_uint32(settings, FreeRDP_ChannelCount, 0) ||
884  !freerdp_settings_set_bool(settings, FreeRDP_CertificateCallbackPreferPEM, FALSE) ||
885  !freerdp_settings_set_uint32(settings, FreeRDP_KeySpec, AT_KEYEXCHANGE))
886  goto out_fail;
887 
888  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ChannelDefArray, NULL,
889  CHANNEL_MAX_COUNT))
890  goto out_fail;
891 
892  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportMonitorLayoutPdu, FALSE))
893  goto out_fail;
894 
895  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorCount, 0))
896  goto out_fail;
897 
898  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorDefArray, NULL, 32))
899  goto out_fail;
900 
901  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftX, 0))
902  goto out_fail;
903 
904  if (!freerdp_settings_set_uint32(settings, FreeRDP_MonitorLocalShiftY, 0))
905  goto out_fail;
906 
907  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, NULL, 0))
908  goto out_fail;
909 
910  if (!freerdp_settings_set_uint32(settings, FreeRDP_MultitransportFlags,
911  TRANSPORT_TYPE_UDP_FECR))
912  goto out_fail;
913  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportMultitransport, TRUE))
914  goto out_fail;
915 
916  if (!settings_get_computer_name(settings))
917  goto out_fail;
918 
919  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerCertificate, NULL, 1))
920  goto out_fail;
921 
922  if (!freerdp_capability_buffer_allocate(settings, 32))
923  goto out_fail;
924 
925  {
926  char tmp[32] = { 0 };
927  if (!freerdp_settings_set_string_len(settings, FreeRDP_ClientProductId, tmp, sizeof(tmp)))
928  goto out_fail;
929  }
930 
931  {
932  char ClientHostname[33] = { 0 };
933  DWORD size = sizeof(ClientHostname) - 2;
934  GetComputerNameA(ClientHostname, &size);
935  if (!freerdp_settings_set_string(settings, FreeRDP_ClientHostname, ClientHostname))
936  goto out_fail;
937  }
938 
939  /* [MS-RDPBCGR] 2.2.7.1.5 Pointer Capability Set (TS_POINTER_CAPABILITYSET)
940  *
941  * if we are in server mode send a reasonable large cache size,
942  * if we are in client mode just set the value to the maximum we want to
943  * support and during capability exchange that size will be limited to the
944  * sizes the server supports
945  *
946  * We have chosen 128 cursors in cache which is at worst 128 * 576kB (384x384 pixel cursor with
947  * 32bit color depth)
948  * */
949  if (freerdp_settings_get_bool(settings, FreeRDP_ServerMode))
950  {
951  if (!freerdp_settings_set_uint32(settings, FreeRDP_PointerCacheSize, 25) ||
952  !freerdp_settings_set_uint32(settings, FreeRDP_ColorPointerCacheSize, 25))
953  goto out_fail;
954  }
955  else
956  {
957  if (!freerdp_settings_set_uint32(settings, FreeRDP_PointerCacheSize, 128) ||
958  !freerdp_settings_set_uint32(settings, FreeRDP_ColorPointerCacheSize, 128))
959  goto out_fail;
960  }
961 
962  if (!freerdp_settings_set_uint32(settings, FreeRDP_LargePointerFlag,
963  (LARGE_POINTER_FLAG_96x96 | LARGE_POINTER_FLAG_384x384)) ||
964  !freerdp_settings_set_bool(settings, FreeRDP_SoundBeepsEnabled, TRUE) ||
965  !freerdp_settings_set_bool(settings, FreeRDP_DrawGdiPlusEnabled, FALSE) ||
966  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowSkipAlpha, TRUE) ||
967  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowColorSubsampling, FALSE) ||
968  !freerdp_settings_set_bool(settings, FreeRDP_DrawAllowDynamicColorFidelity, TRUE) ||
969  !freerdp_settings_set_bool(settings, FreeRDP_FrameMarkerCommandEnabled, TRUE) ||
970  !freerdp_settings_set_bool(settings, FreeRDP_SurfaceFrameMarkerEnabled, TRUE) ||
971  !freerdp_settings_set_bool(settings, FreeRDP_AllowCacheWaitingList, TRUE) ||
972  !freerdp_settings_set_uint32(settings, FreeRDP_BitmapCacheV2NumCells, 5))
973  goto out_fail;
974  settings->BitmapCacheV2CellInfo =
976 
977  if (!settings->BitmapCacheV2CellInfo)
978  goto out_fail;
979 
980  {
981  BITMAP_CACHE_V2_CELL_INFO cache = { 0 };
982  cache.numEntries = 600;
983  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 0,
984  &cache) ||
985  !freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 1, &cache))
986  goto out_fail;
987  cache.numEntries = 2048;
988  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 2,
989  &cache) ||
990  !freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 4, &cache))
991  goto out_fail;
992  cache.numEntries = 4096;
993  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_BitmapCacheV2CellInfo, 3, &cache))
994  goto out_fail;
995  }
996  if (!freerdp_settings_set_bool(settings, FreeRDP_NoBitmapCompressionHeader, TRUE) ||
997  !freerdp_settings_set_bool(settings, FreeRDP_RefreshRect, TRUE) ||
998  !freerdp_settings_set_bool(settings, FreeRDP_SuppressOutput, TRUE) ||
999  !freerdp_settings_set_uint32(settings, FreeRDP_GlyphSupportLevel, GLYPH_SUPPORT_NONE))
1000  goto out_fail;
1001  settings->GlyphCache = calloc(10, sizeof(GLYPH_CACHE_DEFINITION));
1002 
1003  if (!settings->GlyphCache)
1004  goto out_fail;
1005 
1006  settings->FragCache = calloc(1, sizeof(GLYPH_CACHE_DEFINITION));
1007 
1008  if (!settings->FragCache)
1009  goto out_fail;
1010 
1011  for (size_t x = 0; x < 10; x++)
1012  {
1013  GLYPH_CACHE_DEFINITION cache = { 0 };
1014  cache.cacheEntries = 254;
1015  switch (x)
1016  {
1017  case 0:
1018  case 1:
1019  cache.cacheMaximumCellSize = 4;
1020  break;
1021  case 2:
1022  case 3:
1023  cache.cacheMaximumCellSize = 8;
1024  break;
1025  case 4:
1026  cache.cacheMaximumCellSize = 16;
1027  break;
1028  case 5:
1029  cache.cacheMaximumCellSize = 32;
1030  break;
1031  case 6:
1032  cache.cacheMaximumCellSize = 64;
1033  break;
1034  case 7:
1035  cache.cacheMaximumCellSize = 128;
1036  break;
1037  case 8:
1038  cache.cacheMaximumCellSize = 256;
1039  break;
1040  case 9:
1041  cache.cacheMaximumCellSize = 256;
1042  break;
1043  default:
1044  goto out_fail;
1045  }
1046 
1047  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_GlyphCache, x, &cache))
1048  goto out_fail;
1049  }
1050  {
1051  GLYPH_CACHE_DEFINITION cache = { 0 };
1052  cache.cacheEntries = 256;
1053  cache.cacheMaximumCellSize = 256;
1054  if (!freerdp_settings_set_pointer_array(settings, FreeRDP_FragCache, 0, &cache))
1055  goto out_fail;
1056  }
1057  if (!freerdp_settings_set_uint32(settings, FreeRDP_OffscreenSupportLevel, 0) ||
1058  !freerdp_settings_set_uint32(settings, FreeRDP_OffscreenCacheSize, 7680) ||
1059  !freerdp_settings_set_uint32(settings, FreeRDP_OffscreenCacheEntries, 2000) ||
1060  !freerdp_settings_set_uint32(settings, FreeRDP_DrawNineGridCacheSize, 2560) ||
1061  !freerdp_settings_set_uint32(settings, FreeRDP_DrawNineGridCacheEntries, 256) ||
1062  !freerdp_settings_set_string(settings, FreeRDP_ClientDir, client_dll) ||
1063  !freerdp_settings_get_string(settings, FreeRDP_ClientDir) ||
1064  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteWndSupportLevel,
1065  WINDOW_LEVEL_SUPPORTED | WINDOW_LEVEL_SUPPORTED_EX) ||
1066  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteAppNumIconCaches, 3) ||
1067  !freerdp_settings_set_uint32(settings, FreeRDP_RemoteAppNumIconCacheEntries, 12) ||
1068  !freerdp_settings_set_uint32(settings, FreeRDP_VCChunkSize,
1069  (server && !remote) ? CHANNEL_CHUNK_MAX_LENGTH
1070  : CHANNEL_CHUNK_LENGTH) ||
1071  /* [MS-RDPBCGR] 2.2.7.2.7 Large Pointer Capability Set (TS_LARGE_POINTER_CAPABILITYSET)
1072  requires at least this size */
1073  !freerdp_settings_set_uint32(settings, FreeRDP_MultifragMaxRequestSize,
1074  server ? 0 : 608299) ||
1075  !freerdp_settings_set_bool(settings, FreeRDP_GatewayUseSameCredentials, FALSE) ||
1076  !freerdp_settings_set_bool(settings, FreeRDP_GatewayBypassLocal, FALSE) ||
1077  !freerdp_settings_set_bool(settings, FreeRDP_GatewayRpcTransport, TRUE) ||
1078  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpTransport, TRUE) ||
1079  !freerdp_settings_set_bool(settings, FreeRDP_GatewayUdpTransport, TRUE) ||
1080  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpUseWebsockets, TRUE) ||
1081  !freerdp_settings_set_bool(settings, FreeRDP_GatewayHttpExtAuthSspiNtlm, FALSE) ||
1082  !freerdp_settings_set_bool(settings, FreeRDP_GatewayArmTransport, FALSE) ||
1083  !freerdp_settings_set_bool(settings, FreeRDP_FastPathInput, TRUE) ||
1084  !freerdp_settings_set_bool(settings, FreeRDP_FastPathOutput, TRUE) ||
1085  !freerdp_settings_set_bool(settings, FreeRDP_LongCredentialsSupported, TRUE) ||
1086  !freerdp_settings_set_uint32(settings, FreeRDP_FrameAcknowledge, 2) ||
1087  !freerdp_settings_set_bool(settings, FreeRDP_MouseMotion, TRUE) ||
1088  !freerdp_settings_set_uint32(settings, FreeRDP_NSCodecColorLossLevel, 3) ||
1089  !freerdp_settings_set_bool(settings, FreeRDP_NSCodecAllowSubsampling, TRUE) ||
1090  !freerdp_settings_set_bool(settings, FreeRDP_NSCodecAllowDynamicColorFidelity, TRUE) ||
1091  !freerdp_settings_set_bool(settings, FreeRDP_AutoReconnectionEnabled, FALSE) ||
1092  !freerdp_settings_set_uint32(settings, FreeRDP_AutoReconnectMaxRetries, 20) ||
1093  !freerdp_settings_set_bool(settings, FreeRDP_GfxThinClient, FALSE) ||
1094  !freerdp_settings_set_bool(settings, FreeRDP_GfxSmallCache, TRUE) ||
1095  !freerdp_settings_set_bool(settings, FreeRDP_GfxProgressive, FALSE) ||
1096  !freerdp_settings_set_bool(settings, FreeRDP_GfxProgressiveV2, FALSE) ||
1097  !freerdp_settings_set_bool(settings, FreeRDP_GfxPlanar, TRUE) ||
1098  !freerdp_settings_set_bool(settings, FreeRDP_GfxH264, FALSE) ||
1099  !freerdp_settings_set_bool(settings, FreeRDP_GfxAVC444, FALSE) ||
1100  !freerdp_settings_set_bool(settings, FreeRDP_GfxSendQoeAck, FALSE))
1101  goto out_fail;
1102  {
1103  ARC_CS_PRIVATE_PACKET cookie = { 0 };
1104  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ClientAutoReconnectCookie, &cookie,
1105  1))
1106  goto out_fail;
1107  }
1108  {
1109  ARC_SC_PRIVATE_PACKET cookie = { 0 };
1110  if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ServerAutoReconnectCookie, &cookie,
1111  1))
1112  goto out_fail;
1113  }
1114 
1115  settings->ClientTimeZone = (LPTIME_ZONE_INFORMATION)calloc(1, sizeof(TIME_ZONE_INFORMATION));
1116 
1117  if (!settings->ClientTimeZone)
1118  goto out_fail;
1119 
1120  if (!settings->ServerMode)
1121  {
1122  DYNAMIC_TIME_ZONE_INFORMATION dynamic = { 0 };
1123  TIME_ZONE_INFORMATION* tz =
1124  freerdp_settings_get_pointer_writable(settings, FreeRDP_ClientTimeZone);
1125  WINPR_ASSERT(tz);
1126 
1127  GetTimeZoneInformation(tz);
1128  GetDynamicTimeZoneInformation(&dynamic);
1129 
1130  if (!freerdp_settings_set_string_from_utf16N(settings, FreeRDP_DynamicDSTTimeZoneKeyName,
1131  dynamic.TimeZoneKeyName,
1132  ARRAYSIZE(dynamic.TimeZoneKeyName)))
1133  goto out_fail;
1134 
1135  if (!freerdp_settings_set_bool(settings, FreeRDP_DynamicDaylightTimeDisabled,
1136  dynamic.DynamicDaylightTimeDisabled))
1137  goto out_fail;
1138  }
1139 
1140  if (!freerdp_settings_set_bool(settings, FreeRDP_TcpKeepAlive, TRUE) ||
1141  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveRetries, 3) ||
1142  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveDelay, 5) ||
1143  !freerdp_settings_set_uint32(settings, FreeRDP_TcpKeepAliveInterval, 2) ||
1144  !freerdp_settings_set_uint32(settings, FreeRDP_TcpAckTimeout, 9000) ||
1145  !freerdp_settings_set_uint32(settings, FreeRDP_TcpConnectTimeout, 15000))
1146  goto out_fail;
1147 
1148  if (!freerdp_settings_get_bool(settings, FreeRDP_ServerMode))
1149  {
1150  BOOL rc = FALSE;
1151  char* path = NULL;
1152  if (!freerdp_settings_set_bool(settings, FreeRDP_RedirectClipboard, TRUE))
1153  goto out_fail;
1154  /* these values are used only by the client part */
1155  path = GetKnownPath(KNOWN_PATH_HOME);
1156  rc = freerdp_settings_set_string(settings, FreeRDP_HomePath, path);
1157  free(path);
1158 
1159  if (!rc || !freerdp_settings_get_string(settings, FreeRDP_HomePath))
1160  goto out_fail;
1161 
1162  char* config = freerdp_settings_get_config_path();
1163  rc = freerdp_settings_set_string(settings, FreeRDP_ConfigPath, config);
1164  if (rc)
1165  {
1166  char* action = GetCombinedPath(config, "action.sh");
1167  rc = freerdp_settings_set_string(settings, FreeRDP_ActionScript, action);
1168  free(action);
1169  }
1170 
1171  free(config);
1172  if (!rc)
1173  goto out_fail;
1174  }
1175 
1176  settings_load_hkey_local_machine(settings);
1177 
1178  if (!freerdp_settings_set_bool(settings, FreeRDP_SmartcardLogon, FALSE))
1179  goto out_fail;
1180  if (!freerdp_settings_set_uint32(settings, FreeRDP_TlsSecLevel, 1))
1181  goto out_fail;
1182  settings->OrderSupport = calloc(1, 32);
1183 
1184  if (!freerdp_settings_set_uint16(settings, FreeRDP_TLSMinVersion, TLS1_VERSION))
1185  goto out_fail;
1186  if (!freerdp_settings_set_uint16(settings, FreeRDP_TLSMaxVersion, 0))
1187  goto out_fail;
1188 
1189  if (!settings->OrderSupport)
1190  goto out_fail;
1191 
1192  if (!freerdp_settings_set_default_order_support(settings))
1193  goto out_fail;
1194 
1195  const BOOL enable = freerdp_settings_get_bool(settings, FreeRDP_ServerMode);
1196 
1197  {
1198  const FreeRDP_Settings_Keys_Bool keys[] = { FreeRDP_SupportGraphicsPipeline,
1199  FreeRDP_SupportStatusInfoPdu,
1200  FreeRDP_SupportErrorInfoPdu,
1201  FreeRDP_SupportAsymetricKeys };
1202 
1203  for (size_t x = 0; x < ARRAYSIZE(keys); x++)
1204  {
1205  if (!freerdp_settings_set_bool(settings, keys[x], enable))
1206  goto out_fail;
1207  }
1208  }
1209 
1210  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportDynamicTimeZone, TRUE))
1211  goto out_fail;
1212  if (!freerdp_settings_set_bool(settings, FreeRDP_SupportSkipChannelJoin, TRUE))
1213  goto out_fail;
1214 
1215  return settings;
1216 out_fail:
1217  WINPR_PRAGMA_DIAG_PUSH
1218  WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
1219  freerdp_settings_free(settings);
1220  WINPR_PRAGMA_DIAG_POP
1221  return NULL;
1222 }
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.
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 96 of file settings_str.c.

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

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 1333 of file common/settings.c.

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

◆ 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 2082 of file common/settings.c.

2084 {
2085  WINPR_ASSERT(settings);
2086 
2087  if (!param)
2088  return freerdp_settings_set_string_copy_(settings, id, NULL, 0, TRUE);
2089 
2090  size_t len = 0;
2091 
2092  char* str = ConvertWCharToUtf8Alloc(param, &len);
2093  if (!str && (len != 0))
2094  return FALSE;
2095 
2096  return freerdp_settings_set_string_(settings, id, str, len);
2097 }

◆ 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 2099 of file common/settings.c.

2101 {
2102  size_t len = 0;
2103 
2104  WINPR_ASSERT(settings);
2105 
2106  if (!param)
2107  return freerdp_settings_set_string_copy_(settings, id, NULL, length, TRUE);
2108 
2109  char* str = ConvertWCharNToUtf8Alloc(param, length, &len);
2110  if (!str && (length != 0))
2111  {
2112  /* If the input string is an empty string, but length > 0
2113  * consider the conversion a success */
2114  const size_t wlen = _wcsnlen(param, length);
2115  if (wlen != 0)
2116  return FALSE;
2117  }
2118 
2119  return freerdp_settings_set_string_(settings, id, str, len);
2120 }

◆ 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 2018 of file common/settings.c.

2021 {
2022  WINPR_ASSERT(settings);
2023  WINPR_ASSERT(capsFlags || (capsCount == 0));
2024  WINPR_ASSERT(capsData || (capsCount == 0));
2025  WINPR_ASSERT(capsSizes || (capsCount == 0));
2026  WINPR_ASSERT(capsCount <= UINT16_MAX);
2027 
2028  for (UINT32 x = 0; x < capsCount; x++)
2029  {
2030  if (capsFlags[x])
2031  {
2032  wStream buffer;
2033  wStream* sub = Stream_StaticConstInit(&buffer, capsData[x], capsSizes[x]);
2034 
2035  if (!rdp_read_capability_set(sub, (UINT16)x, settings, serverReceivedCaps))
2036  return FALSE;
2037  }
2038  }
2039 
2040  return TRUE;
2041 }

◆ 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 2199 of file common/settings.c.

2200 {
2201  const UINT32 invalid = mask & ~(RNS_UD_32BPP_SUPPORT | RNS_UD_24BPP_SUPPORT |
2202  RNS_UD_16BPP_SUPPORT | RNS_UD_15BPP_SUPPORT);
2203 
2204  if (mask & RNS_UD_32BPP_SUPPORT)
2205  winpr_str_append("RNS_UD_32BPP_SUPPORT", buffer, size, "|");
2206  if (mask & RNS_UD_24BPP_SUPPORT)
2207  winpr_str_append("RNS_UD_24BPP_SUPPORT", buffer, size, "|");
2208  if (mask & RNS_UD_16BPP_SUPPORT)
2209  winpr_str_append("RNS_UD_16BPP_SUPPORT", buffer, size, "|");
2210  if (mask & RNS_UD_15BPP_SUPPORT)
2211  winpr_str_append("RNS_UD_15BPP_SUPPORT", buffer, size, "|");
2212 
2213  if (invalid != 0)
2214  {
2215  char str[32] = { 0 };
2216  (void)_snprintf(str, sizeof(str), "RNS_UD_INVALID[0x%04" PRIx32 "]", invalid);
2217  winpr_str_append(str, buffer, size, "|");
2218  }
2219  char hex[32] = { 0 };
2220  (void)_snprintf(hex, sizeof(hex), "[0x%04" PRIx16 "]", mask);
2221  return buffer;
2222 }