[Toc][Index]

DosSetVec


Bindings:  C, MASM 

This call allows a process to register an address to be used when a 
machine exception occurs. 
 DosSetVec    (VecNum, Routine, PrevAddress) 
 
 VecNum (USHORT) - input 
    Number of the vector to be serviced by this routine. Valid values are: 
    
    Value     Definition 
    00        Divide overflow 
    04        Overflow 
    05        Bound 
    06        Invalid opcode 
    07        Processor extension not available 
    16        Processor extension error. 
 Routine (PFN) - input 
    Address of a routine to be entered when the exception occurs. If this 
    parameter is 0, any previous address is de-registered. 
 PrevAddress (PFN) - output 
    Address of the previous handler routine.  This is provided so a 
    handler may be set, then later restored to the previous handler. 
 
 rc (USHORT) - return 
    Return code descriptions are: 
    1         ERROR_INVALID_FUNCTION 
    50        ERROR_NOT_SUPPORTED 
 
 Remarks 
 The DosSetVec process is analogous to setting an address in the interrupt 
 vector table when running in 8086 mode. 
 Should an exception occur, and the process has registered a handler, that 
 handler is entered as if its address had been stored in the CPU's 
 interrupt vector, except that the interrupt is still enabled.  If no 
 address has been registered for that vector, the process terminates. 
 When a process registers an exception handler for VecNum 7 (processor 
 extension not available), the machine status word (MSW) for that process 
 is set to indicate that a numeric processor extension (NPX) 287 is not 
 present in the machine.  The Emulate bit is set and the Monitor Processor 
 bit is reset.  This is done without regard for the true state of the 
 hardware. 
 When a process de-registers a handler for VecNum 7, the MSW is set to 
 reflect the true state of the hardware. 
 When an NPX287 exception is processing, the NPX287 status word is passed 
 to the exception handler by being pushed on the stack before the 
 exception handler is invoked.  When the exception handler has completed 
 execution, this word must be popped from the stack before an IRET is 
 issued to return to the exception handler interface routine. 
 
 Family API Considerations 
 Some options operate differently in the DOS mode than in OS/2 mode. 
  Therefore, the following restriction applies to DosSetVec when coding 
 for the DOS mode. 
 VecNum = 7 not supported. 
 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs