ReactOS 0.4.15-dev-7994-gb388cb6
seh0018.c File Reference
#include <windows.h>
#include "seh.h"
Include dependency graph for seh0018.c:

Go to the source code of this file.

Functions

void rtlRaiseException (DWORD Status)
 
void eret (DWORD Status, PLONG Counter)
 
int main ()
 

Variables

char test [] = "SEH0018.c"
 

Function Documentation

◆ eret()

void eret ( DWORD  Status,
PLONG  Counter 
)

Definition at line 15 of file seh0018.c.

15 {
16 try {
17 try {
19 }
20 except((((DWORD)GetExceptionCode()) == Status) ? 1 : 0)
21 /* exeption handler should get executed */
22 {
23 /* set counter = 2 */
24 *Counter += 1;
25 return;
26 }
27 endtry
28 }
29 finally {
30 /* set counter = 3 */
31 *Counter += 1;
32 }
33 endtry
34
35 return;
36}
#define except(x)
Definition: btrfs_drv.h:136
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
void rtlRaiseException(DWORD Status)
Definition: seh0018.c:10
#define endtry
Definition: seh.h:24
#define GetExceptionCode()
Definition: seh.h:27
static LARGE_INTEGER Counter
Definition: clock.c:43

Referenced by main().

◆ main()

int main ( void  )

Definition at line 38 of file seh0018.c.

38 {
39
41
42 Counter = 0;
43
44 try {
45 /* set counter = 1 */
46 Counter += 1;
48 }
49 finally {
50 /* set counter = 4 */
51 Counter += 1;
52 }
53 endtry
54
55 if (Counter != 4) {
56 printf("TEST 18 FAILED. Counter = %d\n\r", Counter);
57 return -1;
58 }
59
60 return 0;
61}
#define printf
Definition: freeldr.h:97
long LONG
Definition: pedump.c:60
void eret(DWORD Status, PLONG Counter)
Definition: seh0018.c:15
#define EXCEPTION_ACCESS_VIOLATION
Definition: winbase.h:311

◆ rtlRaiseException()

void rtlRaiseException ( DWORD  Status)

Definition at line 10 of file seh0018.c.

10 {
11 RaiseException(Status, 0, /*no flags*/ 0, 0);
12 return;
13}
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700

Referenced by eret().

Variable Documentation

◆ test

char test[] = "SEH0018.c"

Definition at line 8 of file seh0018.c.