SetDefaultDllDirectories
SetDefaultDllDirectories is a Windows API function that configures the default DLL search order for the calling process. It is implemented in Kernel32.dll and is used to influence how LoadLibrary and related functions resolve DLLs when a full path is not specified. The function does not load any libraries by itself; instead, it establishes the default locations that will be considered during subsequent DLL loading operations.
The function takes a single parameter, DirectoryFlags, which is a bitmask of flags that specify which locations
In practice, SetDefaultDllDirectories is often used at process startup to adopt a safer, more predictable DLL
Return value is a BOOL: nonzero indicates success, zero indicates failure. On failure, use GetLastError to retrieve