21#include <freerdp/config.h>
22#include <freerdp/version.h>
24#include "../settings.h"
26#include <winpr/assert.h>
29#include <winpr/synch.h>
30#include <winpr/print.h>
31#include <winpr/stream.h>
32#include <winpr/winsock.h>
33#include <winpr/cred.h>
34#include <winpr/bcrypt.h>
36#include <freerdp/log.h>
37#include <freerdp/error.h>
38#include <freerdp/crypto/certificate.h>
39#include <freerdp/utils/ringbuffer.h>
40#include <freerdp/utils/smartcardlogon.h>
41#include <freerdp/utils/aad.h>
47#include "../credssp_auth.h"
50#include "../../crypto/crypto.h"
51#include "../../crypto/certificate.h"
52#include "../../crypto/opensslcompat.h"
55#include "../redirection.h"
57#include <winpr/json.h>
71typedef struct rdp_arm rdpArm;
73#define TAG FREERDP_TAG("core.gateway.arm")
76static BOOL arm_tls_connect(rdpArm* arm, rdpTls* tls, UINT32 timeout)
82 BIO* socketBio = NULL;
83 BIO* bufferedBio = NULL;
84 rdpSettings* settings = arm->context->settings;
93 const char* proxyUsername = NULL;
94 const char* proxyPassword = NULL;
95 BOOL isProxyConnection =
96 proxy_prepare(settings, &peerHostname, &peerPort, &proxyUsername, &proxyPassword);
98 sockfd = freerdp_tcp_connect(arm->context, peerHostname, peerPort, timeout);
100 WLog_Print(arm->log, WLOG_DEBUG,
"connecting to %s %d", peerHostname, peerPort);
104 socketBio = BIO_new(BIO_s_simple_socket());
108 closesocket((SOCKET)sockfd);
112 BIO_set_fd(socketBio, sockfd, BIO_CLOSE);
113 bufferedBio = BIO_new(BIO_s_buffered_socket());
117 BIO_free_all(socketBio);
121 bufferedBio = BIO_push(bufferedBio, socketBio);
125 status = BIO_set_nonblock(bufferedBio, TRUE);
127 if (isProxyConnection)
129 if (!proxy_connect(arm->context, bufferedBio, proxyUsername, proxyPassword,
133 BIO_free_all(bufferedBio);
140 BIO_free_all(bufferedBio);
145 tls->port = MIN(UINT16_MAX, WINPR_ASSERTING_INT_CAST(int32_t, settings->GatewayPort));
146 tls->isGatewayTransport = TRUE;
147 status = freerdp_tls_connect(tls, bufferedBio);
150 rdpContext* context = arm->context;
152 freerdp_set_last_error_if_not(context, FREERDP_ERROR_TLS_CONNECT_FAILED);
154 freerdp_set_last_error_if_not(context, FREERDP_ERROR_CONNECT_CANCELLED);
158 return (status >= 1);
161static BOOL arm_fetch_wellknown(rdpArm* arm)
164 WINPR_ASSERT(arm->context);
165 WINPR_ASSERT(arm->context->rdp);
167 rdpRdp* rdp = arm->context->rdp;
173 const BOOL useTenant =
175 const char* tenantid =
"common";
180 rdp->wellknown = freerdp_utils_aad_get_wellknown(arm->log, base, tenantid);
181 return rdp->wellknown ? TRUE : FALSE;
184static wStream* arm_build_http_request(rdpArm* arm,
const char* method,
185 TRANSFER_ENCODING transferEncoding,
const char* content_type,
186 size_t content_length)
189 HttpRequest* request = NULL;
190 const char* uri = NULL;
193 WINPR_ASSERT(method);
194 WINPR_ASSERT(content_type);
196 WINPR_ASSERT(arm->context);
197 WINPR_ASSERT(arm->context->rdp);
199 uri = http_context_get_uri(arm->http);
200 request = http_request_new();
205 if (!http_request_set_method(request, method) || !http_request_set_uri(request, uri))
212 pGetCommonAccessToken GetCommonAccessToken = freerdp_get_common_access_token(arm->context);
213 if (!GetCommonAccessToken)
215 WLog_Print(arm->log, WLOG_ERROR,
"No authorization token provided");
219 if (!arm_fetch_wellknown(arm))
222 if (!GetCommonAccessToken(arm->context, ACCESS_TOKEN_TYPE_AVD, &token, 0))
224 WLog_Print(arm->log, WLOG_ERROR,
"Unable to obtain access token");
237 if (!http_request_set_auth_scheme(request,
"Bearer") ||
238 !http_request_set_auth_param(
243 if (!http_request_set_transfer_encoding(request, transferEncoding) ||
244 !http_request_set_content_length(request, content_length) ||
245 !http_request_set_content_type(request, content_type))
248 s = http_request_write(arm->http, request);
250 http_request_free(request);
253 Stream_SealLength(s);
258static BOOL arm_send_http_request(rdpArm* arm, rdpTls* tls,
const char* method,
259 const char* content_type,
const char* data,
size_t content_length)
263 arm_build_http_request(arm, method, TransferEncodingIdentity, content_type, content_length);
268 const size_t sz = Stream_Length(s);
269 status = freerdp_tls_write_all(tls, Stream_Buffer(s), sz);
271 Stream_Free(s, TRUE);
272 if (status >= 0 && content_length > 0 && data)
273 status = freerdp_tls_write_all(tls, (
const BYTE*)data, content_length);
275 return (status >= 0);
278static void arm_free(rdpArm* arm)
283 freerdp_tls_free(arm->tls);
284 http_context_free(arm->http);
289static rdpArm* arm_new(rdpContext* context)
291 WINPR_ASSERT(context);
293 rdpArm* arm = (rdpArm*)calloc(1,
sizeof(rdpArm));
297 arm->log = WLog_Get(TAG);
298 arm->context = context;
299 arm->tls = freerdp_tls_new(context);
303 arm->http = http_context_new();
315static char* arm_create_request_json(rdpArm* arm)
318 char* message = NULL;
324 goto arm_create_cleanup;
333 goto arm_create_cleanup;
365static WINPR_CIPHER_CTX* treatAuthBlob(wLog* log,
const BYTE* pbInput,
size_t cbInput,
368 WINPR_CIPHER_CTX* ret = NULL;
369 char algoName[100] = { 0 };
371 WINPR_ASSERT(pBlockSize);
372 SSIZE_T algoSz = ConvertWCharNToUtf8((
const WCHAR*)pbInput, cbInput /
sizeof(WCHAR), algoName,
373 sizeof(algoName) - 1);
376 WLog_Print(log, WLOG_ERROR,
"invalid algoName");
380 if (strcmp(algoName,
"AES") != 0)
382 WLog_Print(log, WLOG_ERROR,
"only AES is supported for now");
386 *pBlockSize = WINPR_AES_BLOCK_SIZE;
387 const size_t algoLen = WINPR_ASSERTING_INT_CAST(
size_t, (algoSz + 1)) *
sizeof(WCHAR);
388 if (cbInput < algoLen)
390 WLog_Print(log, WLOG_ERROR,
"invalid AuthBlob size");
398 wStream* s = Stream_StaticConstInit(&staticStream, &pbInput[algoLen], cbInput);
400 if (!Stream_CheckAndLogRequiredLengthWLog(log, s, 12))
403 const UINT32 dwMagic = Stream_Get_UINT32(s);
404 if (dwMagic != BCRYPT_KEY_DATA_BLOB_MAGIC)
406 WLog_Print(log, WLOG_ERROR,
"unsupported authBlob type");
410 const UINT32 dwVersion = Stream_Get_UINT32(s);
411 if (dwVersion != BCRYPT_KEY_DATA_BLOB_VERSION1)
413 WLog_Print(log, WLOG_ERROR,
"unsupported authBlob version %" PRIu32
", expecting %d",
414 dwVersion, BCRYPT_KEY_DATA_BLOB_VERSION1);
418 const UINT32 cbKeyData = Stream_Get_UINT32(s);
419 if (!Stream_CheckAndLogRequiredLengthWLog(log, s, cbKeyData))
421 WLog_Print(log, WLOG_ERROR,
"invalid authBlob size");
425 WINPR_CIPHER_TYPE cipherType = 0;
429 cipherType = WINPR_CIPHER_AES_128_CBC;
432 cipherType = WINPR_CIPHER_AES_192_CBC;
435 cipherType = WINPR_CIPHER_AES_256_CBC;
438 WLog_Print(log, WLOG_ERROR,
"invalid authBlob cipher size");
442 ret = winpr_Cipher_NewEx(cipherType, WINPR_ENCRYPT, Stream_Pointer(s), cbKeyData, NULL, 0);
445 WLog_Print(log, WLOG_ERROR,
"error creating cipher");
449 if (!winpr_Cipher_SetPadding(ret, TRUE))
451 WLog_Print(log, WLOG_ERROR,
"unable to enable padding on cipher");
452 winpr_Cipher_Free(ret);
459static BOOL arm_stringEncodeW(
const BYTE* pin,
size_t cbIn, BYTE** ppOut,
size_t* pcbOut)
465 char* b64encoded = crypto_base64_encode_ex(pin, cbIn, TRUE);
471 *ppOut = (BYTE*)ConvertUtf8NToWCharAlloc(b64encoded, strlen(b64encoded), &outSz);
477 *pcbOut = (outSz + 1) *
sizeof(WCHAR);
481static BOOL arm_encodeRedirectPasswd(wLog* log, rdpSettings* settings,
const rdpCertificate* cert,
482 WINPR_CIPHER_CTX* cipher,
size_t blockSize)
486 BYTE* finalOutput = NULL;
492 size_t wpasswdLen = 0;
496 WLog_Print(log, WLOG_ERROR,
"error when converting password to UTF16");
500 const size_t wpasswdBytes = (wpasswdLen + 1) *
sizeof(WCHAR);
501 BYTE* encryptedPass = calloc(1, wpasswdBytes + blockSize);
506 size_t encryptedPassLen = 0;
507 if (!winpr_Cipher_Update(cipher, wpasswd, wpasswdBytes, encryptedPass, &encryptedPassLen))
510 if (encryptedPassLen > wpasswdBytes)
514 if (!winpr_Cipher_Final(cipher, &encryptedPass[encryptedPassLen], &finalLen))
516 WLog_Print(log, WLOG_ERROR,
"error when ciphering password");
519 encryptedPassLen += finalLen;
522 size_t output_length = 0;
523 if (!freerdp_certificate_publickey_encrypt(cert, encryptedPass, encryptedPassLen, &output,
526 WLog_Print(log, WLOG_ERROR,
"unable to encrypt with the server's public key");
530 size_t finalOutputLen = 0;
531 if (!arm_stringEncodeW(output, output_length, &finalOutput, &finalOutputLen))
533 WLog_Print(log, WLOG_ERROR,
"unable to base64+utf16 final blob");
540 WLog_Print(log, WLOG_ERROR,
"unable to set the redirection password in settings");
544 settings->RdstlsSecurity = TRUE;
545 settings->AadSecurity = FALSE;
546 settings->NlaSecurity = FALSE;
547 settings->RdpSecurity = FALSE;
548 settings->TlsSecurity = FALSE;
549 settings->RedirectionFlags = LB_PASSWORD_IS_PK_ENCRYPTED;
563static BOOL arm_pick_base64Utf16Field(wLog* log,
const WINPR_JSON* json,
const char* name,
564 BYTE** poutput,
size_t* plen)
577 BYTE* output1 = NULL;
579 crypto_base64_decode(nodeValue, strlen(nodeValue), &output1, &len1);
580 if (!output1 || !len1)
582 WLog_Print(log, WLOG_ERROR,
"error when first unbase64 for %s", name);
588 char* output2 = ConvertWCharNToUtf8Alloc((WCHAR*)output1, len1 /
sizeof(WCHAR), &len2);
590 if (!output2 || !len2)
592 WLog_Print(log, WLOG_ERROR,
"error when decode('utf-16') for %s", name);
598 crypto_base64_decode(output2, len2, &output, plen);
600 if (!output || !*plen)
602 WLog_Print(log, WLOG_ERROR,
"error when second unbase64 for %s", name);
631static size_t arm_parse_ipvx_count(WINPR_JSON* ipvX)
642static BOOL arm_parse_ipv6(rdpSettings* settings, WINPR_JSON* ipv6,
size_t* pAddressIdx)
644 WINPR_ASSERT(settings);
646 WINPR_ASSERT(pAddressIdx);
656 for (
size_t j = 0; j < naddresses; j++)
663 if (utils_str_is_empty(addr))
666 if (*pAddressIdx >= count)
668 WLog_ERR(TAG,
"Exceeded TargetNetAddresses, parsing failed");
672 if (!freerdp_settings_set_pointer_array(settings, FreeRDP_TargetNetAddresses,
673 (*pAddressIdx)++, addr))
679static BOOL arm_parse_ipv4(rdpSettings* settings, WINPR_JSON* ipv4,
size_t* pAddressIdx)
681 WINPR_ASSERT(settings);
683 WINPR_ASSERT(pAddressIdx);
691 for (
size_t j = 0; j < naddresses; j++)
697 WINPR_JSON* publicIpNode =
702 if (!utils_str_is_empty(publicIp))
704 if (*pAddressIdx >= count)
706 WLog_ERR(TAG,
"Exceeded TargetNetAddresses, parsing failed");
709 if (!freerdp_settings_set_pointer_array(settings, FreeRDP_TargetNetAddresses,
710 (*pAddressIdx)++, publicIp))
715 WINPR_JSON* privateIpNode =
720 if (!utils_str_is_empty(privateIp))
722 if (*pAddressIdx >= count)
724 WLog_ERR(TAG,
"Exceeded TargetNetAddresses, parsing failed");
727 if (!freerdp_settings_set_pointer_array(settings, FreeRDP_TargetNetAddresses,
728 (*pAddressIdx)++, privateIp))
736static BOOL arm_treat_azureInstanceNetworkMetadata(wLog* log,
const char* metadata,
737 rdpSettings* settings)
741 WINPR_ASSERT(settings);
743 if (!freerdp_target_net_adresses_reset(settings, 0))
749 WLog_Print(log, WLOG_ERROR,
"invalid azureInstanceNetworkMetadata");
762 WLog_Print(log, WLOG_ERROR,
"expecting interface to be an Array");
767 if (interfaceSz == 0)
769 WLog_WARN(TAG,
"no addresses in azure instance metadata");
775 for (
size_t i = 0; i < interfaceSz; i++)
783 count += arm_parse_ipvx_count(ipv6);
787 count += arm_parse_ipvx_count(ipv4);
790 if (!freerdp_target_net_adresses_reset(settings, count))
793 size_t addressIdx = 0;
794 for (
size_t i = 0; i < interfaceSz; i++)
803 if (!arm_parse_ipv6(settings, ipv6, &addressIdx))
810 if (!arm_parse_ipv4(settings, ipv4, &addressIdx))
814 if (addressIdx > UINT32_MAX)
820 ret = addressIdx > 0;
827static void zfree(
char* str)
838static BOOL arm_fill_rdstls(rdpArm* arm, rdpSettings* settings,
const WINPR_JSON* json,
839 const rdpCertificate* redirectedServerCert)
843 BYTE* authBlob = NULL;
869 WINPR_ASSERT(arm->context);
870 WINPR_ASSERT(arm->context->instance);
872 char* username = NULL;
873 char* password = NULL;
877 domain = _strdup(ddomain);
879 username = _strdup(duser);
882 IFCALLRESULT(FALSE, arm->context->instance->AuthenticateEx, arm->context->instance,
883 &username, &password, &domain, AUTH_RDSTLS);
891 if (!rc || !rc1 || !rc2 || !rc3)
896 WINPR_JSON* redirectedAuthGuidNode =
902 if (!redirectedAuthGuid)
905 size_t wGUID_len = 0;
906 wGUID = ConvertUtf8ToWCharAlloc(redirectedAuthGuid, &wGUID_len);
907 if (!wGUID || (wGUID_len == 0))
909 WLog_Print(arm->log, WLOG_ERROR,
"unable to allocate space for redirectedAuthGuid");
914 (wGUID_len + 1) *
sizeof(WCHAR));
918 WLog_Print(arm->log, WLOG_ERROR,
"unable to set RedirectionGuid");
923 size_t authBlobLen = 0;
924 if (!arm_pick_base64Utf16Field(arm->log, json,
"redirectedAuthBlob", &authBlob, &authBlobLen))
927 size_t blockSize = 0;
928 WINPR_CIPHER_CTX* cipher = treatAuthBlob(arm->log, authBlob, authBlobLen, &blockSize);
933 arm_encodeRedirectPasswd(arm->log, settings, redirectedServerCert, cipher, blockSize);
934 winpr_Cipher_Free(cipher);
946static BOOL arm_fill_gateway_parameters(rdpArm* arm,
const char* message,
size_t len)
949 WINPR_ASSERT(arm->context);
950 WINPR_ASSERT(message);
952 rdpCertificate* redirectedServerCert = NULL;
958 rdpSettings* settings = arm->context->settings;
961 if (gwurlstr != NULL)
963 WLog_Print(arm->log, WLOG_DEBUG,
"extracted target url %s", gwurlstr);
968 WINPR_JSON* serverNameNode =
981 const char key[] =
"redirectedUsername";
984 const char* userName = NULL;
993 WINPR_JSON* azureMeta =
1000 WLog_Print(arm->log, WLOG_ERROR,
"error when treating azureInstanceNetworkMetadata");
1008 if (arm_pick_base64Utf16Field(arm->log, json,
"redirectedServerCert", &cert, &certLen))
1010 const BOOL rc = rdp_redirection_read_target_cert(&redirectedServerCert, cert, certLen);
1014 else if (!rdp_set_target_certificate(settings, redirectedServerCert))
1021 status = arm_fill_rdstls(arm, settings, json, redirectedServerCert);
1025 freerdp_certificate_free(redirectedServerCert);
1029static BOOL arm_handle_request_ok(rdpArm* arm,
const HttpResponse* response)
1031 const size_t len = http_response_get_body_length(response);
1032 const char* msg = (
const char*)http_response_get_body(response);
1033 if (strnlen(msg, len + 1) > len)
1036 WLog_Print(arm->log, WLOG_DEBUG,
"Got HTTP Response data: %s", msg);
1037 return arm_fill_gateway_parameters(arm, msg, len);
1040static BOOL arm_handle_bad_request(rdpArm* arm,
const HttpResponse* response, BOOL* retry)
1042 WINPR_ASSERT(response);
1043 WINPR_ASSERT(retry);
1049 const size_t len = http_response_get_body_length(response);
1050 const char* msg = (
const char*)http_response_get_body(response);
1051 if (strnlen(msg, len + 1) > len)
1054 WLog_Print(arm->log, WLOG_DEBUG,
"Got HTTP Response data: %s", msg);
1060 if (error_ptr != NULL)
1061 WLog_Print(arm->log, WLOG_ERROR,
"NullPoException: %s", error_ptr);
1068 if (gw_code_str == NULL)
1070 WLog_Print(arm->log, WLOG_ERROR,
"Response has no \"Code\" property");
1071 http_response_log_error_status(WLog_Get(TAG), WLOG_ERROR, response);
1075 if (strcmp(gw_code_str,
"E_PROXY_ORCHESTRATION_LB_SESSIONHOST_DEALLOCATED") == 0)
1081 WLog_WARN(TAG,
"Starting your VM. It may take up to 5 minutes");
1083 WLog_WARN(TAG,
"%s", msgstr);
1084 freerdp_set_last_error_if_not(arm->context, FREERDP_ERROR_CONNECT_TARGET_BOOTING);
1088 http_response_log_error_status(WLog_Get(TAG), WLOG_ERROR, response);
1098static BOOL arm_handle_request(rdpArm* arm, BOOL* retry, DWORD timeout)
1100 WINPR_ASSERT(retry);
1102 if (!arm_fetch_wellknown(arm))
1110 char* message = NULL;
1113 HttpResponse* response = NULL;
1114 long StatusCode = 0;
1116 if (!http_context_set_uri(arm->http,
"/api/arm/v2/connections/") ||
1117 !http_context_set_accept(arm->http,
"application/json") ||
1118 !http_context_set_cache_control(arm->http,
"no-cache") ||
1119 !http_context_set_pragma(arm->http,
"no-cache") ||
1120 !http_context_set_connection(arm->http,
"Keep-Alive") ||
1121 !http_context_set_user_agent(arm->http, FREERDP_USER_AGENT) ||
1122 !http_context_set_x_ms_user_agent(arm->http, FREERDP_USER_AGENT) ||
1124 FreeRDP_GatewayHostname)))
1127 if (!arm_tls_connect(arm, arm->tls, timeout))
1130 message = arm_create_request_json(arm);
1134 if (!arm_send_http_request(arm, arm->tls,
"POST",
"application/json", message, strlen(message)))
1137 response = http_response_recv(arm->tls, TRUE);
1141 StatusCode = http_response_get_status_code(response);
1142 if (StatusCode == HTTP_STATUS_OK)
1144 if (!arm_handle_request_ok(arm, response))
1147 else if (StatusCode == HTTP_STATUS_BAD_REQUEST)
1149 if (!arm_handle_bad_request(arm, response, retry))
1154 http_response_log_error_status(WLog_Get(TAG), WLOG_ERROR, response);
1160 http_response_free(response);
1167BOOL arm_resolve_endpoint(wLog* log, rdpContext* context, DWORD timeout)
1170 WLog_Print(log, WLOG_ERROR,
"arm gateway support not compiled in");
1177 if (!context->settings)
1183 WLog_Print(log, WLOG_ERROR,
"loadBalanceInfo and RemoteApplicationProgram needed");
1187 rdpArm* arm = arm_new(context);
1197 freerdp* instance = context->instance;
1198 WINPR_ASSERT(instance);
1199 SSIZE_T delay = IFCALLRESULT(-1, instance->RetryDialog, instance,
"arm-transport",
1200 arm->gateway_retry, arm);
1201 arm->gateway_retry++;
1206 WLog_Print(arm->log, WLOG_DEBUG,
"Delay for %" PRIdz
"ms before next attempt",
1210 DWORD slp = (UINT32)delay;
1211 if (delay > UINT32_MAX)
1218 rc = arm_handle_request(arm, &retry, timeout);
1220 }
while (retry && rc);
WINPR_API BOOL WINPR_JSON_HasObjectItem(const WINPR_JSON *object, const char *string)
Check if JSON has an object matching the name.
WINPR_API BOOL WINPR_JSON_IsString(const WINPR_JSON *item)
Check if JSON item is of type String.
WINPR_API WINPR_JSON * WINPR_JSON_CreateObject(void)
WINPR_JSON_CreateObject.
WINPR_API WINPR_JSON * WINPR_JSON_GetArrayItem(const WINPR_JSON *array, size_t index)
Return a pointer to an item in the array.
WINPR_API WINPR_JSON * WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON *object, const char *string)
Same as WINPR_JSON_GetObjectItem but with case sensitive matching.
WINPR_API WINPR_JSON * WINPR_JSON_AddStringToObject(WINPR_JSON *object, const char *name, const char *string)
WINPR_JSON_AddStringToObject.
WINPR_API WINPR_JSON * WINPR_JSON_ParseWithLength(const char *value, size_t buffer_length)
Parse a JSON string.
WINPR_API char * WINPR_JSON_PrintUnformatted(WINPR_JSON *item)
Serialize a JSON instance to string without formatting for human readable formatted output see WINPR_...
WINPR_API const char * WINPR_JSON_GetStringValue(WINPR_JSON *item)
Return the String value of a JSON item.
WINPR_API WINPR_JSON * WINPR_JSON_AddNullToObject(WINPR_JSON *object, const char *name)
WINPR_JSON_AddNullToObject.
WINPR_API void WINPR_JSON_Delete(WINPR_JSON *item)
Delete a WinPR JSON wrapper object.
WINPR_API size_t WINPR_JSON_GetArraySize(const WINPR_JSON *array)
Get the number of arrayitems from an array.
WINPR_API BOOL WINPR_JSON_IsArray(const WINPR_JSON *item)
Check if JSON item is of type Array.
WINPR_API const char * WINPR_JSON_GetErrorPtr(void)
Return an error string.
WINPR_API WINPR_JSON * WINPR_JSON_Parse(const char *value)
Parse a '\0' terminated JSON string.
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 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 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 const void * freerdp_settings_get_pointer(const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a immutable pointer settings value.
FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id, UINT32 param)
Sets a UINT32 settings value.
FREERDP_API const char * freerdp_settings_get_string(const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a immutable string settings value.