ReactOS 0.4.15-dev-7953-g1f49173
seh0005.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[] = "SEH0005.c";
9
10int main() {
11 PLONG BadAddress;
12 PLONG BlackHole;
14
15 BadAddress = (PLONG)((PVOID)0);
16 BlackHole = &Counter;
17
18 Counter = 0;
19
20 try {
21 Counter += 1;
22 *BlackHole += *BadAddress;
23 }
25 /* counter == 1 (EXECUTE HANDLER) */
26 {
27 Counter += 1;
28 }
29 endtry
30
31 if (Counter != 2) {
32 printf("TEST 5 FAILED. Counter = %d\n\r", Counter);
33 return -1;
34 }
35
36 return 0;
37}
#define except(x)
Definition: btrfs_drv.h:136
#define printf
Definition: freeldr.h:97
long LONG
Definition: pedump.c:60
char test[]
Definition: seh0005.c:8
int main()
Definition: seh0005.c:10
#define endtry
Definition: seh.h:24
static LARGE_INTEGER Counter
Definition: clock.c:43
int32_t * PLONG
Definition: typedefs.h:58