2011-07-01 05:23:36 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-01 05:23:36 +04:00
|
|
|
* RDP Settings
|
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Jay Sorg
|
2012-11-08 03:23:25 +04:00
|
|
|
* Copyright 2010-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2016-02-26 16:50:27 +03:00
|
|
|
* Copyright 2016 Armin Novak <armin.novak@gmail.com>
|
2023-02-09 10:48:11 +03:00
|
|
|
* Copyright 2023 Armin Novak <anovak@thincast.com>
|
|
|
|
* Copyright 2023 Thincast Technologies GmbH
|
2011-07-01 05:23:36 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-11-08 08:29:24 +04:00
|
|
|
#ifndef FREERDP_SETTINGS_H
|
|
|
|
#define FREERDP_SETTINGS_H
|
2011-07-01 05:23:36 +04:00
|
|
|
|
2016-02-23 20:08:18 +03:00
|
|
|
#include <winpr/timezone.h>
|
2021-01-18 19:27:40 +03:00
|
|
|
#include <winpr/wlog.h>
|
2016-02-23 20:08:18 +03:00
|
|
|
|
2012-11-09 04:01:52 +04:00
|
|
|
#include <freerdp/api.h>
|
2023-10-16 10:32:27 +03:00
|
|
|
#include <freerdp/config.h>
|
2011-07-07 21:37:48 +04:00
|
|
|
#include <freerdp/types.h>
|
2023-01-16 10:42:16 +03:00
|
|
|
#include <freerdp/redirection.h>
|
2011-07-08 08:37:25 +04:00
|
|
|
|
2023-10-16 13:59:19 +03:00
|
|
|
#if !defined(WITH_OPAQUE_SETTINGS)
|
|
|
|
#include <freerdp/settings_types_private.h>
|
|
|
|
#endif
|
|
|
|
|
2023-10-16 10:32:27 +03:00
|
|
|
#include <freerdp/settings_keys.h>
|
|
|
|
#include <freerdp/settings_types.h>
|
|
|
|
|
2023-02-03 13:40:35 +03:00
|
|
|
#include <freerdp/crypto/certificate.h>
|
|
|
|
#include <freerdp/crypto/privatekey.h>
|
|
|
|
|
2023-03-14 11:27:55 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \file
|
|
|
|
* \brief This is the FreeRDP settings module.
|
|
|
|
*
|
|
|
|
* 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)
|
|
|
|
*/
|
|
|
|
|
2023-10-16 10:32:27 +03:00
|
|
|
typedef struct rdp_settings rdpSettings;
|
2020-04-11 12:55:11 +03:00
|
|
|
|
2013-10-13 02:20:25 +04:00
|
|
|
/**
|
2019-11-06 17:24:51 +03:00
|
|
|
* rdpSettings creation flags
|
2019-05-08 15:35:25 +03:00
|
|
|
*/
|
2019-11-06 17:24:51 +03:00
|
|
|
#define FREERDP_SETTINGS_SERVER_MODE 0x00000001
|
2023-11-02 17:38:13 +03:00
|
|
|
#define FREERDP_SETTINGS_REMOTE_MODE 0x00000002
|
2019-11-06 17:24:51 +03:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief creates a new setting struct
|
|
|
|
*
|
|
|
|
* \param flags Flags for creation, use \b FREERDP_SETTINGS_SERVER_MODE for server settings, 0
|
|
|
|
* for client.
|
|
|
|
*
|
|
|
|
* \return A newly allocated settings struct or NULL
|
|
|
|
*/
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API rdpSettings* freerdp_settings_new(DWORD flags);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Creates a deep copy of settings
|
|
|
|
*
|
|
|
|
* \param settings A pointer to a settings struct to copy. May be NULL (returns NULL)
|
|
|
|
*
|
|
|
|
* \return A newly allocated copy of \b settings or NULL
|
|
|
|
*/
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API rdpSettings* freerdp_settings_clone(const rdpSettings* settings);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
2022-12-09 16:35:03 +03:00
|
|
|
/** \brief Deep copies settings from \b src to \b dst
|
2022-11-25 14:09:40 +03:00
|
|
|
*
|
2022-12-09 16:35:03 +03:00
|
|
|
* The function frees up all allocated data in \b dst before copying the data from \b src
|
2022-11-25 14:09:40 +03:00
|
|
|
*
|
|
|
|
* \param dst A pointer for the settings to copy data to. May be NULL (fails copy)
|
|
|
|
* \param src A pointer to the settings to copy. May be NULL (fails copy)
|
|
|
|
*
|
2022-12-09 16:35:03 +03:00
|
|
|
* \return \b TRUE for success, \b FALSE for failure.
|
2022-11-25 14:09:40 +03:00
|
|
|
*/
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_copy(rdpSettings* dst, const rdpSettings* src);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
2023-10-13 13:24:05 +03:00
|
|
|
/** \brief copies one setting identified by \b id from \b src to \b dst
|
|
|
|
*
|
|
|
|
* The function frees up all allocated data in \b dst before copying the data from \b src
|
|
|
|
*
|
|
|
|
* \param dst A pointer for the settings to copy data to. May be NULL (fails copy)
|
|
|
|
* \param src A pointer to the settings to copy. May be NULL (fails copy)
|
|
|
|
* \param id The settings identifier to copy
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
FREERDP_API BOOL freerdp_settings_copy_item(rdpSettings* dst, const rdpSettings* src,
|
|
|
|
size_t id);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Free a settings struct with all data in it
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to free, May be NULL
|
|
|
|
*/
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API void freerdp_settings_free(rdpSettings* settings);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Dumps the contents of a settings struct to a WLog logger
|
|
|
|
*
|
|
|
|
* \param log The logger to write to, must not be NULL
|
|
|
|
* \param level The WLog level to use for the log entries
|
|
|
|
* \param settings A pointer to the settings to dump. May be NULL.
|
|
|
|
*/
|
2021-01-18 19:27:40 +03:00
|
|
|
FREERDP_API void freerdp_settings_dump(wLog* log, DWORD level, const rdpSettings* settings);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Dumps the difference between two settings structs to a WLog
|
|
|
|
*
|
|
|
|
* \param log The logger to write to, must not be NULL.
|
|
|
|
* \param level The WLog level to use for the log entries.
|
|
|
|
* \param src A pointer to the settings to dump. May be NULL.
|
|
|
|
* \param other A pointer to the settings to dump. May be NULL.
|
|
|
|
*
|
|
|
|
* \return \b TRUE if not equal, \b FALSE otherwise
|
|
|
|
*/
|
2022-04-19 12:35:35 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_print_diff(wLog* log, DWORD level, const rdpSettings* src,
|
|
|
|
const rdpSettings* other);
|
2021-01-18 19:27:40 +03:00
|
|
|
|
2021-04-12 11:38:40 +03:00
|
|
|
FREERDP_API ADDIN_ARGV* freerdp_addin_argv_new(size_t argc, const char* argv[]);
|
|
|
|
FREERDP_API ADDIN_ARGV* freerdp_addin_argv_clone(const ADDIN_ARGV* args);
|
|
|
|
FREERDP_API void freerdp_addin_argv_free(ADDIN_ARGV* args);
|
|
|
|
|
|
|
|
FREERDP_API BOOL freerdp_addin_argv_add_argument(ADDIN_ARGV* args, const char* argument);
|
|
|
|
FREERDP_API BOOL freerdp_addin_argv_add_argument_ex(ADDIN_ARGV* args, const char* argument,
|
|
|
|
size_t len);
|
|
|
|
FREERDP_API BOOL freerdp_addin_argv_del_argument(ADDIN_ARGV* args, const char* argument);
|
|
|
|
|
|
|
|
FREERDP_API int freerdp_addin_set_argument(ADDIN_ARGV* args, const char* argument);
|
|
|
|
FREERDP_API int freerdp_addin_replace_argument(ADDIN_ARGV* args, const char* previous,
|
|
|
|
const char* argument);
|
|
|
|
FREERDP_API int freerdp_addin_set_argument_value(ADDIN_ARGV* args, const char* option,
|
|
|
|
const char* value);
|
|
|
|
FREERDP_API int freerdp_addin_replace_argument_value(ADDIN_ARGV* args, const char* previous,
|
|
|
|
const char* option, const char* value);
|
2019-11-06 17:24:51 +03:00
|
|
|
|
|
|
|
FREERDP_API BOOL freerdp_device_collection_add(rdpSettings* settings, RDPDR_DEVICE* device);
|
|
|
|
FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find(rdpSettings* settings,
|
|
|
|
const char* name);
|
|
|
|
FREERDP_API RDPDR_DEVICE* freerdp_device_collection_find_type(rdpSettings* settings,
|
|
|
|
UINT32 type);
|
2021-10-07 11:43:16 +03:00
|
|
|
|
|
|
|
FREERDP_API RDPDR_DEVICE* freerdp_device_new(UINT32 Type, size_t count, const char* args[]);
|
|
|
|
FREERDP_API RDPDR_DEVICE* freerdp_device_clone(const RDPDR_DEVICE* device);
|
|
|
|
FREERDP_API void freerdp_device_free(RDPDR_DEVICE* device);
|
2022-05-02 15:20:12 +03:00
|
|
|
FREERDP_API BOOL freerdp_device_equal(const RDPDR_DEVICE* one, const RDPDR_DEVICE* other);
|
2021-10-07 11:43:16 +03:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API void freerdp_device_collection_free(rdpSettings* settings);
|
|
|
|
|
|
|
|
FREERDP_API BOOL freerdp_static_channel_collection_add(rdpSettings* settings,
|
|
|
|
ADDIN_ARGV* channel);
|
2021-04-12 11:38:40 +03:00
|
|
|
FREERDP_API BOOL freerdp_static_channel_collection_del(rdpSettings* settings, const char* name);
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings,
|
|
|
|
const char* name);
|
2021-06-22 15:39:10 +03:00
|
|
|
#if defined(WITH_FREERDP_DEPRECATED)
|
2021-04-12 11:38:40 +03:00
|
|
|
FREERDP_API WINPR_DEPRECATED(ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel));
|
2021-06-22 15:39:10 +03:00
|
|
|
#endif
|
2021-04-12 11:38:40 +03:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API void freerdp_static_channel_collection_free(rdpSettings* settings);
|
|
|
|
|
|
|
|
FREERDP_API BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings,
|
|
|
|
ADDIN_ARGV* channel);
|
2021-04-12 11:38:40 +03:00
|
|
|
FREERDP_API BOOL freerdp_dynamic_channel_collection_del(rdpSettings* settings,
|
|
|
|
const char* name);
|
2021-05-18 13:16:21 +03:00
|
|
|
FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(const rdpSettings* settings,
|
2019-11-06 17:24:51 +03:00
|
|
|
const char* name);
|
2021-04-12 11:38:40 +03:00
|
|
|
|
2021-06-22 15:39:10 +03:00
|
|
|
#if defined(WITH_FREERDP_DEPRECATED)
|
2021-04-12 11:38:40 +03:00
|
|
|
FREERDP_API WINPR_DEPRECATED(ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel));
|
2021-06-22 15:39:10 +03:00
|
|
|
#endif
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings);
|
2022-06-27 13:05:24 +03:00
|
|
|
FREERDP_API void freerdp_capability_buffer_free(rdpSettings* settings);
|
|
|
|
FREERDP_API BOOL freerdp_capability_buffer_copy(rdpSettings* settings, const rdpSettings* src);
|
2019-11-06 17:24:51 +03:00
|
|
|
|
2022-10-06 12:32:08 +03:00
|
|
|
FREERDP_API void freerdp_server_license_issuers_free(rdpSettings* settings);
|
|
|
|
FREERDP_API BOOL freerdp_server_license_issuers_copy(rdpSettings* settings, char** addresses,
|
|
|
|
UINT32 count);
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
FREERDP_API void freerdp_target_net_addresses_free(rdpSettings* settings);
|
2021-12-15 11:30:18 +03:00
|
|
|
FREERDP_API BOOL freerdp_target_net_addresses_copy(rdpSettings* settings, char** addresses,
|
|
|
|
UINT32 count);
|
2019-11-06 17:24:51 +03:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* DEPRECATED:
|
|
|
|
* the functions freerdp_get_param_* and freerdp_set_param_* are deprecated.
|
|
|
|
* use freerdp_settings_get_* and freerdp_settings_set_* as a replacement!
|
|
|
|
*/
|
2021-06-22 15:39:10 +03:00
|
|
|
#if defined(WITH_FREERDP_DEPRECATED)
|
2022-03-23 15:18:35 +03:00
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_get_bool instead",
|
|
|
|
BOOL freerdp_get_param_bool(const rdpSettings* settings,
|
2019-11-07 14:39:22 +03:00
|
|
|
int id));
|
2022-03-23 15:18:35 +03:00
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_bool instead",
|
|
|
|
int freerdp_set_param_bool(rdpSettings* settings, int id,
|
|
|
|
BOOL param));
|
|
|
|
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_get_int[16|32] instead",
|
|
|
|
int freerdp_get_param_int(const rdpSettings* settings,
|
|
|
|
int id));
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_int[16|32] instead",
|
|
|
|
int freerdp_set_param_int(rdpSettings* settings, int id,
|
|
|
|
int param));
|
|
|
|
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_uint32 instead",
|
|
|
|
UINT32 freerdp_get_param_uint32(const rdpSettings* settings,
|
|
|
|
int id));
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_uint32 instead",
|
|
|
|
int freerdp_set_param_uint32(rdpSettings* settings, int id,
|
|
|
|
UINT32 param));
|
|
|
|
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_get_uint64 instead",
|
|
|
|
UINT64 freerdp_get_param_uint64(const rdpSettings* settings,
|
|
|
|
int id));
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_uint64 instead",
|
|
|
|
int freerdp_set_param_uint64(rdpSettings* settings, int id,
|
|
|
|
UINT64 param));
|
|
|
|
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_get_string instead",
|
|
|
|
char* freerdp_get_param_string(const rdpSettings* settings,
|
|
|
|
int id));
|
|
|
|
FREERDP_API WINPR_DEPRECATED_VAR("Use freerdp_settings_set_string instead",
|
|
|
|
int freerdp_set_param_string(rdpSettings* settings, int id,
|
|
|
|
const char* param));
|
2021-06-22 15:39:10 +03:00
|
|
|
#endif
|
2013-03-20 23:33:33 +04:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a boolean settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the boolean key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Bool id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a BOOL settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, FreeRDP_Settings_Keys_Bool id,
|
|
|
|
BOOL param);
|
2013-03-20 23:33:33 +04:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a INT16 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the INT16 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API INT16 freerdp_settings_get_int16(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int16 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a INT16 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_int16(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int16 id, INT16 param);
|
2013-06-27 02:49:01 +04:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a UINT16 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the UINT16 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API UINT16 freerdp_settings_get_uint16(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt16 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a UINT16 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_uint16(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt16 id, UINT16 param);
|
2013-03-20 23:33:33 +04:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a INT32 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the INT32 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API INT32 freerdp_settings_get_int32(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int32 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a INT32 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int32 id, INT32 param);
|
2013-04-06 03:08:37 +04:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a UINT32 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the UINT32 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt32 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a UINT32 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt32 id, UINT32 param);
|
2019-03-21 15:08:59 +03:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a INT64 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the INT64 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API INT64 freerdp_settings_get_int64(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int64 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a INT64 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_int64(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Int64 id, INT64 param);
|
2019-03-21 15:08:59 +03:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a UINT64 settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the value of the UINT64 key
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API UINT64 freerdp_settings_get_uint64(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt64 id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a UINT64 settings value.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_UInt64 id, UINT64 param);
|
2019-03-21 15:08:59 +03:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a immutable string settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the immutable string pointer
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API const char* freerdp_settings_get_string(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Returns a string settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the string pointer
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API char* freerdp_settings_get_string_writable(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a string settings value. The \b param is copied.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set. If NULL allocates an empty string buffer of \b len size,
|
|
|
|
* otherwise a copy is created. \param len The length of \b param, 0 to remove the old entry.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_string_len(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2020-11-19 12:09:34 +03:00
|
|
|
const char* param, size_t len);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Sets a string settings value. The \b param is copied.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set. If NULL removes the old entry, otherwise a copy is created.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_string(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2019-11-06 17:24:51 +03:00
|
|
|
const char* param);
|
2019-03-21 15:08:59 +03:00
|
|
|
|
2023-10-13 16:02:02 +03:00
|
|
|
/** \brief appends a string to a settings value. The \b param is copied.
|
|
|
|
* If the initial value of the setting was not empty, <old value><separator><param> is created
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param separator The separator string to use. May be NULL (no separator)
|
|
|
|
* \param param The value to append
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_append_string(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2023-10-13 16:02:02 +03:00
|
|
|
const char* separator, const char* param);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Sets a string settings value. The \b param is converted to UTF-8 and the copy stored.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set. If NULL removes the old entry, otherwise a copy is created.
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_string_from_utf16(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2022-10-28 11:27:46 +03:00
|
|
|
const WCHAR* param);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Sets a string settings value. The \b param is converted to UTF-8 and the copy stored.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
* \param param The value to set. If NULL removes the old entry, otherwise a copy is created.
|
|
|
|
* \param length The length of the WCHAR string in number of WCHAR characters
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE for failure
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_string_from_utf16N(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2022-10-28 11:27:46 +03:00
|
|
|
const WCHAR* param, size_t length);
|
|
|
|
/** \brief Return an allocated UTF16 string
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings struct to use
|
|
|
|
* \param id The settings identifier
|
|
|
|
*
|
|
|
|
* \return An allocated, '\0' terminated WCHAR string or NULL
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API WCHAR* freerdp_settings_get_string_as_utf16(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_String id,
|
2022-10-28 11:27:46 +03:00
|
|
|
size_t* pCharLen);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a immutable pointer settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the immutable pointer value
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API const void* freerdp_settings_get_pointer(const rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Pointer id);
|
2022-11-25 14:09:40 +03:00
|
|
|
|
|
|
|
/** \brief Returns a mutable pointer settings value
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to query, must not be NULL.
|
|
|
|
* \param id The key to query
|
|
|
|
*
|
|
|
|
* \return the mutable pointer value
|
|
|
|
*/
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API void* freerdp_settings_get_pointer_writable(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Pointer id);
|
|
|
|
FREERDP_API BOOL freerdp_settings_set_pointer(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Pointer id,
|
2020-11-19 12:09:34 +03:00
|
|
|
const void* data);
|
2023-10-16 10:32:27 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_pointer_len(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Pointer id,
|
2020-11-19 12:09:34 +03:00
|
|
|
const void* data, size_t len);
|
|
|
|
|
|
|
|
FREERDP_API const void* freerdp_settings_get_pointer_array(const rdpSettings* settings,
|
2023-10-16 10:32:27 +03:00
|
|
|
FreeRDP_Settings_Keys_Pointer id,
|
|
|
|
size_t offset);
|
2020-11-19 12:09:34 +03:00
|
|
|
FREERDP_API void* freerdp_settings_get_pointer_array_writable(const rdpSettings* settings,
|
2023-10-16 10:32:27 +03:00
|
|
|
FreeRDP_Settings_Keys_Pointer id,
|
|
|
|
size_t offset);
|
|
|
|
FREERDP_API BOOL freerdp_settings_set_pointer_array(rdpSettings* settings,
|
|
|
|
FreeRDP_Settings_Keys_Pointer id,
|
2020-11-19 12:09:34 +03:00
|
|
|
size_t offset, const void* data);
|
2013-03-20 23:33:33 +04:00
|
|
|
|
2020-04-11 12:55:11 +03:00
|
|
|
FREERDP_API BOOL freerdp_settings_set_value_for_name(rdpSettings* settings, const char* name,
|
|
|
|
const char* value);
|
|
|
|
|
2022-11-28 14:35:02 +03:00
|
|
|
/** \brief Get a key index for the name string of that key
|
|
|
|
*
|
|
|
|
* \param value A key name string like FreeRDP_ServerMode
|
|
|
|
*
|
|
|
|
* \return The key index or -1 in case of an error (e.g. name does not exist)
|
|
|
|
*/
|
2020-04-11 12:55:11 +03:00
|
|
|
FREERDP_API SSIZE_T freerdp_settings_get_key_for_name(const char* value);
|
2022-11-28 14:35:02 +03:00
|
|
|
|
|
|
|
/** \brief Get a key type for the name string of that key
|
|
|
|
*
|
|
|
|
* \param value A key name string like FreeRDP_ServerMode
|
|
|
|
*
|
|
|
|
* \return The key type (e.g. FREERDP_SETTINGS_TYPE_BOOL) or -1 in case of an error (e.g. name
|
|
|
|
* does not exist)
|
|
|
|
*/
|
2020-04-11 12:55:11 +03:00
|
|
|
FREERDP_API SSIZE_T freerdp_settings_get_type_for_name(const char* value);
|
2022-10-25 15:12:29 +03:00
|
|
|
|
2022-11-28 14:35:02 +03:00
|
|
|
/** \brief Get a key type for the key index
|
|
|
|
*
|
|
|
|
* \param key The key index like FreeRDP_ServerMode
|
|
|
|
*
|
|
|
|
* \return The key type (e.g. FREERDP_SETTINGS_TYPE_BOOL) or -1 in case of an error (e.g. name
|
|
|
|
* does not exist)
|
|
|
|
*/
|
2020-04-11 12:55:11 +03:00
|
|
|
FREERDP_API SSIZE_T freerdp_settings_get_type_for_key(size_t key);
|
2022-10-25 15:12:29 +03:00
|
|
|
FREERDP_API const char* freerdp_settings_get_type_name_for_key(size_t key);
|
|
|
|
FREERDP_API const char* freerdp_settings_get_type_name_for_type(SSIZE_T type);
|
|
|
|
|
2020-04-11 12:55:11 +03:00
|
|
|
FREERDP_API const char* freerdp_settings_get_name_for_key(size_t key);
|
2021-03-12 18:54:45 +03:00
|
|
|
FREERDP_API UINT32 freerdp_settings_get_codecs_flags(const rdpSettings* settings);
|
2020-04-11 12:55:11 +03:00
|
|
|
|
2022-11-28 14:35:02 +03:00
|
|
|
/** \brief 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.
|
|
|
|
*
|
|
|
|
* \param settings A pointer to the settings to use
|
|
|
|
* \param capsFlags A pointer to the capablity flags, must have capsCount fields
|
|
|
|
* \param capsData A pointer array to the RAW capability data, must have capsCount fields
|
|
|
|
* \param capsSizes A pointer to an array of RAW capability sizes, must have capsCount fields
|
|
|
|
* \param capsCount The number of capabilities contained in the RAW data
|
|
|
|
* \param serverReceivedCaps Indicates if the parser should assume to be a server or client
|
|
|
|
* instance
|
|
|
|
*
|
|
|
|
* \return \b TRUE for success, \b FALSE in case of an error
|
|
|
|
*/
|
|
|
|
FREERDP_API BOOL freerdp_settings_update_from_caps(rdpSettings* settings, const BYTE* capsFlags,
|
|
|
|
const BYTE** capsData,
|
|
|
|
const UINT32* capsSizes, UINT32 capsCount,
|
|
|
|
BOOL serverReceivedCaps);
|
2022-10-05 10:30:37 +03:00
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief 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.
|
|
|
|
*
|
|
|
|
* \param settings The settings to query, must not be NULL.
|
|
|
|
*
|
|
|
|
* \return A string pointer or NULL in case of failure.
|
|
|
|
*/
|
2022-10-14 20:39:12 +03:00
|
|
|
FREERDP_API const char* freerdp_settings_get_server_name(const rdpSettings* settings);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a stringified representation of RAIL support flags
|
|
|
|
*
|
|
|
|
* \param flags The flags to stringify
|
|
|
|
* \param buffer A pointer to the string buffer to write to
|
|
|
|
* \param length The size of the string buffer
|
|
|
|
*
|
|
|
|
* \return A pointer to \b buffer for success, NULL otherwise
|
|
|
|
*/
|
2022-06-29 13:35:31 +03:00
|
|
|
FREERDP_API char* freerdp_rail_support_flags_to_string(UINT32 flags, char* buffer,
|
|
|
|
size_t length);
|
|
|
|
|
2022-11-25 14:09:40 +03:00
|
|
|
/** \brief Returns a stringified representation of the RDP protocol version.
|
|
|
|
*
|
|
|
|
* \param version The RDP protocol version number.
|
|
|
|
*
|
|
|
|
* \return A string representation of the protocol version as "RDP_VERSION_10_11" or
|
|
|
|
* "RDP_VERSION_UNKNOWN" for invalid/unknown versions
|
|
|
|
*/
|
2022-10-12 13:37:54 +03:00
|
|
|
FREERDP_API const char* freerdp_rdp_version_string(UINT32 version);
|
|
|
|
|
2022-12-15 12:33:59 +03:00
|
|
|
/** \brief Returns a string representation of \b RDPDR_DTYP_*
|
|
|
|
*
|
|
|
|
* \param type The integer of the \b RDPDR_DTYP_* to stringify
|
|
|
|
*
|
|
|
|
* \return A string representation of the \b RDPDR_DTYP_* or "RDPDR_DTYP_UNKNOWN"
|
|
|
|
*/
|
|
|
|
FREERDP_API const char* freerdp_rdpdr_dtyp_string(UINT32 type);
|
|
|
|
|
2023-01-17 17:36:18 +03:00
|
|
|
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);
|
|
|
|
|
2023-04-13 13:52:38 +03:00
|
|
|
/** \brief returns a string representation of \b RNS_UD_XXBPP_SUPPORT values
|
|
|
|
*
|
|
|
|
* return A string reprenentation of the bitmask.
|
|
|
|
*/
|
|
|
|
FREERDP_API const char* freerdp_supported_color_depths_string(UINT16 mask, char* buffer,
|
|
|
|
size_t size);
|
|
|
|
|
2013-01-22 18:42:01 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-11-08 08:29:24 +04:00
|
|
|
#endif /* FREERDP_SETTINGS_H */
|