home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d009_2 / 1.ddi / SAMPLES / TRAPS / CAUSERIP.MS$ / CAUSERIP.bin
Encoding:
Text File  |  1992-02-03  |  1.4 KB  |  39 lines

  1. '************************** CAUSERIP.MST *********************************
  2. 'Demonstrates:  Trapping a Windows RIP from a MSTest script
  3. '
  4. 'Required Files: RIPTRAP.DLL, TOOLHELP.DLL
  5. '
  6. 'Uses:
  7. '
  8. 'Complexity Level: ADVANCED
  9. '
  10. 'Notes: This script simply calls the Windows FatalExit function, which
  11. '       causes a RIP.
  12. '
  13. 'NOTE!: Do not run this script by itself.  This script should be run by
  14. '       TRAPRIP.MST.  Load and run TRAPRIP.MST to execute this sample
  15. '       program.
  16. '
  17. '       FatalExit is a Windows function which should only be called by an
  18. '       application when it wants to inform a debugger (such as CodeView)
  19. '       that an fatal event has occurred.  However, Windows itself will
  20. '       call FatalExit if you have the Windows debug kernel installed and
  21. '       certain problems occur with your application.  An example is if an
  22. '       invalid handle is passed to one of the Windows API.
  23. '
  24. '       If you are not in a debugger, this causes the RIP information to
  25. '       be displayed to a debug terminal, and prompts the user for a
  26. '       response. The result is that the test suite is stopped.
  27. '       Therefore, you may wish to trap FatalExit so that a test suite can
  28. '       continue.
  29. '
  30. '*************************************************************************
  31.  
  32. DECLARE SUB FatalExit LIB "KERNEL.EXE" (nErrCode As Integer)
  33.  
  34. ' Cause a RIP FatalExit (17)
  35. FatalExit 17
  36. END
  37.  
  38.  
  39.