This change resolves #32391 and is a follow-up to #14089.
The old randomness API has been deprecated and will be removed at some point according to Microsoft.1 This PR removes all uses of that API from Bitcoin Core code, but the deprecated API is still invoked in Bitcoin Core binaries compiled after this PR because of upstream use, see this comment: #32400 (comment).
For reference on BCryptGenRandom
, see: https://learn.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom.
STATUS_SUCCESS
gets defined here since including ntstatus.h
is more trouble than it’s worth.