Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: On second thought, rolling this change back pending further investigation.

...

Code Block
bgColor#ccccff
langc
#include <Windows.h>
#include <wincrypt.h>
#include <stdio.h>
 
HCRYPTPROV prov;
if (CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET0)) {
  long int li = 0;
  if (CryptGenRandom(prov, sizeof(li), (BYTE *)&li))
    printf("Random number: %ld\n", li);
  CryptReleaseContext(prov, 0);
}

...