From: Marc-André Moreau Date: Tue, 28 Feb 2012 15:01:47 +0000 (-0500) Subject: libfreerdp-auth: fix warnings on windows X-Git-Tag: 1.1.0-beta1~424 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffda55e7f451ea95a7144a0e00a48528163bc124;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-auth: fix warnings on windows --- diff --git a/include/freerdp/auth/sspi.h b/include/freerdp/auth/sspi.h index 6ab6f14..50729bc 100644 --- a/include/freerdp/auth/sspi.h +++ b/include/freerdp/auth/sspi.h @@ -23,6 +23,19 @@ #include #include +#ifdef _WIN32 +#include +#include +#include + +#ifdef NATIVE_SSPI +#define SECURITY_WIN32 +#include +#pragma comment(lib, "secur32.lib") +#endif + +#endif + struct _SEC_INTEGER { uint32 LowPart; @@ -70,6 +83,8 @@ typedef struct _SEC_PKG_INFO SEC_PKG_INFO; typedef uint32 SECURITY_STATUS; +#ifndef _WINERROR_ + #define SEC_E_OK 0x00000000 #define SEC_E_INSUFFICIENT_MEMORY 0x80090300 #define SEC_E_INVALID_HANDLE 0x80090301 @@ -156,6 +171,8 @@ typedef uint32 SECURITY_STATUS; #define SEC_I_SIGNATURE_NEEDED 0x0009035C #define SEC_I_NO_RENEGOTIATION 0x00090360 +#endif + #define SECURITY_NATIVE_DREP 0x00000010 #define SECURITY_NETWORK_DREP 0x00000000 diff --git a/libfreerdp-auth/NTLM/ntlm.c b/libfreerdp-auth/NTLM/ntlm.c index 6671944..7275304 100644 --- a/libfreerdp-auth/NTLM/ntlm.c +++ b/libfreerdp-auth/NTLM/ntlm.c @@ -312,7 +312,7 @@ SECURITY_STATUS ntlm_EncryptMessage(CTXT_HANDLE* phContext, uint32 fQOP, SEC_BUF context = sspi_SecureHandleGetLowerPointer(phContext); - for (index = 0; index < pMessage->cBuffers; index++) + for (index = 0; index < (int) pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer = &pMessage->pBuffers[index]; @@ -389,7 +389,7 @@ SECURITY_STATUS ntlm_DecryptMessage(CTXT_HANDLE* phContext, SEC_BUFFER_DESC* pMe context = sspi_SecureHandleGetLowerPointer(phContext); - for (index = 0; index < pMessage->cBuffers; index++) + for (index = 0; index < (int) pMessage->cBuffers; index++) { if (pMessage->pBuffers[index].BufferType == SECBUFFER_DATA) data_buffer = &pMessage->pBuffers[index]; diff --git a/libfreerdp-auth/credssp.c b/libfreerdp-auth/credssp.c index ab62ee0..c5a9d3c 100644 --- a/libfreerdp-auth/credssp.c +++ b/libfreerdp-auth/credssp.c @@ -29,7 +29,7 @@ #include #include -//#define WITH_SSPI 1 +#define WITH_SSPI 1 /** * TSRequest ::= SEQUENCE { diff --git a/libfreerdp-auth/sspi.c b/libfreerdp-auth/sspi.c index 6c268ad..80c8f83 100644 --- a/libfreerdp-auth/sspi.c +++ b/libfreerdp-auth/sspi.c @@ -106,7 +106,7 @@ void* sspi_ContextBufferAlloc(uint32 allocatorIndex, size_t size) int index; void* contextBuffer; - for (index = 0; index < ContextBufferAllocTable.cMaxEntries; index++) + for (index = 0; index < (int) ContextBufferAllocTable.cMaxEntries; index++) { if (ContextBufferAllocTable.entries[index].contextBuffer == NULL) { @@ -137,7 +137,7 @@ void sspi_ContextBufferFree(void* contextBuffer) int index; uint32 allocatorIndex; - for (index = 0; index < ContextBufferAllocTable.cMaxEntries; index++) + for (index = 0; index < (int) ContextBufferAllocTable.cMaxEntries; index++) { if (contextBuffer == ContextBufferAllocTable.entries[index].contextBuffer) { @@ -275,7 +275,7 @@ SECURITY_FUNCTION_TABLE* sspi_GetSecurityFunctionTableByName(const char* Name) cPackages = sizeof(SEC_PKG_INFO_LIST) / sizeof(SEC_PKG_INFO*); - for (index = 0; index < cPackages; index++) + for (index = 0; index < (int) cPackages; index++) { if (strcmp(Name, SECURITY_FUNCTION_TABLE_NAME_LIST[index].Name) == 0) { @@ -310,7 +310,7 @@ SECURITY_STATUS EnumerateSecurityPackages(uint32* pcPackages, SEC_PKG_INFO** ppP pPackageInfo = (SEC_PKG_INFO*) sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size); - for (index = 0; index < cPackages; index++) + for (index = 0; index < (int) cPackages; index++) { pPackageInfo[index].fCapabilities = SEC_PKG_INFO_LIST[index]->fCapabilities; pPackageInfo[index].wVersion = SEC_PKG_INFO_LIST[index]->wVersion; @@ -334,7 +334,7 @@ void FreeContextBuffer_EnumerateSecurityPackages(void* contextBuffer) cPackages = sizeof(SEC_PKG_INFO_LIST) / sizeof(SEC_PKG_INFO*); - for (index = 0; index < cPackages; index++) + for (index = 0; index < (int) cPackages; index++) { if (pPackageInfo[index].Name) xfree(pPackageInfo[index].Name); @@ -363,7 +363,7 @@ SECURITY_STATUS QuerySecurityPackageInfo(char* pszPackageName, SEC_PKG_INFO** pp cPackages = sizeof(SEC_PKG_INFO_LIST) / sizeof(SEC_PKG_INFO*); - for (index = 0; index < cPackages; index++) + for (index = 0; index < (int) cPackages; index++) { if (strcmp(pszPackageName, SEC_PKG_INFO_LIST[index]->Name) == 0) {