Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(vpn): fail early if wintun.dll is not present (cherry-pick #16707) #16738

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

gcp-cherry-pick-bot[bot]
Copy link

Cherry-picked fix(vpn): fail early if wintun.dll is not present (#16707)

Prevents the VPN startup from hanging for 5 minutes due to a startup
backoff if wintun.dll cannot be loaded.

Because the wintun package doesn't expose an easy Load() error
method for us, the only way for us to force it to load (without unwanted
side effects) is through wintun.Version() which doesn't return an
error message.

So, we call that function so the wintun package loads the DLL and
configures the logging properly, then we try to load the DLL ourselves.
LoadLibraryEx will not load the library multiple times and returns a
reference to the existing library.

Closes coder/coder-desktop-windows#24

Prevents the VPN startup from hanging for 5 minutes due to a startup
backoff if `wintun.dll` cannot be loaded.

Because the `wintun` package doesn't expose an easy `Load() error`
method for us, the only way for us to force it to load (without unwanted
side effects) is through `wintun.Version()` which doesn't return an
error message.

So, we call that function so the `wintun` package loads the DLL and
configures the logging properly, then we try to load the DLL ourselves.
`LoadLibraryEx` will not load the library multiple times and returns a
reference to the existing library.

Closes coder/coder-desktop-windows#24
@matifali matifali merged commit 780b271 into release/2.20 Feb 28, 2025
32 checks passed
@matifali matifali deleted the cherry-pick-53a920-release/2.20 branch February 28, 2025 07:48
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants