Merge branch 'cleanup' of github.com:FreeRDP/FreeRDP into cleanup
This commit is contained in:
commit
098fd2912e
@ -29,4 +29,22 @@
|
||||
#include <winpr/string.h>
|
||||
#include <winpr/memory.h>
|
||||
|
||||
/* Data Alignment */
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
WINPR_API void* _aligned_malloc(size_t size, size_t alignment);
|
||||
WINPR_API void* _aligned_realloc(void* memblock, size_t size, size_t alignment);
|
||||
WINPR_API void* _aligned_recalloc(void* memblock, size_t num, size_t size, size_t alignment);
|
||||
|
||||
WINPR_API void* _aligned_offset_malloc(size_t size, size_t alignment, size_t offset);
|
||||
WINPR_API void* _aligned_offset_realloc(void* memblock, size_t size, size_t alignment, size_t offset);
|
||||
WINPR_API void* _aligned_offset_recalloc(void* memblock, size_t num, size_t size, size_t alignment, size_t offset);
|
||||
|
||||
WINPR_API size_t _aligned_msize(void* memblock, size_t alignment, size_t offset);
|
||||
|
||||
#endif
|
||||
|
||||
WINPR_API void _aligned_free(void* memblock);
|
||||
|
||||
#endif /* WINPR_CRT_H */
|
||||
|
@ -26,6 +26,37 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
typedef struct _LIST_ENTRY LIST_ENTRY;
|
||||
typedef struct _LIST_ENTRY* PLIST_ENTRY;
|
||||
|
||||
struct _LIST_ENTRY
|
||||
{
|
||||
PLIST_ENTRY Flink;
|
||||
PLIST_ENTRY Blink;
|
||||
};
|
||||
|
||||
typedef struct _SINGLE_LIST_ENTRY SINGLE_LIST_ENTRY;
|
||||
typedef struct _SINGLE_LIST_ENTRY* PSINGLE_LIST_ENTRY;
|
||||
|
||||
struct _SINGLE_LIST_ENTRY
|
||||
{
|
||||
PSINGLE_LIST_ENTRY Next;
|
||||
};
|
||||
|
||||
typedef struct LIST_ENTRY32
|
||||
{
|
||||
DWORD Flink;
|
||||
DWORD Blink;
|
||||
} LIST_ENTRY32;
|
||||
typedef LIST_ENTRY32 *PLIST_ENTRY32;
|
||||
|
||||
typedef struct LIST_ENTRY64
|
||||
{
|
||||
ULONGLONG Flink;
|
||||
ULONGLONG Blink;
|
||||
} LIST_ENTRY64;
|
||||
typedef LIST_ENTRY64 *PLIST_ENTRY64;
|
||||
|
||||
#ifdef _AMD64_
|
||||
|
||||
typedef struct _SLIST_ENTRY *PSLIST_ENTRY;
|
||||
|
@ -37,5 +37,11 @@
|
||||
#endif
|
||||
#endif /* DECLSPEC_ALIGN */
|
||||
|
||||
#ifdef _AMD64_
|
||||
#define MEMORY_ALLOCATION_ALIGNMENT 16
|
||||
#else
|
||||
#define MEMORY_ALLOCATION_ALIGNMENT 8
|
||||
#endif
|
||||
|
||||
#endif /* WINPR_SPEC_H */
|
||||
|
||||
|
@ -137,6 +137,8 @@ WINPR_API DWORD GetCurrentProcessorNumber(VOID);
|
||||
|
||||
/* Thread-Local Storage */
|
||||
|
||||
#define TLS_OUT_OF_INDEXES ((DWORD) 0xFFFFFFFF)
|
||||
|
||||
WINPR_API DWORD TlsAlloc(VOID);
|
||||
WINPR_API LPVOID TlsGetValue(DWORD dwTlsIndex);
|
||||
WINPR_API BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
|
||||
|
33
winpr/include/winpr/timezone.h
Normal file
33
winpr/include/winpr/timezone.h
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Time Zone
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef WINPR_TIMEZONE_H
|
||||
#define WINPR_TIMEZONE_H
|
||||
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/wtypes.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* WINPR_TIMEZONE_H */
|
||||
|
33
winpr/include/winpr/winhttp.h
Normal file
33
winpr/include/winpr/winhttp.h
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Windows HTTP (WinHTTP)
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef WINPR_WINHTTP_H
|
||||
#define WINPR_WINHTTP_H
|
||||
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/wtypes.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* WINPR_WINHTTP_H */
|
||||
|
33
winpr/include/winpr/winsock.h
Normal file
33
winpr/include/winpr/winsock.h
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Windows Sockets (Winsock)
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef WINPR_WINSOCK_H
|
||||
#define WINPR_WINSOCK_H
|
||||
|
||||
#include <winpr/winpr.h>
|
||||
#include <winpr/wtypes.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* WINPR_WINSOCK_H */
|
||||
|
@ -41,6 +41,9 @@ add_subdirectory(sspicli)
|
||||
add_subdirectory(sspi)
|
||||
add_subdirectory(registry)
|
||||
add_subdirectory(library)
|
||||
add_subdirectory(timezone)
|
||||
add_subdirectory(winsock)
|
||||
add_subdirectory(winhttp)
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
add_library(winpr
|
||||
@ -59,7 +62,10 @@ if(WITH_MONOLITHIC_BUILD)
|
||||
$<TARGET_OBJECTS:winpr-sspicli>
|
||||
$<TARGET_OBJECTS:winpr-sspi>
|
||||
$<TARGET_OBJECTS:winpr-registry>
|
||||
$<TARGET_OBJECTS:winpr-library>)
|
||||
$<TARGET_OBJECTS:winpr-library>
|
||||
$<TARGET_OBJECTS:winpr-timezone>
|
||||
$<TARGET_OBJECTS:winpr-winsock>
|
||||
$<TARGET_OBJECTS:winpr-winhttp>)
|
||||
|
||||
set_target_properties(winpr PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
# WinPR: Windows Portable Runtime
|
||||
# libwinpr-crt cmake build script
|
||||
#
|
||||
# Copyright 2011 O.S. Systems Software Ltda.
|
||||
# Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>
|
||||
# Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@ -18,6 +16,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
set(WINPR_CRT_SRCS
|
||||
alignment.c
|
||||
memory.c
|
||||
string.c)
|
||||
|
||||
|
70
winpr/libwinpr/crt/alignment.c
Normal file
70
winpr/libwinpr/crt/alignment.c
Normal file
@ -0,0 +1,70 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Data Alignment
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
/* Data Alignment: http://msdn.microsoft.com/en-us/library/fs9stz4e/ */
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
void* _aligned_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* _aligned_realloc(void* memblock, size_t size, size_t alignment)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* _aligned_recalloc(void* memblock, size_t num, size_t size, size_t alignment)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* _aligned_offset_malloc(size_t size, size_t alignment, size_t offset)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* _aligned_offset_realloc(void* memblock, size_t size, size_t alignment, size_t offset)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* _aligned_offset_recalloc(void* memblock, size_t num, size_t size, size_t alignment, size_t offset)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t _aligned_msize(void* memblock, size_t alignment, size_t offset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _aligned_free(void* memblock)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -74,32 +74,56 @@ USHORT QueryDepthSList(PSLIST_HEADER ListHead)
|
||||
|
||||
LONG InterlockedIncrement(LONG volatile *Addend)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_add_and_fetch(Addend, 1);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LONG InterlockedDecrement(LONG volatile *Addend)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_sub_and_fetch(Addend, 1);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LONG InterlockedExchange(LONG volatile *Target, LONG Value)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_val_compare_and_swap(Target, *Target, Value);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LONG InterlockedExchangeAdd(LONG volatile *Addend, LONG Value)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_add_and_fetch(Addend, Value);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LONG InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange, LONG Comperand)
|
||||
LONG InterlockedCompareExchange(LONG volatile *Destination, LONG ExChange, LONG Comperand)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination, LONG64 ExChange, LONG64 Comperand)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -69,6 +69,11 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/**
|
||||
* TODO: implement thread suspend/resume using pthreads
|
||||
* http://stackoverflow.com/questions/3140867/suspend-pthreads-without-using-condition
|
||||
*/
|
||||
|
||||
typedef void *(*pthread_start_routine)(void*);
|
||||
|
||||
HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,
|
||||
@ -82,12 +87,20 @@ HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize
|
||||
{
|
||||
HANDLE handle;
|
||||
pthread_t thread;
|
||||
pthread_attr_t attr;
|
||||
|
||||
pthread_create(&thread, 0, (pthread_start_routine) lpStartAddress, lpParameter);
|
||||
pthread_detach(thread);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
if (dwStackSize > 0)
|
||||
pthread_attr_setstacksize(&attr, (size_t) dwStackSize);
|
||||
|
||||
pthread_create(&thread, &attr, (pthread_start_routine) lpStartAddress, lpParameter);
|
||||
|
||||
handle = winpr_Handle_Insert(HANDLE_TYPE_THREAD, (void*) thread);
|
||||
|
||||
pthread_attr_destroy(&attr);
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
@ -34,23 +34,49 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
DWORD TlsAlloc(VOID)
|
||||
{
|
||||
return 0;
|
||||
DWORD dwTlsIndex;
|
||||
pthread_key_t key;
|
||||
|
||||
if (pthread_key_create(&key, NULL) != 0)
|
||||
return TLS_OUT_OF_INDEXES;
|
||||
|
||||
dwTlsIndex = (DWORD) key;
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
LPVOID TlsGetValue(DWORD dwTlsIndex)
|
||||
{
|
||||
return NULL;
|
||||
LPVOID value;
|
||||
pthread_key_t key;
|
||||
|
||||
key = (pthread_key_t) dwTlsIndex;
|
||||
value = (LPVOID) pthread_getspecific(key);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
|
||||
{
|
||||
pthread_key_t key;
|
||||
|
||||
key = (pthread_key_t) dwTlsIndex;
|
||||
pthread_setspecific(key, lpTlsValue);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL TlsFree(DWORD dwTlsIndex)
|
||||
{
|
||||
pthread_key_t key;
|
||||
|
||||
key = (pthread_key_t) dwTlsIndex;
|
||||
pthread_key_delete(key);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
33
winpr/libwinpr/timezone/CMakeLists.txt
Normal file
33
winpr/libwinpr/timezone/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# WinPR: Windows Portable Runtime
|
||||
# libwinpr-timezone cmake build script
|
||||
#
|
||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(WINPR_TIMEZONE_SRCS
|
||||
timezone.c)
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
add_library(winpr-timezone OBJECT ${WINPR_TIMEZONE_SRCS})
|
||||
else()
|
||||
add_library(winpr-timezone ${WINPR_TIMEZONE_SRCS})
|
||||
endif()
|
||||
|
||||
set_target_properties(winpr-timezone PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
|
||||
else()
|
||||
install(TARGETS winpr-timezone DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
46
winpr/libwinpr/timezone/timezone.c
Normal file
46
winpr/libwinpr/timezone/timezone.c
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Time Zone
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/timezone.h>
|
||||
|
||||
/**
|
||||
* api-ms-win-core-timezone-l1-1-0.dll:
|
||||
*
|
||||
* EnumDynamicTimeZoneInformation
|
||||
* FileTimeToSystemTime
|
||||
* GetDynamicTimeZoneInformation
|
||||
* GetDynamicTimeZoneInformationEffectiveYears
|
||||
* GetTimeZoneInformation
|
||||
* GetTimeZoneInformationForYear
|
||||
* SetDynamicTimeZoneInformation
|
||||
* SetTimeZoneInformation
|
||||
* SystemTimeToFileTime
|
||||
* SystemTimeToTzSpecificLocalTime
|
||||
* TzSpecificLocalTimeToSystemTime
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
33
winpr/libwinpr/winhttp/CMakeLists.txt
Normal file
33
winpr/libwinpr/winhttp/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# WinPR: Windows Portable Runtime
|
||||
# libwinpr-winhttp cmake build script
|
||||
#
|
||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(WINPR_WINHTTP_SRCS
|
||||
winhttp.c)
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
add_library(winpr-winhttp OBJECT ${WINPR_WINHTTP_SRCS})
|
||||
else()
|
||||
add_library(winpr-winhttp ${WINPR_WINHTTP_SRCS})
|
||||
endif()
|
||||
|
||||
set_target_properties(winpr-winhttp PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
|
||||
else()
|
||||
install(TARGETS winpr-winhttp DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
74
winpr/libwinpr/winhttp/winhttp.c
Normal file
74
winpr/libwinpr/winhttp/winhttp.c
Normal file
@ -0,0 +1,74 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Windows HTTP (WinHTTP)
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/winhttp.h>
|
||||
|
||||
/**
|
||||
* winhttp.dll:
|
||||
*
|
||||
* WinHttpAddRequestHeaders
|
||||
* WinHttpAutoProxySvcMain
|
||||
* WinHttpCheckPlatform
|
||||
* WinHttpCloseHandle
|
||||
* WinHttpConnect
|
||||
* WinHttpCrackUrl
|
||||
* WinHttpCreateProxyResolver
|
||||
* WinHttpCreateUrl
|
||||
* WinHttpDetectAutoProxyConfigUrl
|
||||
* WinHttpFreeProxyResult
|
||||
* WinHttpGetDefaultProxyConfiguration
|
||||
* WinHttpGetIEProxyConfigForCurrentUser
|
||||
* WinHttpGetProxyForUrl
|
||||
* WinHttpGetProxyForUrlEx
|
||||
* WinHttpGetProxyResult
|
||||
* WinHttpOpen
|
||||
* WinHttpOpenRequest
|
||||
* WinHttpQueryAuthSchemes
|
||||
* WinHttpQueryDataAvailable
|
||||
* WinHttpQueryHeaders
|
||||
* WinHttpQueryOption
|
||||
* WinHttpReadData
|
||||
* WinHttpReceiveResponse
|
||||
* WinHttpResetAutoProxy
|
||||
* WinHttpSendRequest
|
||||
* WinHttpSetCredentials
|
||||
* WinHttpSetDefaultProxyConfiguration
|
||||
* WinHttpSetOption
|
||||
* WinHttpSetStatusCallback
|
||||
* WinHttpSetTimeouts
|
||||
* WinHttpTimeFromSystemTime
|
||||
* WinHttpTimeToSystemTime
|
||||
* WinHttpWebSocketClose
|
||||
* WinHttpWebSocketCompleteUpgrade
|
||||
* WinHttpWebSocketQueryCloseStatus
|
||||
* WinHttpWebSocketReceive
|
||||
* WinHttpWebSocketSend
|
||||
* WinHttpWebSocketShutdown
|
||||
* WinHttpWriteData
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
33
winpr/libwinpr/winsock/CMakeLists.txt
Normal file
33
winpr/libwinpr/winsock/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# WinPR: Windows Portable Runtime
|
||||
# libwinpr-winsock cmake build script
|
||||
#
|
||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(WINPR_WINSOCK_SRCS
|
||||
winsock.c)
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
add_library(winpr-winsock OBJECT ${WINPR_WINSOCK_SRCS})
|
||||
else()
|
||||
add_library(winpr-winsock ${WINPR_WINSOCK_SRCS})
|
||||
endif()
|
||||
|
||||
set_target_properties(winpr-winsock PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
|
||||
|
||||
if(WITH_MONOLITHIC_BUILD)
|
||||
|
||||
else()
|
||||
install(TARGETS winpr-winsock DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
215
winpr/libwinpr/winsock/winsock.c
Normal file
215
winpr/libwinpr/winsock/winsock.c
Normal file
@ -0,0 +1,215 @@
|
||||
/**
|
||||
* WinPR: Windows Portable Runtime
|
||||
* Windows Sockets (Winsock)
|
||||
*
|
||||
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/winsock.h>
|
||||
|
||||
/**
|
||||
* ws2_32.dll:
|
||||
*
|
||||
* __WSAFDIsSet
|
||||
* accept
|
||||
* bind
|
||||
* closesocket
|
||||
* connect
|
||||
* freeaddrinfo
|
||||
* FreeAddrInfoEx
|
||||
* FreeAddrInfoExW
|
||||
* FreeAddrInfoW
|
||||
* getaddrinfo
|
||||
* GetAddrInfoExA
|
||||
* GetAddrInfoExCancel
|
||||
* GetAddrInfoExOverlappedResult
|
||||
* GetAddrInfoExW
|
||||
* GetAddrInfoW
|
||||
* gethostbyaddr
|
||||
* gethostbyname
|
||||
* gethostname
|
||||
* GetHostNameW
|
||||
* getnameinfo
|
||||
* GetNameInfoW
|
||||
* getpeername
|
||||
* getprotobyname
|
||||
* getprotobynumber
|
||||
* getservbyname
|
||||
* getservbyport
|
||||
* getsockname
|
||||
* getsockopt
|
||||
* htonl
|
||||
* htons
|
||||
* inet_addr
|
||||
* inet_ntoa
|
||||
* inet_ntop
|
||||
* inet_pton
|
||||
* InetNtopW
|
||||
* InetPtonW
|
||||
* ioctlsocket
|
||||
* listen
|
||||
* ntohl
|
||||
* ntohs
|
||||
* recv
|
||||
* recvfrom
|
||||
* select
|
||||
* send
|
||||
* sendto
|
||||
* SetAddrInfoExA
|
||||
* SetAddrInfoExW
|
||||
* setsockopt
|
||||
* shutdown
|
||||
* socket
|
||||
* WahCloseApcHelper
|
||||
* WahCloseHandleHelper
|
||||
* WahCloseNotificationHandleHelper
|
||||
* WahCloseSocketHandle
|
||||
* WahCloseThread
|
||||
* WahCompleteRequest
|
||||
* WahCreateHandleContextTable
|
||||
* WahCreateNotificationHandle
|
||||
* WahCreateSocketHandle
|
||||
* WahDestroyHandleContextTable
|
||||
* WahDisableNonIFSHandleSupport
|
||||
* WahEnableNonIFSHandleSupport
|
||||
* WahEnumerateHandleContexts
|
||||
* WahInsertHandleContext
|
||||
* WahNotifyAllProcesses
|
||||
* WahOpenApcHelper
|
||||
* WahOpenCurrentThread
|
||||
* WahOpenHandleHelper
|
||||
* WahOpenNotificationHandleHelper
|
||||
* WahQueueUserApc
|
||||
* WahReferenceContextByHandle
|
||||
* WahRemoveHandleContext
|
||||
* WahWaitForNotification
|
||||
* WahWriteLSPEvent
|
||||
* WEP
|
||||
* WPUCompleteOverlappedRequest
|
||||
* WPUGetProviderPathEx
|
||||
* WSAAccept
|
||||
* WSAAddressToStringA
|
||||
* WSAAddressToStringW
|
||||
* WSAAdvertiseProvider
|
||||
* WSAAsyncGetHostByAddr
|
||||
* WSAAsyncGetHostByName
|
||||
* WSAAsyncGetProtoByName
|
||||
* WSAAsyncGetProtoByNumber
|
||||
* WSAAsyncGetServByName
|
||||
* WSAAsyncGetServByPort
|
||||
* WSAAsyncSelect
|
||||
* WSACancelAsyncRequest
|
||||
* WSACancelBlockingCall
|
||||
* WSACleanup
|
||||
* WSACloseEvent
|
||||
* WSAConnect
|
||||
* WSAConnectByList
|
||||
* WSAConnectByNameA
|
||||
* WSAConnectByNameW
|
||||
* WSACreateEvent
|
||||
* WSADuplicateSocketA
|
||||
* WSADuplicateSocketW
|
||||
* WSAEnumNameSpaceProvidersA
|
||||
* WSAEnumNameSpaceProvidersExA
|
||||
* WSAEnumNameSpaceProvidersExW
|
||||
* WSAEnumNameSpaceProvidersW
|
||||
* WSAEnumNetworkEvents
|
||||
* WSAEnumProtocolsA
|
||||
* WSAEnumProtocolsW
|
||||
* WSAEventSelect
|
||||
* WSAGetLastError
|
||||
* WSAGetOverlappedResult
|
||||
* WSAGetQOSByName
|
||||
* WSAGetServiceClassInfoA
|
||||
* WSAGetServiceClassInfoW
|
||||
* WSAGetServiceClassNameByClassIdA
|
||||
* WSAGetServiceClassNameByClassIdW
|
||||
* WSAHtonl
|
||||
* WSAHtons
|
||||
* WSAInstallServiceClassA
|
||||
* WSAInstallServiceClassW
|
||||
* WSAIoctl
|
||||
* WSAIsBlocking
|
||||
* WSAJoinLeaf
|
||||
* WSALookupServiceBeginA
|
||||
* WSALookupServiceBeginW
|
||||
* WSALookupServiceEnd
|
||||
* WSALookupServiceNextA
|
||||
* WSALookupServiceNextW
|
||||
* WSANSPIoctl
|
||||
* WSANtohl
|
||||
* WSANtohs
|
||||
* WSAPoll
|
||||
* WSAProviderCompleteAsyncCall
|
||||
* WSAProviderConfigChange
|
||||
* WSApSetPostRoutine
|
||||
* WSARecv
|
||||
* WSARecvDisconnect
|
||||
* WSARecvFrom
|
||||
* WSARemoveServiceClass
|
||||
* WSAResetEvent
|
||||
* WSASend
|
||||
* WSASendDisconnect
|
||||
* WSASendMsg
|
||||
* WSASendTo
|
||||
* WSASetBlockingHook
|
||||
* WSASetEvent
|
||||
* WSASetLastError
|
||||
* WSASetServiceA
|
||||
* WSASetServiceW
|
||||
* WSASocketA
|
||||
* WSASocketW
|
||||
* WSAStartup
|
||||
* WSAStringToAddressA
|
||||
* WSAStringToAddressW
|
||||
* WSAUnadvertiseProvider
|
||||
* WSAUnhookBlockingHook
|
||||
* WSAWaitForMultipleEvents
|
||||
* WSCDeinstallProvider
|
||||
* WSCDeinstallProviderEx
|
||||
* WSCEnableNSProvider
|
||||
* WSCEnumProtocols
|
||||
* WSCEnumProtocolsEx
|
||||
* WSCGetApplicationCategory
|
||||
* WSCGetApplicationCategoryEx
|
||||
* WSCGetProviderInfo
|
||||
* WSCGetProviderPath
|
||||
* WSCInstallNameSpace
|
||||
* WSCInstallNameSpaceEx
|
||||
* WSCInstallNameSpaceEx2
|
||||
* WSCInstallProvider
|
||||
* WSCInstallProviderAndChains
|
||||
* WSCInstallProviderEx
|
||||
* WSCSetApplicationCategory
|
||||
* WSCSetApplicationCategoryEx
|
||||
* WSCSetProviderInfo
|
||||
* WSCUnInstallNameSpace
|
||||
* WSCUnInstallNameSpaceEx2
|
||||
* WSCUpdateProvider
|
||||
* WSCUpdateProviderEx
|
||||
* WSCWriteNameSpaceOrder
|
||||
* WSCWriteProviderOrder
|
||||
* WSCWriteProviderOrderEx
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user