ReactOS 0.4.16-dev-329-g9223134
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"
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 11 of file seh0022.c.

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

Variable Documentation

◆ test

char test[] = "SEH0022.c"

Definition at line 9 of file seh0022.c.