Changeset 1224 for trunk/src/kernel32/exceptions.cpp
- Timestamp:
- Oct 9, 1999, 5:03:47 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/exceptions.cpp
r1221 r1224 1 /* $Id: exceptions.cpp,v 1.2 2 1999-10-09 13:33:23sandervl Exp $ */1 /* $Id: exceptions.cpp,v 1.23 1999-10-09 15:03:10 sandervl Exp $ */ 2 2 3 3 /* … … 64 64 #include "mmap.h" 65 65 #include <wprocess.h> 66 #include "oslibexcept.h" 66 67 67 68 //Global Process Unhandled exception filter … … 130 131 DWORD es, DWORD fs, DWORD gs, DWORD ss) 131 132 { 132 PWINEXCEPTION_FRAME pframe, dispatch, nested_frame;133 133 WINEXCEPTION_RECORD record; 134 WINEXCEPTION_RECORD newrec;135 134 WINEXCEPTION_POINTERS ExceptionInfo; 136 135 WINCONTEXT context; … … 175 174 } 176 175 176 rc = RtlDispatchException(&record, &context); 177 178 // and finally, the unhandled exception filter 179 if(rc == ExceptionContinueSearch && UnhandledExceptionFilter != NULL) 180 { 181 ExceptionInfo.ExceptionRecord = &record; 182 ExceptionInfo.ContextRecord = &context; 183 184 rc = UnhandledExceptionFilter(&ExceptionInfo); 185 } 186 187 // terminate the process 188 if(rc != ExceptionContinueExecution || 189 record.ExceptionFlags & EH_NONCONTINUABLE) 190 { 191 dprintf(("KERNEL32: RaiseException terminating process.\n")); 192 DosExit(EXIT_PROCESS, 0); 193 } 194 195 return; 196 } 197 //****************************************************************************** 198 //****************************************************************************** 199 DWORD RtlDispatchException(WINEXCEPTION_RECORD *pRecord, WINCONTEXT *pContext) 200 { 201 PWINEXCEPTION_FRAME pframe, dispatch, nested_frame; 202 int rc; 203 177 204 // get chain of exception frames 178 rc 205 rc = ExceptionContinueSearch; 179 206 180 207 nested_frame = NULL; … … 193 220 (int)pframe & 3) 194 221 { 195 record.ExceptionFlags |= EH_STACK_INVALID;222 pRecord->ExceptionFlags |= EH_STACK_INVALID; 196 223 break; 197 224 } 198 225 199 rc = pframe->Handler( &record,226 rc = pframe->Handler(pRecord, 200 227 pframe, 201 &context,202 &dispatch);228 pContext, 229 dispatch); 203 230 204 231 if (pframe == nested_frame) … … 206 233 /* no longer nested */ 207 234 nested_frame = NULL; 208 record.ExceptionFlags &= ~EH_NESTED_CALL;235 pRecord->ExceptionFlags &= ~EH_NESTED_CALL; 209 236 } 210 237 … … 214 241 { 215 242 case ExceptionContinueExecution: 216 if (!(record.ExceptionFlags & EH_NONCONTINUABLE)) return; 217 DosExit(EXIT_PROCESS, 0); 243 if (!(pRecord->ExceptionFlags & EH_NONCONTINUABLE)) return rc; 218 244 break; 219 245 case ExceptionContinueSearch: … … 221 247 case ExceptionNestedException: 222 248 if (nested_frame < dispatch) nested_frame = dispatch; 223 record.ExceptionFlags |= EH_NESTED_CALL;249 pRecord->ExceptionFlags |= EH_NESTED_CALL; 224 250 break; 225 251 default: 226 DosExit(EXIT_PROCESS, 0);227 252 break; 228 253 } … … 230 255 pframe = pframe->Prev; 231 256 } 232 233 // and finally, the unhandled exception filter 234 if(rc == ExceptionContinueSearch && UnhandledExceptionFilter != NULL) 235 { 236 ExceptionInfo.ExceptionRecord = &record; 237 ExceptionInfo.ContextRecord = &context; 238 239 rc = UnhandledExceptionFilter(&ExceptionInfo); 240 } 241 242 // terminate the process 243 if(rc != ExceptionContinueExecution) 244 { 245 dprintf(("KERNEL32: RaiseException terminating process.\n")); 246 DosExit(EXIT_PROCESS, 0); 247 } 248 249 return; 250 } 251 252 257 return rc; 258 } 253 259 /***************************************************************************** 254 260 * Name : int _Pascal OS2RtlUnwind … … 934 940 PVOID p) 935 941 { 936 // pERegRec->prev_structure = 0;937 942 dprintfException(pERepRec, pERegRec, pCtxRec, p); 938 943 … … 948 953 case XCPT_FLOAT_UNDERFLOW: 949 954 dprintf(("KERNEL32: OS2ExceptionHandler: FPU exception, fix and continue\n")); 950 pCtxRec->ctx_env[0] |= 0x1F; 951 pCtxRec->ctx_stack[0].losig = 0; 952 pCtxRec->ctx_stack[0].hisig = 0; 953 pCtxRec->ctx_stack[0].signexp = 0; 954 955 return (XCPT_CONTINUE_EXECUTION); 955 if(fIsOS2Image == FALSE) //Only for real win32 apps 956 { 957 if(OSLibDispatchException(pERepRec, pERegRec, pCtxRec, p) == FALSE) 958 { 959 pCtxRec->ctx_env[0] |= 0x1F; 960 pCtxRec->ctx_stack[0].losig = 0; 961 pCtxRec->ctx_stack[0].hisig = 0; 962 pCtxRec->ctx_stack[0].signexp = 0; 963 } 964 return (XCPT_CONTINUE_EXECUTION); 965 } 966 else return (XCPT_CONTINUE_SEARCH); 956 967 957 968 case XCPT_PROCESS_TERMINATE: … … 1008 1019 case XCPT_IN_PAGE_ERROR: 1009 1020 CrashAndBurn: 1021 if(fIsOS2Image == FALSE) //Only for real win32 apps 1022 { 1023 if(OSLibDispatchException(pERepRec, pERegRec, pCtxRec, p) == TRUE) 1024 { 1025 return (XCPT_CONTINUE_EXECUTION); 1026 } 1027 } 1010 1028 dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill\n")); 1011 1029 pCtxRec->ctx_RegEip = (ULONG)KillWin32Process;
Note:
See TracChangeset
for help on using the changeset viewer.