Remove the unused win32 exception handler

Especially don't send crash reports from this tree to id ;)
This commit is contained in:
dhewg 2011-12-14 12:46:30 +01:00
parent 1dad3d711f
commit dfdb6b6d4a

View file

@ -35,7 +35,6 @@ If you have questions concerning this license or the applicable additional terms
#include <direct.h>
#include <io.h>
#include <conio.h>
#include <mapi.h>
#include <shellapi.h>
#ifndef __MRC__
@ -1203,129 +1202,8 @@ const char *GetExceptionCodeInfo( UINT code ) {
}
}
/*
====================
EmailCrashReport
emailer originally from Raven/Quake 4
====================
*/
void EmailCrashReport( LPSTR messageText ) {
LPMAPISENDMAIL MAPISendMail;
MapiMessage message;
static int lastEmailTime = 0;
if ( Sys_Milliseconds() < lastEmailTime + 10000 ) {
return;
}
lastEmailTime = Sys_Milliseconds();
HINSTANCE mapi = LoadLibrary( "MAPI32.DLL" );
if( mapi ) {
MAPISendMail = ( LPMAPISENDMAIL )GetProcAddress( mapi, "MAPISendMail" );
if( MAPISendMail ) {
MapiRecipDesc toProgrammers =
{
0, // ulReserved
MAPI_TO, // ulRecipClass
"DOOM 3 Crash", // lpszName
"SMTP:programmers@idsoftware.com", // lpszAddress
0, // ulEIDSize
0 // lpEntry
};
memset( &message, 0, sizeof( message ) );
message.lpszSubject = "DOOM 3 Fatal Error";
message.lpszNoteText = messageText;
message.nRecipCount = 1;
message.lpRecips = &toProgrammers;
MAPISendMail(
0, // LHANDLE lhSession
0, // ULONG ulUIParam
&message, // lpMapiMessage lpMessage
MAPI_DIALOG, // FLAGS flFlags
0 // ULONG ulReserved
);
}
FreeLibrary( mapi );
}
}
int Sys_FPU_PrintStateFlags( char *ptr, int ctrl, int stat, int tags, int inof, int inse, int opof, int opse );
/*
====================
_except_handler
====================
*/
EXCEPTION_DISPOSITION __cdecl _except_handler( struct _EXCEPTION_RECORD *ExceptionRecord, void * EstablisherFrame,
struct _CONTEXT *ContextRecord, void * DispatcherContext ) {
static char msg[ 8192 ];
char FPUFlags[2048];
Sys_FPU_PrintStateFlags( FPUFlags, ContextRecord->FloatSave.ControlWord,
ContextRecord->FloatSave.StatusWord,
ContextRecord->FloatSave.TagWord,
ContextRecord->FloatSave.ErrorOffset,
ContextRecord->FloatSave.ErrorSelector,
ContextRecord->FloatSave.DataOffset,
ContextRecord->FloatSave.DataSelector );
sprintf( msg,
"Please describe what you were doing when DOOM 3 crashed!\n"
"If this text did not pop into your email client please copy and email it to programmers@idsoftware.com\n"
"\n"
"-= FATAL EXCEPTION =-\n"
"\n"
"%s\n"
"\n"
"0x%x at address 0x%08x\n"
"\n"
"%s\n"
"\n"
"EAX = 0x%08x EBX = 0x%08x\n"
"ECX = 0x%08x EDX = 0x%08x\n"
"ESI = 0x%08x EDI = 0x%08x\n"
"EIP = 0x%08x ESP = 0x%08x\n"
"EBP = 0x%08x EFL = 0x%08x\n"
"\n"
"CS = 0x%04x\n"
"SS = 0x%04x\n"
"DS = 0x%04x\n"
"ES = 0x%04x\n"
"FS = 0x%04x\n"
"GS = 0x%04x\n"
"\n"
"%s\n",
com_version.GetString(),
ExceptionRecord->ExceptionCode,
ExceptionRecord->ExceptionAddress,
GetExceptionCodeInfo( ExceptionRecord->ExceptionCode ),
ContextRecord->Eax, ContextRecord->Ebx,
ContextRecord->Ecx, ContextRecord->Edx,
ContextRecord->Esi, ContextRecord->Edi,
ContextRecord->Eip, ContextRecord->Esp,
ContextRecord->Ebp, ContextRecord->EFlags,
ContextRecord->SegCs,
ContextRecord->SegSs,
ContextRecord->SegDs,
ContextRecord->SegEs,
ContextRecord->SegFs,
ContextRecord->SegGs,
FPUFlags
);
EmailCrashReport( msg );
common->FatalError( msg );
// Tell the OS to restart the faulting instruction
return ExceptionContinueExecution;
}
#define TEST_FPU_EXCEPTIONS /* FPU_EXCEPTION_INVALID_OPERATION | */ \
/* FPU_EXCEPTION_DENORMALIZED_OPERAND | */ \
/* FPU_EXCEPTION_DIVIDE_BY_ZERO | */ \
@ -1347,16 +1225,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
Sys_GetCurrentMemoryStatus( exeLaunchMemoryStats );
#if 0
DWORD handler = (DWORD)_except_handler;
__asm
{ // Build EXCEPTION_REGISTRATION record:
push handler // Address of handler function
push FS:[0] // Address of previous handler
mov FS:[0],ESP // Install new EXECEPTION_REGISTRATION
}
#endif
win32.hInstance = hInstance;
idStr::Copynz( sys_cmdline, lpCmdLine, sizeof( sys_cmdline ) );