wfreerdp: fix compilation
This commit is contained in:
parent
3cfc3d6d80
commit
d3dc1c780d
@ -151,6 +151,9 @@ endif()
|
|||||||
# Sub-directories
|
# Sub-directories
|
||||||
add_subdirectory(include)
|
add_subdirectory(include)
|
||||||
add_subdirectory(libfreerdp-utils)
|
add_subdirectory(libfreerdp-utils)
|
||||||
|
|
||||||
|
add_subdirectory(winpr)
|
||||||
|
|
||||||
add_subdirectory(libfreerdp-gdi)
|
add_subdirectory(libfreerdp-gdi)
|
||||||
add_subdirectory(libfreerdp-rail)
|
add_subdirectory(libfreerdp-rail)
|
||||||
add_subdirectory(libfreerdp-cache)
|
add_subdirectory(libfreerdp-cache)
|
||||||
@ -160,8 +163,6 @@ add_subdirectory(libfreerdp-channels)
|
|||||||
add_subdirectory(libfreerdp-locale)
|
add_subdirectory(libfreerdp-locale)
|
||||||
add_subdirectory(libfreerdp-core)
|
add_subdirectory(libfreerdp-core)
|
||||||
|
|
||||||
add_subdirectory(winpr)
|
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
add_subdirectory(channels)
|
add_subdirectory(channels)
|
||||||
endif()
|
endif()
|
||||||
|
@ -11,14 +11,16 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This static variable holds an error code if the return value from connect is false.
|
* This static variable holds an error code if the return value from connect is false.
|
||||||
* This variable is always set to 0 in the beginning of the connect sequence.
|
* This variable is always set to 0 in the beginning of the connect sequence.
|
||||||
* The returned code can be used to inform the user of the detailed connect error.
|
* The returned code can be used to inform the user of the detailed connect error.
|
||||||
* The value can hold one of the defined error codes below OR an error according to errno
|
* The value can hold one of the defined error codes below OR an error according to errno
|
||||||
*/
|
*/
|
||||||
extern int connectErrorCode ;
|
|
||||||
|
extern int connectErrorCode;
|
||||||
|
|
||||||
#define ERRORSTART 10000
|
#define ERRORSTART 10000
|
||||||
#define PREECONNECTERROR ERRORSTART + 1
|
#define PREECONNECTERROR ERRORSTART + 1
|
||||||
#define UNDEFINEDCONNECTERROR ERRORSTART + 2
|
#define UNDEFINEDCONNECTERROR ERRORSTART + 2
|
||||||
@ -30,7 +32,6 @@ extern int connectErrorCode ;
|
|||||||
#define TLSCONNECTERROR ERRORSTART + 8
|
#define TLSCONNECTERROR ERRORSTART + 8
|
||||||
#define AUTHENTICATIONERROR ERRORSTART + 9
|
#define AUTHENTICATIONERROR ERRORSTART + 9
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -791,13 +791,12 @@ uint8* freerdp_image_flip(uint8* srcData, uint8* dstData, int width, int height,
|
|||||||
|
|
||||||
uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv)
|
uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv)
|
||||||
{
|
{
|
||||||
int x, y, bit;
|
|
||||||
int maskIndex;
|
|
||||||
uint8* data;
|
uint8* data;
|
||||||
uint8 bmask;
|
uint8 bmask;
|
||||||
uint32 pmask;
|
|
||||||
uint32* icon;
|
uint32* icon;
|
||||||
|
int x, y, bit;
|
||||||
|
int maskIndex;
|
||||||
|
|
||||||
if (bpp == 16)
|
if (bpp == 16)
|
||||||
{
|
{
|
||||||
/* Server sends 16 bpp field, but data is usually 15-bit 555 */
|
/* Server sends 16 bpp field, but data is usually 15-bit 555 */
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
|
||||||
|
#include <freerdp/errorcodes.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connection Sequence\n
|
* Connection Sequence\n
|
||||||
* client server\n
|
* client server\n
|
||||||
@ -107,7 +109,8 @@ boolean rdp_client_connect(rdpRdp* rdp)
|
|||||||
|
|
||||||
if (mcs_send_connect_initial(rdp->mcs) != true)
|
if (mcs_send_connect_initial(rdp->mcs) != true)
|
||||||
{
|
{
|
||||||
if(!connectErrorCode){
|
if (!connectErrorCode)
|
||||||
|
{
|
||||||
connectErrorCode = MCSCONNECTINITIALERROR;
|
connectErrorCode = MCSCONNECTINITIALERROR;
|
||||||
}
|
}
|
||||||
printf("Error: unable to send MCS Connect Initial\n");
|
printf("Error: unable to send MCS Connect Initial\n");
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#include "errinfo.h"
|
#include "errinfo.h"
|
||||||
|
|
||||||
|
int connectErrorCode;
|
||||||
|
|
||||||
/* Protocol-independent codes */
|
/* Protocol-independent codes */
|
||||||
|
|
||||||
#define ERRINFO_RPC_INITIATED_DISCONNECT_STRING \
|
#define ERRINFO_RPC_INITIATED_DISCONNECT_STRING \
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
|
|
||||||
#include <freerdp/freerdp.h>
|
#include <freerdp/freerdp.h>
|
||||||
|
#include <freerdp/errorcodes.h>
|
||||||
#include <freerdp/utils/memory.h>
|
#include <freerdp/utils/memory.h>
|
||||||
|
|
||||||
/* connectErrorCode is 'extern' in errorcodes.h. See comment there.*/
|
/* connectErrorCode is 'extern' in errorcodes.h. See comment there.*/
|
||||||
@ -45,8 +46,9 @@ boolean freerdp_connect(freerdp* instance)
|
|||||||
{
|
{
|
||||||
rdpRdp* rdp;
|
rdpRdp* rdp;
|
||||||
boolean status = false;
|
boolean status = false;
|
||||||
|
|
||||||
/* We always set the return code to 0 before we start the connect sequence*/
|
/* We always set the return code to 0 before we start the connect sequence*/
|
||||||
connectErrorCode = 0 ;
|
connectErrorCode = 0;
|
||||||
|
|
||||||
rdp = instance->context->rdp;
|
rdp = instance->context->rdp;
|
||||||
|
|
||||||
@ -81,9 +83,12 @@ boolean freerdp_connect(freerdp* instance)
|
|||||||
if (status != true)
|
if (status != true)
|
||||||
{
|
{
|
||||||
printf("freerdp_post_connect failed\n");
|
printf("freerdp_post_connect failed\n");
|
||||||
if(!connectErrorCode){
|
|
||||||
|
if (!connectErrorCode)
|
||||||
|
{
|
||||||
connectErrorCode = POSTCONNECTERROR;
|
connectErrorCode = POSTCONNECTERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,8 +100,10 @@ boolean freerdp_connect(freerdp* instance)
|
|||||||
|
|
||||||
s = stream_new(1024);
|
s = stream_new(1024);
|
||||||
instance->update->pcap_rfx = pcap_open(instance->settings->play_rfx_file, false);
|
instance->update->pcap_rfx = pcap_open(instance->settings->play_rfx_file, false);
|
||||||
|
|
||||||
if (instance->update->pcap_rfx)
|
if (instance->update->pcap_rfx)
|
||||||
instance->update->play_rfx = true;
|
instance->update->play_rfx = true;
|
||||||
|
|
||||||
update = instance->update;
|
update = instance->update;
|
||||||
|
|
||||||
while (instance->update->play_rfx && pcap_has_next_record(update->pcap_rfx))
|
while (instance->update->play_rfx && pcap_has_next_record(update->pcap_rfx))
|
||||||
@ -119,9 +126,12 @@ boolean freerdp_connect(freerdp* instance)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!connectErrorCode){
|
|
||||||
|
if (!connectErrorCode)
|
||||||
|
{
|
||||||
connectErrorCode = UNDEFINEDCONNECTERROR;
|
connectErrorCode = UNDEFINEDCONNECTERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,10 +88,11 @@ boolean transport_connect_tls(rdpTransport* transport)
|
|||||||
transport->layer = TRANSPORT_LAYER_TLS;
|
transport->layer = TRANSPORT_LAYER_TLS;
|
||||||
transport->tls->sockfd = transport->tcp->sockfd;
|
transport->tls->sockfd = transport->tcp->sockfd;
|
||||||
|
|
||||||
if (tls_connect(transport->tls) != true) {
|
if (tls_connect(transport->tls) != true)
|
||||||
if(!connectErrorCode){
|
{
|
||||||
|
if (!connectErrorCode)
|
||||||
connectErrorCode = TLSCONNECTERROR;
|
connectErrorCode = TLSCONNECTERROR;
|
||||||
}
|
|
||||||
tls_free(transport->tls);
|
tls_free(transport->tls);
|
||||||
transport->tls = NULL;
|
transport->tls = NULL;
|
||||||
return false;
|
return false;
|
||||||
@ -111,10 +112,11 @@ boolean transport_connect_nla(rdpTransport* transport)
|
|||||||
transport->layer = TRANSPORT_LAYER_TLS;
|
transport->layer = TRANSPORT_LAYER_TLS;
|
||||||
transport->tls->sockfd = transport->tcp->sockfd;
|
transport->tls->sockfd = transport->tcp->sockfd;
|
||||||
|
|
||||||
if (tls_connect(transport->tls) != true) {
|
if (tls_connect(transport->tls) != true)
|
||||||
if(!connectErrorCode){
|
{
|
||||||
|
if (!connectErrorCode)
|
||||||
connectErrorCode = TLSCONNECTERROR;
|
connectErrorCode = TLSCONNECTERROR;
|
||||||
}
|
|
||||||
tls_free(transport->tls);
|
tls_free(transport->tls);
|
||||||
transport->tls = NULL;
|
transport->tls = NULL;
|
||||||
return false;
|
return false;
|
||||||
@ -133,9 +135,9 @@ boolean transport_connect_nla(rdpTransport* transport)
|
|||||||
|
|
||||||
if (credssp_authenticate(transport->credssp) < 0)
|
if (credssp_authenticate(transport->credssp) < 0)
|
||||||
{
|
{
|
||||||
if(!connectErrorCode){
|
if (!connectErrorCode)
|
||||||
connectErrorCode = AUTHENTICATIONERROR;
|
connectErrorCode = AUTHENTICATIONERROR;
|
||||||
}
|
|
||||||
printf("Authentication failure, check credentials.\n"
|
printf("Authentication failure, check credentials.\n"
|
||||||
"If credentials are valid, the NTLMSSP implementation may be to blame.\n");
|
"If credentials are valid, the NTLMSSP implementation may be to blame.\n");
|
||||||
|
|
||||||
|
@ -41,10 +41,11 @@ static void freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context,
|
|||||||
rbytes = bytes_per_sample * rchan;
|
rbytes = bytes_per_sample * rchan;
|
||||||
rframes = sframes * rrate / srate;
|
rframes = sframes * rrate / srate;
|
||||||
rsize = rbytes * rframes;
|
rsize = rbytes * rframes;
|
||||||
if (rsize > context->resampled_maxlength)
|
|
||||||
|
if (rsize > (int) context->resampled_maxlength)
|
||||||
{
|
{
|
||||||
context->resampled_maxlength = rsize + 1024;
|
context->resampled_maxlength = rsize + 1024;
|
||||||
context->resampled_buffer = xrealloc(context->resampled_buffer, context->resampled_maxlength);
|
context->resampled_buffer = (uint8*) xrealloc(context->resampled_buffer, context->resampled_maxlength);
|
||||||
}
|
}
|
||||||
dst = context->resampled_buffer;
|
dst = context->resampled_buffer;
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <freerdp/utils/tcp.h>
|
#include <freerdp/utils/tcp.h>
|
||||||
#include <freerdp/utils/print.h>
|
#include <freerdp/utils/print.h>
|
||||||
#include <freerdp/errorcodes.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -56,9 +55,6 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* connectErrorCode is 'extern' in errorcodes.h. See comment there.*/
|
|
||||||
int connectErrorCode ;
|
|
||||||
|
|
||||||
int freerdp_tcp_connect(const char* hostname, int port)
|
int freerdp_tcp_connect(const char* hostname, int port)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
@ -77,19 +73,12 @@ int freerdp_tcp_connect(const char* hostname, int port)
|
|||||||
|
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
{
|
{
|
||||||
if(status==EAI_NONAME){
|
|
||||||
if(!connectErrorCode){
|
|
||||||
connectErrorCode = DNSNAMENOTFOUND;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!connectErrorCode){
|
|
||||||
connectErrorCode = DNSERROR;
|
|
||||||
}
|
|
||||||
printf("tcp_connect: getaddrinfo (%s)\n", gai_strerror(status));
|
printf("tcp_connect: getaddrinfo (%s)\n", gai_strerror(status));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sockfd = -1;
|
sockfd = -1;
|
||||||
|
|
||||||
for (ai = res; ai; ai = ai->ai_next)
|
for (ai = res; ai; ai = ai->ai_next)
|
||||||
{
|
{
|
||||||
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||||
@ -102,17 +91,11 @@ int freerdp_tcp_connect(const char* hostname, int port)
|
|||||||
printf("connected to %s:%s\n", hostname, servname);
|
printf("connected to %s:%s\n", hostname, servname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!connectErrorCode){
|
|
||||||
int tmperror = errno ;
|
|
||||||
if(tmperror!=0){
|
|
||||||
connectErrorCode = tmperror ;
|
|
||||||
}else{
|
|
||||||
connectErrorCode = CONNECTERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
sockfd = -1;
|
sockfd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
|
|
||||||
if (sockfd == -1)
|
if (sockfd == -1)
|
||||||
|
@ -47,4 +47,3 @@ endif()
|
|||||||
target_link_libraries(winpr-rpc ${OPENSSL_LIBRARIES})
|
target_link_libraries(winpr-rpc ${OPENSSL_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS winpr-rpc DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS winpr-rpc DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
|
@ -64,7 +64,10 @@ include_directories(${ZLIB_INCLUDE_DIRS})
|
|||||||
|
|
||||||
set_target_properties(winpr-sspi PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
set_target_properties(winpr-sspi PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||||
|
|
||||||
target_link_libraries(winpr-sspi winpr-crt)
|
if (NOT WIN32)
|
||||||
|
target_link_libraries(winpr-sspi winpr-crt)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(winpr-sspi freerdp-utils)
|
target_link_libraries(winpr-sspi freerdp-utils)
|
||||||
target_link_libraries(winpr-sspi freerdp-crypto)
|
target_link_libraries(winpr-sspi freerdp-crypto)
|
||||||
target_link_libraries(winpr-sspi ${ZLIB_LIBRARIES})
|
target_link_libraries(winpr-sspi ${ZLIB_LIBRARIES})
|
||||||
|
Loading…
Reference in New Issue
Block a user