4.35.1 Windows-specific Operating System Interaction
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Operating System Interaction
          • Windows-specific Operating System Interaction
            • win_exec/2
            • win_shell/3
            • win_shell/2
            • win_registry_get_value/3
            • win_folder/2
            • win_add_dll_directory/1
            • win_add_dll_directory/2
            • win_remove_dll_directory/1
            • win_process_modules/1
            • win_get_user_preferred_ui_languages/2
    • Packages
win_add_dll_directory(+AbsDir, -Cookie)
This predicate adds a directory to the search path for dependent DLL files. If the call is successful it unifies Cookie with a handle that must be passed to win_remove_dll_directory/1 to remove the directory from the search path. Error conditions:

  • This predicate fails if Windows does not yet support the underlying primitives. These are available in recently patched Windows 7 systems and later.
  • This predicate throws an exception if the provided path is invalid or the underlying Windows API returns an error.

If open_shared_object/2 is passed an absolute path to a DLL on a Windows installation that supports AddDllDirectory() and friends,147Windows 7 with up-to-date patches or Windows 8. SWI-Prolog uses LoadLibraryEx() with the flags LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR and LOAD_LIBRARY_SEARCH_DEFAULT_DIRS. In this scenario, directories from %PATH% are not searched. Additional directories can be added using win_add_dll_directory/2.