This function is required because of the fact that .NET does not provide any way to copy unmanaged blocks, but provides only methods to copy from unmanaged memory to managed memory and vise versa.
public static IntPtr CopyUnmanagedMemory(IntPtr dst, IntPtr src, int count) { unsafe { CopyUnmanagedMemory((byte*)dst.ToPointer(), (byte*)src.ToPointer(), count); } return dst; }