Changeset 431 for branches/branch-1-0/include/helpers
- Timestamp:
- Nov 29, 2017, 5:52:24 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1-0/include/helpers/except.h
r264 r431 70 70 * struct for thread exception handling. 71 71 * 72 *@@changed V0.9.0 (99-10-22) [umoeller]: pfnOnKill added 73 *@@changed V0.9.0 (99-10-22) [umoeller]: renamed from REGREC2 72 * Note: code within a TRY{}CATCH block can change 73 * pszFmt and ulArgX whenever needed to help identify 74 * the cause of an exception 74 75 */ 75 76 … … 80 81 jmp_buf jmpThread; // additional buffer for setjmp 81 82 EXCEPTIONREPORTRECORD err; // exception handlers copy the report rec here 82 PVOID pvUser; // user ptr 83 PVOID pvUser; // user ptr - set to &pszSetBy by TRY_V2 84 PSZ pszSetBy; // the file & function that set the handler 85 PSZ pszFmt; // format string for fprintf() - can be null 86 ULONG ulArg1; // arg1 for pszFmt 87 ULONG ulArg2; // arg2 for pszFmt 88 ULONG ulArg3; // arg3 for pszFmt 89 ULONG ulArg4; // arg4 for pszFmt 83 90 } EXCEPTIONREGISTRATIONRECORD2; 84 91 … … 123 130 PCONTEXTRECORD pContextRec); 124 131 132 VOID _Optlink excExplainException2(FILE *file, 133 PSZ pszHandlerName, 134 PEXCEPTIONREPORTRECORD pReportRec, 135 PCONTEXTRECORD pContextRec, 136 PEXCEPTIONREGISTRATIONRECORD2 pRegRec2); 137 125 138 VOID excRegisterHooks(PFNEXCOPENFILE pfnExcOpenFileNew, 126 139 PFNEXCHOOK pfnExcHookNew, … … 152 165 #ifdef __NO_EXCEPTION_HANDLERS__ 153 166 // exception handlers can completely be disabled 167 #define TRY_LOUD6(excptstruct, fmt, arg1, arg2, arg3, arg4) 154 168 #define TRY_LOUD(excptstruct) 155 #else 169 #define FMT_WNDPROC 170 #else 171 // avoid problems if header and source are different versions 172 #define TRY_V2 1 173 156 174 #ifdef __NO_LOUD_EXCEPTION_HANDLERS__ 157 #define TRY_LOUD (e) TRY_QUIET(e)175 #define TRY_LOUD6 TRY_QUIET6 158 176 #else // __NO_LOUD_EXCEPTION_HANDLERS__ 159 #define TRY_LOUD(excptstruct)\177 #define TRY_LOUD6(excptstruct, fmt, arg1, arg2, arg3, arg4) \ 160 178 { \ 161 179 EXCEPTSTRUCT excptstruct = {0}; \ 162 180 excptstruct.RegRec2.pfnHandler = (PFN)excHandlerLoud; \ 181 excptstruct.RegRec2.pvUser = &excptstruct.RegRec2.pszSetBy; \ 182 excptstruct.RegRec2.pszSetBy = __FILE__##"::"##__FUNCTION__##"()"; \ 183 excptstruct.RegRec2.pszFmt = fmt; \ 184 excptstruct.RegRec2.ulArg1 = (ULONG)arg1; \ 185 excptstruct.RegRec2.ulArg2 = (ULONG)arg2; \ 186 excptstruct.RegRec2.ulArg3 = (ULONG)arg3; \ 187 excptstruct.RegRec2.ulArg4 = (ULONG)arg4; \ 163 188 excptstruct.arc = DosSetExceptionHandler( \ 164 189 (PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); \ … … 173 198 174 199 #endif // __NO_LOUD_EXCEPTION_HANDLERS__ 175 #endif 176 177 #ifdef __NO_EXCEPTION_HANDLERS__ 178 // exception handlers can completely be disabled 200 201 #define TRY_LOUD(excptstruct) \ 202 TRY_LOUD6(excptstruct, 0, 0, 0, 0, 0) 203 204 #define TRY_LOUD2(excptstruct, fmt) \ 205 TRY_LOUD6(excptstruct, fmt, 0, 0, 0, 0) 206 207 #define TRY_LOUD3(excptstruct, fmt, arg1) \ 208 TRY_LOUD6(excptstruct, fmt, arg1, 0, 0, 0) 209 210 #define TRY_LOUD4(excptstruct, fmt, arg1, arg2) \ 211 TRY_LOUD6(excptstruct, fmt, arg1, arg2, 0, 0) 212 213 #define TRY_LOUD5(excptstruct, fmt, arg1, arg2, arg3) \ 214 TRY_LOUD6(excptstruct, fmt, arg1, arg2, arg3, 0) 215 216 #define TRY_WNDPROC_FMT "hwnd= %08x msg= %04x mp1= %08x mp2= %08x\n" 217 218 #define TRY_WNDPROC(excptstruct, hwd) \ 219 TRY_LOUD6(excptstruct, TRY_WNDPROC_FMT, hwd, msg, mp1, mp2) 220 221 #endif 222 223 #ifdef __NO_EXCEPTION_HANDLERS__ 224 // exception handlers can completely be disabled 225 #define TRY_QUIET6(excptstruct, fmt, arg1, arg2, arg3, arg4) 179 226 #define TRY_QUIET(excptstruct) 180 227 #else 181 #define TRY_QUIET (excptstruct)\228 #define TRY_QUIET6(excptstruct, fmt, arg1, arg2, arg3, arg4) \ 182 229 { \ 183 230 EXCEPTSTRUCT excptstruct = {0}; \ 184 231 excptstruct.RegRec2.pfnHandler = (PFN)excHandlerQuiet; \ 232 excptstruct.RegRec2.pvUser = &excptstruct.RegRec2.pszSetBy; \ 233 excptstruct.RegRec2.pszSetBy = __FILE__##"::"##__FUNCTION__##"()"; \ 234 excptstruct.RegRec2.pszFmt = fmt; \ 235 excptstruct.RegRec2.ulArg1 = arg1; \ 236 excptstruct.RegRec2.ulArg2 = arg2; \ 237 excptstruct.RegRec2.ulArg3 = arg3; \ 238 excptstruct.RegRec2.ulArg4 = arg4; \ 185 239 excptstruct.arc = DosSetExceptionHandler( \ 186 240 (PEXCEPTIONREGISTRATIONRECORD)&(excptstruct.RegRec2)); \ … … 194 248 { 195 249 250 #define TRY_QUIET(excptstruct) \ 251 TRY_QUIET6(excptstruct, 0, 0, 0, 0, 0) 252 196 253 #endif 197 254
Note:
See TracChangeset
for help on using the changeset viewer.