ReactOS 0.4.16-dev-122-g325d74c
seh0013.c File Reference
#include <setjmp.h>
#include <windows.h>
#include "seh.h"
Include dependency graph for seh0013.c:

Go to the source code of this file.

Functions

void rtlRaiseException (DWORD Status)
 
void AccessViolation (PLONG BlackHole, PLONG BadAddress)
 
int main ()
 

Variables

char test [] = "SEH0013.c"
 

Function Documentation

◆ AccessViolation()

void AccessViolation ( PLONG  BlackHole,
PLONG  BadAddress 
)

Definition at line 16 of file seh0013.c.

16 {
17 *BlackHole += *BadAddress;
18 return;
19}

Referenced by main().

◆ main()

int main ( void  )

Definition at line 21 of file seh0013.c.

21 {
22 PLONG BadAddress;
23 PCHAR BadByte;
24 PLONG BlackHole;
25 ULONG Index2 = 1;
27
28 BadAddress = (PLONG)((PVOID)0);
29 BadByte = (PCHAR)((PVOID)0);
30 BadByte += 1;
31 BlackHole = &Counter;
32
33 Counter = 0;
34
35 try {
36 AccessViolation(BlackHole, BadAddress);
37 }
39 /*
40 * exception handler should gete executed
41 * setting Counter to 1
42 */
43 {
44 Counter += 1;
45 try {
47 }
49 /* exception handler should get executed */
50 {
51 if (Counter != 1) {
52 printf("TEST 13 FAILED. Counter = %d\n\r", Counter);
53 return -1;
54 }
55 /* set's counter to 2 */
56 Counter += 1;
57 }
58 endtry
59 }
60 endtry
61
62 if (Counter != 2) {
63 printf("TEST 13 FAILED. Counter= %d\n\r", Counter);
64 return -1;
65 }
66
67 return 0;
68}
#define except(x)
Definition: btrfs_drv.h:136
#define printf
Definition: freeldr.h:97
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
#define PCHAR
Definition: match.c:90
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
long LONG
Definition: pedump.c:60
void rtlRaiseException(DWORD Status)
Definition: seh0013.c:11
void AccessViolation(PLONG BlackHole, PLONG BadAddress)
Definition: seh0013.c:16
#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
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51

◆ rtlRaiseException()

void rtlRaiseException ( DWORD  Status)

Definition at line 11 of file seh0013.c.

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

Referenced by main().

Variable Documentation

◆ test

char test[] = "SEH0013.c"

Definition at line 9 of file seh0013.c.