Skip to content

Commit

Permalink
EXCEPTION_EXECUTE_HANDLER?
Browse files Browse the repository at this point in the history
  • Loading branch information
user95401 committed Apr 6, 2024
1 parent 14a5a07 commit 44d22a3
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions src/_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,8 @@ BOOL WINAPI ConsoleHandler(DWORD CEvent) {
auto iAlreadyWas = false;

LONG WINAPI VectoredExceptionHandler(_EXCEPTION_POINTERS* pExceptInfo) {
if(iAlreadyWas) {
log::error("{}, its me, im already was called so i return EXCEPTION_EXECUTE_HANDLER", __FUNCTION__);
return EXCEPTION_EXECUTE_HANDLER;//hl shed
}
else iAlreadyWas = true;
//save game
SaveMethods();
//error msg
DWORD exc_code = pExceptInfo->ExceptionRecord->ExceptionCode;
bool dontCare = false;
//msg text
std::stringstream buffer;
buffer << "Was received fatal exception: ";
switch (exc_code) {
case DBG_PRINTEXCEPTION_WIDE_C:
buffer << "DBG_PRINTEXCEPTION_WIDE_C";
dontCare = true;
break;
case DBG_PRINTEXCEPTION_C:
buffer << "DBG_PRINTEXCEPTION_C";
dontCare = true;
break;
default:
buffer << "0x" << std::hex << exc_code;
break;
}
log::warn("{}", buffer.str());
//msg text makeup end
if (dontCare) {
iAlreadyWas = false;
return EXCEPTION_CONTINUE_EXECUTION;//came from 2.2 pc gdps... idk if needs here
}
return EXCEPTION_CONTINUE_SEARCH;
return EXCEPTION_EXECUTE_HANDLER;
}

$on_mod(Loaded) {
Expand Down

0 comments on commit 44d22a3

Please sign in to comment.