Desktop Functions: Smart Device Functions:
|
CryptGenRandom (advapi32)
C# Signature:
[DllImport("advapi32.dll", SetLastError=true)] VB Signature:
Declare Function CryptGenRandom Lib "advapi32.dll" (ByVal hProv As IntPtr, ByVal dwLen As Integer, ByVal pbBuffer As Byte()) As Boolean User-Defined Types:None. Alternative Managed API:The RNGCryptoServiceProvider class Do you know one? Please contribute it! Notes:None. Tips & Tricks:Please add some! Sample Code:byte[] newRandom = new byte[10]; if (!CryptGenRandom(hProv, (uint)(newRandom.Length), newRandom)) {
throw new Win32Exception(Marshal.GetLastWin32Error()); } CryptGenRandom(hProv, newRandom.Length, newRandom); Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|