Changeset 14 for trunk/include/helpers/except.h
- Timestamp:
- Dec 9, 2000, 8:19:42 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/except.h
r7 r14 53 53 54 54 /******************************************************************** 55 * *56 * Declarations *57 * *55 * 56 * Declarations 57 * 58 58 ********************************************************************/ 59 60 // forward declaration 61 typedef struct _EXCEPTIONREGISTRATIONRECORD2 *PEXCEPTIONREGISTRATIONRECORD2; 59 62 60 63 // "OnKill" function prototype for EXCEPTIONREGISTRATIONRECORD2 61 64 // added V0.9.0 (99-10-22) [umoeller] 62 typedef VOID APIENTRY FNEXCONKILL(VOID); 63 typedef FNEXCONKILL *PFNEXCONKILL; 65 // removed V0.9.7 (2000-12-08) [umoeller] 66 // typedef VOID APIENTRY FNEXCONKILL(PEXCEPTIONREGISTRATIONRECORD2); 67 // typedef FNEXCONKILL *PFNEXCONKILL; 64 68 65 69 /* … … 77 81 PFN pfnHandler; // as in EXCEPTIONREGISTRATIONRECORD 78 82 jmp_buf jmpThread; // additional buffer for setjmp 79 PFNEXCONKILL pfnOnKill; // subroutine to call upon process/thread termination 80 } EXCEPTIONREGISTRATIONRECORD2, *PEXCEPTIONREGISTRATIONRECORD2; 83 // PFNEXCONKILL pfnOnKill; // subroutine to call upon process/thread termination 84 PVOID pvUser; // user ptr 85 } EXCEPTIONREGISTRATIONRECORD2; 81 86 82 87 /* … … 110 115 111 116 /******************************************************************** 112 * *113 * Prototypes *114 * *117 * 118 * Prototypes 119 * 115 120 ********************************************************************/ 116 121 … … 133 138 134 139 /******************************************************************** 135 * *136 * Macros *137 * *140 * 141 * Macros 142 * 138 143 ********************************************************************/ 139 144 … … 142 147 #ifdef __NO_EXCEPTION_HANDLERS__ 143 148 // exception handlers can completely be disabled 144 #define TRY_LOUD(excptstruct , _pfnOnKill)145 #else 146 #define TRY_LOUD(excptstruct , _pfnOnKill)\149 #define TRY_LOUD(excptstruct) 150 #else 151 #define TRY_LOUD(excptstruct) \ 147 152 { \ 148 153 EXCEPTSTRUCT excptstruct = {0}; \ 149 154 excptstruct.RegRec2.pfnHandler = (PFN)excHandlerLoud; \ 150 excptstruct.RegRec2.pfnOnKill = _pfnOnKill; \151 155 excptstruct.arc = DosSetExceptionHandler( \ 152 156 (PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); \ … … 159 163 if (excptstruct.ulExcpt == 0) \ 160 164 { 161 #endif 162 163 #ifdef __NO_EXCEPTION_HANDLERS__ 164 // exception handlers can completely be disabled 165 #define TRY_QUIET(excptstruct, _pfnOnKill) 166 #else 167 #define TRY_QUIET(excptstruct, _pfnOnKill) \ 165 166 #endif 167 168 #ifdef __NO_EXCEPTION_HANDLERS__ 169 // exception handlers can completely be disabled 170 #define TRY_QUIET(excptstruct) 171 #else 172 #define TRY_QUIET(excptstruct) \ 168 173 { \ 169 174 EXCEPTSTRUCT excptstruct = {0}; \ 170 175 excptstruct.RegRec2.pfnHandler = (PFN)excHandlerQuiet; \ 171 excptstruct.RegRec2.pfnOnKill = _pfnOnKill; \172 176 excptstruct.arc = DosSetExceptionHandler( \ 173 177 (PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); \ … … 180 184 if (excptstruct.ulExcpt == 0) \ 181 185 { 186 182 187 #endif 183 188 … … 192 197 else \ 193 198 { /* exception occured: */ \ 194 DosUnsetExceptionHandler( \ 195 (PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); 199 DosUnsetExceptionHandler((PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); 196 200 #endif 197 201
Note:
See TracChangeset
for help on using the changeset viewer.