From 938d423ec9ee6a63c192fcb13e33013ad748dfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 30 Oct 2013 17:56:44 -0400 Subject: [PATCH] freerdp: fix build on Windows --- libfreerdp/core/nla.c | 13 +++++--- .../test/TestEnvironmentGetSetEB.c | 33 +++++++++++-------- .../TestEnvironmentMergeEnvironmentStrings.c | 4 +-- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 3bc9cbc2d..9fa35b42b 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -113,6 +113,7 @@ int credssp_ntlm_client_init(rdpCredssp* credssp) { char* spn; int length; + rdpTls* tls = NULL; freerdp* instance; rdpSettings* settings; @@ -138,12 +139,16 @@ int credssp_ntlm_client_init(rdpCredssp* credssp) (char*) credssp->identity.User, (char*) credssp->identity.Domain, (char*) credssp->identity.Password); #endif - rdpTls *tls = NULL; - if(credssp->transport->layer == TRANSPORT_LAYER_TLS) { + if (credssp->transport->layer == TRANSPORT_LAYER_TLS) + { tls = credssp->transport->TlsIn; - } else if(credssp->transport->layer == TRANSPORT_LAYER_TSG_TLS) { + } + else if (credssp->transport->layer == TRANSPORT_LAYER_TSG_TLS) + { tls = credssp->transport->TsgTls; - } else { + } + else + { fprintf(stderr, "Unknown NLA transport layer\n"); return 0; } diff --git a/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c b/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c index 0420e8881..dbf248a6a 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentGetSetEB.c @@ -6,6 +6,7 @@ int TestEnvironmentGetSetEB(int argc, char* argv[]) { +#ifndef _WIN32 char test[1024]; TCHAR* p; int length; @@ -17,7 +18,6 @@ int TestEnvironmentGetSetEB(int argc, char* argv[]) p = (LPSTR) malloc(length); length = GetEnvironmentVariableEBA(lpszEnvironmentBlock,"DISPLAY", p, length); - printf("GetEnvironmentVariableA(WINPR_TEST_VARIABLE) = %s\n" , p); if (strcmp(p, "WINPR_TEST_VALUE") != 0) @@ -27,35 +27,40 @@ int TestEnvironmentGetSetEB(int argc, char* argv[]) free(p); - lpszEnvironmentBlockNew = (LPTCH)malloc(1024); + lpszEnvironmentBlockNew = (LPTCH) malloc(1024); memcpy(lpszEnvironmentBlockNew,lpszEnvironmentBlock,56); - if (SetEnvironmentVariableEBA(&lpszEnvironmentBlockNew,"test","5") ) { - - if (GetEnvironmentVariableEBA(lpszEnvironmentBlockNew,"test", test, 1023) ) { - if (strcmp(test,"5") != 0) { + if (SetEnvironmentVariableEBA(&lpszEnvironmentBlockNew, "test", "5")) + { + if (GetEnvironmentVariableEBA(lpszEnvironmentBlockNew,"test", test, 1023)) + { + if (strcmp(test,"5") != 0) + { return -1; } - } else { + } + else + { return -1; } } //free(lpszEnvironmentBlockNew); - if (SetEnvironmentVariableEBA(&lpszEnvironmentBlockNew,"test",NULL) ) { - - if (GetEnvironmentVariableEBA(lpszEnvironmentBlockNew,"test", test, 1023) ) { + if (SetEnvironmentVariableEBA(&lpszEnvironmentBlockNew, "test", NULL)) + { + if (GetEnvironmentVariableEBA(lpszEnvironmentBlockNew,"test", test, 1023)) + { return -1; - } else { + } + else + { // not found .. this is expected } } free(lpszEnvironmentBlockNew); - - - +#endif return 0; } diff --git a/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c b/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c index 15a243285..dca201137 100644 --- a/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c +++ b/winpr/libwinpr/environment/test/TestEnvironmentMergeEnvironmentStrings.c @@ -6,6 +6,7 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[]) { +#ifndef _WIN32 TCHAR* p; int length; LPTCH lpszEnvironmentBlock; @@ -17,8 +18,6 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[]) p = (TCHAR*) lpszMergedEnvironmentBlock; - - while (p[0] && p[1]) { printf("%s\n", p); @@ -27,6 +26,7 @@ int TestEnvironmentMergeEnvironmentStrings(int argc, char* argv[]) } FreeEnvironmentStrings(lpszEnvironmentBlock); +#endif return 0; }