Skip to content

Commit cadaf9c

Browse files
committed
Use SetUnhandledExceptionFilter for the entire process
1 parent 3580323 commit cadaf9c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

GeneralsMD/Code/Main/WinMain.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,15 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin
751751
// Necessary to allow memory managers and such to have useful critical sections
752752
static CriticalSection critSec1, critSec2, critSec3, critSec4, critSec5;
753753

754+
// UnHandledExceptionFilter ===================================================
755+
/** Handler for unhandled win32 exceptions. */
756+
//=============================================================================
757+
static LONG WINAPI UnHandledExceptionFilter(struct _EXCEPTION_POINTERS* e_info)
758+
{
759+
DumpExceptionInfo(e_info);
760+
return EXCEPTION_EXECUTE_HANDLER;
761+
}
762+
754763
// WinMain ====================================================================
755764
/** Application entry point */
756765
//=============================================================================
@@ -765,7 +774,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
765774

766775
try {
767776

768-
_set_se_translator( DumpExceptionInfo ); // Hook that allows stack trace.
777+
SetUnhandledExceptionFilter( UnHandledExceptionFilter );
769778
//
770779
// there is something about checkin in and out the .dsp and .dsw files
771780
// that blows the working directory information away on each of the

0 commit comments

Comments
 (0)