CopyMemory

The CopyMemory function copies a block of memory from one location to another.

VOID CopyMemory(
  PVOID Destination,  // pointer to address of copy destination
  CONST VOID *Source, // pointer to address of block to copy
  DWORD Length        // size, in bytes, of block to copy
);
 

Parameters

Destination
Pointer to the starting address of the copied block's destination.
Source
Pointer to the starting address of the block of memory to copy.
Length
Specifies the size, in bytes, of the block of memory to copy.

Return Values

This function has no return value.

Remarks

If the source and destination blocks overlap, the results are undefined. For overlapped blocks, use the MoveMemory function.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.

See Also

Memory Management Overview, Memory Management Functions, CopyMemoryVlm, FillMemory, FillMemoryVlm, MoveMemory, MoveMemoryVlm, ZeroMemory