Pelokalan
Python ID
id en
Masuk
Proyek
whatsnew__3-8.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
ctypes
ctypes
On Windows, :class:`~ctypes.CDLL` and subclasses now accept a *winmode* parameter to specify flags for the underlying ``LoadLibraryEx`` call. The default flags are set to only load DLL dependencies from trusted locations, including the path where the DLL is stored (if a full or partial path is used to load the initial DLL) and paths added by :func:`~os.add_dll_directory`. (Contributed by Steve Dower in :issue:`36085`.)
Added new function :func:`~os.add_dll_directory` on Windows for providing additional search paths for native dependencies when importing extension modules or loading DLLs using :mod:`ctypes`. (Contributed by Steve Dower in :issue:`36085`.)
DLL dependencies for extension modules and DLLs loaded with :mod:`ctypes` on Windows are now resolved more securely. Only the system paths, the directory containing the DLL or PYD file, and directories added with :func:`~os.add_dll_directory` are searched for load-time dependencies. Specifically, :envvar:`PATH` and the current working directory are no longer used, and modifications to these will no longer have any effect on normal DLL resolution. If your application relies on these mechanisms, you should check for :func:`~os.add_dll_directory` and if it exists, use it to add your DLLs directory while loading your library. Note that Windows 7 users will need to ensure that Windows Update KB2533623 has been installed (this is also verified by the installer). (Contributed by Steve Dower in :issue:`36085`.)