[utils] Use local kernel32 for file locking on Windows

Ref: https://github.com/ytdl-org/youtube-dl/issues/21545

Authored by: Grub4K
pull/6107/head
Simon Sawicki 2 years ago
parent 59d7de0da5
commit 37e325b92f

@ -2106,7 +2106,7 @@ if sys.platform == 'win32':
('hEvent', ctypes.wintypes.HANDLE), ('hEvent', ctypes.wintypes.HANDLE),
] ]
kernel32 = ctypes.windll.kernel32 kernel32 = ctypes.WinDLL('kernel32')
LockFileEx = kernel32.LockFileEx LockFileEx = kernel32.LockFileEx
LockFileEx.argtypes = [ LockFileEx.argtypes = [
ctypes.wintypes.HANDLE, # hFile ctypes.wintypes.HANDLE, # hFile

Loading…
Cancel
Save