| author | |
| committer | |
| log | 729f2aceb045e54b2b74a33fa5f64cb9802988c6 |
| tree | 6f5e3a6c93f6e0859819f0866e7c37a7ea9a4637 |
| parent | cbca434cf01f78f451dad3714bbdac4f1e0b777d |
2 files changed, 2 insertions(+), 2 deletions(-)
std/os/index.zig+1-1| ... | ... | @@ -133,7 +133,7 @@ pub fn getRandomBytes(buf: []u8) !void { |
| 133 | 133 | // Call RtlGenRandom() instead of CryptGetRandom() on Windows |
| 134 | 134 | // https://github.com/rust-lang-nursery/rand/issues/111 |
| 135 | 135 | // https://bugzilla.mozilla.org/show_bug.cgi?id=504270 |
| 136 | if (!windows.RtlGenRandom(buf.ptr, buf.len)) { | |
| 136 | if (windows.RtlGenRandom(buf.ptr, buf.len) == 0) { | |
| 137 | 137 | const err = windows.GetLastError(); |
| 138 | 138 | return switch (err) { |
| 139 | 139 | else => unexpectedErrorWindows(err), |
std/os/windows/advapi32.zig+1-1| ... | ... | @@ -31,5 +31,5 @@ pub extern "advapi32" stdcallcc fn RegQueryValueExW(hKey: HKEY, lpValueName: LPC |
| 31 | 31 | |
| 32 | 32 | // RtlGenRandom is known as SystemFunction036 under advapi32 |
| 33 | 33 | // http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx */ |
| 34 | pub extern "advapi32" stdcallcc fn SystemFunction036(output: PVOID, length: ULONG_PTR) BOOL; | |
| 34 | pub extern "advapi32" stdcallcc fn SystemFunction036(output: [*]u8, length: usize) BOOL; | |
| 35 | 35 | pub const RtlGenRandom = SystemFunction036; |