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

Use Windows API for Life Before Main #7

Closed
mitsuhiko opened this issue May 18, 2023 · 0 comments · Fixed by #12
Closed

Use Windows API for Life Before Main #7

mitsuhiko opened this issue May 18, 2023 · 0 comments · Fixed by #12
Labels
enhancement New feature or request

Comments

@mitsuhiko
Copy link
Owner

mitsuhiko commented May 18, 2023

Currently this crate relies on life before main on Windows which is undefined behavior for the stdlib. It would be nice to swap this out for the native windows functions to avoid potential issues.

The following calls in self_delete_on_init would need to be replaced:

  • env::current_exe -> GetModuleFileNameW
  • std::env::args_os -> GetCommandLineW + CommandLineToArgvW
  • fs::remove_file -> DeleteFileW
  • Command::new -> CreateProcessW
@mitsuhiko mitsuhiko added the enhancement New feature or request label May 18, 2023
This was referenced May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant