-
Notifications
You must be signed in to change notification settings - Fork 102
Support Windows 7 #1000
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
base: main
Are you sure you want to change the base?
Support Windows 7 #1000
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1000 +/- ##
==========================================
- Coverage 95.80% 92.45% -3.35%
==========================================
Files 61 71 +10
Lines 8143 9812 +1669
Branches 0 9812 +9812
==========================================
+ Hits 7801 9072 +1271
- Misses 342 451 +109
- Partials 0 289 +289 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0blu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 👍
I've tested the changes by compiling on my Windows 11 PC and executing a simple program in my Windows 7 VM.
fn main() {
let rng = SystemRandom::new();
let mut buffer = [0u8; 32];
if rng.fill(&mut buffer).is_err() {
println!("Error filling random bytes");
} else {
println!("Everything is okay");
println!("{:02X?}", buffer);
}
}cargo +nightly build --release --target x86_64-win7-windows-msvc -Zbuild-std
Used commits:
justsmth@929b3d6
justsmth/aws-lc@c7599cd
### Issues: Addresses #1997 ### Description of changes: `ProcessPrng` (from `bcryptprimitives.dll`) is only available on Windows 8+. So the current code fails at runtime on Windows 7 because `GetProcAddress` returns `NULL` and causes an `abort()`. This change defines `AWSLC_WINDOWS_7_COMPAT` when `_WIN32_WINNT <= _WIN32_WINNT_WIN7`. Then uses the existing `BCryptGenRandom` logic when it's is defined. * Related: aws/aws-lc-rs#1000 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
|
|
||
| if target().ends_with("-win7-windows-msvc") { | ||
| // 0x0601 is the value of `_WIN32_WINNT_WIN7` | ||
| build_options.push(BuildOption::define("_WIN32_WINNT", "0x0601")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed: https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
#define _WIN32_WINNT_WIN7 0x0601 // Windows 7
Issues:
Addresses aws/aws-lc#1997
Description of changes:
When targeting Windows 7, ensure that there's a definition for
_WIN32_WINNT).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.