libfreerdp-core: fix compilation on windows

This commit is contained in:
Marc-André Moreau 2012-05-04 17:23:26 -04:00
parent 62a7615535
commit 95b6e2e04b
5 changed files with 22 additions and 15 deletions

View File

@ -953,10 +953,10 @@ FREERDP_API SECURITY_STATUS SEC_ENTRY VerifySignature(PCtxtHandle phContext, PSe
/* Custom API */
void sspi_GlobalInit();
void sspi_GlobalFinish();
FREERDP_API void sspi_GlobalInit();
FREERDP_API void sspi_GlobalFinish();
void sspi_SecBufferAlloc(PSecBuffer SecBuffer, size_t size);
void sspi_SecBufferFree(PSecBuffer SecBuffer);
FREERDP_API void sspi_SecBufferAlloc(PSecBuffer SecBuffer, size_t size);
FREERDP_API void sspi_SecBufferFree(PSecBuffer SecBuffer);
#endif /* FREERDP_SSPI_H */

View File

@ -42,12 +42,10 @@
typedef int BOOL, *PBOOL, *LPBOOL;
typedef unsigned char BYTE, *PBYTE, *LPBYTE;
typedef BYTE byte;
typedef BYTE BOOLEAN, *PBOOLEAN;
typedef wchar_t WCHAR, *PWCHAR;
typedef WCHAR* BSTR;
typedef char CHAR, *PCHAR;
typedef double DOUBLE;
typedef unsigned long DWORD, *PDWORD, *LPDWORD;
typedef unsigned int DWORD32;
typedef unsigned __int64 DWORD64;
@ -111,11 +109,6 @@ typedef int INT_PTR;
typedef unsigned int UINT_PTR;
#endif
typedef void* PCONTEXT_HANDLE;
typedef PCONTEXT_HANDLE* PPCONTEXT_HANDLE;
typedef unsigned long error_status_t;
typedef struct _GUID
{
unsigned long Data1;
@ -181,4 +174,12 @@ typedef struct _SECURITY_DESCRIPTOR
#endif
typedef BYTE byte;
typedef double DOUBLE;
typedef void* PCONTEXT_HANDLE;
typedef PCONTEXT_HANDLE* PPCONTEXT_HANDLE;
typedef unsigned long error_status_t;
#endif /* FREERDP_WINDOWS_TYPES_H */

View File

@ -107,9 +107,15 @@ void http_request_set_auth_param(HttpRequest* http_request, char* auth_param)
http_request->AuthParam = xstrdup(auth_param);
}
#ifdef _WIN32
#define http_encode_line(_str, _fmt, ...) \
_str = xmalloc(sprintf_s(NULL, 0, _fmt, ## __VA_ARGS__) + 1); \
sprintf_s(_str, sprintf_s(NULL, 0, _fmt, ## __VA_ARGS__) + 1, _fmt, ## __VA_ARGS__);
#else
#define http_encode_line(_str, _fmt, ...) \
_str = xmalloc(snprintf(NULL, 0, _fmt, ## __VA_ARGS__) + 1); \
snprintf(_str, snprintf(NULL, 0, _fmt, ## __VA_ARGS__) + 1, _fmt, ## __VA_ARGS__);
#endif
STREAM* http_request_write(HttpContext* http_context, HttpRequest* http_request)
{

View File

@ -874,7 +874,7 @@ PFORMAT_STRING NdrpComputeCount(PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMem
break;
case FC_HYPER:
data = *(ULONGLONG*) ptr;
data = (ULONG_PTR) *(ULONGLONG*) ptr;
break;
}
@ -1773,7 +1773,6 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P
for (i = 0; i < numberParams; i++)
{
float tmp;
arg = pStubMsg->StackTop + params[i].StackOffset;
fmt = (PFORMAT_STRING) &pStubMsg->StubDesc->pFormatTypes[params[i].Type.Offset];
@ -1782,7 +1781,7 @@ void NdrProcessParams(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, NDR_P
!(params[i].Attributes.IsSimpleRef) &&
((params[i].Type.FormatChar) == FC_FLOAT) && !fpuArgs)
{
tmp = *(double*) arg;
float tmp = *(double*) arg;
arg = (unsigned char*) &tmp;
}
#endif

View File

@ -1692,6 +1692,7 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
{
uint8* data;
uint32 length;
STREAM* s_p4;
int status = -1;
UNICONV* tsg_uniconv;
rdpRpc* rpc = tsg->rpc;
@ -1829,7 +1830,7 @@ boolean tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
memcpy(tsg_packet4 + 4, tsg->TunnelContext, 16);
memcpy(tsg_packet4 + 38, &port, 2);
STREAM* s_p4 = stream_new(60 + dest_addr_unic_len + 2);
s_p4 = stream_new(60 + dest_addr_unic_len + 2);
stream_write(s_p4, tsg_packet4, 48);
stream_write_uint32(s_p4, (dest_addr_unic_len / 2) + 1); /* MaximumCount */
stream_write_uint32(s_p4, 0x00000000); /* Offset */