30 NTSTATUS status = STATUS_SUCCESS;
32 BCRYPT_ALG_HANDLE hAlg = 0;
36 BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM, NULL, 0))) {
40 status = BCryptGenRandom(hAlg,
buf, (ULONG) cb_buf, 0);
41 BCryptCloseAlgorithmProvider(hAlg, 0);
43 return BCRYPT_SUCCESS(status);
46 return (1 == RAND_bytes(
buf, cb_buf));