ReactOS
0.4.16-dev-303-g11d5cb8
seh0014.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
[] =
"SEH0014.c"
;
9
10
void
rtlRaiseExceptin
(
DWORD
Status
) {
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
try
{
22
rtlRaiseExceptin
(
EXCEPTION_ACCESS_VIOLATION
);
23
}
24
except
((
GetExceptionCode
() ==
STATUS_ACCESS_VIOLATION
) ? 1 : 0)
25
/* handler should get executed setting counter to 1 */
26
{
27
Counter
+= 1;
28
goto
t9;
/* executes finally before goto */
29
}
30
endtry
31
}
32
finally
33
/* should set counter to 2 */
34
{
35
Counter
+= 1;
36
}
37
endtry
38
39
t9:
40
;
41
42
if
(
Counter
!= 2) {
43
printf
(
"TEST 14 FAILED. Counter = %d\n\r"
,
Counter
);
44
return
-1;
45
}
46
47
return
0;
48
}
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
printf
#define printf
Definition:
freeldr.h:97
Status
Status
Definition:
gdiplustypes.h:25
GetExceptionCode
#define GetExceptionCode
Definition:
excpt.h:83
STATUS_ACCESS_VIOLATION
#define STATUS_ACCESS_VIOLATION
Definition:
ntstatus.h:242
LONG
long LONG
Definition:
pedump.c:60
rtlRaiseExceptin
void rtlRaiseExceptin(DWORD Status)
Definition:
seh0014.c:10
test
char test[]
Definition:
seh0014.c:8
main
int main()
Definition:
seh0014.c:15
seh.h
endtry
#define endtry
Definition:
seh.h:24
Counter
static LARGE_INTEGER Counter
Definition:
clock.c:43
EXCEPTION_ACCESS_VIOLATION
#define EXCEPTION_ACCESS_VIOLATION
Definition:
winbase.h:337
modules
rostests
apitests
compiler
ms
seh
seh0014.c
Generated on Sun Dec 1 2024 06:09:22 for ReactOS by
1.9.6