ReactOS  0.4.15-dev-5112-g22d8c0f
seh0008.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[] = "SEH0008.c";
9 
11  RaiseException(Status, 0, /*no flags*/ 0, 0);
12  return;
13 }
14 
15 int main() {
16  LONG Counter;
17 
18  Counter = 0;
19 
20  try {
21  Counter += 1;
22  /* raise exception */
23  RaiseException(EXCEPTION_ACCESS_VIOLATION, 0, /*no flags*/ 0, 0);
24  }
26  /*
27  * if correct exeception (EXECIUTE HANDLER (1) else
28  * CONTINUE SEARCH (0)). this test should execute handler
29  */
30  {
31  Counter += 1;
32  }
33  endtry
34 
35  if (Counter != 2) {
36  printf("TEST 8 FAILED. Counter = %d\n\r", Counter);
37  return -1;
38  }
39 
40  return 0;
41 }
int main()
Definition: seh0008.c:15
#define endtry
Definition: seh.h:24
#define EXCEPTION_ACCESS_VIOLATION
Definition: winbase.h:308
char test[]
Definition: seh0008.c:8
long LONG
Definition: pedump.c:60
Status
Definition: gdiplustypes.h:24
#define printf
Definition: freeldr.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define except(x)
Definition: btrfs_drv.h:136
void rtlRaiseStatus(DWORD Status)
Definition: seh0008.c:10
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
static LARGE_INTEGER Counter
Definition: clock.c:43
#define GetExceptionCode()
Definition: seh.h:27