winpr: fix win32 linking issues
Depending on the windows target version (_WIN32_WINNT), the used SDK and the build configuration the linker will see multiple libraries exporting the same symbols. To prevent ugly hacks (e.g. modifying cmake's default system libraries or fragile library linking order chains) we prefix these functions with "winpr_" and create corresponding defines to keep the current api names.
This commit is contained in:
parent
6a3b48d4f0
commit
27c439675f
@ -122,47 +122,79 @@ extern "C" {
|
||||
|
||||
#ifdef WINPR_THREAD_POOL
|
||||
|
||||
WINPR_API PTP_WAIT CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID CloseThreadpoolWait(PTP_WAIT pwa);
|
||||
WINPR_API VOID SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout);
|
||||
WINPR_API VOID WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks);
|
||||
WINPR_API PTP_WAIT winpr_CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID winpr_CloseThreadpoolWait(PTP_WAIT pwa);
|
||||
WINPR_API VOID winpr_SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout);
|
||||
WINPR_API VOID winpr_WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks);
|
||||
|
||||
#define CreateThreadpoolWait winpr_CreateThreadpoolWait
|
||||
#define CloseThreadpoolWait winpr_CloseThreadpoolWait
|
||||
#define SetThreadpoolWait winpr_SetThreadpoolWait
|
||||
#define WaitForThreadpoolWaitCallbacks winpr_WaitForThreadpoolWaitCallbacks
|
||||
|
||||
/* Work */
|
||||
|
||||
WINPR_API PTP_WORK CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID CloseThreadpoolWork(PTP_WORK pwk);
|
||||
WINPR_API VOID SubmitThreadpoolWork(PTP_WORK pwk);
|
||||
WINPR_API BOOL TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks);
|
||||
WINPR_API PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID winpr_CloseThreadpoolWork(PTP_WORK pwk);
|
||||
WINPR_API VOID winpr_SubmitThreadpoolWork(PTP_WORK pwk);
|
||||
WINPR_API BOOL winpr_TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID winpr_WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks);
|
||||
|
||||
#define CreateThreadpoolWork winpr_CreateThreadpoolWork
|
||||
#define CloseThreadpoolWork winpr_CloseThreadpoolWork
|
||||
#define SubmitThreadpoolWork winpr_SubmitThreadpoolWork
|
||||
#define TrySubmitThreadpoolCallback winpr_TrySubmitThreadpoolCallback
|
||||
#define WaitForThreadpoolWorkCallbacks winpr_WaitForThreadpoolWorkCallbacks
|
||||
|
||||
/* Timer */
|
||||
|
||||
WINPR_API PTP_TIMER CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID CloseThreadpoolTimer(PTP_TIMER pti);
|
||||
WINPR_API BOOL IsThreadpoolTimerSet(PTP_TIMER pti);
|
||||
WINPR_API VOID SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, DWORD msWindowLength);
|
||||
WINPR_API VOID WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks);
|
||||
WINPR_API PTP_TIMER winpr_CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID winpr_CloseThreadpoolTimer(PTP_TIMER pti);
|
||||
WINPR_API BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti);
|
||||
WINPR_API VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, DWORD msWindowLength);
|
||||
WINPR_API VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks);
|
||||
|
||||
#define CreateThreadpoolTimer winpr_CreateThreadpoolTimer
|
||||
#define CloseThreadpoolTimer winpr_CloseThreadpoolTimer
|
||||
#define IsThreadpoolTimerSet winpr_IsThreadpoolTimerSet
|
||||
#define SetThreadpoolTimer winpr_SetThreadpoolTimer
|
||||
#define WaitForThreadpoolTimerCallbacks winpr_WaitForThreadpoolTimerCallbacks
|
||||
|
||||
/* I/O */
|
||||
|
||||
WINPR_API PTP_IO CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID CloseThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID StartThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID CancelThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks);
|
||||
WINPR_API PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe);
|
||||
WINPR_API VOID winpr_CloseThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID winpr_StartThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID winpr_CancelThreadpoolIo(PTP_IO pio);
|
||||
WINPR_API VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks);
|
||||
|
||||
#define CreateThreadpoolIo winpr_CreateThreadpoolIo
|
||||
#define CloseThreadpoolIo winpr_CloseThreadpoolIo
|
||||
#define StartThreadpoolIo winpr_StartThreadpoolIo
|
||||
#define CancelThreadpoolIo winpr_CancelThreadpoolIo
|
||||
#define WaitForThreadpoolIoCallbacks winpr_WaitForThreadpoolIoCallbacks
|
||||
|
||||
/* Clean-up Group */
|
||||
|
||||
WINPR_API PTP_CLEANUP_GROUP CreateThreadpoolCleanupGroup(void);
|
||||
WINPR_API VOID CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPendingCallbacks, PVOID pvCleanupContext);
|
||||
WINPR_API VOID CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg);
|
||||
WINPR_API PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup(void);
|
||||
WINPR_API VOID winpr_CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPendingCallbacks, PVOID pvCleanupContext);
|
||||
WINPR_API VOID winpr_CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg);
|
||||
|
||||
#define CreateThreadpoolCleanupGroup winpr_CreateThreadpoolCleanupGroup
|
||||
#define CloseThreadpoolCleanupGroupMembers winpr_CloseThreadpoolCleanupGroupMembers
|
||||
#define CloseThreadpoolCleanupGroup winpr_CloseThreadpoolCleanupGroup
|
||||
|
||||
/* Pool */
|
||||
|
||||
WINPR_API PTP_POOL CreateThreadpool(PVOID reserved);
|
||||
WINPR_API VOID CloseThreadpool(PTP_POOL ptpp);
|
||||
WINPR_API BOOL SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic);
|
||||
WINPR_API VOID SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost);
|
||||
WINPR_API PTP_POOL winpr_CreateThreadpool(PVOID reserved);
|
||||
WINPR_API VOID winpr_CloseThreadpool(PTP_POOL ptpp);
|
||||
WINPR_API BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic);
|
||||
WINPR_API VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost);
|
||||
|
||||
#define CreateThreadpool winpr_CreateThreadpool
|
||||
#define CloseThreadpool winpr_CloseThreadpool
|
||||
#define SetThreadpoolThreadMinimum winpr_SetThreadpoolThreadMinimum
|
||||
#define SetThreadpoolThreadMaximum winpr_SetThreadpoolThreadMaximum
|
||||
|
||||
/* Callback Environment */
|
||||
|
||||
@ -207,23 +239,26 @@ static INLINE VOID SetThreadpoolCallbackLibrary(PTP_CALLBACK_ENVIRON pcbe, PVOID
|
||||
|
||||
/* Callback */
|
||||
|
||||
WINPR_API BOOL CallbackMayRunLong(PTP_CALLBACK_INSTANCE pci);
|
||||
WINPR_API BOOL winpr_CallbackMayRunLong(PTP_CALLBACK_INSTANCE pci);
|
||||
|
||||
/* Callback Clean-up */
|
||||
|
||||
WINPR_API VOID SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE evt);
|
||||
WINPR_API VOID ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE sem, DWORD crel);
|
||||
WINPR_API VOID ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE mut);
|
||||
WINPR_API VOID LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, PCRITICAL_SECTION pcs);
|
||||
WINPR_API VOID FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HMODULE mod);
|
||||
WINPR_API VOID DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE pci);
|
||||
WINPR_API VOID winpr_SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE evt);
|
||||
WINPR_API VOID winpr_ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE sem, DWORD crel);
|
||||
WINPR_API VOID winpr_ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HANDLE mut);
|
||||
WINPR_API VOID winpr_LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, PCRITICAL_SECTION pcs);
|
||||
WINPR_API VOID winpr_FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE pci, HMODULE mod);
|
||||
WINPR_API VOID winpr_DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE pci);
|
||||
|
||||
#define SetEventWhenCallbackReturns winpr_SetEventWhenCallbackReturns
|
||||
#define ReleaseSemaphoreWhenCallbackReturns winpr_ReleaseSemaphoreWhenCallbackReturns
|
||||
#define ReleaseMutexWhenCallbackReturns winpr_ReleaseMutexWhenCallbackReturns
|
||||
#define LeaveCriticalSectionWhenCallbackReturns winpr_LeaveCriticalSectionWhenCallbackReturns
|
||||
#define FreeLibraryWhenCallbackReturns winpr_FreeLibraryWhenCallbackReturns
|
||||
#define DisassociateCurrentThreadFromCallback winpr_DisassociateCurrentThreadFromCallback
|
||||
|
||||
#endif
|
||||
|
||||
/* Dummy */
|
||||
|
||||
WINPR_API void winpr_pool_dummy(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -277,7 +277,7 @@ WINPR_API BOOL DeleteTimerQueueTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE Com
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) && (_WIN32_WINNT < 0x0600))
|
||||
#define InitializeCriticalSectionEx(A,B,C) InitializeCriticalSectionAndSpinCount(A,B)
|
||||
#define InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags) InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount)
|
||||
#endif
|
||||
|
||||
#ifndef _RTL_RUN_ONCE_DEF
|
||||
@ -312,11 +312,15 @@ typedef PRTL_RUN_ONCE PINIT_ONCE;
|
||||
typedef PRTL_RUN_ONCE LPINIT_ONCE;
|
||||
typedef BOOL (CALLBACK * PINIT_ONCE_FN)(PINIT_ONCE InitOnce, PVOID Parameter, PVOID* Context);
|
||||
|
||||
WINPR_API BOOL InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID* lpContext);
|
||||
WINPR_API BOOL InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext);
|
||||
WINPR_API BOOL InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID* Context);
|
||||
WINPR_API VOID InitOnceInitialize(PINIT_ONCE InitOnce);
|
||||
WINPR_API BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID* lpContext);
|
||||
WINPR_API BOOL winpr_InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext);
|
||||
WINPR_API BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID* Context);
|
||||
WINPR_API VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce);
|
||||
|
||||
#define InitOnceBeginInitialize winpr_InitOnceBeginInitialize
|
||||
#define InitOnceComplete winpr_InitOnceComplete
|
||||
#define InitOnceExecuteOnce winpr_InitOnceExecuteOnce
|
||||
#define InitOnceInitialize winpr_InitOnceInitialize
|
||||
#endif
|
||||
|
||||
/* Synchronization Barrier */
|
||||
@ -344,9 +348,13 @@ typedef PRTL_BARRIER LPSYNCHRONIZATION_BARRIER;
|
||||
#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY 0x02
|
||||
#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE 0x04
|
||||
|
||||
WINPR_API BOOL WINAPI InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount);
|
||||
WINPR_API BOOL WINAPI EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags);
|
||||
WINPR_API BOOL WINAPI DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier);
|
||||
WINPR_API BOOL WINAPI winpr_InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount);
|
||||
WINPR_API BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags);
|
||||
WINPR_API BOOL WINAPI winpr_DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier);
|
||||
|
||||
#define InitializeSynchronizationBarrier winpr_InitializeSynchronizationBarrier
|
||||
#define EnterSynchronizationBarrier winpr_EnterSynchronizationBarrier
|
||||
#define DeleteSynchronizationBarrier winpr_DeleteSynchronizationBarrier
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -301,7 +301,8 @@ WINPR_API BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer
|
||||
|
||||
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600))
|
||||
|
||||
WINPR_API ULONGLONG GetTickCount64(void);
|
||||
WINPR_API ULONGLONG winpr_GetTickCount64(void);
|
||||
#define GetTickCount64 winpr_GetTickCount64
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -64,8 +64,12 @@
|
||||
|
||||
#if (_WIN32_WINNT < 0x0600)
|
||||
|
||||
WINPR_API PCSTR inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize);
|
||||
WINPR_API INT inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf);
|
||||
WINPR_API PCSTR winpr_inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize);
|
||||
WINPR_API INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf);
|
||||
|
||||
#define inet_ntop winpr_inet_ntop
|
||||
#define inet_pton winpr_inet_pton
|
||||
|
||||
|
||||
#endif /* (_WIN32_WINNT < 0x0600) */
|
||||
|
||||
|
@ -48,7 +48,7 @@ static BOOL CALLBACK init_module(PINIT_ONCE once, PVOID param, PVOID *context)
|
||||
}
|
||||
#endif
|
||||
|
||||
PTP_CLEANUP_GROUP CreateThreadpoolCleanupGroup()
|
||||
PTP_CLEANUP_GROUP winpr_CreateThreadpoolCleanupGroup()
|
||||
{
|
||||
PTP_CLEANUP_GROUP cleanupGroup = NULL;
|
||||
#ifdef _WIN32
|
||||
@ -60,7 +60,7 @@ PTP_CLEANUP_GROUP CreateThreadpoolCleanupGroup()
|
||||
return cleanupGroup;
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPendingCallbacks, PVOID pvCleanupContext)
|
||||
VOID winpr_CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPendingCallbacks, PVOID pvCleanupContext)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
@ -73,7 +73,7 @@ VOID CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP ptpcg, BOOL fCancelPen
|
||||
/* No default implementation */
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg)
|
||||
VOID winpr_CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP ptpcg)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
|
@ -26,29 +26,29 @@
|
||||
|
||||
#ifdef WINPR_THREAD_POOL
|
||||
|
||||
PTP_IO CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
PTP_IO winpr_CreateThreadpoolIo(HANDLE fl, PTP_WIN32_IO_CALLBACK pfnio, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolIo(PTP_IO pio)
|
||||
VOID winpr_CloseThreadpoolIo(PTP_IO pio)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID StartThreadpoolIo(PTP_IO pio)
|
||||
VOID winpr_StartThreadpoolIo(PTP_IO pio)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID CancelThreadpoolIo(PTP_IO pio)
|
||||
VOID winpr_CancelThreadpoolIo(PTP_IO pio)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks)
|
||||
VOID winpr_WaitForThreadpoolIoCallbacks(PTP_IO pio, BOOL fCancelPendingCallbacks)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -174,7 +174,7 @@ PTP_POOL GetDefaultThreadpool()
|
||||
return pool;
|
||||
}
|
||||
|
||||
PTP_POOL CreateThreadpool(PVOID reserved)
|
||||
PTP_POOL winpr_CreateThreadpool(PVOID reserved)
|
||||
{
|
||||
PTP_POOL pool = NULL;
|
||||
#ifdef _WIN32
|
||||
@ -194,7 +194,7 @@ PTP_POOL CreateThreadpool(PVOID reserved)
|
||||
return pool;
|
||||
}
|
||||
|
||||
VOID CloseThreadpool(PTP_POOL ptpp)
|
||||
VOID winpr_CloseThreadpool(PTP_POOL ptpp)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
@ -224,7 +224,7 @@ VOID CloseThreadpool(PTP_POOL ptpp)
|
||||
}
|
||||
}
|
||||
|
||||
BOOL SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic)
|
||||
BOOL winpr_SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic)
|
||||
{
|
||||
HANDLE thread;
|
||||
#ifdef _WIN32
|
||||
@ -250,7 +250,7 @@ BOOL SetThreadpoolThreadMinimum(PTP_POOL ptpp, DWORD cthrdMic)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost)
|
||||
VOID winpr_SetThreadpoolThreadMaximum(PTP_POOL ptpp, DWORD cthrdMost)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
|
@ -26,22 +26,22 @@
|
||||
|
||||
#ifdef WINPR_THREAD_POOL
|
||||
|
||||
PTP_WAIT CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
PTP_WAIT winpr_CreateThreadpoolWait(PTP_WAIT_CALLBACK pfnwa, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolWait(PTP_WAIT pwa)
|
||||
VOID winpr_CloseThreadpoolWait(PTP_WAIT pwa)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout)
|
||||
VOID winpr_SetThreadpoolWait(PTP_WAIT pwa, HANDLE h, PFILETIME pftTimeout)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks)
|
||||
VOID winpr_WaitForThreadpoolWaitCallbacks(PTP_WAIT pwa, BOOL fCancelPendingCallbacks)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -26,27 +26,27 @@
|
||||
|
||||
#ifdef WINPR_THREAD_POOL
|
||||
|
||||
PTP_TIMER CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
PTP_TIMER winpr_CreateThreadpoolTimer(PTP_TIMER_CALLBACK pfnti, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolTimer(PTP_TIMER pti)
|
||||
VOID winpr_CloseThreadpoolTimer(PTP_TIMER pti)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL IsThreadpoolTimerSet(PTP_TIMER pti)
|
||||
BOOL winpr_IsThreadpoolTimerSet(PTP_TIMER pti)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, DWORD msWindowLength)
|
||||
VOID winpr_SetThreadpoolTimer(PTP_TIMER pti, PFILETIME pftDueTime, DWORD msPeriod, DWORD msWindowLength)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VOID WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks)
|
||||
VOID winpr_WaitForThreadpoolTimerCallbacks(PTP_TIMER pti, BOOL fCancelPendingCallbacks)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ static TP_CALLBACK_ENVIRON DEFAULT_CALLBACK_ENVIRONMENT =
|
||||
{ 0 } /* Flags */
|
||||
};
|
||||
|
||||
PTP_WORK CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
PTP_WORK winpr_CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
{
|
||||
PTP_WORK work = NULL;
|
||||
#ifdef _WIN32
|
||||
@ -91,7 +91,7 @@ PTP_WORK CreateThreadpoolWork(PTP_WORK_CALLBACK pfnwk, PVOID pv, PTP_CALLBACK_EN
|
||||
return work;
|
||||
}
|
||||
|
||||
VOID CloseThreadpoolWork(PTP_WORK pwk)
|
||||
VOID winpr_CloseThreadpoolWork(PTP_WORK pwk)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
@ -104,7 +104,7 @@ VOID CloseThreadpoolWork(PTP_WORK pwk)
|
||||
free(pwk);
|
||||
}
|
||||
|
||||
VOID SubmitThreadpoolWork(PTP_WORK pwk)
|
||||
VOID winpr_SubmitThreadpoolWork(PTP_WORK pwk)
|
||||
{
|
||||
PTP_POOL pool;
|
||||
PTP_CALLBACK_INSTANCE callbackInstance;
|
||||
@ -127,7 +127,7 @@ VOID SubmitThreadpoolWork(PTP_WORK pwk)
|
||||
}
|
||||
}
|
||||
|
||||
BOOL TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
BOOL winpr_TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, PTP_CALLBACK_ENVIRON pcbe)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
InitOnceExecuteOnce(&init_once_module, init_module, NULL, NULL);
|
||||
@ -138,7 +138,7 @@ BOOL TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK pfns, PVOID pv, PTP_CALLBAC
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks)
|
||||
VOID winpr_WaitForThreadpoolWorkCallbacks(PTP_WORK pwk, BOOL fCancelPendingCallbacks)
|
||||
{
|
||||
HANDLE event;
|
||||
PTP_POOL pool;
|
||||
|
@ -87,7 +87,7 @@ static BOOL CALLBACK InitOnce_Barrier(PINIT_ONCE once, PVOID param, PVOID *conte
|
||||
|
||||
#endif
|
||||
|
||||
BOOL WINAPI InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount)
|
||||
BOOL WINAPI winpr_InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, LONG lTotalThreads, LONG lSpinCount)
|
||||
{
|
||||
SYSTEM_INFO sysinfo;
|
||||
HANDLE hEvent0;
|
||||
@ -132,7 +132,7 @@ BOOL WINAPI InitializeSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags)
|
||||
BOOL WINAPI winpr_EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, DWORD dwFlags)
|
||||
{
|
||||
LONG remainingThreads;
|
||||
HANDLE hCurrentEvent;
|
||||
@ -226,7 +226,7 @@ BOOL WINAPI EnterSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier, DWO
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier)
|
||||
BOOL WINAPI winpr_DeleteSynchronizationBarrier(LPSYNCHRONIZATION_BARRIER lpBarrier)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (g_NativeBarrier)
|
||||
|
@ -31,24 +31,24 @@
|
||||
|
||||
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600))
|
||||
|
||||
BOOL InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID* lpContext)
|
||||
BOOL winpr_InitOnceBeginInitialize(LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending, LPVOID* lpContext)
|
||||
{
|
||||
WLog_ERR(TAG, "not implemented");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext)
|
||||
BOOL winpr_InitOnceComplete(LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext)
|
||||
{
|
||||
WLog_ERR(TAG, "not implemented");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID InitOnceInitialize(PINIT_ONCE InitOnce)
|
||||
VOID winpr_InitOnceInitialize(PINIT_ONCE InitOnce)
|
||||
{
|
||||
WLog_ERR(TAG, "not implemented");
|
||||
}
|
||||
|
||||
BOOL InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID* Context)
|
||||
BOOL winpr_InitOnceExecuteOnce(PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter, LPVOID* Context)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
|
@ -436,7 +436,7 @@ DWORD GetTickCount(void)
|
||||
|
||||
#if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600))
|
||||
|
||||
ULONGLONG GetTickCount64(void)
|
||||
ULONGLONG winpr_GetTickCount64(void)
|
||||
{
|
||||
ULONGLONG ticks = 0;
|
||||
#if defined(__linux__)
|
||||
|
@ -234,7 +234,7 @@
|
||||
|
||||
#if (_WIN32_WINNT < 0x0600)
|
||||
|
||||
PCSTR inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize)
|
||||
PCSTR winpr_inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize)
|
||||
{
|
||||
if (Family == AF_INET)
|
||||
{
|
||||
@ -262,7 +262,7 @@ PCSTR inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INT inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf)
|
||||
INT winpr_inet_pton(INT Family, PCSTR pszAddrString, PVOID pAddrBuf)
|
||||
{
|
||||
SOCKADDR_STORAGE addr;
|
||||
int addr_len = sizeof(addr);
|
||||
|
Loading…
Reference in New Issue
Block a user