Fault Handling Logic Changed for Windows 95 (141203)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • Microsoft Windows 95

This article was previously published under Q141203

SUMMARY

Windows 95 has modified the way VxD fault handlers should handle passing the fault on to the previous handler. Using fault handler logic from a Windows 3.10 VxD may cause problems in Windows 95.

MORE INFORMATION

In Windows 3.1x, the following code logic might have been used by a fault handler:
   pPrevFaultHandler dd ?

      mov     eax, fault_number
      mov     esi, offset32 FaultHandler
      VMMCall Hook_V86_Fault
      mov     pPrevFaultHandler, esi

   BeginProc FaultHandler
      ;;;
      ;;; handler code
      ;;;

      cmp     pPrevFaultHandler, 0
      jz     @F
      jmp     pPrevFaultHandler
   @@:   ret
   EndProc FaultHandler
				


In Windows 95, this logic should be modified as follows:
   pPrevFaultHandler dd 0

      mov     eax, fault_number
      mov     esi, offset32 FaultHandler
      VMMCall Hook_V86_Fault
   ;   NOTE:  No "mov pPrevFaultHandler, esi" instruction
   ;   esi = 0 if this is the first fault handler
   ;   pPrevFaultHandler will *always* be nonzero.
   ;   if esi = 0, pPrevFaultHandler will be the address
   ;   of the default handler.

      ...
      mov     eax, fault_number
      mov     esi, offset32 FaultHandler
      VMMCall UnHook_V86_Fault

   BeginProc FaultHandler, HOOK_PROC, pPrevFaultHandler
      ;;;
      ;;; handler code
      ;;;

   ;   NOTE: No "cmp pPrevFaultHandler, 0" instruction
      jmp   pPrevFaultHandler
   EndProc FaultHandler
				

Modification Type:MajorLast Reviewed:2/25/2004
Keywords:kbhowto KB141203