In Unix/Process.inc, we seed a random number generator from
/dev/urandom if possible, but if not, we're happy to fall back to
ordinary pseudorandom strategies, like the current time and PID.
The corresponding function on Windows calls CryptGenRandom, but it
doesn't have a fallback if that strategy fails. But CryptGenRandom
can fail, if a cryptography provider isn't properly initialized, or
occasionally (by our observation) simply intermittently.
If it's reasonable on Unix to implement traditional pseudorandom-number
seeding as a fallback, then it's surely reasonable to do the same on
Windows. So this patch adds a last-ditch use of ordinary rand(), using
much the same strategy as the Unix fallback code.
Why do you need the static_cast<void>?