ReactOS  0.4.15-dev-3187-ge372f2b
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"
 
int perfect
 

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 22 of file seh0024.c.

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

Variable Documentation

◆ perfect

int perfect

Definition at line 20 of file seh0024.c.

◆ test

char test[] = "SEH0024.c"

Definition at line 19 of file seh0024.c.