HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
seed_win32_impl.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
6
7#include "seed_intf.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
10#include <format>
11
12hi_export_module(hikogui.random.seed : impl);
13
14namespace hi::inline v1 {
15
16inline void generate_seed(void *ptr, size_t size)
17{
19 if (not SUCCEEDED(status)) {
20 throw os_error(std::format("BCryptGenRandom(): {}", get_last_error_message(status)));
21 }
22}
23
24}
Rules for working with win32 headers.
DOXYGEN BUG.
Definition algorithm.hpp:16
void generate_seed(void *ptr, size_t size)
Load a random seed.
Definition seed_win32_impl.hpp:16
std::string get_last_error_message()
Get the OS error message from the last error received on this thread.
Definition exception_win32_impl.hpp:31
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377