ReactOS 0.4.15-dev-7931-gfd331f1
seh0021.c File Reference
#include <windows.h>
#include <setjmp.h>
#include "seh.h"
Include dependency graph for seh0021.c:

Go to the source code of this file.

Functions

int main ()
 

Variables

char test [] = "SEH0021.c"
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 11 of file seh0021.c.

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

Variable Documentation

◆ test

char test[] = "SEH0021.c"

Definition at line 9 of file seh0021.c.