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

Go to the source code of this file.

Functions

int main ()
 

Variables

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

Function Documentation

◆ main()

int main ( void  )

Definition at line 12 of file seh0022.c.

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

◆ test

char test[] = "SEH0022.c"

Definition at line 9 of file seh0022.c.