ReactOS  0.4.15-dev-2701-g34593d9
seh0010.c
Go to the documentation of this file.
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for
3 // full license information.
4 
5 #include <windows.h>
6 #include "seh.h"
7 
8 char test[] = "SEH0010.c";
9 int perfect;
10 
12  RaiseException(Status, 0, /*no flags*/ 0, 0);
13  return;
14 }
15 
17  try {
19  }
20  finally {
21  if (abnormal_termination() != 0)
22  /*
23  * not abnormal termination
24  * counter should eqaul 99
25  */
26  {
27  *Counter = 99;
28  } else {
29  *Counter = 100;
30  }
31  }
32  endtry
33  return;
34 }
35 
36 int main() {
37  LONG Counter;
38 
39  Counter = 0;
40 
41  try {
43  }
45  /* exception raised was 0xC0000005L, and execute handler */
46  {
47  Counter -= 1;
48  }
49  endtry
50 
51  if (Counter != 98) {
52  printf("TEST 10 FAILED. Counter = %d\n\r", Counter);
53  return -1;
54  }
55 
56  return 0;
57 }
#define endtry
Definition: seh.h:24
void rtlRaiseExcpt(DWORD Status)
Definition: seh0010.c:11
long LONG
Definition: pedump.c:60
Status
Definition: gdiplustypes.h:24
unsigned long DWORD
Definition: ntddk_ex.h:95
int main()
Definition: seh0010.c:36
#define except(x)
Definition: btrfs_drv.h:139
char test[]
Definition: seh0010.c:8
void tfRaiseExcpt(DWORD Status, PLONG Counter)
Definition: seh0010.c:16
VOID WINAPI RaiseException(IN DWORD dwExceptionCode, IN DWORD dwExceptionFlags, IN DWORD nNumberOfArguments, IN CONST ULONG_PTR *lpArguments OPTIONAL)
Definition: except.c:700
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
int perfect
Definition: seh0010.c:9
static LARGE_INTEGER Counter
Definition: clock.c:43
#define GetExceptionCode()
Definition: seh.h:27
signed int * PLONG
Definition: retypes.h:5
#define abnormal_termination
Definition: seh.h:25
#define printf
Definition: config.h:203