VirtualCopyEx (Compact 2013)

3/28/2014

This function dynamically maps a virtual address to a physical address by creating a new page-table entry. Terminate the mapping by calling VirtualFree. This function is callable in kernel mode and in user mode. Calls from the user mode driver are restricted to mapping only the driver-specific physical mapping.

Syntax

BOOL VirtualCopyEx(
    HANDLE hDstProc,
    LPVOID lpvDest,
    HANDLE hSrcProc,
    LPVOID lpvSrc,
    DWORD cbSize,
    DWORD fdwProtect
);

Parameters

  • hDstProc
    [in] Handle to the destination process.
  • lpvDest
    [in] Pointer to the destination memory. Reserved.
  • hSrcProc
    [in] Handle to the source process.
  • lpvSrc
    [in] Pointer to committed memory.
  • cbSize
    [in] Size, in bytes, of the region. The allocated pages include all pages containing one or more bytes in the range from lpAddress to (lpAddress + cbSize). This means that a 2-byte range straddling a page boundary causes both pages to be included in the allocated region.
  • fdwProtect
    [in] Type of access protection. If the pages are being committed, any one of a number of flags can be specified, along with the PAGE_GUARD and PAGE_NOCACHE, protection modifier flags.

    For information about the available values for this parameter, see VirtualCopy.

Return Value

TRUE indicates success. FALSE indicates failure. To obtain extended error information, call GetLastError.

Remarks

This function is similar to VirtualCopy, except VirtualCopyEx requires handles to the source and destination process. For more information about this function, see VirtualCopy.

Requirements

Header

pkfuncs.h

Library

coredll.lib

See Also

Reference

Memory Management Functions
VirtualCopy
VirtualFree
VirtualAllocEx
VirtualAllocCopyEx