home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sherlock.zip / EXCEPT / EXCEPT.ZIP / SOURCE.ZIP / SAMPLE.C < prev    next >
Text File  |  1993-10-19  |  2KB  |  59 lines

  1. /**********************************************************************/
  2. /*                           IBM DAPTOOLS UseOnly                    */
  3. /**********************************************************************/
  4. /*                                                                    */
  5. /*  SAMPLE                                                            */
  6. /*                                                                    */
  7. /* SAMPLE 32 bit program to access EXCEPTQ.DLL exception handler      */
  8. /* SAMPLE generates a TRAP to demonstrate information gathering       */
  9. /* C-SET/2 compiler complies that code                                */
  10. /**********************************************************************/
  11. /* Version: 2.2             |   Marc Fiammante                        */
  12. /*                          |   La Gaude FRANCE                       */
  13. /**********************************************************************/
  14. /*                                                                    */
  15. /**********************************************************************/
  16. /* History:                                                           */
  17. /* --------                                                           */
  18. /*                                                                    */
  19. /* created: Marc Fiammante December 1992                              */
  20. /**********************************************************************/
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23. #include <malloc.h>
  24. #include <string.h>
  25. #include <direct.h>
  26. #include <process.h>
  27. #include <conio.h>
  28.  
  29. #define INCL_DOSSEMAPHORES
  30. #define INCL_NOCOMMON
  31. #define INCL_DOSPROCESS
  32. #define INCL_DOSSEMAPHORES
  33. #define INCL_DOSERRORS
  34. #define INCL_DOSMODULEMGR     /* handlers for DLLs */
  35. #define INCL_DOSFILEMGR       /* handlers for the dos file functions */
  36. #define INCL_DOSMEMMGR        /* get the memory management stuff in here */
  37. #define INCL_DOSPROCESS
  38. #define INCL_DOSDATETIME
  39. #define INCL_BASE
  40.  
  41.  
  42. #include <os2.h>
  43. #include <bse.h>
  44.  
  45. USHORT APIENTRY16 SETEXCEPT(_Seg16 PEXCEPTIONREGISTRATIONRECORD);
  46.  
  47. main()
  48. {
  49. PCHAR Test;
  50. EXCEPTIONREGISTRATIONRECORD ExceptReg;
  51.  
  52.     printf("Setting exception handler\n");
  53.     SETEXCEPT(&ExceptReg);
  54.  
  55.     printf("Generating the TRAP from thread\n");
  56.     Test=NULL;
  57.     *Test=0;
  58. }
  59.