Fault Handling Logic Changed for Windows 95

Last reviewed: August 13, 1997
Article ID: Q141203

The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API) included with Microsoft Windows 95

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

Keywords          : kbcode kbhowto kbprg
Version           : 4.0
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 13, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.