Handling the DRV_LOAD Message

The pen driver responds to DRV_LOAD by calling the multiplex interrupt (interrupt 2Fh) to get the protect-mode entry point in the previously-loaded virtual pen driver. The following code illustrates this:

_asm {
         xor    di, di                          ; Initialize DI to zero.
         mov    ax, GET_VPEND_API_ENTRY_POINT   ; 1684h
         mov    bx, VPenD_Device_ID             ; Virtual Pen Driver ID
         int    2Fh                             ; Multiplex interrupt
; On return, ES:DI points to protect mode entry point in VxD.
         mov    word ptr vlpfnVpenD_API_Entry_Point+2, es;
         mov    word ptr vlpfnVpenD_API_Entry_Point, di
}
 

If the virtual pen driver does not respond, the pen driver will return a failure condition to Windows. However, if the virtual pen driver exists in memory and responds correctly to the call, the pen driver next fills in a VPEND_INIT structure with information for the virtual pen driver to use. The pen driver then calls the virtual pen driver entry point that is pointed to by ES:DI. The virtual pen driver records the information for future use and initializes the DRV_PENINFO structure pointed to by the lpPenInfo member of the VPEND_INIT structure. All the members of the VPEND_INIT and DRV_PENINFO structures are defined in the "Reference" section of About the Pen Driver.