Skip to content

Windows 7 support on Rust 1.77 and lower #608

@ensch

Description

@ensch

Currently the Window 10 and newer code using ProcessPrng is always chosen on Rust 1.77 and lower, because target_vendor = "win7" was only introduced with Rust 1.78. As the ProcessPrng API does not exist on Windows 7, programs just refuse to start.

Code in backend.rs:

 } else if #[cfg(all(windows, target_vendor = "win7"))] {
        mod windows7;
        pub use windows7::*;
    } else if #[cfg(windows)] {
        mod windows;
        pub use windows::*;

Would it be possible to either always use the safe Windows 7 code on older Rust versions (1.77 and lower) or change the code to automatically detect if ProcessPrng is available using e.g. GetProcAddress, so the best API is chosen depending on what is available? All older Rust versions support Windows 7 by default, so it seems wrong to statically depend on a Windows 10 API with no way to disable this dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions