ReactOS  0.4.15-dev-5089-g555bec6
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"
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 11 of file seh0023.c.

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

Variable Documentation

◆ test

char test[] = "SEH0023.c"

Definition at line 9 of file seh0023.c.