CopyMemory (urlmon)
Last changed: -180.214.232.93

.
Summary
Copies a block of memory from one location to another.

C# Signature:

[DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)]

public static extern void CopyMemory(IntPtr dest, IntPtr src, uint count);

VB Signature:

Public Declare Auto Sub CopyMemory lib "kernel32.dll" Alias "CopyMemory"(destination As IntPtr, source As IntPtr, length As UInteger)

<DllImport("kernel32.dll", SetLastError:= True, EntryPoint:= "CopyMemory")>
Public Shared Sub CopyMemory(destination As IntPtr, source As IntPtr, length As UInteger)
End Sub

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

    static void Main()
    {
    const int size = 200;
    IntPtr memorySource = Marshal.AllocHGlobal(size);
    IntPtr memoryTarget = Marshal.AllocHGlobal(size);

    CopyMemory(memoryTarget,memorySource,size);
    }

//http://stackoverflow.com/questions/15975972/copy-data-from-from-intptr-to-intptr

Documentation
CopyMemory on MSDN