ReactOS  0.4.15-dev-3299-gbe8e5fc
seh0023.c File Reference
#include <windows.h>
#include <setjmp.h>
#include "seh.h"
Include dependency graph for seh0023.c:

Go to the source code of this file.

Functions

int main ()
 

Variables

char test [] = "SEH0023.c"
 
int perfect
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 12 of file seh0023.c.

12  {
13  jmp_buf JumpBuffer;
14  LONG Counter;
15 
16  Counter = 0;
17 
18  if (_setjmp(JumpBuffer) == 0) {
19  try {
20  try {
21  /* set counter = 1 */
22  *(volatile LONG*)&Counter += 1;
23  RaiseException(EXCEPTION_INT_OVERFLOW, 0, /*no flags*/ 0, 0);
24  }
25  finally {
26  /* set counter = 2 */
27  *(volatile LONG*)&Counter += 1;
28  longjmp(JumpBuffer, 1);
29  }
30  endtry
31  }
32  except(1)
33  /* should never get here */
34  {
35  *(volatile LONG*)&Counter += 1;
36  }
37  endtry
38  } else {
39  /* set counter = 3 */
40  *(volatile LONG*)&Counter += 1;
41  }
42 
43  if (Counter != 3) {
44  printf("TEST 23 FAILED. Counter = %d\n\r", Counter);
45  return -1;
46  }
47 
48  return 0;
49 }
#define endtry
Definition: seh.h:24
#define EXCEPTION_INT_OVERFLOW
Definition: winbase.h:321
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 10 of file seh0023.c.

◆ test

char test[] = "SEH0023.c"

Definition at line 9 of file seh0023.c.