We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b2e4f9d commit 832c7afCopy full SHA for 832c7af
library/std/src/sys/windows/rand.rs
@@ -38,6 +38,18 @@ pub fn hashmap_random_keys() -> (u64, u64) {
38
39
struct Rng(c::BCRYPT_ALG_HANDLE);
40
impl Rng {
41
+ #[cfg(miri)]
42
+ fn open() -> Result<Self, c::NTSTATUS> {
43
+ const BCRYPT_RNG_ALG_HANDLE: c::BCRYPT_ALG_HANDLE = ptr::invalid_mut(0x81);
44
+ let _ = (
45
+ c::BCryptOpenAlgorithmProvider,
46
+ c::BCryptCloseAlgorithmProvider,
47
+ c::BCRYPT_RNG_ALGORITHM,
48
+ c::STATUS_NOT_SUPPORTED,
49
+ );
50
+ Ok(Self(BCRYPT_RNG_ALG_HANDLE))
51
+ }
52
+ #[cfg(not(miri))]
53
// Open a handle to the RNG algorithm.
54
fn open() -> Result<Self, c::NTSTATUS> {
55
use crate::sync::atomic::AtomicPtr;
0 commit comments