summaryrefslogtreecommitdiffstats
path: root/winpr/include
diff options
context:
space:
mode:
Diffstat (limited to 'winpr/include')
-rw-r--r--winpr/include/winpr/comm.h3
-rw-r--r--winpr/include/winpr/crt.h11
-rw-r--r--winpr/include/winpr/environment.h9
-rw-r--r--winpr/include/winpr/file.h13
-rw-r--r--winpr/include/winpr/intrin.h2
-rw-r--r--winpr/include/winpr/io.h2
-rw-r--r--winpr/include/winpr/memory.h6
-rw-r--r--winpr/include/winpr/pipe.h3
-rw-r--r--winpr/include/winpr/pool.h2
-rw-r--r--winpr/include/winpr/synch.h39
-rw-r--r--winpr/include/winpr/sysinfo.h11
-rw-r--r--winpr/include/winpr/thread.h2
-rw-r--r--winpr/include/winpr/winpr.h10
-rw-r--r--winpr/include/winpr/winsock.h4
-rw-r--r--winpr/include/winpr/wtsapi.h10
15 files changed, 113 insertions, 14 deletions
diff --git a/winpr/include/winpr/comm.h b/winpr/include/winpr/comm.h
index 9eb535c..2dbc4fd 100644
--- a/winpr/include/winpr/comm.h
+++ b/winpr/include/winpr/comm.h
@@ -25,8 +25,6 @@
#include <winpr/collections.h>
#include <winpr/file.h>
-#include <winpr/winpr.h>
-#include <winpr/wtypes.h>
#if defined __linux__ && !defined ANDROID
@@ -392,6 +390,7 @@ extern "C"
* also ensures that CommCreateFileA() has been registered through
* RegisterHandleCreator().
*/
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CommCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h
index 6c155ee..f42c953 100644
--- a/winpr/include/winpr/crt.h
+++ b/winpr/include/winpr/crt.h
@@ -190,27 +190,34 @@ extern "C"
{
#endif
+ WINPR_API void winpr_aligned_free(void* memblock);
+
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_malloc(size_t size, size_t alignment);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_calloc(size_t count, size_t size, size_t alignment);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_realloc(void* memblock, size_t size, size_t alignment);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_recalloc(void* memblock, size_t num, size_t size,
size_t alignment);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_offset_malloc(size_t size, size_t alignment, size_t offset);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_offset_realloc(void* memblock, size_t size, size_t alignment,
size_t offset);
+ WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
WINPR_API void* winpr_aligned_offset_recalloc(void* memblock, size_t num, size_t size,
size_t alignment, size_t offset);
WINPR_API size_t winpr_aligned_msize(void* memblock, size_t alignment, size_t offset);
- WINPR_API void winpr_aligned_free(void* memblock);
-
#ifdef __cplusplus
}
#endif
diff --git a/winpr/include/winpr/environment.h b/winpr/include/winpr/environment.h
index f530d59..c963f8c 100644
--- a/winpr/include/winpr/environment.h
+++ b/winpr/include/winpr/environment.h
@@ -87,7 +87,13 @@ extern "C"
* http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx
*/
+ WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock);
+ WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock);
+
+ WINPR_ATTR_MALLOC(FreeEnvironmentStringsA, 1)
WINPR_API LPCH GetEnvironmentStrings(VOID);
+
+ WINPR_ATTR_MALLOC(FreeEnvironmentStringsW, 1)
WINPR_API LPWCH GetEnvironmentStringsW(VOID);
WINPR_API BOOL SetEnvironmentStringsA(LPCH NewEnvironment);
@@ -96,9 +102,6 @@ extern "C"
WINPR_API DWORD ExpandEnvironmentStringsA(LPCSTR lpSrc, LPSTR lpDst, DWORD nSize);
WINPR_API DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize);
- WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock);
- WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock);
-
#ifdef __cplusplus
}
#endif
diff --git a/winpr/include/winpr/file.h b/winpr/include/winpr/file.h
index c455d74..09aa2c2 100644
--- a/winpr/include/winpr/file.h
+++ b/winpr/include/winpr/file.h
@@ -27,6 +27,7 @@
#include <winpr/nt.h>
#include <winpr/io.h>
#include <winpr/error.h>
+#include <winpr/handle.h>
#ifndef _WIN32
@@ -262,11 +263,13 @@ extern "C"
{
#endif
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
@@ -359,12 +362,20 @@ extern "C"
WINPR_API BOOL SetFileTime(HANDLE hFile, const FILETIME* lpCreationTime,
const FILETIME* lpLastAccessTime, const FILETIME* lpLastWriteTime);
+ WINPR_API BOOL FindClose(HANDLE hFindFile);
+
+ WINPR_ATTR_MALLOC(FindClose, 1)
WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
+
+ WINPR_ATTR_MALLOC(FindClose, 1)
WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData);
+ WINPR_ATTR_MALLOC(FindClose, 1)
WINPR_API HANDLE FindFirstFileExA(LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId,
LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp,
LPVOID lpSearchFilter, DWORD dwAdditionalFlags);
+
+ WINPR_ATTR_MALLOC(FindClose, 1)
WINPR_API HANDLE FindFirstFileExW(LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId,
LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp,
LPVOID lpSearchFilter, DWORD dwAdditionalFlags);
@@ -372,8 +383,6 @@ extern "C"
WINPR_API BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);
WINPR_API BOOL FindNextFileW(HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData);
- WINPR_API BOOL FindClose(HANDLE hFindFile);
-
WINPR_API BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
WINPR_API BOOL CreateDirectoryW(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
diff --git a/winpr/include/winpr/intrin.h b/winpr/include/winpr/intrin.h
index 066f45f..0e61d4d 100644
--- a/winpr/include/winpr/intrin.h
+++ b/winpr/include/winpr/intrin.h
@@ -22,7 +22,7 @@
#ifndef WINPR_INTRIN_H
#define WINPR_INTRIN_H
-#if !defined(_WIN32) || defined(__MINGW32__)
+#if !defined(_WIN32) || defined(__MINGW32__) || defined(_M_ARM64)
/**
* __lzcnt16, __lzcnt, __lzcnt64:
diff --git a/winpr/include/winpr/io.h b/winpr/include/winpr/io.h
index 2a0e34c..2df2316 100644
--- a/winpr/include/winpr/io.h
+++ b/winpr/include/winpr/io.h
@@ -22,6 +22,7 @@
#include <winpr/winpr.h>
#include <winpr/wtypes.h>
+#include <winpr/handle.h>
#ifdef _WIN32
@@ -71,6 +72,7 @@ extern "C"
DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize,
LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort,
ULONG_PTR CompletionKey,
DWORD NumberOfConcurrentThreads);
diff --git a/winpr/include/winpr/memory.h b/winpr/include/winpr/memory.h
index 850d6b2..09f83bd 100644
--- a/winpr/include/winpr/memory.h
+++ b/winpr/include/winpr/memory.h
@@ -37,14 +37,20 @@ extern "C"
{
#endif
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
DWORD flProtect, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
DWORD flProtect, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, LPCWSTR lpName);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenFileMappingA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
WINPR_API LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess,
diff --git a/winpr/include/winpr/pipe.h b/winpr/include/winpr/pipe.h
index 932fda5..a31d5eb 100644
--- a/winpr/include/winpr/pipe.h
+++ b/winpr/include/winpr/pipe.h
@@ -73,10 +73,13 @@ extern "C"
* Named pipe
*/
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateNamedPipeA(LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode,
DWORD nMaxInstances, DWORD nOutBufferSize,
DWORD nInBufferSize, DWORD nDefaultTimeOut,
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateNamedPipeW(LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode,
DWORD nMaxInstances, DWORD nOutBufferSize,
DWORD nInBufferSize, DWORD nDefaultTimeOut,
diff --git a/winpr/include/winpr/pool.h b/winpr/include/winpr/pool.h
index 3160ae3..efc467c 100644
--- a/winpr/include/winpr/pool.h
+++ b/winpr/include/winpr/pool.h
@@ -110,7 +110,7 @@ typedef VOID (*PTP_WIN32_IO_CALLBACK)(PTP_CALLBACK_INSTANCE Instance, PVOID Cont
#define WINPR_THREAD_POOL 1
#elif defined(_WIN32) && (_WIN32_WINNT < 0x0600)
#define WINPR_THREAD_POOL 1
-#elif defined(__MINGW32__) && (__MINGW64_VERSION_MAJOR < 8)
+#elif defined(__MINGW32__) && (__MINGW64_VERSION_MAJOR < 7)
#define WINPR_THREAD_POOL 1
#endif
diff --git a/winpr/include/winpr/synch.h b/winpr/include/winpr/synch.h
index b310a3b..c59c979 100644
--- a/winpr/include/winpr/synch.h
+++ b/winpr/include/winpr/synch.h
@@ -44,17 +44,26 @@ extern "C"
/* Mutex */
#define CREATE_MUTEX_INITIAL_OWNER 0x00000001
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
LPCWSTR lpName);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateMutexExA(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCSTR lpName,
DWORD dwFlags, DWORD dwDesiredAccess);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateMutexExW(LPSECURITY_ATTRIBUTES lpMutexAttributes, LPCWSTR lpName,
DWORD dwFlags, DWORD dwDesiredAccess);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenMutexA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenMutexW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
WINPR_API BOOL ReleaseMutex(HANDLE hMutex);
@@ -71,12 +80,18 @@ extern "C"
/* Semaphore */
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenSemaphoreA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenSemaphoreW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
#ifdef UNICODE
@@ -93,17 +108,26 @@ extern "C"
#define CREATE_EVENT_MANUAL_RESET 0x00000001
#define CREATE_EVENT_INITIAL_SET 0x00000002
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
BOOL bInitialState, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
BOOL bInitialState, LPCWSTR lpName);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateEventExA(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCSTR lpName,
DWORD dwFlags, DWORD dwDesiredAccess);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateEventExW(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName,
DWORD dwFlags, DWORD dwDesiredAccess);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenEventA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenEventW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName);
WINPR_API BOOL SetEvent(HANDLE hEvent);
@@ -225,14 +249,20 @@ extern "C"
typedef VOID (*PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue,
DWORD dwTimerHighValue);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes,
BOOL bManualReset, LPCSTR lpTimerName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes,
BOOL bManualReset, LPCWSTR lpTimerName);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateWaitableTimerExA(LPSECURITY_ATTRIBUTES lpTimerAttributes,
LPCSTR lpTimerName, DWORD dwFlags,
DWORD dwDesiredAccess);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateWaitableTimerExW(LPSECURITY_ATTRIBUTES lpTimerAttributes,
LPCWSTR lpTimerName, DWORD dwFlags,
DWORD dwDesiredAccess);
@@ -246,8 +276,11 @@ extern "C"
LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext,
ULONG TolerableDelay);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenWaitableTimerA(DWORD dwDesiredAccess, BOOL bInheritHandle,
LPCSTR lpTimerName);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE OpenWaitableTimerW(DWORD dwDesiredAccess, BOOL bInheritHandle,
LPCWSTR lpTimerName);
@@ -282,7 +315,9 @@ extern "C"
typedef VOID (*WAITORTIMERCALLBACK)(PVOID lpParameter, BOOLEAN TimerOrWaitFired);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateTimerQueue(void);
+
WINPR_API BOOL DeleteTimerQueue(HANDLE TimerQueue);
WINPR_API BOOL DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent);
@@ -395,13 +430,17 @@ extern "C"
WINPR_API VOID USleep(DWORD dwMicroseconds);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileDescriptorEventW(LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset, BOOL bInitialState,
int FileDescriptor, ULONG mode);
+
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateFileDescriptorEventA(LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset, BOOL bInitialState,
int FileDescriptor, ULONG mode);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset, BOOL bInitialState, void* pObject);
diff --git a/winpr/include/winpr/sysinfo.h b/winpr/include/winpr/sysinfo.h
index d7d6dd8..61fadc3 100644
--- a/winpr/include/winpr/sysinfo.h
+++ b/winpr/include/winpr/sysinfo.h
@@ -322,6 +322,17 @@ extern "C"
#endif
+#define WINPR_TIME_NS_TO_S(ns) ((ns) / 1000000000ull)
+#define WINPR_TIME_NS_TO_MS(ns) ((ns) / 1000000ull)
+#define WINPR_TIME_NS_TO_US(ns) ((ns) / 1000ull)
+
+#define WINPR_TIME_NS_REM_NS(ns) ((ns) % 1000000000ull)
+#define WINPR_TIME_NS_REM_US(ns) (WINPR_TIME_NS_REM_NS(ns) / 1000ull)
+#define WINPR_TIME_NS_REM_MS(ns) (WINPR_TIME_NS_REM_US(ns) / 1000ull)
+
+ WINPR_API UINT64 winpr_GetTickCount64NS(void);
+ WINPR_API UINT64 winpr_GetUnixTimeNS(void);
+
WINPR_API DWORD GetTickCountPrecise(void);
WINPR_API BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature);
diff --git a/winpr/include/winpr/thread.h b/winpr/include/winpr/thread.h
index 2f17603..b0bad74 100644
--- a/winpr/include/winpr/thread.h
+++ b/winpr/include/winpr/thread.h
@@ -198,10 +198,12 @@ extern "C"
#define CREATE_SUSPENDED 0x00000004
#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize,
LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter,
DWORD dwCreationFlags, LPDWORD lpThreadId);
+ WINPR_ATTR_MALLOC(CloseHandle, 1)
WINPR_API HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThreadAttributes,
SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter, DWORD dwCreationFlags,
diff --git a/winpr/include/winpr/winpr.h b/winpr/include/winpr/winpr.h
index 04311d8..a429c7a 100644
--- a/winpr/include/winpr/winpr.h
+++ b/winpr/include/winpr/winpr.h
@@ -119,6 +119,16 @@
#define INLINE inline
#endif
+#if defined(__GNUC__) || defined(__clang__)
+#define WINPR_ALIGN64 __attribute__((aligned(8)))
+#else
+#ifdef _WIN32
+#define WINPR_ALIGN64 __declspec(align(8))
+#else
+#define WINPR_ALIGN64
+#endif
+#endif
+
WINPR_API void winpr_get_version(int* major, int* minor, int* revision);
WINPR_API const char* winpr_get_version_string(void);
WINPR_API const char* winpr_get_build_revision(void);
diff --git a/winpr/include/winpr/winsock.h b/winpr/include/winpr/winsock.h
index 73dc9ae..dbf8462 100644
--- a/winpr/include/winpr/winsock.h
+++ b/winpr/include/winpr/winsock.h
@@ -297,10 +297,12 @@ extern "C"
WINPR_API void WSASetLastError(int iError);
WINPR_API int WSAGetLastError(void);
+ WINPR_API BOOL WSACloseEvent(HANDLE hEvent);
+
+ WINPR_ATTR_MALLOC(WSACloseEvent, 1)
WINPR_API HANDLE WSACreateEvent(void);
WINPR_API BOOL WSASetEvent(HANDLE hEvent);
WINPR_API BOOL WSAResetEvent(HANDLE hEvent);
- WINPR_API BOOL WSACloseEvent(HANDLE hEvent);
WINPR_API int WSAEventSelect(SOCKET s, WSAEVENT hEventObject, LONG lNetworkEvents);
diff --git a/winpr/include/winpr/wtsapi.h b/winpr/include/winpr/wtsapi.h
index bd5616f..9902ffe 100644
--- a/winpr/include/winpr/wtsapi.h
+++ b/winpr/include/winpr/wtsapi.h
@@ -1002,13 +1002,19 @@ extern "C"
WINPR_API BOOL WINAPI WTSEnumerateServersA(LPSTR pDomainName, DWORD Reserved, DWORD Version,
PWTS_SERVER_INFOA* ppServerInfo, DWORD* pCount);
+ WINPR_API VOID WINAPI WTSCloseServer(HANDLE hServer);
+
+ WINPR_ATTR_MALLOC(WTSCloseServer, 1)
WINPR_API HANDLE WINAPI WTSOpenServerW(LPWSTR pServerName);
+
+ WINPR_ATTR_MALLOC(WTSCloseServer, 1)
WINPR_API HANDLE WINAPI WTSOpenServerA(LPSTR pServerName);
+ WINPR_ATTR_MALLOC(WTSCloseServer, 1)
WINPR_API HANDLE WINAPI WTSOpenServerExW(LPWSTR pServerName);
- WINPR_API HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName);
- WINPR_API VOID WINAPI WTSCloseServer(HANDLE hServer);
+ WINPR_ATTR_MALLOC(WTSCloseServer, 1)
+ WINPR_API HANDLE WINAPI WTSOpenServerExA(LPSTR pServerName);
WINPR_API BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version,
PWTS_SESSION_INFOW* ppSessionInfo, DWORD* pCount);