set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
if(MONOLITHIC_BUILD)
- target_link_libraries(${MODULE_NAME} freerdp)
+ target_link_libraries(${MODULE_NAME} freerdp winpr)
else()
- target_link_libraries(${MODULE_NAME} freerdp-utils)
+ target_link_libraries(${MODULE_NAME} freerdp-utils winpr-crt)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_PLUGIN_PATH})
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <winpr/crt.h>
+
#include <freerdp/types.h>
#include <freerdp/constants.h>
#include <freerdp/utils/hexdump.h>
if (ascii)
{
- format_name->name = xstrdup((char*) s->p);
+ format_name->name = _strdup((char*) s->p);
format_name->length = strlen(format_name->name);
}
else
if( path[0] == '%' )
{
_snprintf(buf, sizeof(buf), "%s\\", getenv("USERPROFILE"));
- disk_register_disk_path(pEntryPoints, name, xstrdup(buf));
+ disk_register_disk_path(pEntryPoints, name, _strdup(buf));
}
else if( path[0] == '*' )
{
buf[len + 1] = dev[0];
buf[len + 2] = 0;
buf[len + 3] = 0;
- disk_register_disk_path(pEntryPoints, xstrdup(buf), xstrdup(dev));
+ disk_register_disk_path(pEntryPoints, _strdup(buf), _strdup(dev));
}
}
}
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
#include <winpr/synch.h>
#include <freerdp/utils/memory.h>
listener = xnew(DVCMAN_LISTENER);
listener->iface.GetConfiguration = dvcman_get_configuration;
listener->dvcman = dvcman;
- listener->channel_name = xstrdup(pszChannelName);
+ listener->channel_name = _strdup(pszChannelName);
listener->flags = ulFlags;
listener->listener_callback = pListenerCallback;
#include <time.h>
#include <cups/cups.h>
+#include <winpr/crt.h>
+
#include <freerdp/utils/memory.h>
#include <freerdp/utils/svc_plugin.h>
#include <freerdp/channels/rdpdr.h>
#ifndef _CUPS_API_1_4
- cups_printjob->printjob_object = xstrdup(tmpnam(NULL));
+ cups_printjob->printjob_object = _strdup(tmpnam(NULL));
#else
{
cups_printer = xnew(rdpCupsPrinter);
cups_printer->printer.id = cups_driver->id_sequence++;
- cups_printer->printer.name = xstrdup(name);
+ cups_printer->printer.name = _strdup(name);
/* This is a generic PostScript printer driver developed by MS, so it should be good in most cases */
cups_printer->printer.driver = "MS Publisher Imagesetter";
cups_printer->printer.is_default = is_default;
* limitations under the License.
*/
-#include <windows.h>
-#include <winspool.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <winpr/crt.h>
+#include <winpr/windows.h>
+
+#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
+#include <winspool.h>
-#include "config.h"
#include <freerdp/utils/memory.h>
#include <freerdp/utils/svc_plugin.h>
-#include "rdpdr_types.h"
#include "printer_main.h"
#include "printer_win.h"
win_printer = xnew(rdpWinPrinter);
win_printer->printer.id = win_driver->id_sequence++;
- win_printer->printer.name = xstrdup(name);
+ win_printer->printer.name = _strdup(name);
win_printer->printer.is_default = is_default;
win_printer->printer.CreatePrintJob = printer_win_create_printjob;
# limitations under the License.
set(RDPSND_ALSA_SRCS
- rdpsnd_alsa.c
-)
+ rdpsnd_alsa.c)
include_directories(..)
include_directories(${ALSA_INCLUDE_DIRS})
set_target_properties(rdpsnd_alsa PROPERTIES PREFIX "")
if(MONOLITHIC_BUILD)
- target_link_libraries(rdpsnd_alsa freerdp)
+ target_link_libraries(rdpsnd_alsa freerdp winpr)
else()
- target_link_libraries(rdpsnd_alsa freerdp-utils)
+ target_link_libraries(rdpsnd_alsa freerdp-utils winpr-crt)
endif()
target_link_libraries(rdpsnd_alsa ${ALSA_LIBRARIES})
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include <alsa/asoundlib.h>
#include <freerdp/types.h>
if (data && strcmp((char*) data->data[0], "alsa") == 0)
{
- alsa->device_name = xstrdup((char*) data->data[1]);
+ alsa->device_name = _strdup((char*) data->data[1]);
}
if (alsa->device_name == NULL)
{
- alsa->device_name = xstrdup("default");
+ alsa->device_name = _strdup("default");
}
alsa->out_handle = 0;
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include <pulse/pulseaudio.h>
+
#include <freerdp/types.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/dsp.h>
if (data && strcmp((char*)data->data[0], "pulse") == 0)
{
if(data->data[1] && strlen((char*)data->data[1]) > 0)
- pulse->device_name = xstrdup((char*)data->data[1]);
+ pulse->device_name = _strdup((char*)data->data[1]);
else
pulse->device_name = NULL;
}
#include <freerdp/client/channels.h>
#include <freerdp/rail.h>
+#include <winpr/crt.h>
#include <winpr/synch.h>
#include "xf_gdi.h"
if (xfi->instance->settings->window_title != NULL)
{
- win_title = xstrdup(xfi->instance->settings->window_title);
+ win_title = _strdup(xfi->instance->settings->window_title);
}
else if (xfi->instance->settings->port == 3389)
{
#include <stddef.h>
#include <ctype.h>
#include <wchar.h>
+
#include <freerdp/api.h>
FREERDP_API void* xzalloc(size_t size);
-FREERDP_API char* xstrdup(const char* str);
FREERDP_API char* xstrtoup(const char* str);
FREERDP_API wchar_t* xwcsdup(const wchar_t* wstr);
set(${MODULE_PREFIX}_LIBS winpr)
else()
set(${MODULE_PREFIX}_LIBS
+ winpr-registry
winpr-utils
- winpr-sspi)
-
- if(NOT WIN32)
- set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-registry)
- endif()
+ winpr-sspi
+ winpr-crt)
endif()
if(WIN32)
#include "connection.h"
#include "transport.h"
+#include <winpr/crt.h>
+
#include <freerdp/errorcodes.h>
/**
if (redirection->flags & LB_TARGET_NET_ADDRESS)
{
free(settings->hostname);
- settings->hostname = xstrdup(redirection->targetNetAddress.ascii);
+ settings->hostname = _strdup(redirection->targetNetAddress.ascii);
}
else if (redirection->flags & LB_TARGET_FQDN)
{
free(settings->hostname);
- settings->hostname = xstrdup(redirection->targetFQDN.ascii);
+ settings->hostname = _strdup(redirection->targetFQDN.ascii);
}
else if (redirection->flags & LB_TARGET_NETBIOS_NAME)
{
free(settings->hostname);
- settings->hostname = xstrdup(redirection->targetNetBiosName.ascii);
+ settings->hostname = _strdup(redirection->targetNetBiosName.ascii);
}
}
if (redirection->flags & LB_USERNAME)
{
free(settings->username);
- settings->username = xstrdup(redirection->username.ascii);
+ settings->username = _strdup(redirection->username.ascii);
}
if (redirection->flags & LB_DOMAIN)
{
free(settings->domain);
- settings->domain = xstrdup(redirection->domain.ascii);
+ settings->domain = _strdup(redirection->domain.ascii);
}
if (redirection->flags & LB_PASSWORD)
if (http_context->Method)
free(http_context->Method);
- http_context->Method = xstrdup(method);
+ http_context->Method = _strdup(method);
}
void http_context_set_uri(HttpContext* http_context, char* uri)
if (http_context->URI)
free(http_context->URI);
- http_context->URI = xstrdup(uri);
+ http_context->URI = _strdup(uri);
}
void http_context_set_user_agent(HttpContext* http_context, char* user_agent)
if (http_context->UserAgent)
free(http_context->UserAgent);
- http_context->UserAgent = xstrdup(user_agent);
+ http_context->UserAgent = _strdup(user_agent);
}
void http_context_set_host(HttpContext* http_context, char* host)
if (http_context->Host)
free(http_context->Host);
- http_context->Host = xstrdup(host);
+ http_context->Host = _strdup(host);
}
void http_context_set_accept(HttpContext* http_context, char* accept)
if (http_context->Accept)
free(http_context->Accept);
- http_context->Accept = xstrdup(accept);
+ http_context->Accept = _strdup(accept);
}
void http_context_set_cache_control(HttpContext* http_context, char* cache_control)
if (http_context->CacheControl)
free(http_context->CacheControl);
- http_context->CacheControl = xstrdup(cache_control);
+ http_context->CacheControl = _strdup(cache_control);
}
void http_context_set_connection(HttpContext* http_context, char* connection)
if (http_context->Connection)
free(http_context->Connection);
- http_context->Connection = xstrdup(connection);
+ http_context->Connection = _strdup(connection);
}
void http_context_set_pragma(HttpContext* http_context, char* pragma)
if (http_context->Pragma)
free(http_context->Pragma);
- http_context->Pragma = xstrdup(pragma);
+ http_context->Pragma = _strdup(pragma);
}
void http_context_free(HttpContext* http_context)
if (http_request->Method)
free(http_request->Method);
- http_request->Method = xstrdup(method);
+ http_request->Method = _strdup(method);
}
void http_request_set_uri(HttpRequest* http_request, char* uri)
if (http_request->URI)
free(http_request->URI);
- http_request->URI = xstrdup(uri);
+ http_request->URI = _strdup(uri);
}
void http_request_set_auth_scheme(HttpRequest* http_request, char* auth_scheme)
if (http_request->AuthScheme)
free(http_request->AuthScheme);
- http_request->AuthScheme = xstrdup(auth_scheme);
+ http_request->AuthScheme = _strdup(auth_scheme);
}
void http_request_set_auth_param(HttpRequest* http_request, char* auth_param)
if (http_request->AuthParam)
free(http_request->AuthParam);
- http_request->AuthParam = xstrdup(auth_param);
+ http_request->AuthParam = _strdup(auth_param);
}
#ifndef _WIN32
*separator = '\0';
http_response->StatusCode = atoi(status_code);
- http_response->ReasonPhrase = xstrdup(reason_phrase);
+ http_response->ReasonPhrase = _strdup(reason_phrase);
*separator = ' ';
}
{
char* separator;
- http_response->Authorization = xstrdup(value);
+ http_response->Authorization = _strdup(value);
separator = strchr(value, ' ');
if (separator != NULL)
{
*separator = '\0';
- http_response->AuthScheme = xstrdup(value);
- http_response->AuthParam = xstrdup(separator + 1);
+ http_response->AuthScheme = _strdup(value);
+ http_response->AuthParam = _strdup(separator + 1);
*separator = ' ';
}
}
/* WWW-Authenticate: NTLM base64token */
*separator = '\0';
- http_response->AuthScheme = xstrdup(value);
- http_response->AuthParam = xstrdup(separator + 1);
+ http_response->AuthScheme = _strdup(value);
+ http_response->AuthParam = _strdup(separator + 1);
*separator = ' ';
return;
while (line != NULL)
{
- http_response->lines[count] = xstrdup(line);
+ http_response->lines[count] = _strdup(line);
line = strtok(NULL, "\r\n");
count++;
}
if (http_response->ContentLength > 0)
{
- http_response->Content = xstrdup(content);
+ http_response->Content = _strdup(content);
}
break;
#include <unistd.h>
#endif
+#include <winpr/crt.h>
+#include <winpr/registry.h>
+
#include <freerdp/settings.h>
#include <freerdp/utils/file.h>
-#include <winpr/registry.h>
-
static const char client_dll[] = "C:\\Windows\\System32\\mstscax.dll";
void settings_client_load_hkey_local_machine(rdpSettings* settings)
settings->draw_nine_grid_cache_size = 2560;
settings->draw_nine_grid_cache_entries = 256;
- settings->client_dir = xstrdup(client_dll);
+ settings->client_dir = _strdup(client_dll);
settings->num_icon_caches = 3;
settings->num_icon_cache_entries = 12;
#include <errno.h>
#include <fcntl.h>
+#include <winpr/crt.h>
+
#ifndef _WIN32
#include <netdb.h>
#include <unistd.h>
tcp->ip_address[sizeof(tcp->ip_address) - 1] = 0;
tcp->settings->ipv6 = 0;
- tcp->settings->ip_address = xstrdup(tcp->ip_address);
+ tcp->settings->ip_address = _strdup(tcp->ip_address);
}
void tcp_get_mac_address(rdpTcp * tcp)
endif()
if(MONOLITHIC_BUILD)
+ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
else()
+ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-crt)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-utils)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
#include <stdio.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include <openssl/pem.h>
#include <openssl/rsa.h>
if (certdata != NULL)
{
- certdata->hostname = xstrdup(hostname);
- certdata->fingerprint = xstrdup(fingerprint);
+ certdata->hostname = _strdup(hostname);
+ certdata->fingerprint = _strdup(fingerprint);
}
return certdata;
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
if(MONOLITHIC_BUILD)
+ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
else()
+ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-crt)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-utils)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include "liblocale.h"
#include <freerdp/types.h>
for (i = 0; i < length; i++, num++)
{
layouts[num].code = RDP_KEYBOARD_LAYOUT_TABLE[i].code;
- layouts[num].name = xstrdup(RDP_KEYBOARD_LAYOUT_TABLE[i].name);
+ layouts[num].name = _strdup(RDP_KEYBOARD_LAYOUT_TABLE[i].name);
}
}
if ((types & RDP_KEYBOARD_LAYOUT_TYPE_VARIANT) != 0)
for (i = 0; i < length; i++, num++)
{
layouts[num].code = RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[i].code;
- layouts[num].name = xstrdup(RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[i].name);
+ layouts[num].name = _strdup(RDP_KEYBOARD_LAYOUT_VARIANT_TABLE[i].name);
}
}
if ((types & RDP_KEYBOARD_LAYOUT_TYPE_IME) != 0)
for (i = 0; i < length; i++, num++)
{
layouts[num].code = RDP_KEYBOARD_IME_TABLE[i].code;
- layouts[num].name = xstrdup(RDP_KEYBOARD_IME_TABLE[i].name);
+ layouts[num].name = _strdup(RDP_KEYBOARD_IME_TABLE[i].name);
}
}
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include "liblocale.h"
+
#include <freerdp/utils/memory.h>
#include <freerdp/locale/locale.h>
#include <freerdp/locale/keyboard.h>
if (keyboardLayoutId > 0)
{
- *xkb_layout = xstrdup(layout);
- *xkb_variant = xstrdup(variant);
+ *xkb_layout = _strdup(layout);
+ *xkb_variant = _strdup(variant);
return keyboardLayoutId;
}
if (keyboardLayoutId > 0)
{
- *xkb_layout = xstrdup(layout);
- *xkb_variant = xstrdup(variant);
+ *xkb_layout = _strdup(layout);
+ *xkb_variant = _strdup(variant);
return keyboardLayoutId;
}
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include "liblocale.h"
#include <freerdp/utils/time.h>
if (tz_env != NULL)
{
- tzid = xstrdup(tz_env);
+ tzid = _strdup(tz_env);
return tzid;
}
char* p;
char* list_copy;
- list_copy = xstrdup(list);
+ list_copy = _strdup(list);
p = strtok(list_copy, " ");
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
else()
- if(NOT WIN32)
- set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-crt)
- endif()
-
- set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-synch)
-
+ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr-crt winpr-synch)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#ifdef _WIN32
#include <io.h>
#define isatty _isatty
&& (p[1] == 0 || (p[1] == ':' && !strchr(p + 2, ':'))))
{
/* Either "[...]" or "[...]:..." with at most one : after the brackets */
- settings->hostname = xstrdup(hostname + 1);
+ settings->hostname = _strdup(hostname + 1);
if ((p = strchr((char*)settings->hostname, ']')))
{
else
{
/* Port number is cut off and used if exactly one : in the string */
- settings->hostname = xstrdup(hostname);
+ settings->hostname = _strdup(hostname);
if ((p = strchr((char*)settings->hostname, ':')) && !strchr(p + 1, ':'))
{
printf("missing username\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->username = xstrdup(argv[index]);
+ settings->username = _strdup(argv[index]);
}
else if (strcmp("-p", argv[index]) == 0)
{
printf("missing password\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->password = xstrdup(argv[index]);
+ settings->password = _strdup(argv[index]);
settings->autologon = 1;
/*
printf("missing domain\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->domain = xstrdup(argv[index]);
+ settings->domain = _strdup(argv[index]);
}
else if (strcmp("-s", argv[index]) == 0)
{
printf("missing shell\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->shell = xstrdup(argv[index]);
+ settings->shell = _strdup(argv[index]);
}
else if (strcmp("-c", argv[index]) == 0)
{
printf("missing directory\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->directory = xstrdup(argv[index]);
+ settings->directory = _strdup(argv[index]);
}
else if (strcmp("-g", argv[index]) == 0)
{
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->window_title = xstrdup(argv[index]);
+ settings->window_title = _strdup(argv[index]);
}
else if (strcmp("-t", argv[index]) == 0)
{
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->certificate_name = xstrdup(argv[index]);
+ settings->certificate_name = _strdup(argv[index]);
}
else if (strcmp("--no-fastpath", argv[index]) == 0)
{
printf("missing file name\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->dump_rfx_file = xstrdup(argv[index]);
+ settings->dump_rfx_file = _strdup(argv[index]);
settings->dump_rfx = true;
settings->rfx_codec_only = true;
}
printf("missing file name\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
- settings->play_rfx_file = xstrdup(argv[index]);
+ settings->play_rfx_file = _strdup(argv[index]);
settings->play_rfx = true;
}
else if (strcmp("--fonts", argv[index]) == 0)
printf("missing TSG username\n");
return -1;
}
- settings->tsg_username = xstrdup(argv[index]);
+ settings->tsg_username = _strdup(argv[index]);
index++;
if (index == argc)
{
printf("missing TSG password\n");
return -1;
}
- settings->tsg_password = xstrdup(argv[index]);
+ settings->tsg_password = _strdup(argv[index]);
index++;
if (index == argc)
{
printf("missing TSG server\n");
return -1;
}
- settings->tsg_hostname = xstrdup(argv[index]);
+ settings->tsg_hostname = _strdup(argv[index]);
}
else if (strcmp("--plugin", argv[index]) == 0)
{
return -1;
}
settings->send_preconnection_pdu = true;
- settings->preconnection_blob = xstrdup(argv[index]);
+ settings->preconnection_blob = _strdup(argv[index]);
}
else if (strcmp("--version", argv[index]) == 0)
{
input[0] = '\0';
printf("username: ");
if (scanf("%511s", input) > 0) {
- settings->username = xstrdup(input);
+ settings->username = _strdup(input);
}
}
/* password */
/* Try to catch the cases where the string is NULL-ish right
at the get go */
if (input[0] != '\0' && !(input[0] == '.' && input[1] == '\0')) {
- settings->domain = xstrdup(input);
+ settings->domain = _strdup(input);
}
}
}
#include <string.h>
#include <sys/stat.h>
+#include <winpr/crt.h>
+
#include <freerdp/types.h>
#include <freerdp/settings.h>
#include <freerdp/utils/memory.h>
if (settings->home_path == NULL)
settings->home_path = getenv(HOME_ENV_VARIABLE);
if (settings->home_path == NULL)
- settings->home_path = xstrdup("/");
+ settings->home_path = _strdup("/");
return settings->home_path;
}
}
else
{
- path = xstrdup(file_path);
+ path = _strdup(file_path);
}
}
else
return NULL;
if (depth <= 0)
- return xstrdup(base_path);
+ return _strdup(base_path);
base_length = strlen(base_path);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include <winpr/crt.h>
#include <winpr/windows.h>
+
#include <freerdp/utils/file.h>
#include <freerdp/utils/print.h>
#include <freerdp/utils/memory.h>
else
{
/* explicit path given, use it instead of default path */
- path = xstrdup(suffixed_name);
+ path = _strdup(suffixed_name);
}
entry = freerdp_load_library_symbol(path, entry_name);
#include <stdlib.h>
#include <string.h>
+#include <winpr/crt.h>
+
#include <freerdp/utils/memory.h>
/**
}
/**
- * Duplicate a string in memory.
- * This function is used to secure the strdup function.
- * It will allocate a new memory buffer and copy the string content in it.
- * If allocation fails, it will log an error.
- *
- * @param str - pointer to the character string to copy. If str is NULL, nothing is done.
- *
- * @return a pointer to a newly allocated character string containing the same bytes as str.
- * NULL if an allocation error occurred, or if the str parameter was NULL.
- */
-
-char* xstrdup(const char* str)
-{
- char* mem;
-
- if (str == NULL)
- return NULL;
-
-#ifdef _WIN32
- mem = _strdup(str);
-#else
- mem = strdup(str);
-#endif
-
- if (mem == NULL)
- perror("strdup");
-
- return mem;
-}
-
-/**
* Duplicate a wide string in memory.
* This function is used to secure a call to wcsdup.
* It verifies the return value, and logs a message if an allocation error occurred.
char* out;
char* p;
int c;
- out = xstrdup(str);
- if(out != NULL)
+
+ out = _strdup(str);
+
+ if (out != NULL)
{
p = out;
- while(*p != '\0')
+
+ while (*p != '\0')
{
c = toupper((unsigned char)*p);
- *p++ = (char)c;
+ *p++ = (char) c;
}
}
+
return out;
}
if(MONOLITHIC_BUILD)
target_link_libraries(${MODULE_NAME}
+ winpr
freerdp
freerdp-channels-server)
else()
target_link_libraries(${MODULE_NAME}
+ winpr-crt
freerdp-core
freerdp-utils
freerdp-codec
#include <signal.h>
#include <sys/time.h>
+#include <winpr/crt.h>
+
#include <freerdp/constants.h>
#include <freerdp/utils/sleep.h>
#include <freerdp/utils/memory.h>
test_peer_init(client);
/* Initialize the real server settings here */
- client->settings->cert_file = xstrdup("server.crt");
- client->settings->privatekey_file = xstrdup("server.key");
+ client->settings->cert_file = _strdup("server.crt");
+ client->settings->privatekey_file = _strdup("server.key");
client->settings->nla_security = false;
client->settings->rfx_codec = true;
client->settings->suppress_output = true;