Hi All,
I have the same exact problem.
Here is my code:
ntstat = BCryptOpenAlgorithmProvider(&pHandle,BCRYPT_RNG_ALGORITHM,MS_PRIMITIVE_PROVIDER,//MS_PLATFORM_CRYPTO_PROVIDER,
NULL);
if (0 == ntstat)
{
for (long i = 0; i < filesize; i++) {
BCryptGenRandom(pHandle, buf, sizeof(buf), NULL);
//outfile.write((char *)&buf[0], _countof(buf));
}
BCryptCloseAlgorithmProvider(pHandle, NULL);
}
else
{
sprintf((char *)text, "error = 0x%08x", (unsigned int)ntstat);
}
Best regards,