ReactOS
0.4.16-dev-1946-g52006dd
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
8
char
test
[] =
"SEH0010.c"
;
9
10
void
rtlRaiseExcpt
(
DWORD
Status
) {
11
RaiseException
(
Status
, 0,
/*no flags*/
0, 0);
12
return
;
13
}
14
15
void
tfRaiseExcpt
(
DWORD
Status
,
PLONG
Counter
) {
16
try
{
17
rtlRaiseExcpt
(
Status
);
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
35
int
main
() {
36
LONG
Counter
;
37
38
Counter
= 0;
39
40
try
{
41
tfRaiseExcpt
(
STATUS_ACCESS_VIOLATION
, &
Counter
);
42
}
43
except
((
GetExceptionCode
() ==
STATUS_ACCESS_VIOLATION
) ? 1 : 0)
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
}
except
#define except(x)
Definition:
btrfs_drv.h:136
RaiseException
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition:
except.c:700
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
STATUS_ACCESS_VIOLATION
#define STATUS_ACCESS_VIOLATION
Definition:
fpEnumPrinters.c:23
printf
#define printf
Definition:
freeldr.h:97
Status
Status
Definition:
gdiplustypes.h:25
GetExceptionCode
#define GetExceptionCode
Definition:
excpt.h:83
LONG
long LONG
Definition:
pedump.c:60
tfRaiseExcpt
void tfRaiseExcpt(DWORD Status, PLONG Counter)
Definition:
seh0010.c:15
rtlRaiseExcpt
void rtlRaiseExcpt(DWORD Status)
Definition:
seh0010.c:10
test
char test[]
Definition:
seh0010.c:8
main
int main()
Definition:
seh0010.c:35
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
seh0010.c
Generated on Thu Dec 4 2025 06:07:36 for ReactOS by
1.9.6