ReactOS  0.4.15-dev-3299-gbe8e5fc
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"
 
int perfect
 

Function Documentation

◆ AccessViolation()

void AccessViolation ( PLONG  BlackHole,
PLONG  BadAddress 
)

Definition at line 17 of file seh0013.c.

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

Referenced by main().

◆ main()

int main ( void  )

Definition at line 22 of file seh0013.c.

22  {
23  PLONG BadAddress;
24  PCHAR BadByte;
25  PLONG BlackHole;
26  ULONG Index2 = 1;
27  LONG Counter;
28 
29  BadAddress = (PLONG)((PVOID)0);
30  BadByte = (PCHAR)((PVOID)0);
31  BadByte += 1;
32  BlackHole = &Counter;
33 
34  Counter = 0;
35 
36  try {
37  AccessViolation(BlackHole, BadAddress);
38  }
40  /*
41  * exception handler should gete executed
42  * setting Counter to 1
43  */
44  {
45  Counter += 1;
46  try {
48  }
50  /* exception handler should get executed */
51  {
52  if (Counter != 1) {
53  printf("TEST 13 FAILED. Counter = %d\n\r", Counter);
54  return -1;
55  }
56  /* set's counter to 2 */
57  Counter += 1;
58  }
59  endtry
60  }
61  endtry
62 
63  if (Counter != 2) {
64  printf("TEST 13 FAILED. Counter= %d\n\r", Counter);
65  return -1;
66  }
67 
68  return 0;
69 }
signed char * PCHAR
Definition: retypes.h:7
void AccessViolation(PLONG BlackHole, PLONG BadAddress)
Definition: seh0013.c:17
#define endtry
Definition: seh.h:24
long LONG
Definition: pedump.c:60
#define PCHAR
Definition: match.c:90
void rtlRaiseException(DWORD Status)
Definition: seh0013.c:12
#define except(x)
Definition: btrfs_drv.h:139
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
static LARGE_INTEGER Counter
Definition: clock.c:43
unsigned int ULONG
Definition: retypes.h:1
#define GetExceptionCode()
Definition: seh.h:27
signed int * PLONG
Definition: retypes.h:5
#define printf
Definition: config.h:203

◆ rtlRaiseException()

void rtlRaiseException ( DWORD  Status)

Definition at line 12 of file seh0013.c.

12  {
13  RaiseException(Status, 0, /*no flags*/ 0, 0);
14  return;
15 }
Status
Definition: gdiplustypes.h:24
VOID WINAPI RaiseException(IN DWORD dwExceptionCode, IN DWORD dwExceptionFlags, IN DWORD nNumberOfArguments, IN CONST ULONG_PTR *lpArguments OPTIONAL)
Definition: except.c:700

Referenced by main().

Variable Documentation

◆ perfect

int perfect

Definition at line 10 of file seh0013.c.

◆ test

char test[] = "SEH0013.c"

Definition at line 9 of file seh0013.c.