Library load modes.
Each of system family provides own modes. Flags not supported by a particular platform will be silently ignored.
Default open mode. See the Default: comments below to find out the flags that are enabled by default.
If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module.
Note Do not use this value; it is provided only for backward compatibility. If you are planning to access only data or resources in the DLL, use LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_IMAGE_RESOURCE or both.
If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL.
If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy.
This value cannot be combined with any LOAD_LIBRARY_SEARCH flag.
Relocations shall be performed at an implementation-defined time, ranging from the time of the dlopen() call until the first reference to a given symbol occurs.
Specifying RTLD_LAZY should improve performance on implementations supporting dynamic symbol binding as a process may not reference all of the functions in any given object. And, for systems supporting dynamic symbol resolution for normal process execution, this behavior mimics the normal handling of process execution.
All necessary relocations shall be performed when the object is first loaded. This may waste some processing if relocations are performed for functions that are never referenced. This behavior may be useful for plugins that need to know as soon as an object is loaded that all symbols referenced during execution are available.
The object's symbols shall be made available for the relocation processing of any other object. In addition, symbol lookup using dlopen(0, mode) and an associated dlsym() allows objects loaded with this mode to be searched.
The object's symbols shall not be made available for the relocation processing of any other object.
This is a default Windows behavior that can not be changed.
Platforms: POSIX (requires glibc >= 2.3.4)
The object will use its own symbols in preference to global symbols with the same name contained in libraries that have already been loaded. This flag is not specified in POSIX.1-2001.
Platforms: Windows, POSIX
Append a platform specific extension and prefix to shared library filename before trying to load it. If load attempt fails, try to load with exactly specified name.
// Opens `./my_plugins/plugin1.dll` on Windows, `./my_plugins/libplugin1.so` on Linux, `./my_plugins/libplugin1.dylib` on MacOS. // If that fails, loads `./my_plugins/plugin1` boost::dll::shared_library lib("./my_plugins/plugin1", load_mode::append_decorations);
Platforms: Windows, POSIX
Allow loading from system folders if path to library contains no parent path.