22 #include <winpr/config.h>
24 #include <winpr/synch.h>
25 #include <winpr/interlocked.h>
28 #define TAG WINPR_TAG("sync")
30 #if (!defined(_WIN32)) || (defined(_WIN32) && (_WIN32_WINNT < 0x0600))
32 BOOL winpr_InitOnceBeginInitialize(
LPINIT_ONCE lpInitOnce, DWORD dwFlags, PBOOL fPending,
35 WLog_ERR(TAG,
"not implemented");
39 BOOL winpr_InitOnceComplete(
LPINIT_ONCE lpInitOnce, DWORD dwFlags, LPVOID lpContext)
41 WLog_ERR(TAG,
"not implemented");
45 VOID winpr_InitOnceInitialize(
PINIT_ONCE InitOnce)
47 WLog_ERR(TAG,
"not implemented");
50 BOOL winpr_InitOnceExecuteOnce(
PINIT_ONCE InitOnce, PINIT_ONCE_FN InitFn, PVOID Parameter,
55 switch ((ULONG_PTR)InitOnce->Ptr & 3)
64 if (InterlockedCompareExchangePointer(&InitOnce->Ptr, (PVOID)1, (PVOID)0) !=
72 if (InitFn(InitOnce, Parameter, Context))
75 InitOnce->Ptr = (PVOID)2;
80 InitOnce->Ptr = (PVOID)0;
88 WLog_ERR(TAG,
"internal error");