21#include <freerdp/config.h>
26#include <winpr/assert.h>
29#include <winpr/path.h>
30#include <winpr/cmdline.h>
31#include <winpr/winsock.h>
33#include <freerdp/log.h>
34#include <freerdp/version.h>
36#include <winpr/tools/makecert.h>
39#include <sys/select.h>
45#define TAG SERVER_TAG("shadow")
47static const char bind_address[] =
"bind-address,";
49#define fail_at(arg, rc) fail_at_((arg), (rc), __FILE__, __func__, __LINE__)
53 const DWORD level = WLOG_ERROR;
54 wLog* log = WLog_Get(TAG);
55 if (WLog_IsLevelActive(log, level))
56 WLog_PrintMessage(log, WLOG_MESSAGE_TEXT, level, line, file, fkt,
57 "Command line parsing failed at '%s' value '%s' [%d]", arg->Name,
62static int command_line_compare(
const void* pa,
const void* pb)
74 return strcmp(a->Name, b->Name);
77static int shadow_server_print_command_line_help(
int argc,
char** argv,
80 if ((argc < 1) || !largs || !argv)
84 char* path = winpr_GetConfigFilePath(TRUE,
"SAM");
85 printf(
"Usage: %s [options]\n", argv[0]);
87 printf(
"Notes: By default NLA security is active.\n");
88 printf(
"\tIn this mode a SAM database is required.\n");
89 printf(
"\tProvide one with /sam-file:<file with path>\n");
90 printf(
"\telse the default path %s is used.\n", path);
91 printf(
"\tIf there is no existing SAM file authentication for all users will fail.\n");
92 printf(
"\n\tIf authentication against PAM is desired, start with -sec-nla (requires "
94 "support for PAM)\n\n");
96 printf(
" /flag (enables flag)\n");
97 printf(
" /option:<value> (specifies option with value)\n");
98 printf(
" +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')\n");
107 while (arg->Name != NULL)
125 if (arg->Flags & COMMAND_LINE_VALUE_FLAG)
128 printf(
"%-20s\n", arg->Name);
129 printf(
"\t%s\n", arg->Text);
131 else if ((arg->Flags & COMMAND_LINE_VALUE_REQUIRED) ||
132 (arg->Flags & COMMAND_LINE_VALUE_OPTIONAL))
138 const size_t length = (strlen(arg->Name) + strlen(arg->Format) + 2);
139 char* str = (
char*)calloc(length + 1,
sizeof(
char));
144 (void)sprintf_s(str, length + 1,
"%s:%s", arg->Name, arg->Format);
145 (void)printf(
"%-20s\n", str);
150 printf(
"%-20s\n", arg->Name);
153 printf(
"\t%s\n", arg->Text);
155 else if (arg->Flags & COMMAND_LINE_VALUE_BOOL)
157 const size_t length = strlen(arg->Name) + 32;
158 char* str = calloc(length + 1,
sizeof(
char));
163 (void)sprintf_s(str, length + 1,
"%s (default:%s)", arg->Name,
164 arg->Default ?
"on" :
"off");
165 (void)printf(
" %s", arg->Default ?
"-" :
"+");
166 (void)printf(
"%-20s\n", str);
167 (void)printf(
"\t%s\n", arg->Text);
171 }
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
179int shadow_server_command_line_status_print(rdpShadowServer* server,
int argc,
char** argv,
182 WINPR_UNUSED(server);
184 if (status == COMMAND_LINE_STATUS_PRINT_VERSION)
186 printf(
"FreeRDP version %s (git %s)\n", FREERDP_VERSION_FULL, FREERDP_GIT_REVISION);
187 return COMMAND_LINE_STATUS_PRINT_VERSION;
189 else if (status == COMMAND_LINE_STATUS_PRINT_BUILDCONFIG)
191 printf(
"%s\n", freerdp_get_build_config());
192 return COMMAND_LINE_STATUS_PRINT_BUILDCONFIG;
194 else if (status == COMMAND_LINE_STATUS_PRINT)
196 return COMMAND_LINE_STATUS_PRINT;
200 if (shadow_server_print_command_line_help(argc, argv, cargs) < 0)
203 return COMMAND_LINE_STATUS_PRINT_HELP;
209int shadow_server_parse_command_line(rdpShadowServer* server,
int argc,
char** argv,
215 rdpSettings* settings = server->settings;
217 if ((argc < 2) || !argv || !cargs)
220 CommandLineClearArgumentsA(cargs);
221 flags = COMMAND_LINE_SEPARATOR_COLON;
222 flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS;
223 status = CommandLineParseArgumentsA(argc, argv, cargs, flags, server, NULL, NULL);
233 if (!(arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT))
236 CommandLineSwitchStart(arg) CommandLineSwitchCase(arg,
"port")
238 long val = strtol(arg->Value, NULL, 0);
240 if ((errno != 0) || (val <= 0) || (val > UINT16_MAX))
241 return fail_at(arg, COMMAND_LINE_ERROR);
243 server->port = (DWORD)val;
245 CommandLineSwitchCase(arg,
"ipc-socket")
248 if (server->ipcSocket)
249 return fail_at(arg, COMMAND_LINE_ERROR);
250 server->ipcSocket = _strdup(arg->Value);
252 if (!server->ipcSocket)
253 return fail_at(arg, COMMAND_LINE_ERROR);
255 CommandLineSwitchCase(arg,
"bind-address")
258 size_t len = strlen(arg->Value) +
sizeof(bind_address);
260 if (server->ipcSocket)
261 return fail_at(arg, COMMAND_LINE_ERROR);
262 server->ipcSocket = calloc(len,
sizeof(CHAR));
264 if (!server->ipcSocket)
265 return fail_at(arg, COMMAND_LINE_ERROR);
267 rc = _snprintf(server->ipcSocket, len,
"%s%s", bind_address, arg->Value);
268 if ((rc < 0) || ((
size_t)rc != len - 1))
269 return fail_at(arg, COMMAND_LINE_ERROR);
271 CommandLineSwitchCase(arg,
"may-view")
273 server->mayView = arg->Value ? TRUE : FALSE;
275 CommandLineSwitchCase(arg,
"bitmap-compat")
277 server->SupportMultiRectBitmapUpdates = arg->Value ? FALSE : TRUE;
279 CommandLineSwitchCase(arg,
"may-interact")
281 server->mayInteract = arg->Value ? TRUE : FALSE;
283 CommandLineSwitchCase(arg,
"server-side-cursor")
285 server->ShowMouseCursor = arg->Value ? TRUE : FALSE;
287 CommandLineSwitchCase(arg,
"mouse-relative")
289 const BOOL val = arg->Value ? TRUE : FALSE;
292 return fail_at(arg, COMMAND_LINE_ERROR);
294 CommandLineSwitchCase(arg,
"max-connections")
297 unsigned long val = strtoul(arg->Value, NULL, 0);
299 if ((errno != 0) || (val > UINT32_MAX))
300 return fail_at(arg, COMMAND_LINE_ERROR);
301 server->maxClientsConnected = val;
303 CommandLineSwitchCase(arg,
"rect")
311 char* str = _strdup(arg->Value);
314 return fail_at(arg, COMMAND_LINE_ERROR);
317 p = strchr(p + 1,
',');
322 return fail_at(arg, COMMAND_LINE_ERROR);
327 p = strchr(p + 1,
',');
332 return fail_at(arg, COMMAND_LINE_ERROR);
337 p = strchr(p + 1,
',');
342 return fail_at(arg, COMMAND_LINE_ERROR);
347 x = strtol(tok[0], NULL, 0);
352 y = strtol(tok[1], NULL, 0);
357 w = strtol(tok[2], NULL, 0);
362 h = strtol(tok[3], NULL, 0);
370 if ((x < 0) || (y < 0) || (w < 1) || (h < 1) || (errno != 0))
371 return fail_at(arg, COMMAND_LINE_ERROR);
373 if ((x > UINT16_MAX) || (y > UINT16_MAX) || (x + w > UINT16_MAX) ||
374 (y + h > UINT16_MAX))
375 return fail_at(arg, COMMAND_LINE_ERROR);
376 server->subRect.left = (UINT16)x;
377 server->subRect.top = (UINT16)y;
378 server->subRect.right = (UINT16)(x + w);
379 server->subRect.bottom = (UINT16)(y + h);
380 server->shareSubRect = TRUE;
382 CommandLineSwitchCase(arg,
"auth")
384 server->authentication = arg->Value ? TRUE : FALSE;
386 CommandLineSwitchCase(arg,
"remote-guard")
389 arg->Value ? TRUE : FALSE))
390 return fail_at(arg, COMMAND_LINE_ERROR);
392 CommandLineSwitchCase(arg,
"restricted-admin")
395 arg->Value ? TRUE : FALSE))
396 return fail_at(arg, COMMAND_LINE_ERROR);
398 CommandLineSwitchCase(arg,
"vmconnect")
401 arg->Value ? TRUE : FALSE))
402 return fail_at(arg, COMMAND_LINE_ERROR);
404 CommandLineSwitchCase(arg,
"sec")
406 if (strcmp(
"rdp", arg->Value) == 0)
409 return fail_at(arg, COMMAND_LINE_ERROR);
411 return fail_at(arg, COMMAND_LINE_ERROR);
413 return fail_at(arg, COMMAND_LINE_ERROR);
415 return fail_at(arg, COMMAND_LINE_ERROR);
417 return fail_at(arg, COMMAND_LINE_ERROR);
419 else if (strcmp(
"tls", arg->Value) == 0)
422 return fail_at(arg, COMMAND_LINE_ERROR);
424 return fail_at(arg, COMMAND_LINE_ERROR);
426 return fail_at(arg, COMMAND_LINE_ERROR);
428 return fail_at(arg, COMMAND_LINE_ERROR);
430 else if (strcmp(
"nla", arg->Value) == 0)
433 return fail_at(arg, COMMAND_LINE_ERROR);
435 return fail_at(arg, COMMAND_LINE_ERROR);
437 return fail_at(arg, COMMAND_LINE_ERROR);
439 return fail_at(arg, COMMAND_LINE_ERROR);
441 else if (strcmp(
"ext", arg->Value) == 0)
444 return fail_at(arg, COMMAND_LINE_ERROR);
446 return fail_at(arg, COMMAND_LINE_ERROR);
448 return fail_at(arg, COMMAND_LINE_ERROR);
450 return fail_at(arg, COMMAND_LINE_ERROR);
454 WLog_ERR(TAG,
"unknown protocol security: %s", arg->Value);
455 return fail_at(arg, COMMAND_LINE_ERROR_UNEXPECTED_VALUE);
458 CommandLineSwitchCase(arg,
"sec-rdp")
461 arg->Value ? TRUE : FALSE))
462 return fail_at(arg, COMMAND_LINE_ERROR);
464 CommandLineSwitchCase(arg,
"sec-tls")
467 arg->Value ? TRUE : FALSE))
468 return fail_at(arg, COMMAND_LINE_ERROR);
470 CommandLineSwitchCase(arg,
"sec-nla")
473 arg->Value ? TRUE : FALSE))
474 return fail_at(arg, COMMAND_LINE_ERROR);
476 CommandLineSwitchCase(arg,
"sec-ext")
479 arg->Value ? TRUE : FALSE))
480 return fail_at(arg, COMMAND_LINE_ERROR);
482 CommandLineSwitchCase(arg,
"sam-file")
485 return fail_at(arg, COMMAND_LINE_ERROR);
487 CommandLineSwitchCase(arg,
"log-level")
489 wLog* root = WLog_GetRoot();
491 if (!WLog_SetStringLogLevel(root, arg->Value))
492 return fail_at(arg, COMMAND_LINE_ERROR);
494 CommandLineSwitchCase(arg,
"log-filters")
496 if (!WLog_AddStringLogFilters(arg->Value))
497 return fail_at(arg, COMMAND_LINE_ERROR);
499 CommandLineSwitchCase(arg,
"nsc")
502 return fail_at(arg, COMMAND_LINE_ERROR);
504 CommandLineSwitchCase(arg,
"rfx")
507 arg->Value ? TRUE : FALSE))
508 return fail_at(arg, COMMAND_LINE_ERROR);
510 CommandLineSwitchCase(arg,
"gfx")
513 arg->Value ? TRUE : FALSE))
514 return fail_at(arg, COMMAND_LINE_ERROR);
516 CommandLineSwitchCase(arg,
"gfx-progressive")
519 arg->Value ? TRUE : FALSE))
520 return fail_at(arg, COMMAND_LINE_ERROR);
522 CommandLineSwitchCase(arg,
"gfx-rfx")
525 arg->Value ? TRUE : FALSE))
526 return fail_at(arg, COMMAND_LINE_ERROR);
528 CommandLineSwitchCase(arg,
"gfx-planar")
531 return fail_at(arg, COMMAND_LINE_ERROR);
533 CommandLineSwitchCase(arg,
"gfx-avc420")
536 return fail_at(arg, COMMAND_LINE_ERROR);
538 CommandLineSwitchCase(arg,
"gfx-avc444")
541 arg->Value ? TRUE : FALSE))
542 return fail_at(arg, COMMAND_LINE_ERROR);
544 return fail_at(arg, COMMAND_LINE_ERROR);
546 CommandLineSwitchCase(arg,
"keytab")
549 return fail_at(arg, COMMAND_LINE_ERROR);
551 CommandLineSwitchCase(arg,
"ccache")
554 return fail_at(arg, COMMAND_LINE_ERROR);
556 CommandLineSwitchCase(arg,
"tls-secrets-file")
559 return fail_at(arg, COMMAND_LINE_ERROR);
561 CommandLineSwitchDefault(arg)
564 CommandLineSwitchEnd(arg)
565 }
while ((arg = CommandLineFindNextArgumentA(arg)) != NULL);
567 arg = CommandLineFindArgumentA(cargs,
"monitors");
569 if (arg && (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT))
571 UINT32 numMonitors = 0;
573 numMonitors = shadow_enum_monitors(monitors, 16);
575 if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
578 long val = strtol(arg->Value, NULL, 0);
580 if ((val < 0) || (errno != 0) || ((UINT32)val >= numMonitors))
581 status = COMMAND_LINE_STATUS_PRINT;
583 server->selectedMonitor = (UINT32)val;
589 for (UINT32 index = 0; index < numMonitors; index++)
592 const INT64 width = monitor->right - monitor->left + 1;
593 const INT64 height = monitor->bottom - monitor->top + 1;
594 WLog_INFO(TAG,
" %s [%d] %" PRId64
"x%" PRId64
"\t+%" PRId32
"+%" PRId32
"",
595 (monitor->flags == 1) ?
"*" :
" ", index, width, height, monitor->left,
599 status = COMMAND_LINE_STATUS_PRINT;
609 return COMMAND_LINE_ERROR;
614static DWORD WINAPI shadow_server_thread(LPVOID arg)
616 rdpShadowServer* server = (rdpShadowServer*)arg;
619 freerdp_listener* listener = server->listener;
620 shadow_subsystem_start(server->subsystem);
624 HANDLE events[MAXIMUM_WAIT_OBJECTS] = { 0 };
626 events[nCount++] = server->StopEvent;
627 nCount += listener->GetEventHandles(listener, &events[nCount], ARRAYSIZE(events) - nCount);
631 WLog_ERR(TAG,
"Failed to get FreeRDP file descriptor");
635 status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
646 if (!listener->CheckFileDescriptor(listener))
648 WLog_ERR(TAG,
"Failed to check FreeRDP file descriptor");
662 listener->Close(listener);
663 shadow_subsystem_stop(server->subsystem);
667 if (shadow_client_boardcast_quit(server, 0))
669 while (ArrayList_Count(server->clients) > 0)
679static BOOL open_port(rdpShadowServer* server,
char* address)
682 char* modaddr = address;
686 if (modaddr[0] ==
'[')
688 char* end = strchr(address,
']');
691 WLog_ERR(TAG,
"Could not parse bind-address %s", address);
697 WLog_ERR(TAG,
"Excess data after IPv6 address: '%s'", end);
703 status = server->listener->Open(server->listener, modaddr, (UINT16)server->port);
708 "Problem creating TCP listener. (Port already used or insufficient permissions?)");
714int shadow_server_start(rdpShadowServer* server)
723 if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
727 (void)signal(SIGPIPE, SIG_IGN);
729 server->screen = shadow_screen_new(server);
733 WLog_ERR(TAG,
"screen_new failed");
737 server->capture = shadow_capture_new(server);
739 if (!server->capture)
741 WLog_ERR(TAG,
"capture_new failed");
751 ipc = server->ipcSocket && (strncmp(bind_address, server->ipcSocket,
752 strnlen(bind_address,
sizeof(bind_address))) != 0);
757 char** ptr = CommandLineParseCommaSeparatedValuesEx(NULL, server->ipcSocket, &count);
758 if (!ptr || (count <= 1))
760 if (server->ipcSocket == NULL)
762 if (!open_port(server, NULL))
764 CommandLineParserFree(ptr);
770 CommandLineParserFree(ptr);
775 WINPR_ASSERT(ptr || (count == 0));
776 for (
size_t x = 1; x < count; x++)
778 BOOL success = open_port(server, ptr[x]);
781 CommandLineParserFree(ptr);
785 CommandLineParserFree(ptr);
789 status = server->listener->OpenLocal(server->listener, server->ipcSocket);
793 WLog_ERR(TAG,
"Problem creating local socket listener. (Port already used or "
794 "insufficient permissions?)");
799 if (!(server->thread = CreateThread(NULL, 0, shadow_server_thread, (
void*)server, 0, NULL)))
807int shadow_server_stop(rdpShadowServer* server)
814 (void)SetEvent(server->StopEvent);
815 (void)WaitForSingleObject(server->thread, INFINITE);
816 (void)CloseHandle(server->thread);
817 server->thread = NULL;
818 if (server->listener && server->listener->Close)
819 server->listener->Close(server->listener);
824 shadow_screen_free(server->screen);
825 server->screen = NULL;
830 shadow_capture_free(server->capture);
831 server->capture = NULL;
837static int shadow_server_init_config_path(rdpShadowServer* server)
839 if (!server->ConfigPath)
845 if (!winpr_PathFileExists(configHome) && !winpr_PathMakePath(configHome, 0))
847 WLog_ERR(TAG,
"Failed to create directory '%s'", configHome);
852 server->ConfigPath = configHome;
856 if (!server->ConfigPath)
862static BOOL shadow_server_create_certificate(rdpShadowServer* server,
const char* filepath)
865 char* makecert_argv[6] = {
"makecert",
"-rdp",
"-live",
"-silent",
"-y",
"5" };
867 WINPR_STATIC_ASSERT(ARRAYSIZE(makecert_argv) <= INT_MAX);
868 const size_t makecert_argc = ARRAYSIZE(makecert_argv);
870 MAKECERT_CONTEXT* makecert = makecert_context_new();
875 if (makecert_context_process(makecert, (
int)makecert_argc, makecert_argv) < 0)
878 if (makecert_context_set_output_file_name(makecert,
"shadow") != 1)
881 WINPR_ASSERT(server);
882 WINPR_ASSERT(filepath);
883 if (!winpr_PathFileExists(server->CertificateFile))
885 if (makecert_context_output_certificate_file(makecert, filepath) != 1)
889 if (!winpr_PathFileExists(server->PrivateKeyFile))
891 if (makecert_context_output_private_key_file(makecert, filepath) != 1)
896 makecert_context_free(makecert);
899static BOOL shadow_server_init_certificate(rdpShadowServer* server)
901 char* filepath = NULL;
904 WINPR_ASSERT(server);
906 if (!winpr_PathFileExists(server->ConfigPath) && !winpr_PathMakePath(server->ConfigPath, 0))
908 WLog_ERR(TAG,
"Failed to create directory '%s'", server->ConfigPath);
912 if (!(filepath = GetCombinedPath(server->ConfigPath,
"shadow")))
915 if (!winpr_PathFileExists(filepath) && !winpr_PathMakePath(filepath, 0))
917 if (!CreateDirectoryA(filepath, 0))
919 WLog_ERR(TAG,
"Failed to create directory '%s'", filepath);
924 server->CertificateFile = GetCombinedPath(filepath,
"shadow.crt");
925 server->PrivateKeyFile = GetCombinedPath(filepath,
"shadow.key");
927 if (!server->CertificateFile || !server->PrivateKeyFile)
930 if ((!winpr_PathFileExists(server->CertificateFile)) ||
931 (!winpr_PathFileExists(server->PrivateKeyFile)))
933 if (!shadow_server_create_certificate(server, filepath))
937 rdpSettings* settings = server->settings;
938 WINPR_ASSERT(settings);
940 rdpPrivateKey* key = freerdp_key_new_from_file_enc(server->PrivateKeyFile, NULL);
946 rdpCertificate* cert = freerdp_certificate_new_from_file(server->CertificateFile);
953 if (!freerdp_certificate_is_rdp_security_compatible(cert))
966static BOOL shadow_server_check_peer_restrictions(freerdp_listener* listener)
968 WINPR_ASSERT(listener);
970 rdpShadowServer* server = (rdpShadowServer*)listener->info;
971 WINPR_ASSERT(server);
973 if (server->maxClientsConnected > 0)
975 const size_t count = ArrayList_Count(server->clients);
976 if (count >= server->maxClientsConnected)
978 WLog_WARN(TAG,
"connection limit [%" PRIuz
"] reached, discarding client",
979 server->maxClientsConnected);
986int shadow_server_init(rdpShadowServer* server)
989 winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT);
990 WTSRegisterWtsApiFunctionTable(FreeRDP_InitWtsApi());
992 if (!(server->clients = ArrayList_New(TRUE)))
995 if (!(server->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL)))
998 if (!InitializeCriticalSectionAndSpinCount(&(server->lock), 4000))
1001 status = shadow_server_init_config_path(server);
1006 if (!shadow_server_init_certificate(server))
1009 server->listener = freerdp_listener_new();
1011 if (!server->listener)
1014 server->listener->info = (
void*)server;
1015 server->listener->CheckPeerAcceptRestrictions = shadow_server_check_peer_restrictions;
1016 server->listener->PeerAccepted = shadow_client_accepted;
1017 server->subsystem = shadow_subsystem_new();
1019 if (!server->subsystem)
1022 status = shadow_subsystem_init(server->subsystem, server);
1029 shadow_server_uninit(server);
1030 WLog_ERR(TAG,
"Failed to initialize shadow server");
1034int shadow_server_uninit(rdpShadowServer* server)
1039 shadow_server_stop(server);
1040 shadow_subsystem_uninit(server->subsystem);
1041 shadow_subsystem_free(server->subsystem);
1042 server->subsystem = NULL;
1043 freerdp_listener_free(server->listener);
1044 server->listener = NULL;
1045 free(server->CertificateFile);
1046 server->CertificateFile = NULL;
1047 free(server->PrivateKeyFile);
1048 server->PrivateKeyFile = NULL;
1049 free(server->ConfigPath);
1050 server->ConfigPath = NULL;
1051 DeleteCriticalSection(&(server->lock));
1052 (void)CloseHandle(server->StopEvent);
1053 server->StopEvent = NULL;
1054 ArrayList_Free(server->clients);
1055 server->clients = NULL;
1059rdpShadowServer* shadow_server_new(
void)
1061 rdpShadowServer* server = NULL;
1062 server = (rdpShadowServer*)calloc(1,
sizeof(rdpShadowServer));
1067 server->SupportMultiRectBitmapUpdates = TRUE;
1068 server->port = 3389;
1069 server->mayView = TRUE;
1070 server->mayInteract = TRUE;
1071 server->h264RateControlMode = H264_RATECONTROL_VBR;
1072 server->h264BitRate = 10000000;
1073 server->h264FrameRate = 30;
1075 server->authentication = TRUE;
1080void shadow_server_free(rdpShadowServer* server)
1085 free(server->ipcSocket);
1086 server->ipcSocket = NULL;
1088 server->settings = NULL;
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 rdpSettings * freerdp_settings_new(DWORD flags)
creates a new setting struct
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 void freerdp_settings_free(rdpSettings *settings)
Free a settings struct with all data in it.
#define FREERDP_SETTINGS_SERVER_MODE
FREERDP_API char * freerdp_settings_get_config_path(void)
return the configuration directory for the library
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, BOOL param)
Sets a BOOL settings value.