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[] = "SEH0012.c";
9 int perfect;
10 
11 void rtlRaiseException(DWORD Status) {
12   RaiseException(Status, 0, /*no flags*/ 0, 0);
13   return;
14 }
15 
16 int main() {
17   LONG Counter;
18 
19   Counter = 0;
20 
21   try {
22     rtlRaiseException(EXCEPTION_ACCESS_VIOLATION);
23   }
24   except((GetExceptionCode() == STATUS_ACCESS_VIOLATION) ? 1 : 0)
25   /* excpetion handler should get executed */
26   {
27     Counter += 1;
28     try {
29       rtlRaiseException(EXCEPTION_CONTINUE_SEARCH);
30     }
31     except((GetExceptionCode() == EXCEPTION_CONTINUE_SEARCH) ? 1 : 0)
32     /* excpetion handler should get executed */
33     {
34       if (Counter != 1) {
35         printf("TEST 12 FAILED. Counter = %d\n\r", Counter);
36         return -1;
37       }
38       Counter += 1;
39     }
40     endtry
41   }
42   endtry
43 
44   if (Counter != 2) {
45     printf("TEST 12 FAILED. Counter = %d\n\r", Counter);
46     return -1;
47   }
48 
49   return 0;
50 }
51