ReactOS  0.4.15-dev-2701-g34593d9
seh0018.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[] = "SEH0018.c";
9 int perfect;
10 
12  RaiseException(Status, 0, /*no flags*/ 0, 0);
13  return;
14 }
15 
17  try {
18  try {
20  }
21  except((((DWORD)GetExceptionCode()) == Status) ? 1 : 0)
22  /* exeption handler should get executed */
23  {
24  /* set counter = 2 */
25  *Counter += 1;
26  return;
27  }
28  endtry
29  }
30  finally {
31  /* set counter = 3 */
32  *Counter += 1;
33  }
34  endtry
35 
36  return;
37 }
38 
39 int main() {
40 
41  LONG Counter;
42 
43  Counter = 0;
44 
45  try {
46  /* set counter = 1 */
47  Counter += 1;
49  }
50  finally {
51  /* set counter = 4 */
52  Counter += 1;
53  }
54  endtry
55 
56  if (Counter != 4) {
57  printf("TEST 18 FAILED. Counter = %d\n\r", Counter);
58  return -1;
59  }
60 
61  return 0;
62 }
int main()
Definition: seh0018.c:39
void eret(DWORD Status, PLONG Counter)
Definition: seh0018.c:16
#define endtry
Definition: seh.h:24
#define EXCEPTION_ACCESS_VIOLATION
Definition: winbase.h:308
int perfect
Definition: seh0018.c:9
char test[]
Definition: seh0018.c:8
long LONG
Definition: pedump.c:60
Status
Definition: gdiplustypes.h:24
unsigned long DWORD
Definition: ntddk_ex.h:95
#define except(x)
Definition: btrfs_drv.h:139
VOID WINAPI RaiseException(IN DWORD dwExceptionCode, IN DWORD dwExceptionFlags, IN DWORD nNumberOfArguments, IN CONST ULONG_PTR *lpArguments OPTIONAL)
Definition: except.c:700
void rtlRaiseException(DWORD Status)
Definition: seh0018.c:11
static LARGE_INTEGER Counter
Definition: clock.c:43
#define GetExceptionCode()
Definition: seh.h:27
signed int * PLONG
Definition: retypes.h:5
#define printf
Definition: config.h:203