9#pragma warning(disable : 4532)
10#pragma warning(disable : 4702)
19#define NEST_IN_FINALLY
23#define EXCEPTION_NESTED_CALL 0x10
24#define RtlRaiseStatus(x) RaiseException((x), 0, 0, NULL)
25#define RtlRaiseException(x) \
26 RaiseException((x)->ExceptionCode, (x)->ExceptionFlags, \
27 (x)->NumberParameters, (x)->ExceptionInformation)
30#if !(defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_PPC) || \
31 defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64))
35#define except __except
36#define finally __finally
41#define WIN32_LEAN_AND_MEAN
44#if defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_PPC) || \
45 defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64)
54#if !defined(STATUS_SUCCESS)
55#define STATUS_SUCCESS 0
57#if !defined(STATUS_UNSUCCESSFUL)
58#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L)
115 printf(
"filter entered...");
120#pragma warning(disable : 4532)
542 finally {
printf(
"finally 2..."); }
577 volatile char *AvPtr =
NULL;
580 __try { *AvPtr =
'\0'; }
594 *(
volatile int *)0 = 0;
608 printf(
"something failed!\n");
617 printf(
"how did you get here?\n");
675 volatile int *Fault = 0;
702 volatile int *Fault = 0;
752 volatile int *Fault = 0;
808 volatile int *Fault = 0;
896 volatile int *Fault = 0;
944 printf(
"Start of exception test\n");
1052 *BlackHole += *BadAddress;
1104 *BlackHole += *BadAddress;
1156 foo2(BlackHole, BadAddress);
1262 foo2(BlackHole, BadAddress);
1451 if (
setjmp(JumpBuffer) == 0) {
1453 longjmp(JumpBuffer, 1);
1473 if (
setjmp(JumpBuffer) == 0) {
1479 longjmp(JumpBuffer, 1);
1501 if (
setjmp(JumpBuffer) == 0) {
1512 longjmp(JumpBuffer, 1);
1532 if (
setjmp(JumpBuffer) == 0) {
1540 longjmp(JumpBuffer, 1);
1566 if (
setjmp(JumpBuffer) == 0) {
1578 longjmp(JumpBuffer, 1);
1604 if (
setjmp(JumpBuffer) == 0) {
1636 if (
setjmp(JumpBuffer) == 0) {
1648 longjmp(JumpBuffer, 1);
1714#if !defined(i386) && !defined(_M_IA64) && !defined(_M_AMD64) && \
1715 !defined(_M_ARM) && !defined(_M_ARM64)
1742 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1744 if ((Index1 & 0x1) == 0) {
1770 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1772 if ((Index1 & 0x1) == 0) {
1799 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1802 if ((Index1 & 0x1) == 0) {
1832 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1835 if ((Index1 & 0x1) == 0) {
1864 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1866 if ((Index1 & 0x1) == 0) {
1891 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1894 if ((Index1 & 0x1) == 0) {
1923 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1926 if ((Index1 & 0x1) == 0) {
1956 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1958 if ((Index1 & 0x1) == 1) {
1984 for (Index1 = 0; Index1 < 10; Index1 += 1) {
1986 if ((Index1 & 0x1) == 1) {
2013 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2016 if ((Index1 & 0x1) == 1) {
2046 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2049 if ((Index1 & 0x1) == 1) {
2078 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2080 if ((Index1 & 0x1) == 1) {
2105 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2108 if ((Index1 & 0x1) == 1) {
2137 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2140 if ((Index1 & 0x1) == 1) {
2178 if ((Index1 & 0x1) == 1) {
2213 if ((Index1 & 0x1) == 1) {
2249 if ((Index1 & 0x1) == 1) {
2288 if ((Index1 & 0x1) == 1) {
2325 if ((Index1 & 0x1) == 1) {
2359 if ((Index1 & 0x1) == 1) {
2397 if ((Index1 & 0x1) == 1) {
2456 for (Index1 = 0; Index1 < 10; Index1 += 1) {
2457 if (
Echo(Index1) == Index1) {
2657#if !defined(NEST_IN_FINALLY)
2744#if !defined(NEST_IN_FINALLY)
2767#if defined(i386) || defined(_M_IA64) || defined(_M_ALPHA) || defined(_M_AMD64)
2874 *BlackHole += *BadAddress;
2897 *BlackHole += *BadAddress;
2902 *BlackHole += *BadAddress;
2923 *BlackHole += *BadAddress;
2936 *BlackHole += *BadAddress;
2985#if defined(_AMD64_) || defined(_X86_)
3128 printf(
" test69...filter entered...succeeded\n");
3129 printf(
" test70...filter entered...succeeded\n");
3130 printf(
" test71...filter entered...succeeded\n");
3131 printf(
" test72...filter entered...succeeded\n");
3132 printf(
" test73...filter entered...succeeded\n");
3133 printf(
" test74...filter entered...succeeded\n");
3134 printf(
" test75...filter entered...succeeded\n");
3135 printf(
" test76...filter entered...succeeded\n");
3136 printf(
" test77...filter entered...succeeded\n");
3137 printf(
" test78...filter entered...succeeded\n");
3142 printf(
"filter 1...filter 2...finally 1...filter 1...filter 2...finally "
3251 printf(
"End of exception test\n");
3255#pragma optimize("a", off)
3264#pragma optimize("", on)
3286 foo2(BlackHole, BadAddress);
3313 longjmp(JumpBuffer, 1);
3414 *BlackHole += *BadAddress;
3444#if defined(NEST_IN_FINALLY)
__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _controlfp(_In_ unsigned int unNew, _In_ unsigned int unMask)
__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _clearfp(void)
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
unsigned int __cdecl _control87(unsigned int, unsigned int)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
#define DECLSPEC_NOINLINE
#define STATUS_ACCESS_VIOLATION
#define STATUS_DATATYPE_MISALIGNMENT
#define STATUS_INTEGER_OVERFLOW
#define AbnormalTermination()
#define GetExceptionInformation()
#define GetExceptionCode()
DWORD WINAPI GetVersion()
#define abnormal_termination
struct _EXCEPTION_RECORD * ExceptionRecord
static LARGE_INTEGER Counter
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
VOID Test79(PLONG Counter, PLONG Fault)
VOID PgTest72(IN PLONG State, IN PLONG Fault)
VOID addtwo(IN LONG First, IN LONG Second, IN PLONG Place)
VOID PgTest75(IN PLONG State, IN PLONG Fault)
VOID except1(IN PLONG Counter)
VOID PgTest76(IN PLONG State, IN PLONG Fault)
VOID dojump(IN jmp_buf JumpBuffer, IN PLONG Counter)
DECLSPEC_NOINLINE VOID Test86(_Inout_ PLONG Counter)
VOID Test82(__inout PLONG Counter)
ULONG except3(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter)
VOID eret(IN NTSTATUS Status, IN PLONG Counter)
VOID foo2(IN PLONG BlackHole, IN PLONG BadAddress)
VOID fret(IN PLONG Counter)
VOID Test87(_Inout_ PLONG Counter)
void Test81(int *pCounter)
VOID PgTest78(IN PLONG State, IN PLONG Fault)
VOID bar2(IN PLONG BlackHole, IN PLONG BadAddress, IN PLONG Counter)
#define STATUS_UNSUCCESSFUL
VOID PgTest70(IN PLONG State, IN PLONG Fault)
VOID PgTest74(IN PLONG State, IN PLONG Fault)
VOID PgTest71(IN PLONG State, IN PLONG Fault)
DECLSPEC_NOINLINE ULONG PgFilter(VOID)
VOID foo1(IN NTSTATUS Status)
ULONG except2(IN PEXCEPTION_POINTERS ExceptionPointers, IN PLONG Counter)
DECLSPEC_NOINLINE VOID Test84(_Inout_ PLONG Counter)
DECLSPEC_NOINLINE VOID Test82Foo(VOID)
DECLSPEC_NOINLINE LONG Test85(_Inout_ PLONG Counter)
VOID PgTest77(IN PLONG State, IN PLONG Fault)
VOID PgTest73(IN PLONG State, IN PLONG Fault)
VOID bar1(IN NTSTATUS Status, IN PLONG Counter)
VOID Test61Part2(IN OUT PULONG Counter)
VOID Test88(_Inout_ PLONG Counter)
VOID PgTest69(IN PLONG State, IN PLONG Fault)
double SquareDouble(IN double op)
#define EXCEPTION_NESTED_CALL