wfreerdp: fix build
This commit is contained in:
parent
92bf3e4ae0
commit
6cdb09740c
@ -119,12 +119,13 @@ static int extension_load_plugins(rdpExtension* extension)
|
||||
for (i = 0; settings->extensions[i].name[0]; i++)
|
||||
{
|
||||
if (strchr(settings->extensions[i].name, PATH_SEPARATOR) == NULL)
|
||||
snprintf(path, sizeof(path), EXT_PATH "/%s." PLUGIN_EXT, settings->extensions[i].name);
|
||||
sprintf_s(path, sizeof(path), EXT_PATH "/%s." PLUGIN_EXT, settings->extensions[i].name);
|
||||
else
|
||||
snprintf(path, sizeof(path), "%s", settings->extensions[i].name);
|
||||
sprintf_s(path, sizeof(path), "%s", settings->extensions[i].name);
|
||||
|
||||
han = DLOPEN(path);
|
||||
printf("extension_load_plugins: %s\n", path);
|
||||
|
||||
if (han == NULL)
|
||||
{
|
||||
printf("extension_load_plugins: failed to load %s\n", path);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <freerdp/utils/unicode.h>
|
||||
|
||||
#include "gcc.h"
|
||||
@ -514,7 +515,7 @@ BOOL gcc_read_client_core_data(STREAM* s, rdpSettings* settings, UINT16 blockLen
|
||||
/* clientName (32 bytes, null-terminated unicode, truncated to 15 characters) */
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(s), &str, 32 / 2);
|
||||
stream_seek(s, 32);
|
||||
snprintf(settings->ClientHostname, 31, "%s", str);
|
||||
sprintf_s(settings->ClientHostname, 31, "%s", str);
|
||||
settings->ClientHostname[31] = 0;
|
||||
free(str);
|
||||
|
||||
@ -570,7 +571,7 @@ BOOL gcc_read_client_core_data(STREAM* s, rdpSettings* settings, UINT16 blockLen
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(s), &str, 64 / 2);
|
||||
stream_seek(s, 64);
|
||||
snprintf(settings->ClientProductId, 32, "%s", str);
|
||||
sprintf_s(settings->ClientProductId, 32, "%s", str);
|
||||
free(str);
|
||||
blockLength -= 64;
|
||||
|
||||
|
@ -95,7 +95,7 @@ static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_a
|
||||
if (bind_address == NULL)
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
|
||||
snprintf(servname, sizeof(servname), "%d", port);
|
||||
sprintf_s(servname, sizeof(servname), "%d", port);
|
||||
status = getaddrinfo(bind_address, servname, &hints, &res);
|
||||
|
||||
if (status != 0)
|
||||
|
@ -68,7 +68,7 @@ void tcp_get_ip_address(rdpTcp * tcp)
|
||||
if (getsockname(tcp->sockfd, (struct sockaddr*) &sockaddr, &length) == 0)
|
||||
{
|
||||
ip = (BYTE*) (&sockaddr.sin_addr);
|
||||
snprintf(tcp->ip_address, sizeof(tcp->ip_address),
|
||||
sprintf_s(tcp->ip_address, sizeof(tcp->ip_address),
|
||||
"%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
|
||||
}
|
||||
else
|
||||
|
@ -50,6 +50,9 @@
|
||||
#else /* ifdef _WIN32 */
|
||||
|
||||
#include <winpr/windows.h>
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
#define SHUT_RDWR SD_BOTH
|
||||
#define close(_fd) closesocket(_fd)
|
||||
#endif
|
||||
@ -72,7 +75,7 @@ int freerdp_tcp_connect(const char* hostname, int port)
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
snprintf(servname, sizeof(servname), "%d", port);
|
||||
sprintf_s(servname, sizeof(servname), "%d", port);
|
||||
status = getaddrinfo(hostname, servname, &hints, &res);
|
||||
|
||||
if (status != 0)
|
||||
|
@ -174,10 +174,7 @@ WINPR_API BOOL DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier)
|
||||
/* Sleep */
|
||||
|
||||
WINPR_API VOID Sleep(DWORD dwMilliseconds);
|
||||
WINPR_API DWORD SleepEx(DWORD dwMilliseconds, BOOL bAlertable);
|
||||
|
||||
/* Portable usleep() */
|
||||
WINPR_API VOID USleep(DWORD dwMicroseconds);
|
||||
WINPR_API DWORD SleepEx(DWORD dwMilliseconds, BOOL bAlertable)
|
||||
|
||||
/* Address */
|
||||
|
||||
@ -255,6 +252,8 @@ WINPR_API BOOL CancelWaitableTimer(HANDLE hTimer);
|
||||
|
||||
/* Extended API */
|
||||
|
||||
WINPR_API VOID USleep(DWORD dwMicroseconds);
|
||||
|
||||
WINPR_API HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes,
|
||||
BOOL bManualReset, BOOL bInitialState, int FileDescriptor);
|
||||
WINPR_API HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes,
|
||||
|
@ -6,7 +6,9 @@ set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
||||
|
||||
set(${MODULE_PREFIX}_TESTS
|
||||
TestAlignment.c
|
||||
TestString.c)
|
||||
TestString.c
|
||||
TestMultiByteToWideChar.c
|
||||
TestWideCharToMultiByte.c)
|
||||
|
||||
create_test_sourcelist(${MODULE_PREFIX}_SRCS
|
||||
${${MODULE_PREFIX}_DRIVER}
|
||||
|
10
winpr/libwinpr/crt/test/TestMultiByteToWideChar.c
Normal file
10
winpr/libwinpr/crt/test/TestMultiByteToWideChar.c
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/windows.h>
|
||||
|
||||
int TestMultiByteToWideChar(int argc, char* argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
10
winpr/libwinpr/crt/test/TestWideCharToMultiByte.c
Normal file
10
winpr/libwinpr/crt/test/TestWideCharToMultiByte.c
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/windows.h>
|
||||
|
||||
int TestWideCharToMultiByte(int argc, char* argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -36,10 +36,6 @@ set(${MODULE_PREFIX}_SRCS
|
||||
timer.c
|
||||
wait.c)
|
||||
|
||||
if(MSVC AND (NOT MONOLITHIC_BUILD))
|
||||
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
|
||||
endif()
|
||||
|
||||
add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
|
||||
MONOLITHIC ${MONOLITHIC_BUILD}
|
||||
SOURCES ${${MODULE_PREFIX}_SRCS})
|
||||
|
@ -1,2 +0,0 @@
|
||||
LIBRARY "libwinpr-synch"
|
||||
EXPORTS
|
Loading…
x
Reference in New Issue
Block a user