ReactOS
0.4.16-dev-329-g9223134
seh0023.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 <setjmp.h>
7
#include "
seh.h
"
8
9
char
test
[] =
"SEH0023.c"
;
10
11
int
main
() {
12
jmp_buf
JumpBuffer;
13
LONG
Counter
;
14
15
Counter
= 0;
16
17
if
(_setjmp(JumpBuffer) == 0) {
18
try
{
19
try
{
20
/* set counter = 1 */
21
*(
volatile
LONG
*)&
Counter
+= 1;
22
RaiseException
(
EXCEPTION_INT_OVERFLOW
, 0,
/*no flags*/
0, 0);
23
}
24
finally
{
25
/* set counter = 2 */
26
*(
volatile
LONG
*)&
Counter
+= 1;
27
longjmp(JumpBuffer, 1);
28
}
29
endtry
30
}
31
except
(1)
32
/* should never get here */
33
{
34
*(
volatile
LONG
*)&
Counter
+= 1;
35
}
36
endtry
37
}
else
{
38
/* set counter = 3 */
39
*(
volatile
LONG
*)&
Counter
+= 1;
40
}
41
42
if
(
Counter
!= 3) {
43
printf
(
"TEST 23 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
printf
#define printf
Definition:
freeldr.h:97
LONG
long LONG
Definition:
pedump.c:60
test
char test[]
Definition:
seh0023.c:9
main
int main()
Definition:
seh0023.c:11
seh.h
endtry
#define endtry
Definition:
seh.h:24
Counter
static LARGE_INTEGER Counter
Definition:
clock.c:43
jmp_buf
_JBTYPE jmp_buf[_JBLEN]
Definition:
setjmp.h:186
EXCEPTION_INT_OVERFLOW
#define EXCEPTION_INT_OVERFLOW
Definition:
winbase.h:350
modules
rostests
apitests
compiler
ms
seh
seh0023.c
Generated on Sun Dec 8 2024 06:06:49 for ReactOS by
1.9.6