ReactOS 0.4.16-dev-257-g6aa11ac
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
8char test[] = "SEH0010.c";
9
11 RaiseException(Status, 0, /*no flags*/ 0, 0);
12 return;
13}
14
16 try {
18 }
19 finally {
20 if (abnormal_termination() != 0)
21 /*
22 * not abnormal termination
23 * counter should eqaul 99
24 */
25 {
26 *Counter = 99;
27 } else {
28 *Counter = 100;
29 }
30 }
31 endtry
32 return;
33}
34
35int main() {
37
38 Counter = 0;
39
40 try {
42 }
44 /* exception raised was 0xC0000005L, and execute handler */
45 {
46 Counter -= 1;
47 }
48 endtry
49
50 if (Counter != 98) {
51 printf("TEST 10 FAILED. Counter = %d\n\r", Counter);
52 return -1;
53 }
54
55 return 0;
56}
#define except(x)
Definition: btrfs_drv.h:136
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
Status
Definition: gdiplustypes.h:25
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
long LONG
Definition: pedump.c:60
void tfRaiseExcpt(DWORD Status, PLONG Counter)
Definition: seh0010.c:15
void rtlRaiseExcpt(DWORD Status)
Definition: seh0010.c:10
char test[]
Definition: seh0010.c:8
int main()
Definition: seh0010.c:35
#define endtry
Definition: seh.h:24
#define GetExceptionCode()
Definition: seh.h:27
#define abnormal_termination
Definition: seh.h:25
static LARGE_INTEGER Counter
Definition: clock.c:43
int32_t * PLONG
Definition: typedefs.h:58