ReactOS 0.4.15-dev-7924-g5949c20
seh0009.c File Reference
#include <windows.h>
#include "seh.h"
Include dependency graph for seh0009.c:

Go to the source code of this file.

Functions

void AccessViolation (PLONG BlackHole, PLONG BadAddress)
 
int main ()
 

Variables

char test [] = "SEH0009.c"
 

Function Documentation

◆ AccessViolation()

void AccessViolation ( PLONG  BlackHole,
PLONG  BadAddress 
)

Definition at line 10 of file seh0009.c.

10 {
11 *BlackHole += *BadAddress;
12 return;
13}

Referenced by main().

◆ main()

int main ( void  )

Definition at line 15 of file seh0009.c.

15 {
16 PLONG BadAddress;
17 PLONG BlackHole;
19
20 BadAddress = (PLONG)((PVOID)0);
21 BlackHole = &Counter;
22
23 Counter = 0;
24
25 try {
26 Counter += 1;
27 AccessViolation(BlackHole, BadAddress);
28 }
30 /*
31 * should be ACCESS VIOLATOIN 0xC0000005L) causing
32 * execution of handler
33 */
34 {
35 Counter += 1;
36 }
37 endtry
38
39 if (Counter != 2) {
40 printf("TEST 9 FAILED. Counter = %d\n\r", Counter);
41 return -1;
42 }
43
44 return 0;
45}
#define except(x)
Definition: btrfs_drv.h:136
#define printf
Definition: freeldr.h:93
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
long LONG
Definition: pedump.c:60
void AccessViolation(PLONG BlackHole, PLONG BadAddress)
Definition: seh0009.c:10
#define endtry
Definition: seh.h:24
#define GetExceptionCode()
Definition: seh.h:27
static LARGE_INTEGER Counter
Definition: clock.c:43
int32_t * PLONG
Definition: typedefs.h:58

Variable Documentation

◆ test

char test[] = "SEH0009.c"

Definition at line 8 of file seh0009.c.