wfreerdp: fix compilation

This commit is contained in:
Marc-André Moreau 2012-05-21 16:01:24 -04:00
parent 3cfc3d6d80
commit d3dc1c780d
11 changed files with 49 additions and 45 deletions

View File

@ -151,6 +151,9 @@ endif()
# Sub-directories
add_subdirectory(include)
add_subdirectory(libfreerdp-utils)
add_subdirectory(winpr)
add_subdirectory(libfreerdp-gdi)
add_subdirectory(libfreerdp-rail)
add_subdirectory(libfreerdp-cache)
@ -160,8 +163,6 @@ add_subdirectory(libfreerdp-channels)
add_subdirectory(libfreerdp-locale)
add_subdirectory(libfreerdp-core)
add_subdirectory(winpr)
if(NOT WIN32)
add_subdirectory(channels)
endif()

View File

@ -18,7 +18,9 @@ extern "C" {
* 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
*/
extern int connectErrorCode;
#define ERRORSTART 10000
#define PREECONNECTERROR ERRORSTART + 1
#define UNDEFINEDCONNECTERROR ERRORSTART + 2
@ -30,7 +32,6 @@ extern int connectErrorCode ;
#define TLSCONNECTERROR ERRORSTART + 8
#define AUTHENTICATIONERROR ERRORSTART + 9
#ifdef __cplusplus
}
#endif

View File

@ -791,12 +791,11 @@ 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)
{
int x, y, bit;
int maskIndex;
uint8* data;
uint8 bmask;
uint32 pmask;
uint32* icon;
int x, y, bit;
int maskIndex;
if (bpp == 16)
{

View File

@ -22,6 +22,8 @@
#include "connection.h"
#include <freerdp/errorcodes.h>
/**
* Connection Sequence\n
* client server\n
@ -107,7 +109,8 @@ boolean rdp_client_connect(rdpRdp* rdp)
if (mcs_send_connect_initial(rdp->mcs) != true)
{
if(!connectErrorCode){
if (!connectErrorCode)
{
connectErrorCode = MCSCONNECTINITIALERROR;
}
printf("Error: unable to send MCS Connect Initial\n");

View File

@ -19,6 +19,8 @@
#include "errinfo.h"
int connectErrorCode;
/* Protocol-independent codes */
#define ERRINFO_RPC_INITIATED_DISCONNECT_STRING \

View File

@ -26,6 +26,7 @@
#include "extension.h"
#include <freerdp/freerdp.h>
#include <freerdp/errorcodes.h>
#include <freerdp/utils/memory.h>
/* connectErrorCode is 'extern' in errorcodes.h. See comment there.*/
@ -45,6 +46,7 @@ boolean freerdp_connect(freerdp* instance)
{
rdpRdp* rdp;
boolean status = false;
/* We always set the return code to 0 before we start the connect sequence*/
connectErrorCode = 0;
@ -81,9 +83,12 @@ boolean freerdp_connect(freerdp* instance)
if (status != true)
{
printf("freerdp_post_connect failed\n");
if(!connectErrorCode){
if (!connectErrorCode)
{
connectErrorCode = POSTCONNECTERROR;
}
return false;
}
@ -95,8 +100,10 @@ boolean freerdp_connect(freerdp* instance)
s = stream_new(1024);
instance->update->pcap_rfx = pcap_open(instance->settings->play_rfx_file, false);
if (instance->update->pcap_rfx)
instance->update->play_rfx = true;
update = instance->update;
while (instance->update->play_rfx && pcap_has_next_record(update->pcap_rfx))
@ -119,9 +126,12 @@ boolean freerdp_connect(freerdp* instance)
return true;
}
}
if(!connectErrorCode){
if (!connectErrorCode)
{
connectErrorCode = UNDEFINEDCONNECTERROR;
}
return status;
}

View File

@ -88,10 +88,11 @@ boolean transport_connect_tls(rdpTransport* transport)
transport->layer = TRANSPORT_LAYER_TLS;
transport->tls->sockfd = transport->tcp->sockfd;
if (tls_connect(transport->tls) != true) {
if(!connectErrorCode){
if (tls_connect(transport->tls) != true)
{
if (!connectErrorCode)
connectErrorCode = TLSCONNECTERROR;
}
tls_free(transport->tls);
transport->tls = NULL;
return false;
@ -111,10 +112,11 @@ boolean transport_connect_nla(rdpTransport* transport)
transport->layer = TRANSPORT_LAYER_TLS;
transport->tls->sockfd = transport->tcp->sockfd;
if (tls_connect(transport->tls) != true) {
if(!connectErrorCode){
if (tls_connect(transport->tls) != true)
{
if (!connectErrorCode)
connectErrorCode = TLSCONNECTERROR;
}
tls_free(transport->tls);
transport->tls = NULL;
return false;
@ -133,9 +135,9 @@ boolean transport_connect_nla(rdpTransport* transport)
if (credssp_authenticate(transport->credssp) < 0)
{
if(!connectErrorCode){
if (!connectErrorCode)
connectErrorCode = AUTHENTICATIONERROR;
}
printf("Authentication failure, check credentials.\n"
"If credentials are valid, the NTLMSSP implementation may be to blame.\n");

View File

@ -41,10 +41,11 @@ static void freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context,
rbytes = bytes_per_sample * rchan;
rframes = sframes * rrate / srate;
rsize = rbytes * rframes;
if (rsize > context->resampled_maxlength)
if (rsize > (int) context->resampled_maxlength)
{
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;

View File

@ -19,7 +19,6 @@
#include <freerdp/utils/tcp.h>
#include <freerdp/utils/print.h>
#include <freerdp/errorcodes.h>
#include <stdio.h>
#include <stdlib.h>
@ -56,9 +55,6 @@
#endif
/* connectErrorCode is 'extern' in errorcodes.h. See comment there.*/
int connectErrorCode ;
int freerdp_tcp_connect(const char* hostname, int port)
{
int status;
@ -77,19 +73,12 @@ int freerdp_tcp_connect(const char* hostname, int port)
if (status != 0)
{
if(status==EAI_NONAME){
if(!connectErrorCode){
connectErrorCode = DNSNAMENOTFOUND;
}
}
if(!connectErrorCode){
connectErrorCode = DNSERROR;
}
printf("tcp_connect: getaddrinfo (%s)\n", gai_strerror(status));
return -1;
}
sockfd = -1;
for (ai = res; ai; ai = ai->ai_next)
{
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);
break;
}
if(!connectErrorCode){
int tmperror = errno ;
if(tmperror!=0){
connectErrorCode = tmperror ;
}else{
connectErrorCode = CONNECTERROR;
}
}
close(sockfd);
sockfd = -1;
}
freeaddrinfo(res);
if (sockfd == -1)

View File

@ -47,4 +47,3 @@ endif()
target_link_libraries(winpr-rpc ${OPENSSL_LIBRARIES})
install(TARGETS winpr-rpc DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -64,7 +64,10 @@ include_directories(${ZLIB_INCLUDE_DIRS})
set_target_properties(winpr-sspi PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
if (NOT WIN32)
target_link_libraries(winpr-sspi winpr-crt)
endif()
target_link_libraries(winpr-sspi freerdp-utils)
target_link_libraries(winpr-sspi freerdp-crypto)
target_link_libraries(winpr-sspi ${ZLIB_LIBRARIES})