diff options
Diffstat (limited to 'winsup/mingw/samples/seh/sehsub.c')
-rw-r--r-- | winsup/mingw/samples/seh/sehsub.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/winsup/mingw/samples/seh/sehsub.c b/winsup/mingw/samples/seh/sehsub.c index d2442850a..466b2e8e4 100644 --- a/winsup/mingw/samples/seh/sehsub.c +++ b/winsup/mingw/samples/seh/sehsub.c @@ -1,43 +1,43 @@ -/*
- * sehsub.c
- *
- * In an attempt to see what might be going on inside CRTDLL, this program
- * walks the exception list after creating a new thread with _beginthread.
- *
- * It turns out that _beginthread DOES install an exception handler, as
- * expected, but this handler is NOT exported by CRTDLL (it is certainly
- * not _except_handler2 or _XcptFilter)... an odd and unpleasant turn of
- * events.
- */
-
-#include <windows.h>
-#include <excpt.h>
-#include <process.h>
-
-#include "exutil.h"
-
-extern void* __imp__except_handler3;
-
-unsigned
-my_thread (void * p)
-{
- printf ("In my thread.\n");
- WalkExceptionHandlers();
- return 0;
-}
-
-main ()
-{
- unsigned long h;
- unsigned id;
- printf ("In main.\n");
- WalkExceptionHandlers();
-
- printf ("Except_handler3 %08x\n", __imp__except_handler3);
- h = _beginthreadex (NULL, 0, my_thread, NULL, 0, &id);
-
- WaitForSingleObject ((HANDLE) h, INFINITE);
- CloseHandle ((HANDLE) h);
- return;
-}
-
+/* + * sehsub.c + * + * In an attempt to see what might be going on inside CRTDLL, this program + * walks the exception list after creating a new thread with _beginthread. + * + * It turns out that _beginthread DOES install an exception handler, as + * expected, but this handler is NOT exported by CRTDLL (it is certainly + * not _except_handler2 or _XcptFilter)... an odd and unpleasant turn of + * events. + */ + +#include <windows.h> +#include <excpt.h> +#include <process.h> + +#include "exutil.h" + +extern void* __imp__except_handler3; + +unsigned +my_thread (void * p) +{ + printf ("In my thread.\n"); + WalkExceptionHandlers(); + return 0; +} + +main () +{ + unsigned long h; + unsigned id; + printf ("In main.\n"); + WalkExceptionHandlers(); + + printf ("Except_handler3 %08x\n", __imp__except_handler3); + h = _beginthreadex (NULL, 0, my_thread, NULL, 0, &id); + + WaitForSingleObject ((HANDLE) h, INFINITE); + CloseHandle ((HANDLE) h); + return; +} + |