Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unity3.5 360 #24

Merged
merged 2 commits into from

2 participants

@larus
Collaborator

Explicitly call a handler for unhandled exceptions. Needed when top-level exception handler are not allowed like in certain browsers.

larus added some commits
@larus larus Expose the seh exception handler function and add a way to make monoe…
…xplicitly call a handler for unhandled exceptions. Needed when top-level exception handler are not allowed like in certain browsers.
65782e0
@larus larus declare exception handler variable as external 67de1a9
@Tak Tak merged commit f3e12d9 into from
@Tak
Owner

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2012
  1. @larus

    Expose the seh exception handler function and add a way to make monoe…

    larus authored
    …xplicitly call a handler for unhandled exceptions. Needed when top-level exception handler are not allowed like in certain browsers.
Commits on Apr 12, 2012
  1. @larus
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 1 deletion.
  1. +8 −1 mono/mini/mini-windows.c
  2. +3 −0  msvc/mono.def
  3. +13 −0 unity/unity_utils.c
View
9 mono/mini/mini-windows.c
@@ -50,9 +50,10 @@
#include "jit-icalls.h"
-extern LPTOP_LEVEL_EXCEPTION_FILTER old_win32_toplevel_exception_filter;
+extern LPTOP_LEVEL_EXCEPTION_FILTER old_win32_toplevel_exception_filter;
extern guint64 win32_chained_exception_filter_result;
extern gboolean win32_chained_exception_filter_didrun;
+extern int (*gUnhandledExceptionHandler)(EXCEPTION_POINTERS*);
void
mono_runtime_install_handlers (void)
@@ -89,6 +90,12 @@ SIG_HANDLER_SIGNATURE (mono_chain_signal)
win32_chained_exception_filter_result = (*old_win32_toplevel_exception_filter)(info);
return TRUE;
}
+ if (gUnhandledExceptionHandler)
+ {
+ win32_chained_exception_filter_didrun = TRUE;
+ win32_chained_exception_filter_result = (*gUnhandledExceptionHandler)(info);
+ return TRUE;
+ }
return FALSE;
}
View
3  msvc/mono.def
@@ -31,6 +31,9 @@ mono_unity_socket_security_enabled_set
mono_set_ignore_version_and_key_when_finding_assemblies_already_loaded
mono_class_is_generic
mono_class_is_inflated
+mono_unity_seh_handler
+mono_unity_set_unhandled_exception_handler
+
;Exports that should have been here, but I dont understand why they're not.
mono_security_enable_core_clr
mono_security_set_mode
View
13 unity/unity_utils.c
@@ -62,6 +62,19 @@ FILE* unity_fopen( const char *name, const char *mode )
return _wfopen( wideName, wideMode );
}
+LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep);
+LONG mono_unity_seh_handler(EXCEPTION_POINTERS* ep)
+{
+ return seh_handler(ep);
+}
+
+int (*gUnhandledExceptionHandler)(EXCEPTION_POINTERS*) = NULL;
+
+void mono_unity_set_unhandled_exception_handler(void* handler)
+{
+ gUnhandledExceptionHandler = handler;
+}
+
#endif //Win32
GString* gEmbeddingHostName = 0;
Something went wrong with that request. Please try again.