Share via


VirtualCopyEx (Windows Embedded CE 6.0)

1/6/2010

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, when the source and destination process handles are the active process.

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, which must be 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. The following table shows the flags that can be specified.

    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
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

Memory Management Functions
VirtualFree
VirtualAllocEx
VirtualAllocCopyEx

Other Resources

Kernel Mode APIs
Kernel Migration
VirtualCopy