libfreerdp-auth: fix warnings on windows

This commit is contained in:
Marc-André Moreau 2012-02-28 10:01:47 -05:00
parent 0250573a42
commit ffda55e7f4
4 changed files with 26 additions and 9 deletions

View File

@ -23,6 +23,19 @@
#include <freerdp/api.h>
#include <freerdp/types.h>
#ifdef _WIN32
#include <windows.h>
#include <winsock.h>
#include <winerror.h>
#ifdef NATIVE_SSPI
#define SECURITY_WIN32
#include <sspi.h>
#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

View File

@ -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];

View File

@ -29,7 +29,7 @@
#include <freerdp/auth/sspi.h>
#include <freerdp/auth/credssp.h>
//#define WITH_SSPI 1
#define WITH_SSPI 1
/**
* TSRequest ::= SEQUENCE {

View File

@ -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)
{