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