You can also run DllImport RtlMoveMemory to complete the task:
[DllImport("Kernel32.dll", EntryPoint="RtlMoveMemory", SetLastError=false)] static extern void MoveMemory(IntPtr dest, IntPtr src, int size);
It will also require FullTrust, however, since you are working with unmanaged code, I would expect that you already have it.
codekaizen
source share