ReactOS 0.4.15-dev-7958-gcd0bb1a
seh0024.c File Reference
#include <windows.h>
#include <setjmp.h>
#include "seh.h"
Include dependency graph for seh0024.c:

Go to the source code of this file.

Macros

#define faill()
 
#define startest()
 
#define finish()
 

Functions

int main ()
 

Variables

char test [] = "SEH0024.c"
 

Macro Definition Documentation

◆ faill

#define faill ( )

Definition at line 13 of file seh0024.c.

◆ finish

#define finish ( )

Definition at line 15 of file seh0024.c.

◆ startest

#define startest ( )

Definition at line 14 of file seh0024.c.

Function Documentation

◆ main()

int main ( void  )

Definition at line 21 of file seh0024.c.

21 {
22 jmp_buf JumpBuffer;
24
25 Counter = 0;
26
27#if defined(_M_MRX000) || defined(_M_PPC) || defined(_ALPHA)
28 if (setjmp(JumpBuffer) == 0)
29#else
30 if (_setjmp(JumpBuffer) == 0)
31#endif
32
33 {
34 try {
35 try {
36 try {
37 try {
38 /* set counter = 1 */
39 //(volatile LONG) Counter += 1;
40 *(volatile LONG*)&Counter += 1;
41 RaiseException(EXCEPTION_INT_OVERFLOW, 0, /*no flags*/ 0, 0);
42 }
43 finally {
44 /* set counter = 2 */
45 //(volatile LONG) Counter += 1;
46 *(volatile LONG*)&Counter += 1;
47 }
48 endtry
49 }
50 finally {
51 /* set counter = 3 */
52 //(volatile LONG) Counter += 1;
53 *(volatile LONG*)&Counter += 1;
54 /* end unwinding wiht long jump */
55 longjmp(JumpBuffer, 1);
56 }
57 endtry
58 }
59 finally {
60 /* never gets here due to longjump ending unwinding */
61 //(volatile LONG) Counter += 1;
62 *(volatile LONG*)&Counter += 1;
63 }
64 endtry
65 }
66 except(1)
67 /* handle exception after unwinding */
68 {
69 /* sets counter = 4 */
70 //(volatile LONG) Counter += 1;
71 *(volatile LONG*)&Counter += 1;
72 }
73 endtry
74 } else {
75 /* sets counter = 5 */
76 //(volatile LONG) Counter += 1;
77 *(volatile LONG*)&Counter += 1;
78 }
79
80 if (Counter != 5) {
81 printf("TEST 24 FAILED. Counter = %d\n\r", Counter);
82 return -1;
83 }
84
85 return 0;
86}
#define except(x)
Definition: btrfs_drv.h:136
#define setjmp
Definition: setjmp.h:209
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:186
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
#define printf
Definition: freeldr.h:97
long LONG
Definition: pedump.c:60
#define endtry
Definition: seh.h:24
static LARGE_INTEGER Counter
Definition: clock.c:43
#define EXCEPTION_INT_OVERFLOW
Definition: winbase.h:324

Variable Documentation

◆ test

char test[] = "SEH0024.c"

Definition at line 19 of file seh0024.c.