"""
Auto-generated Python stub file from w32.win32sync.vp
Module: w32.win32sync
"""

import c


import t
from stdint import *
from w32.win32base import *

class CRITICAL_SECTION:
    DebugInfo: VOIDPTR
    LockCount: LONG
    RecursionCount: LONG
    OwningThread: HANDLE
    LockSemaphore: HANDLE
    SpinCount: QWORD

def InitializeCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass

def EnterCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass

def LeaveCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass

def DeleteCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> VOID | t.State: pass

def TryEnterCriticalSection(lpCriticalSection: CRITICAL_SECTION | t.CPtr) -> BOOL | t.State: pass

def SetCriticalSectionSpinCount(lpCriticalSection: CRITICAL_SECTION | t.CPtr, dwSpinCount: ULONG) -> ULONG | t.State: pass

def InitializeCriticalSectionAndSpinCount(lpCriticalSection: CRITICAL_SECTION | t.CPtr, dwSpinCount: ULONG) -> BOOL | t.State: pass

def CreateMutexA(lpMutexAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInitialOwner: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass

def CreateMutexW(lpMutexAttributes: SECURITY_ATTRIBUTES | t.CPtr, bInitialOwner: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass

def OpenMutexA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass

def OpenMutexW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass

def ReleaseMutex(hMutex: HANDLE) -> BOOL | t.State: pass

def CreateEventA(lpEventAttributes: SECURITY_ATTRIBUTES | t.CPtr, bManualReset: BOOL, bInitialState: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass

def CreateEventW(lpEventAttributes: SECURITY_ATTRIBUTES | t.CPtr, bManualReset: BOOL, bInitialState: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass

def OpenEventA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass

def OpenEventW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass

def SetEvent(hEvent: HANDLE) -> BOOL | t.State: pass

def ResetEvent(hEvent: HANDLE) -> BOOL | t.State: pass

def PulseEvent(hEvent: HANDLE) -> BOOL | t.State: pass

def CreateSemaphoreA(lpSemaphoreAttributes: SECURITY_ATTRIBUTES | t.CPtr, lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCSTR) -> HANDLE | t.State: pass

def CreateSemaphoreW(lpSemaphoreAttributes: SECURITY_ATTRIBUTES | t.CPtr, lInitialCount: LONG, lMaximumCount: LONG, lpName: LPCWSTR) -> HANDLE | t.State: pass

def OpenSemaphoreA(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCSTR) -> HANDLE | t.State: pass

def OpenSemaphoreW(dwDesiredAccess: ULONG, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE | t.State: pass

def ReleaseSemaphore(hSemaphore: HANDLE, lReleaseCount: LONG, lpPreviousCount: LONG | t.CPtr) -> BOOL | t.State: pass

def WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: ULONG) -> ULONG | t.State: pass

def WaitForSingleObjectEx(hHandle: HANDLE, dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass

def WaitForMultipleObjects(nCount: ULONG, lpHandles: VOIDPTR, bWaitAll: BOOL, dwMilliseconds: ULONG) -> ULONG | t.State: pass

def WaitForMultipleObjectsEx(nCount: ULONG, lpHandles: VOIDPTR, bWaitAll: BOOL, dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass

def InitializeSRWLock(SRWLock: VOIDPTR) -> VOID | t.State: pass

def AcquireSRWLockExclusive(SRWLock: VOIDPTR) -> VOID | t.State: pass

def AcquireSRWLockShared(SRWLock: VOIDPTR) -> VOID | t.State: pass

def ReleaseSRWLockExclusive(SRWLock: VOIDPTR) -> VOID | t.State: pass

def ReleaseSRWLockShared(SRWLock: VOIDPTR) -> VOID | t.State: pass


CONDITION_VARIABLE_LOCKMODE_SHARED: t.CDefine = 0x1

def InitializeConditionVariable(ConditionVariable: VOIDPTR) -> VOID | t.State: pass

def SleepConditionVariableCS(ConditionVariable: VOIDPTR, CriticalSection: CRITICAL_SECTION | t.CPtr, dwMilliseconds: ULONG) -> BOOL | t.State: pass

def SleepConditionVariableSRW(ConditionVariable: VOIDPTR, SRWLock: VOIDPTR, dwMilliseconds: ULONG, Flags: ULONG) -> BOOL | t.State: pass

def WakeConditionVariable(ConditionVariable: VOIDPTR) -> VOID | t.State: pass

def WakeAllConditionVariable(ConditionVariable: VOIDPTR) -> VOID | t.State: pass


INIT_ONCE_STATIC_INIT: t.CDefine = 0x00000001
INIT_ONCE_CHECK_ONLY:  t.CDefine = 0x00000002
INIT_ONCE_ASYNC:       t.CDefine = 0x00000004
INIT_ONCE_INIT_FAILED: t.CDefine = 0x00000008

class INIT_ONCE:
    Ptr: t.CPtr

def InitOnceExecuteOnce(InitOnce: INIT_ONCE | t.CPtr, InitFn: VOIDPTR, Parameter: VOIDPTR, Context: VOIDPTR | t.CPtr) -> BOOL | t.State: pass
