2009/07/07

C# - Setting & Zeroizing Unmanaged Memory Using Pointer

Unmanaged Memory Setting
Marshal.Copy(byte[] source, int startIndex, IntPtr ptrHandle, int endIndex);



Unmanaged Memory Zeroizing
// IntPtr ptrHandle;
byte[] zeroBytes = new byte[1024];
Marshal.Copy(zeroBytes , 0, ptrHandle, zeroBytes.Length - 1);

No comments:

Post a Comment

Google Analytics

Blog Archive

Followers