ReactOS
0.4.16-dev-329-g9223134
seh0007.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
[] =
"SEH0007.c"
;
9
10
int
main
() {
11
PLONG
BadAddress;
12
PLONG
BlackHole;
13
LONG
Counter
;
14
15
// startest();
16
17
BadAddress = (
PLONG
)((
PVOID
)0);
18
BlackHole = &
Counter
;
19
20
Counter
= 0;
21
try
{
22
try
{
23
Counter
+= 1;
24
*BlackHole += *BadAddress;
25
}
26
finally
{
27
if
(
abnormal_termination
() != 0)
28
/*
29
* should execute handler as not abnormal
30
* termination
31
*/
32
{
33
Counter
+= 1;
34
}
35
}
36
endtry
37
}
38
except
(
Counter
)
39
/* counter is positive == EXECUTE_HANDLER */
40
{
41
if
(
Counter
== 2)
42
/* counter should equal 2 and execute handler */
43
{
44
Counter
+= 1;
45
}
46
}
47
endtry
48
49
if
(
Counter
!= 3) {
50
printf
(
"TEST 7 FAILED. Counter = %d\n\r"
,
Counter
);
51
return
-1;
52
}
53
54
return
0;
55
}
except
#define except(x)
Definition:
btrfs_drv.h:136
printf
#define printf
Definition:
freeldr.h:97
void
Definition:
nsiface.idl:2307
LONG
long LONG
Definition:
pedump.c:60
test
char test[]
Definition:
seh0007.c:8
main
int main()
Definition:
seh0007.c:10
seh.h
endtry
#define endtry
Definition:
seh.h:24
abnormal_termination
#define abnormal_termination
Definition:
seh.h:25
Counter
static LARGE_INTEGER Counter
Definition:
clock.c:43
PLONG
int32_t * PLONG
Definition:
typedefs.h:58
modules
rostests
apitests
compiler
ms
seh
seh0007.c
Generated on Sun Dec 8 2024 06:06:49 for ReactOS by
1.9.6