From Oleg Kostenko:
[obnox/wireshark/wip.git] / epan / except.c
index 692127fa16f752cc9376de3e77e598df25960243..103f6e94e2db4d7ae9feb9bfff12637ba47f5f67 100644 (file)
 #include <limits.h>
 #include "except.h"
 
+#ifdef _WIN32
+/* IsDebuggerPresent() needs this #define! */
+#define _WIN32_WINNT 0x0400
+#include <windows.h>
+#include "exceptions.h"
+#endif
+
 #define XCEPT_BUFFER_SIZE      1024
 
 #ifdef KAZLIB_RCSID
@@ -268,6 +275,12 @@ void except_throw(long group, long code, const char *msg)
     except.except_message = msg;
     except.except_dyndata = 0;
 
+#ifdef _WIN32
+    if (code == DissectorError && IsDebuggerPresent()) {
+        DebugBreak();
+    }
+#endif
+
     do_throw(&except);
 }