Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
673 B

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: rng.c
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 11-05-97 jbanes Modified to use static rsaenh.dll.
  15. //
  16. //----------------------------------------------------------------------------
  17. #include <spbase.h>
  18. NTSTATUS
  19. GenerateRandomBits(PUCHAR pbBuffer,
  20. ULONG dwLength)
  21. {
  22. if(!CryptGenRandom(g_hRsaSchannel, dwLength, pbBuffer))
  23. {
  24. return STATUS_INSUFFICIENT_RESOURCES;
  25. }
  26. return STATUS_SUCCESS;
  27. }