## Virtual Device Driver Reference for OS/2

[prev][next][parent][TOC]

### VDHCopyMem - Purpose

Context Issues: This function can be called only in the task context.

DOS Session Terminations: There are no DOS session termination implications for this function.

Notes: Protection faults are handled as if a user application had performed the access. Therefore, writing to an invalid page causes a virtual device driver page fault handler to gain control. If there is no virtual device driver fault handler, a "don't care" page is mapped in at the faulting linear address.

Note that touching invalid pages is allowed only in the context of the DOS session. A virtual device driver cannot touch invalid pages through the HVDM (DOS session Handle) alias region if it is not in the context of that DOS session. A virtual device driver that violates this rule causes a system halt.

This function yields the CPU if it is necessary to ensure that the thread dispatch latency limit is not exceeded. This function also supports overlapping linear regions. However, the results are undefined when copying between regions with aliases (through VDHMapPages) to the same physical page.

If necessary, VDHLockMem is used to ensure that the status of the source and destination linear ranges does not change. This is required only if the source and destination ranges are in private DOS session memory (accessed through the HVDM), and the call to VDHCopyMem is made in the context of some other process.