diff --git a/CHANGELOG.md b/CHANGELOG.md index 209d2e98..19aea09c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.17] - unreleased +### Fixed +- `BCryptGenRandom` signature [#778] + +[#778]: https://github.com/rust-random/getrandom/pull/778 + ## [0.2.16] - 2025-04-22 ### Added - Cygwin support (backport of [#626]) [#654] @@ -461,6 +467,7 @@ Publish initial implementation. ## [0.0.0] - 2019-01-19 Publish an empty template library. +[0.2.17]: https://github.com/rust-random/getrandom/compare/v0.2.16...v0.2.17 [0.2.16]: https://github.com/rust-random/getrandom/compare/v0.2.15...v0.2.16 [0.2.15]: https://github.com/rust-random/getrandom/compare/v0.2.14...v0.2.15 [0.2.14]: https://github.com/rust-random/getrandom/compare/v0.2.13...v0.2.14 diff --git a/src/windows.rs b/src/windows.rs index 2d1c4835..fa4ba03c 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -11,7 +11,7 @@ extern "system" { pBuffer: *mut u8, cbBuffer: u32, dwFlags: u32, - ) -> u32; + ) -> i32; } // Forbidden when targetting UWP @@ -34,6 +34,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> Result<(), Error> { BCRYPT_USE_SYSTEM_PREFERRED_RNG, ) }; + let ret = ret as u32; // NTSTATUS codes use the two highest bits for severity status. if ret >> 30 == 0b11 { // Failed. Try RtlGenRandom as a fallback.