24 #ifndef FREERDP_SETTINGS_H
25 #define FREERDP_SETTINGS_H
27 #include <winpr/timezone.h>
28 #include <winpr/wlog.h>
30 #include <freerdp/api.h>
31 #include <freerdp/config.h>
32 #include <freerdp/types.h>
33 #include <freerdp/redirection.h>
35 #if !defined(WITH_OPAQUE_SETTINGS)
36 #include <freerdp/settings_types_private.h>
39 #include <freerdp/settings_keys.h>
40 #include <freerdp/settings_types.h>
42 #include <freerdp/crypto/certificate.h>
43 #include <freerdp/crypto/privatekey.h>
80 #define FREERDP_SETTINGS_SERVER_MODE 0x00000001
81 #define FREERDP_SETTINGS_REMOTE_MODE 0x00000002
151 const rdpSettings* other);
153 FREERDP_API
void freerdp_addin_argv_free(
ADDIN_ARGV* args);
155 WINPR_ATTR_MALLOC(freerdp_addin_argv_free, 1)
156 FREERDP_API
ADDIN_ARGV* freerdp_addin_argv_new(
size_t argc, const
char* const argv[]);
158 WINPR_ATTR_MALLOC(freerdp_addin_argv_free, 1)
161 FREERDP_API BOOL freerdp_addin_argv_add_argument(
ADDIN_ARGV* args, const
char* argument);
162 FREERDP_API BOOL freerdp_addin_argv_add_argument_ex(
ADDIN_ARGV* args, const
char* argument,
164 FREERDP_API BOOL freerdp_addin_argv_del_argument(
ADDIN_ARGV* args, const
char* argument);
166 FREERDP_API
int freerdp_addin_set_argument(
ADDIN_ARGV* args, const
char* argument);
167 FREERDP_API
int freerdp_addin_replace_argument(
ADDIN_ARGV* args, const
char* previous,
168 const
char* argument);
169 FREERDP_API
int freerdp_addin_set_argument_value(
ADDIN_ARGV* args, const
char* option,
171 FREERDP_API
int freerdp_addin_replace_argument_value(
ADDIN_ARGV* args, const
char* previous,
172 const
char* option, const
char* value);
174 FREERDP_API BOOL freerdp_device_collection_add(rdpSettings* settings,
RDPDR_DEVICE* device);
188 FREERDP_API
RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings,
190 FREERDP_API
RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings,
193 FREERDP_API
void freerdp_device_free(
RDPDR_DEVICE* device);
195 WINPR_ATTR_MALLOC(freerdp_device_free, 1)
196 FREERDP_API
RDPDR_DEVICE* freerdp_device_new(UINT32 Type,
size_t count,
197 const
char* const args[]);
199 WINPR_ATTR_MALLOC(freerdp_device_free, 1)
204 FREERDP_API
void freerdp_device_collection_free(rdpSettings* settings);
206 FREERDP_API BOOL freerdp_static_channel_collection_add(rdpSettings* settings,
208 FREERDP_API BOOL freerdp_static_channel_collection_del(rdpSettings* settings, const
char* name);
209 FREERDP_API
ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings,
211 #if defined(WITH_FREERDP_DEPRECATED)
215 FREERDP_API
void freerdp_static_channel_collection_free(rdpSettings* settings);
217 FREERDP_API BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings,
219 FREERDP_API BOOL freerdp_dynamic_channel_collection_del(rdpSettings* settings,
221 FREERDP_API
ADDIN_ARGV* freerdp_dynamic_channel_collection_find(
const rdpSettings* settings,
224 #if defined(WITH_FREERDP_DEPRECATED)
228 FREERDP_API
void freerdp_dynamic_channel_collection_free(rdpSettings* settings);
229 FREERDP_API
void freerdp_capability_buffer_free(rdpSettings* settings);
230 FREERDP_API BOOL freerdp_capability_buffer_copy(rdpSettings* settings,
const rdpSettings* src);
232 FREERDP_API
void freerdp_server_license_issuers_free(rdpSettings* settings);
233 FREERDP_API BOOL freerdp_server_license_issuers_copy(rdpSettings* settings,
char** addresses,
236 FREERDP_API
void freerdp_target_net_addresses_free(rdpSettings* settings);
237 FREERDP_API BOOL freerdp_target_net_addresses_copy(rdpSettings* settings,
char** addresses,
240 FREERDP_API
void freerdp_performance_flags_make(rdpSettings* settings);
241 FREERDP_API
void freerdp_performance_flags_split(rdpSettings* settings);
244 UINT32 GatewayUsageMethod);
245 FREERDP_API
void freerdp_update_gateway_usage_method(rdpSettings* settings,
246 UINT32 GatewayEnabled,
247 UINT32 GatewayBypassLocal);
253 #if defined(WITH_FREERDP_DEPRECATED)
254 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_get_bool instead",
255 BOOL freerdp_get_param_bool(
const rdpSettings* settings,
257 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_bool instead",
258 int freerdp_set_param_bool(rdpSettings* settings,
int id,
261 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_get_int[16|32] instead",
262 int freerdp_get_param_int(
const rdpSettings* settings,
264 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_int[16|32] instead",
265 int freerdp_set_param_int(rdpSettings* settings,
int id,
268 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_uint32 instead",
269 UINT32 freerdp_get_param_uint32(
const rdpSettings* settings,
271 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_uint32 instead",
272 int freerdp_set_param_uint32(rdpSettings* settings,
int id,
275 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_get_uint64 instead",
276 UINT64 freerdp_get_param_uint64(
const rdpSettings* settings,
278 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_uint64 instead",
279 int freerdp_set_param_uint64(rdpSettings* settings,
int id,
282 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_get_string instead",
283 char* freerdp_get_param_string(
const rdpSettings* settings,
285 FREERDP_API WINPR_DEPRECATED_VAR(
"Use freerdp_settings_set_string instead",
286 int freerdp_set_param_string(rdpSettings* settings,
int id,
309 FreeRDP_Settings_Keys_Bool
id);
330 FreeRDP_Settings_Keys_Int16
id);
341 FreeRDP_Settings_Keys_Int16
id, INT16 param);
351 FreeRDP_Settings_Keys_UInt16
id);
362 FreeRDP_Settings_Keys_UInt16
id, UINT16 param);
372 FreeRDP_Settings_Keys_Int32
id);
383 FreeRDP_Settings_Keys_Int32
id, INT32 param);
393 FreeRDP_Settings_Keys_UInt32
id);
404 FreeRDP_Settings_Keys_UInt32
id, UINT32 param);
414 FreeRDP_Settings_Keys_Int64
id);
425 FreeRDP_Settings_Keys_Int64
id, INT64 param);
435 FreeRDP_Settings_Keys_UInt64
id);
446 FreeRDP_Settings_Keys_UInt64
id, UINT64 param);
456 FreeRDP_Settings_Keys_String
id);
466 FreeRDP_Settings_Keys_String
id);
478 FreeRDP_Settings_Keys_String
id,
479 const char* param,
size_t len);
490 FreeRDP_Settings_Keys_String
id,
505 FreeRDP_Settings_Keys_String
id,
506 const char* separator,
const char* param);
517 FreeRDP_Settings_Keys_String
id,
530 FreeRDP_Settings_Keys_String
id,
531 const WCHAR* param,
size_t length);
540 FreeRDP_Settings_Keys_String
id,
551 FreeRDP_Settings_Keys_Pointer
id);
561 FreeRDP_Settings_Keys_Pointer
id);
572 FreeRDP_Settings_Keys_Pointer
id,
584 FreeRDP_Settings_Keys_Pointer
id,
585 const void* data,
size_t len);
587 FREERDP_API
const void* freerdp_settings_get_pointer_array(
const rdpSettings* settings,
588 FreeRDP_Settings_Keys_Pointer
id,
590 FREERDP_API
void* freerdp_settings_get_pointer_array_writable(
const rdpSettings* settings,
591 FreeRDP_Settings_Keys_Pointer
id,
593 FREERDP_API BOOL freerdp_settings_set_pointer_array(rdpSettings* settings,
594 FreeRDP_Settings_Keys_Pointer
id,
595 size_t offset,
const void* data);
597 FREERDP_API BOOL freerdp_settings_set_value_for_name(rdpSettings* settings,
const char* name,
674 const BYTE** capsData,
675 const UINT32* capsSizes, UINT32 capsCount,
676 BOOL serverReceivedCaps);
717 FREERDP_API
const char* freerdp_encryption_level_string(UINT32 EncryptionLevel);
718 FREERDP_API
const char* freerdp_encryption_methods_string(UINT32 EncryptionLevel,
char* buffer,
732 WINPR_ATTR_MALLOC(free, 1)
FREERDP_API void freerdp_settings_dump(wLog *log, DWORD level, const rdpSettings *settings)
Dumps the contents of a settings struct to a WLog logger.
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_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.
FREERDP_API BOOL freerdp_settings_set_string(rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param)
Sets a string settings value. The param is copied.
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.
FREERDP_API const void * freerdp_settings_get_pointer(const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a immutable pointer settings value.
FREERDP_API INT64 freerdp_settings_get_int64(const rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id)
Returns a INT64 settings value.
FREERDP_API 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.
FREERDP_API const char * freerdp_settings_get_type_name_for_type(SSIZE_T type)
Returns the type name for a type.
FREERDP_API SSIZE_T freerdp_settings_get_type_for_name(const char *value)
Get a key type for the name string of that key.
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 char * freerdp_settings_get_string_writable(rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a string settings value.
FREERDP_API SSIZE_T freerdp_settings_get_type_for_key(SSIZE_T key)
Get a key type for the key index.
FREERDP_API rdpSettings * freerdp_settings_new(DWORD flags)
creates a new setting struct
FREERDP_API BOOL freerdp_settings_are_valid(const rdpSettings *settings)
Returns TRUE if settings are in a valid state, FALSE otherwise.
FREERDP_API UINT64 freerdp_settings_get_uint64(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id)
Returns a UINT64 settings 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.
FREERDP_API const char * freerdp_settings_get_string(const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a immutable string settings value.
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.
FREERDP_API BOOL freerdp_settings_set_pointer_len(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data, size_t len)
Set a pointer to value data.
FREERDP_API const char * freerdp_supported_color_depths_string(UINT16 mask, char *buffer, size_t size)
returns a string representation of RNS_UD_XXBPP_SUPPORT values
FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id, INT32 param)
Sets a INT32 settings value.
FREERDP_API char * freerdp_settings_get_config_path(void)
return the configuration directory for the library
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
FREERDP_API void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.
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_copy(rdpSettings *dst, const rdpSettings *src)
Deep copies settings from src to dst.
FREERDP_API const char * freerdp_rdpdr_dtyp_string(UINT32 type)
Returns a string representation of RDPDR_DTYP_*.
FREERDP_API const char * freerdp_settings_get_server_name(const rdpSettings *settings)
A helper function to return the correct server name.
FREERDP_API rdpSettings * freerdp_settings_clone(const rdpSettings *settings)
Creates a deep copy of settings.
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.
FREERDP_API BOOL freerdp_set_gateway_usage_method(rdpSettings *settings, UINT32 GatewayUsageMethod)
FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id, UINT64 param)
Sets a UINT64 settings value.
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.
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_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.
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 UINT32 freerdp_settings_get_codecs_flags(const rdpSettings *settings)
helper function to get a mask of supported codec flags.
FREERDP_API const char * freerdp_rdp_version_string(UINT32 version)
Returns a stringified representation of the RDP protocol version.
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.
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_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 no...
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.
FREERDP_API const char * freerdp_settings_get_type_name_for_key(SSIZE_T key)
Returns the type name for a key.
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, BOOL param)
Sets a BOOL settings value.
FREERDP_API void * freerdp_settings_get_pointer_writable(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a mutable pointer settings value.
FREERDP_API const char * freerdp_settings_get_name_for_key(SSIZE_T key)
Returns the type name for a key.