Попытка использовать функцию kernel32 SecureZeroMemory
, используя приведенный ниже код, завершается неудачно с System.EntryPointNotFoundException
- хотя это хорошо документировано здесь, в PInvoke и здесь, в SO . Запуск полностью нормальной Windows 10 Pro, на целевой .NET Framework 4.7.2.
/// <summary>
/// A kernel32 function that destroys all values in a block of memory
/// </summary>
/// <param name="destination">The pointer to the start of the block to be zeroed</param>
/// <param name="length">The number of bytes to zero</param>
/// <returns></returns>
[DllImport("kernel32.dll", CharSet = CharSet.Auto, EntryPoint = "RtlSecureZeroMemory")]
public static extern void SecureZeroMemory(IntPtr destination, IntPtr length);