mirror of https://github.com/django/django.git
Fixed #34294 -- Protected django.core.files.locks against argtypes redefinition on Windows.
This commit is contained in:
parent
2b1242abb3
commit
7eb5391b71
|
@ -32,12 +32,12 @@ if os.name == "nt":
|
||||||
POINTER,
|
POINTER,
|
||||||
Structure,
|
Structure,
|
||||||
Union,
|
Union,
|
||||||
|
WinDLL,
|
||||||
byref,
|
byref,
|
||||||
c_int64,
|
c_int64,
|
||||||
c_ulong,
|
c_ulong,
|
||||||
c_void_p,
|
c_void_p,
|
||||||
sizeof,
|
sizeof,
|
||||||
windll,
|
|
||||||
)
|
)
|
||||||
from ctypes.wintypes import BOOL, DWORD, HANDLE
|
from ctypes.wintypes import BOOL, DWORD, HANDLE
|
||||||
|
|
||||||
|
@ -73,10 +73,11 @@ if os.name == "nt":
|
||||||
LPOVERLAPPED = POINTER(OVERLAPPED)
|
LPOVERLAPPED = POINTER(OVERLAPPED)
|
||||||
|
|
||||||
# --- Define function prototypes for extra safety ---
|
# --- Define function prototypes for extra safety ---
|
||||||
LockFileEx = windll.kernel32.LockFileEx
|
kernel32 = WinDLL("kernel32")
|
||||||
|
LockFileEx = kernel32.LockFileEx
|
||||||
LockFileEx.restype = BOOL
|
LockFileEx.restype = BOOL
|
||||||
LockFileEx.argtypes = [HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED]
|
LockFileEx.argtypes = [HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED]
|
||||||
UnlockFileEx = windll.kernel32.UnlockFileEx
|
UnlockFileEx = kernel32.UnlockFileEx
|
||||||
UnlockFileEx.restype = BOOL
|
UnlockFileEx.restype = BOOL
|
||||||
UnlockFileEx.argtypes = [HANDLE, DWORD, DWORD, DWORD, LPOVERLAPPED]
|
UnlockFileEx.argtypes = [HANDLE, DWORD, DWORD, DWORD, LPOVERLAPPED]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue