Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding native library folders to the process DLL search path #1549

Closed
glopesdev opened this issue Sep 6, 2023 · 0 comments · Fixed by #1555
Closed

Consider adding native library folders to the process DLL search path #1549

glopesdev opened this issue Sep 6, 2023 · 0 comments · Fixed by #1555
Labels
bug Something isn't working critical This is a blocking issue affecting all users
Milestone

Comments

@glopesdev
Copy link
Member

glopesdev commented Sep 6, 2023

Starting from Windows 8 and Windows 7 SP1 KB2533623, Microsoft introduced new API enhancements for securely loading external native libraries.

These API calls define a process wide DLL search path which can be modified only by direct calls to these OS-specific functions. Some modern libraries specify the DefaultDllImportSearchPath attribute set to DllImportSearchPath.SafeDirectories which means that only this process wide DLL search path is used for loading native libraries, and the directories under the default PATH environment variable are ignored.

To workaround this, the bootstrapper should call the AddDllDirectory method for each active native library folder when bootstrapping the environment.

Unfortunately, adding the same folders to the PATH environment variable is still required, as the new process wide DLL search path is not used by some legacy libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical This is a blocking issue affecting all users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant