## Virtual Device Driver Reference for OS/2

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

### VDHArmVPMBPHook - Purpose

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

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

Notes: Unlike other hooks, breakpoint hooks are armed until explicitly disarmed by a call to VDHFreeHook. When the breakpoint address is executed from DOS session protected mode, the hook function is called. Any changes made to the client register frame cause the corresponding registers to take on these values after returning to the DOS session. The p parameter in the hook routine points to the RefDataSize bytes of data allocated by VDHAllocHook.

VDHArmVPMBPHook provides a raw breakpoint service. On entry to the arm hook function, the client's CS:EIP is randomly set. It is therefore crucial that the virtual device driver's hook handler sets the CS:EIP to a valid address . Typically, the CS:EIP is retrieved from the client's stack through the use of VDHPopStack, which is a low-level service. Appropriate care should be exercised to ensure that the client's CS:EIP and stack remain valid.

The breakpoint address returned will be valid for all DPMI clients within the DOS session. The breakpoint address may be placed in the DPMI application's IDT (see VDHSetVPMIntVector), but will have to be rehooked each time a DPMI task starts (see VDHInstallUserHook).

There must be a protected-mode DPMI client running in the DOS session before calling this function.