Show full exception message in error message box for managed exceptions

This commit is contained in:
2023-09-28 00:24:44 +03:00
parent 44292efa04
commit bcccb71373
3 changed files with 21 additions and 13 deletions

View File

@@ -30,6 +30,9 @@
#endif
#include "resource.h"
#define CLR_EXCEPTION 0xE0434352
#define VCPP_EXCEPTION 0xE06D7363
const Char* WindowsPlatform::ApplicationWindowClass = TEXT("FlaxWindow");
void* WindowsPlatform::Instance = nullptr;
@@ -272,6 +275,12 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LONG CALLBACK SehExceptionHandler(EXCEPTION_POINTERS* ep)
{
if (ep->ExceptionRecord->ExceptionCode == CLR_EXCEPTION)
{
// Pass CLR exceptions back to runtime
return EXCEPTION_CONTINUE_SEARCH;
}
// Skip if engine already crashed
if (Globals::FatalErrorOccurred)
return EXCEPTION_CONTINUE_SEARCH;