## Virtual Device Driver Reference for OS/2

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

### VDHInstallFaultHook - Format

This function sets a page fault handler for a region of linear address space. The page fault handler receives control when a DOS session touches a page in a reserved region that was invalidated by VDHMapPages. The handler does not get control if the page was indicated "not present" by the Page Manager.

    #include mvdm.h

    HVDM          VDMHandle;               /*  DOS session handle; 0 = current DOS session */

    PVOID         StartingAddress;         /*  Starting linear address */

    ULONG         Pages;                   /*  Number of pages */

    PFAULTHOOK    PageFaultHandlerFcnPtr;  /*  Page fault handler function */

    BOOL          OptionFlag;              /*  Options bit flag */

    BOOL          rc;

    rc = VDHInstallFaultHook(VDMHandle, StartingAddress,

           Pages, PageFaultHandlerFcnPtr, OptionFlag);