Changeset 9910 for trunk/src/kernel32/exceptions.cpp
- Timestamp:
- Mar 6, 2003, 11:22:27 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/exceptions.cpp
r9893 r9910 1 /* $Id: exceptions.cpp,v 1.7 1 2003-03-03 16:41:03sandervl Exp $ */1 /* $Id: exceptions.cpp,v 1.72 2003-03-06 10:22:26 sandervl Exp $ */ 2 2 3 3 /* … … 610 610 szModName, iObj, offObj); 611 611 } 612 612 613 613 /* This is very dangerous. Can hang PM. 614 614 rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, message, "Application Error", … … 715 715 char szLineException[128]; 716 716 char szLineExceptionType[128]; 717 717 718 718 szLineException[0] = 0; /* initialize */ 719 719 szLineExceptionType[0] = 0; /* initialize */ … … 813 813 case XCPT_DATATYPE_MISALIGNMENT: 814 814 strcpy(szLineException, "Datatype Misalignment"); 815 sprintf(szLineExceptionType, "R/W %08x alignment %08x at %08x.", pERepRec->ExceptionInfo[0], 815 sprintf(szLineExceptionType, "R/W %08x alignment %08x at %08x.", pERepRec->ExceptionInfo[0], 816 816 pERepRec->ExceptionInfo[1], pERepRec->ExceptionInfo[2]); 817 817 break; … … 914 914 } 915 915 916 sprintf(szTrapDump, "---[Exception Information]------------\n %s", szLineException); 917 918 strcat(szTrapDump, " ("); 916 sprintf(szTrapDump, "---[Exception Information]------------\n %s (", szLineException); 919 917 920 918 if (fExcptSoftware == TRUE) /* software or hardware generated ? */ … … 935 933 strcat(szTrapDump, ")\n"); /* add trailing brace */ 936 934 935 if (szLineExceptionType[0]) 936 sprintf(szTrapDump + strlen(szTrapDump), " %s\n", szLineExceptionType); 937 937 938 938 rc = DosQueryModFromEIP(&ulModule, &ulObject, sizeof(szModule), … … 947 947 strcat(szTrapDump, szLineException); 948 948 } 949 else 949 else 950 950 { /* fault in DosAllocMem allocated memory, hence PE loader.. */ 951 951 Win32ImageBase * pMod; … … 1007 1007 1008 1008 sprintf(szLineException, " Env[0]=%08x Env[1]=%08x Env[2]=%08x Env[3]=%08x\n", 1009 pCtxRec->ctx_env[0], pCtxRec->ctx_env[1], 1009 pCtxRec->ctx_env[0], pCtxRec->ctx_env[1], 1010 1010 pCtxRec->ctx_env[2], pCtxRec->ctx_env[3]); 1011 1011 strcat(szTrapDump, szLineException); … … 1053 1053 //Override filename of exception log (expects full path) 1054 1054 //***************************************************************************** 1055 void WIN32API SetCustomExceptionLog(LPSTR lpszLogName) 1055 void WIN32API SetCustomExceptionLog(LPSTR lpszLogName) 1056 1056 { 1057 1057 strcpy(szExceptionLogFileName, lpszLogName); … … 1059 1059 //***************************************************************************** 1060 1060 //***************************************************************************** 1061 void WIN32API SetExceptionLogging(BOOL fEnable) 1061 void WIN32API SetExceptionLogging(BOOL fEnable) 1062 1062 { 1063 1063 fExceptionLoggging = fEnable; … … 1088 1088 OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, 1089 1089 0L); /* No extended attribute */ 1090 1090 1091 1091 if(rc == NO_ERROR) { 1092 1092 DosSetFilePtr(hFile, 0, FILE_END, &ulBytesWritten); … … 1095 1095 1096 1096 lpszExeName = WinExe->getModuleName(); 1097 1097 1098 1098 if(lpszExeName) { 1099 1099 DosWrite(hFile, "\n", 2, &ulBytesWritten); … … 1340 1340 1341 1341 dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill\n")); 1342 1342 1343 1343 pCtxRec->ctx_RegEip = (ULONG)KillWin32Process; 1344 1344 pCtxRec->ctx_RegEsp = pCtxRec->ctx_RegEsp + 0x10; … … 1351 1351 { 1352 1352 //NOTE:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1353 //Don't print anything here -> fatal hang if exception occurred 1353 //Don't print anything here -> fatal hang if exception occurred 1354 1354 //inside fprintf 1355 1355 //NOTE:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1356 1356 1357 Win32MemMap *map; 1358 BOOL fWriteAccess = FALSE, ret; 1359 ULONG offset, accessflag; 1360 1361 switch(pERepRec->ExceptionInfo[0]) { 1362 case XCPT_READ_ACCESS: 1363 accessflag = MEMMAP_ACCESS_READ; 1364 break; 1365 case XCPT_WRITE_ACCESS: 1366 accessflag = MEMMAP_ACCESS_WRITE; 1367 fWriteAccess = TRUE; 1368 break; 1369 default: 1370 goto continueGuardException; 1371 } 1372 1373 map = Win32MemMapView::findMapByView(pERepRec->ExceptionInfo[1], &offset, accessflag); 1374 if(map == NULL) { 1375 goto continueGuardException; 1376 } 1377 ret = map->commitGuardPage(pERepRec->ExceptionInfo[1], offset, fWriteAccess); 1378 map->Release(); 1379 if(ret == TRUE) 1380 goto continueexecution; 1381 1382 continueGuardException: 1357 1383 goto continuesearch; 1358 1384 }
Note:
See TracChangeset
for help on using the changeset viewer.