title: Copy data from from IntPtr to IntPtr
body: <p>I have two <code>IntPtr</code> values pointing to some data areas of <code>length</code> bytes. <code>length</code> may have an order of magnitude of 200k to 400k.</p>
  <pre><code>int length = /* ..*/
  IntPtr ptrSrc = /*.. */;
  IntPtr ptrDst = /* .. */;
  </code></pre>
  <p>Now I want to copy the data from <code>ptrSrc</code> to <code>ptrDst</code>. This code works fine:</p>
  <pre><code>byte[] data = new byte[length];
  Marshal.Copy(ptrSrc, data, 0, length);
  Marshal.Copy(data, 0, ptrDst, length);
  </code></pre>
  <p>but it has the drawback of needing an additional temporary (potentially huge) array. Unfortunately, I could not find a <code>Marshal.Copy</code> variant in the .NET framework for copying directly from <code>IntPtr</code> to <code>IntPtr</code>, so I am looking for alternatives.</p>
  <p>I am interested in a solution which works on 32-bit Windows as well as 64-bit Windows. Any suggestions?</p>