I'm using vs2015 and wdk10, I can use random in an empty project .
#include <random>
std::default_random_engine eng;//works fine .
But when I create an empty kernel mode driver project ,I can't use random in it.
#include <random>
std::default_random_engine eng;//namespace "std" has no member "default_random_engine"
Other standard libraries ,like vector and tuple wouldn't work either , all reminding me that namespace "std" has no member XXX (vector ,tuple ,etc .)
How can I solve this ?
The implementation of the std library requires working exception processing for the code to work correctly. That has stopped a port of the standard library from being performed in kernel.
Other examples of code which does not work in kernel, is
As mentioned in the comments
RtlRandomEx
produces pseudo random numbers, and is available in kernel.
For cryptographic secure randomness, then this page holds some value.