ReactOS  0.4.15-dev-4920-g5fa8403
seh0028.c File Reference
#include <windows.h>
#include "seh.h"
Include dependency graph for seh0028.c:

Go to the source code of this file.

Functions

void addtwo (long First, long Second, long *Place)
 
int main ()
 

Variables

char test [] = "SEH0028.c"
 

Function Documentation

◆ addtwo()

void addtwo ( long  First,
long  Second,
long Place 
)

Definition at line 10 of file seh0028.c.

10  {
11  RaiseException(EXCEPTION_INT_OVERFLOW, 0, /*no flags*/ 0, 0);
12  /* not executed due to exception being raised */
13  *Place = First + Second;
14  return;
15 }
WCHAR Second[]
Definition: FormatMessage.c:12
#define EXCEPTION_INT_OVERFLOW
Definition: winbase.h:321
WCHAR First[]
Definition: FormatMessage.c:11
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().

◆ main()

int main ( void  )

Definition at line 17 of file seh0028.c.

17  {
18  LONG Counter;
19 
20  Counter = 0;
21 
22  try {
23  /* set counter = 1 */
24  Counter += 1;
25  addtwo(0x7fff0000, 0x10000, &Counter);
26  }
28  /* 1==EXECUTE HANDLER after unwinding */
29  {
30  /* set counter = 2 */
31  Counter += 1;
32  }
33  endtry
34 
35  if (Counter != 2) {
36  printf("TEST 28 FAILED. Counter = %d\n\r", Counter);
37  return -1;
38  }
39 
40  return 0;
41 }
#define endtry
Definition: seh.h:24
#define STATUS_INTEGER_OVERFLOW
Definition: ntstatus.h:385
long LONG
Definition: pedump.c:60
#define printf
Definition: freeldr.h:94
void addtwo(long First, long Second, long *Place)
Definition: seh0028.c:10
#define except(x)
Definition: btrfs_drv.h:136
static LARGE_INTEGER Counter
Definition: clock.c:43
#define GetExceptionCode()
Definition: seh.h:27

Variable Documentation

◆ test

char test[] = "SEH0028.c"

Definition at line 8 of file seh0028.c.