2 * This program checks if the compiler/RTL does have correct support
3 * for structured exception handling
6 #include "test_config.h"
8 #if defined (ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS)
9 int ExFilter(EXCEPTION_POINTERS
*ep
, DWORD code_arg
)
11 ACE_DEBUG ((LM_INFO
,("In SEH Filter\n")));
12 ACE_DEBUG ((LM_INFO
,("Code param=%d\n"), code_arg
));
13 ACE_DEBUG ((LM_INFO
,("\tep->ExceptionRecord->ExceptionCode =%d\n"), ep
->ExceptionRecord
->ExceptionCode
));
14 ACE_DEBUG ((LM_INFO
,("\tep->ExceptionRecord->ExceptionAddress =%@\n"), ep
->ExceptionRecord
->ExceptionAddress
));
15 if (ep
->ExceptionRecord
->NumberParameters
>= 1)
16 ACE_DEBUG ((LM_INFO
,("\tep->ExceptionRecord->ExceptionInformation[0]=%@\n"), ep
->ExceptionRecord
->ExceptionInformation
[0]));
17 if (ep
->ExceptionRecord
->NumberParameters
== 2)
18 ACE_DEBUG ((LM_INFO
,("\tep->ExceptionRecord->ExceptionInformation[1]=%@\n"), ep
->ExceptionRecord
->ExceptionInformation
[1]));
24 volatile int* pInt
= 0x0000000;
28 #endif /* ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS */
31 run_main (int, ACE_TCHAR
*[])
33 ACE_START_TEST (ACE_TEXT("Compiler_Features_39_Test"));
35 #if defined (ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS)
36 ACE_DEBUG ((LM_DEBUG
,("Testing call SEH\n")));
42 ACE_SEH_EXCEPT (ExFilter(GetExceptionInformation(), GetExceptionCode()))
44 ACE_DEBUG ((LM_DEBUG
,("In SEH call\n")));
47 ACE_DEBUG ((LM_DEBUG
,("SEH call worked\n")));
49 ACE_DEBUG ((LM_DEBUG
,("Testing non-call SEH\n")));
53 volatile int* pInt
= 0x0000000;
56 ACE_SEH_EXCEPT (ExFilter(GetExceptionInformation(), GetExceptionCode()))
58 ACE_DEBUG ((LM_DEBUG
,("In SEH non-call\n")));
61 ACE_DEBUG ((LM_DEBUG
,("SEH non-call worked\n")));
64 ACE_TEXT ("Platform lacks ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS\n")));
65 #endif /* ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS */