ReactOS
0.4.16-dev-340-g0540c21
seh0028.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
[] =
"SEH0028.c"
;
9
10
void
addtwo
(
long
First
,
long
Second
,
long
*Place) {
11
RaiseException
(
EXCEPTION_INT_OVERFLOW
, 0,
/*no flags*/
0, 0);
12
/* not executed due to exception being raised */
13
*Place =
First
+
Second
;
14
return
;
15
}
16
17
int
main
() {
18
LONG
Counter
;
19
20
Counter
= 0;
21
22
try
{
23
/* set counter = 1 */
24
Counter
+= 1;
25
addtwo
(0x7fff0000, 0x10000, &
Counter
);
26
}
27
except
((
GetExceptionCode
() == (
STATUS_INTEGER_OVERFLOW
)) ? 1 : 0)
28
/* 1==EXECUTE HANDLER after unwinding */
29
{
30
/* set counter = 2 */
31
Counter
+= 1;
32
}
33
endtry
34
35
if
(
Counter
!= 2) {
36
printf
(
"TEST 28 FAILED. Counter = %d\n\r"
,
Counter
);
37
return
-1;
38
}
39
40
return
0;
41
}
Second
WCHAR Second[]
Definition:
FormatMessage.c:12
First
WCHAR First[]
Definition:
FormatMessage.c:11
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
printf
#define printf
Definition:
freeldr.h:97
GetExceptionCode
#define GetExceptionCode
Definition:
excpt.h:83
STATUS_INTEGER_OVERFLOW
#define STATUS_INTEGER_OVERFLOW
Definition:
ntstatus.h:385
LONG
long LONG
Definition:
pedump.c:60
addtwo
void addtwo(long First, long Second, long *Place)
Definition:
seh0028.c:10
test
char test[]
Definition:
seh0028.c:8
main
int main()
Definition:
seh0028.c:17
seh.h
endtry
#define endtry
Definition:
seh.h:24
Counter
static LARGE_INTEGER Counter
Definition:
clock.c:43
EXCEPTION_INT_OVERFLOW
#define EXCEPTION_INT_OVERFLOW
Definition:
winbase.h:350
modules
rostests
apitests
compiler
ms
seh
seh0028.c
Generated on Sat Dec 14 2024 06:06:40 for ReactOS by
1.9.6