mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
add jaraco to test sym links on Windows. Fixes #894
This commit is contained in:
parent
fd5ee775e0
commit
52cc753881
50 changed files with 3862 additions and 7 deletions
41
libs/jaraco/windows/api/event.py
Normal file
41
libs/jaraco/windows/api/event.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
from ctypes import (
|
||||
Structure, windll, POINTER, byref, cast, create_unicode_buffer,
|
||||
c_size_t, c_int, create_string_buffer, c_uint64, c_ushort, c_short,
|
||||
c_uint,
|
||||
)
|
||||
from ctypes.wintypes import (
|
||||
BOOLEAN, LPWSTR, DWORD, LPVOID, HANDLE, FILETIME,
|
||||
WCHAR, BOOL, HWND, WORD, UINT,
|
||||
)
|
||||
|
||||
CreateEvent = windll.kernel32.CreateEventW
|
||||
CreateEvent.argtypes = (
|
||||
LPVOID, # LPSECURITY_ATTRIBUTES
|
||||
BOOL,
|
||||
BOOL,
|
||||
LPWSTR,
|
||||
)
|
||||
CreateEvent.restype = HANDLE
|
||||
|
||||
SetEvent = windll.kernel32.SetEvent
|
||||
SetEvent.argtypes = HANDLE,
|
||||
SetEvent.restype = BOOL
|
||||
|
||||
WaitForSingleObject = windll.kernel32.WaitForSingleObject
|
||||
WaitForSingleObject.argtypes = HANDLE, DWORD
|
||||
WaitForSingleObject.restype = DWORD
|
||||
|
||||
_WaitForMultipleObjects = windll.kernel32.WaitForMultipleObjects
|
||||
_WaitForMultipleObjects.argtypes = DWORD, POINTER(HANDLE), BOOL, DWORD
|
||||
_WaitForMultipleObjects.restype = DWORD
|
||||
|
||||
def WaitForMultipleObjects(handles, wait_all=False, timeout=0):
|
||||
n_handles = len(handles)
|
||||
handle_array = (HANDLE*n_handles)()
|
||||
for index, handle in enumerate(handles):
|
||||
handle_array[index] = handle
|
||||
return _WaitForMultipleObjects(n_handles, handle_array, wait_all, timeout)
|
||||
|
||||
WAIT_OBJECT_0 = 0
|
||||
INFINITE = -1
|
||||
WAIT_TIMEOUT = 0x102
|
Loading…
Add table
Add a link
Reference in a new issue