Skip to content

Conversation

@ejstrunz
Copy link

@ejstrunz ejstrunz commented Dec 4, 2025

Currently ProtonVPN.Service sets the DLL import search path to LOAD_LIBRARY_SEARCH_DEFAULT_DIRS using a P/Invoke call to kernel32.dll. I believe the intention is to prevent DLLs being loaded from PATH?

In that case, it is possible to do this with an Assembly attribute instead:

[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]

This should be identical in behaviour, since SafeDirectories and LOAD_LIBRARY_SEARCH_DEFAULT_DIRS both have the value 0x1000.

The ProtonVPN.Native module becomes redundant this way, since it only contained the P/Invoke binding. Therefore I have removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant