ReactOS 0.4.16-dev-1946-g52006dd
pseh.c File Reference
#include <pseh/pseh2.h>
#include <wine/test.h>
Include dependency graph for pseh.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  volatile_context
 
struct  subtest
 

Macros

#define todo_pseh
 
#define DEFINE_TEST(NAME_)   static int NAME_(void)
 
#define USE_TEST_NAME_(NAME_)   # NAME_
 
#define USE_TEST_NAME(NAME_)   USE_TEST_NAME_(NAME_)
 
#define USE_TEST(NAME_)   { USE_TEST_NAME(NAME_), NAME_ }
 

Functions

void no_op (void)
 
int return_arg (int)
 
int return_zero (void)
 
int return_positive (void)
 
int return_negative (void)
 
int return_one (void)
 
int return_minusone (void)
 
int return_zero_2 (void *)
 
int return_positive_2 (void *)
 
int return_negative_2 (void *)
 
int return_one_2 (void *)
 
int return_minusone_2 (void *)
 
int return_zero_3 (int)
 
int return_positive_3 (int)
 
int return_negative_3 (int)
 
int return_one_3 (int)
 
int return_minusone_3 (int)
 
int return_zero_4 (void *, int)
 
int return_positive_4 (void *, int)
 
int return_negative_4 (void *, int)
 
int return_one_4 (void *, int)
 
int return_minusone_4 (void *, int)
 
void set_positive (int *)
 
 DEFINE_TEST (test_empty_1)
 
 DEFINE_TEST (test_empty_2)
 
 DEFINE_TEST (test_empty_3)
 
 DEFINE_TEST (test_empty_4)
 
 DEFINE_TEST (test_empty_5)
 
 DEFINE_TEST (test_empty_6)
 
 DEFINE_TEST (test_empty_7)
 
 DEFINE_TEST (test_empty_8)
 
 DEFINE_TEST (test_execute_handler_1)
 
 DEFINE_TEST (test_continue_execution_1)
 
 DEFINE_TEST (test_continue_search_1)
 
 DEFINE_TEST (test_execute_handler_2)
 
 DEFINE_TEST (test_continue_execution_2)
 
 DEFINE_TEST (test_execute_handler_3)
 
 DEFINE_TEST (test_continue_execution_3)
 
 DEFINE_TEST (test_continue_search_2)
 
 DEFINE_TEST (test_execute_handler_4)
 
 DEFINE_TEST (test_continue_execution_4)
 
 DEFINE_TEST (test_execute_handler_5)
 
 DEFINE_TEST (test_continue_execution_5)
 
 DEFINE_TEST (test_continue_search_3)
 
 DEFINE_TEST (test_execute_handler_6)
 
 DEFINE_TEST (test_continue_execution_6)
 
 DEFINE_TEST (test_execute_handler_7)
 
 DEFINE_TEST (test_continue_execution_7)
 
 DEFINE_TEST (test_continue_search_4)
 
 DEFINE_TEST (test_execute_handler_8)
 
 DEFINE_TEST (test_continue_execution_8)
 
 DEFINE_TEST (test_execute_handler_9)
 
 DEFINE_TEST (test_continue_execution_9)
 
 DEFINE_TEST (test_continue_search_5)
 
 DEFINE_TEST (test_execute_handler_10)
 
 DEFINE_TEST (test_continue_execution_10)
 
 DEFINE_TEST (test_execute_handler_11)
 
 DEFINE_TEST (test_continue_execution_11)
 
 DEFINE_TEST (test_continue_search_6)
 
 DEFINE_TEST (test_execute_handler_12)
 
 DEFINE_TEST (test_continue_execution_12)
 
 DEFINE_TEST (test_leave_1)
 
 DEFINE_TEST (test_leave_2)
 
 DEFINE_TEST (test_leave_3)
 
 DEFINE_TEST (test_leave_4)
 
 DEFINE_TEST (test_leave_5)
 
 DEFINE_TEST (test_leave_6)
 
static int test_yield_1_helper (void)
 
 DEFINE_TEST (test_yield_1)
 
static int test_yield_2_helper (void)
 
 DEFINE_TEST (test_yield_2)
 
static int test_yield_3_helper (void)
 
 DEFINE_TEST (test_yield_3)
 
static int test_yield_4_helper (void)
 
 DEFINE_TEST (test_yield_4)
 
static int test_yield_5_helper (void)
 
 DEFINE_TEST (test_yield_5)
 
static int test_yield_6_helper (void)
 
 DEFINE_TEST (test_yield_6)
 
 DEFINE_TEST (test_finally_1)
 
 DEFINE_TEST (test_finally_2)
 
 DEFINE_TEST (test_finally_3)
 
static int test_finally_4_helper (void)
 
 DEFINE_TEST (test_finally_4)
 
 DEFINE_TEST (test_finally_5)
 
 DEFINE_TEST (test_finally_6)
 
 DEFINE_TEST (test_finally_7)
 
 DEFINE_TEST (test_finally_8)
 
static int test_finally_9_helper (void)
 
 DEFINE_TEST (test_finally_9)
 
 DEFINE_TEST (test_finally_10)
 
 DEFINE_TEST (test_finally_11)
 
 DEFINE_TEST (test_finally_12)
 
static void test_finally_13_helper (void)
 
 DEFINE_TEST (test_finally_13)
 
static void test_finally_14_helper (void)
 
 DEFINE_TEST (test_finally_14)
 
static int verify_xpointers (struct _EXCEPTION_POINTERS *ep, DWORD code, DWORD flags, DWORD argc, const ULONG_PTR *argv, int *ret, int filter)
 
 DEFINE_TEST (test_xpointers_1)
 
 DEFINE_TEST (test_xpointers_2)
 
 DEFINE_TEST (test_xpointers_3)
 
 DEFINE_TEST (test_xpointers_4)
 
 DEFINE_TEST (test_xpointers_5)
 
 DEFINE_TEST (test_xpointers_6)
 
 DEFINE_TEST (test_xpointers_7)
 
 DEFINE_TEST (test_xpointers_8)
 
 DEFINE_TEST (test_xpointers_9)
 
 DEFINE_TEST (test_xpointers_10)
 
 DEFINE_TEST (test_xpointers_11)
 
 DEFINE_TEST (test_xpointers_12)
 
 DEFINE_TEST (test_xpointers_13)
 
 DEFINE_TEST (test_xpointers_14)
 
 DEFINE_TEST (test_xpointers_15)
 
 DEFINE_TEST (test_xpointers_16)
 
static int verify_xcode (int code, int xcode, int *ret, int filter)
 
 DEFINE_TEST (test_xcode_1)
 
 DEFINE_TEST (test_xcode_2)
 
 DEFINE_TEST (test_xcode_3)
 
 DEFINE_TEST (test_abnorm_1)
 
 DEFINE_TEST (test_abnorm_2)
 
 DEFINE_TEST (test_abnorm_3)
 
 DEFINE_TEST (test_abnorm_4)
 
 DEFINE_TEST (test_abnorm_5)
 
 DEFINE_TEST (test_abnorm_6)
 
 DEFINE_TEST (test_abnorm_7)
 
 DEFINE_TEST (test_abnorm_8)
 
 DEFINE_TEST (test_nested_locals_1)
 
 DEFINE_TEST (test_nested_locals_2)
 
 DEFINE_TEST (test_nested_locals_3)
 
static void test_bug_4004_helper_1 (void)
 
static void test_bug_4004_helper_2 (void)
 
 DEFINE_TEST (test_bug_4004)
 
 DEFINE_TEST (test_bug_4663)
 
 DEFINE_TEST (test_unvolatile)
 
 DEFINE_TEST (test_unvolatile_2)
 
 DEFINE_TEST (test_unvolatile_3)
 
 DEFINE_TEST (test_unvolatile_4)
 
 DEFINE_TEST (test_finally_goto)
 
 DEFINE_TEST (test_nested_exception)
 
static LONG WINAPI unhandled_exception (PEXCEPTION_POINTERS ExceptionInfo)
 
static DECLSPEC_NOINLINE int sanity_check (int ret, struct volatile_context *before, struct volatile_context *after)
 
static int passthrough_handler (struct _EXCEPTION_RECORD *e, void *f, struct _CONTEXT *c, void *d)
 
static DECLSPEC_NOINLINE int call_test (int(*func)(void))
 
 DEFINE_TEST (test_PSEH3_bug)
 
void use_lots_of_stack (void)
 
 DEFINE_TEST (test_PSEH3_bug2)
 
void Test_collided_unwind (void)
 
void Do_nested_from_except (void)
 
void Test_nested_from_except (void)
 
 START_TEST (pseh)
 

Variables

static int test_yield_5_ret
 
static int test_yield_6_ret
 
static int test_finally_4_ret
 
static int test_finally_9_ret
 
static int test_finally_13_ret
 
static int test_finally_14_ret
 

Macro Definition Documentation

◆ DEFINE_TEST

#define DEFINE_TEST (   NAME_)    static int NAME_(void)

Definition at line 73 of file pseh.c.

◆ todo_pseh

#define todo_pseh

Definition at line 32 of file pseh.c.

◆ USE_TEST

#define USE_TEST (   NAME_)    { USE_TEST_NAME(NAME_), NAME_ }

Definition at line 2766 of file pseh.c.

◆ USE_TEST_NAME

#define USE_TEST_NAME (   NAME_)    USE_TEST_NAME_(NAME_)

Definition at line 2765 of file pseh.c.

◆ USE_TEST_NAME_

#define USE_TEST_NAME_ (   NAME_)    # NAME_

Definition at line 2764 of file pseh.c.

Function Documentation

◆ call_test()

static DECLSPEC_NOINLINE int call_test ( int(*)(void func)
static

Definition at line 2653 of file pseh.c.

2654{
2655 static int ret;
2656 static struct volatile_context before, after;
2657 static LPTOP_LEVEL_EXCEPTION_FILTER prev_unhandled_exception;
2658#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2659 static _SEH2Registration_t * prev_frame;
2660 _SEH2Registration_t passthrough_frame;
2661#endif
2662
2663 prev_unhandled_exception = SetUnhandledExceptionFilter(&unhandled_exception);
2664
2665#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2666 prev_frame = (_SEH2Registration_t *)__readfsdword(0);
2667 passthrough_frame.SER_Prev = prev_frame;
2668 passthrough_frame.SER_Handler = passthrough_handler;
2669 __writefsdword(0, (unsigned long)&passthrough_frame);
2670#endif
2671
2672#if defined(__GNUC__) && defined(__i386__)
2673 __asm__ __volatile__
2674 (
2675 "mov %%esp, 0x00 + %c[before]\n"
2676 "mov %%ebp, 0x04 + %c[before]\n"
2677 "mov %%ebx, 0x08 + %c[before]\n"
2678 "mov %%esi, 0x0c + %c[before]\n"
2679 "mov %%edi, 0x10 + %c[before]\n"
2680 "call *%[test]\n"
2681 "mov %%esp, 0x00 + %c[after]\n"
2682 "mov %%ebp, 0x04 + %c[after]\n"
2683 "mov %%ebx, 0x08 + %c[after]\n"
2684 "mov %%esi, 0x0c + %c[after]\n"
2685 "mov %%edi, 0x10 + %c[after]\n"
2686 "push %[after]\n"
2687 "push %[before]\n"
2688 "push %[ret]\n"
2689 "call %c[sanity_check]\n"
2690 "pop %%ecx\n"
2691 "pop %%ecx\n"
2692 "pop %%ecx\n" :
2693 [ret] "=a" (ret) :
2694 [test] "r" (func), [before] "i" (&before), [after] "i" (&after), [sanity_check] "i" (&sanity_check) :
2695 "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"
2696 );
2697#else
2698 ret = func();
2699#endif
2700
2701#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2702 if((_SEH2Registration_t *)__readfsdword(0) != &passthrough_frame || passthrough_frame.SER_Prev != prev_frame)
2703 {
2704 trace("exception registration list corrupted\n");
2705 ret = 0;
2706 }
2707
2708 __writefsdword(0, (unsigned long)prev_frame);
2709#endif
2710
2711 SetUnhandledExceptionFilter(prev_unhandled_exception);
2712 return ret;
2713}
#define trace
Definition: atltest.h:70
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DECLSPEC_HOTPATCH SetUnhandledExceptionFilter(IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
Definition: except.c:790
return ret
Definition: mutex.c:146
GLenum func
Definition: glext.h:6028
PPC_QUAL void __writefsdword(const unsigned long Offset, const unsigned long Data)
Definition: intrin_ppc.h:354
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition: intrin_ppc.h:382
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
static LONG WINAPI unhandled_exception(PEXCEPTION_POINTERS ExceptionInfo)
Definition: pseh.c:2608
static int passthrough_handler(struct _EXCEPTION_RECORD *e, void *f, struct _CONTEXT *c, void *d)
Definition: pseh.c:2645
static DECLSPEC_NOINLINE int sanity_check(int ret, struct volatile_context *before, struct volatile_context *after)
Definition: pseh.c:2632
#define test
Definition: rosglue.h:37
__inline int before(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2390
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395
PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
Definition: winbase.h:1210

Referenced by START_TEST().

◆ DEFINE_TEST() [1/104]

DEFINE_TEST ( test_abnorm_1  )

Definition at line 2052 of file pseh.c.

2053{
2054 static int ret;
2055
2056 ret = return_zero();
2057
2058 _SEH2_TRY
2059 {
2060 ret = return_arg(ret);
2061 }
2063 {
2065 }
2066 _SEH2_END;
2067
2068 return ret == return_positive();
2069}
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:182
#define _SEH2_FINALLY
Definition: pseh2_64.h:130
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
int return_arg(int)
Definition: psehtest2.c:24
int return_zero(void)
Definition: psehtest2.c:35
int return_positive(void)
Definition: psehtest2.c:41

◆ DEFINE_TEST() [2/104]

DEFINE_TEST ( test_abnorm_2  )

Definition at line 2071 of file pseh.c.

2072{
2073 static int ret;
2074
2075 ret = return_zero();
2076
2077 _SEH2_TRY
2078 {
2080 }
2082 {
2084 }
2085 _SEH2_END;
2086
2087 return ret == return_positive();
2088}
#define _SEH2_LEAVE
Definition: pseh2_64.h:183

◆ DEFINE_TEST() [3/104]

DEFINE_TEST ( test_abnorm_3  )

Definition at line 2090 of file pseh.c.

2091{
2092 static int ret;
2093
2094 ret = return_zero();
2095
2096 _SEH2_TRY
2097 {
2098 _SEH2_YIELD(goto leave);
2099 }
2101 {
2103 }
2104 _SEH2_END;
2105
2106leave:
2107 return ret == return_positive();
2108}
#define leave
Definition: btrfs_drv.h:138
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184

◆ DEFINE_TEST() [4/104]

DEFINE_TEST ( test_abnorm_4  )

Definition at line 2110 of file pseh.c.

2111{
2112 static int ret;
2113
2114 ret = return_zero();
2115
2116 _SEH2_TRY
2117 {
2118 _SEH2_TRY
2119 {
2120 RaiseException(0xE00DEAD0, 0, 0, NULL);
2121 ret = return_zero();
2122 }
2124 {
2126 }
2127 _SEH2_END;
2128 }
2130 {
2131 ret = return_arg(ret);
2132 }
2133 _SEH2_END;
2134
2135 return ret == return_positive();
2136}
#define NULL
Definition: types.h:112
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82

◆ DEFINE_TEST() [5/104]

DEFINE_TEST ( test_abnorm_5  )

Definition at line 2138 of file pseh.c.

2139{
2140 static int ret;
2141
2142 ret = return_zero();
2143
2144 _SEH2_TRY
2145 {
2146 _SEH2_TRY
2147 {
2148 ret = return_arg(ret);
2149 }
2151 {
2153 }
2154 _SEH2_END;
2155 }
2157 {
2159 }
2160 _SEH2_END;
2161
2162 return ret == return_positive() + return_one();
2163}
int return_one(void)
Definition: psehtest2.c:53

◆ DEFINE_TEST() [6/104]

DEFINE_TEST ( test_abnorm_6  )

Definition at line 2165 of file pseh.c.

2166{
2167 static int ret;
2168
2169 ret = return_zero();
2170
2171 _SEH2_TRY
2172 {
2173 _SEH2_TRY
2174 {
2176 }
2178 {
2180 }
2181 _SEH2_END;
2182 }
2184 {
2186 }
2187 _SEH2_END;
2188
2189 return ret == return_positive() + return_one();
2190}

◆ DEFINE_TEST() [7/104]

DEFINE_TEST ( test_abnorm_7  )

Definition at line 2192 of file pseh.c.

2193{
2194 static int ret;
2195
2196 ret = return_zero();
2197
2198 _SEH2_TRY
2199 {
2200 _SEH2_TRY
2201 {
2202 _SEH2_YIELD(goto leave);
2203 }
2205 {
2207 }
2208 _SEH2_END;
2209 }
2211 {
2213 }
2214 _SEH2_END;
2215
2216leave:
2217 return ret == return_positive() + return_one();
2218}

◆ DEFINE_TEST() [8/104]

DEFINE_TEST ( test_abnorm_8  )

Definition at line 2220 of file pseh.c.

2221{
2222 static int ret;
2223
2224 ret = return_zero();
2225
2226 _SEH2_TRY
2227 {
2228 _SEH2_TRY
2229 {
2230 _SEH2_TRY
2231 {
2232 RaiseException(0xE00DEAD0, 0, 0, NULL);
2233 ret = return_zero();
2234 }
2236 {
2238 }
2239 _SEH2_END;
2240 }
2242 {
2244 }
2245 _SEH2_END;
2246 }
2248 {
2249 ret = return_arg(ret);
2250 }
2251 _SEH2_END;
2252
2253 return ret == return_positive() + return_one();
2254}

◆ DEFINE_TEST() [9/104]

DEFINE_TEST ( test_bug_4004  )

Definition at line 2365 of file pseh.c.

2366{
2367 int i1, i2, i3;
2368
2369 i1 = return_positive();
2370 i2 = return_positive();
2371 i3 = return_positive();
2372
2374
2375 return return_arg(i1) + return_arg(i2) + return_arg(i3) == return_positive() * 3;
2376}
static void test_bug_4004_helper_2(void)
Definition: pseh.c:2353

◆ DEFINE_TEST() [10/104]

DEFINE_TEST ( test_bug_4663  )

Definition at line 2380 of file pseh.c.

2381{
2382 int i1, i2;
2383
2384 i1 = return_positive();
2385 i2 = return_positive();
2386
2387 _SEH2_TRY
2388 {
2389 _SEH2_TRY
2390 {
2391 RaiseException(0xE00DEAD0, 0, 0, 0);
2392 }
2394 {
2395 if (i1 == return_positive())
2396 {
2397 i1 = return_positive() + 1;
2398 }
2399 }
2400 _SEH2_END;
2401
2402 if (i1 == return_positive() + 1)
2403 {
2404 i1 = return_negative();
2405 RaiseException(0xE00DEAD0, 0, 0, 0);
2406 }
2407 }
2409 {
2410 i2 = return_negative();
2411 }
2412 _SEH2_END;
2413
2414 return ((i1 == return_negative()) && (i2 == return_negative()));
2415}
int return_negative(void)
Definition: psehtest2.c:47

◆ DEFINE_TEST() [11/104]

DEFINE_TEST ( test_continue_execution_1  )

Definition at line 146 of file pseh.c.

147{
148 static int ret;
149
150 ret = return_zero();
151
153 {
154 RaiseException(0xE00DEAD0, 0, 0, NULL);
156 }
158 {
159 ret = return_zero();
160 }
161 _SEH2_END;
162
163 return ret == return_positive();
164}
#define EXCEPTION_CONTINUE_EXECUTION
Definition: excpt.h:92

◆ DEFINE_TEST() [12/104]

DEFINE_TEST ( test_continue_execution_10  )

Definition at line 654 of file pseh.c.

655{
656 static int ret;
657
658 ret = return_zero();
659
661 {
662 RaiseException(0xE00DEAD0, 0, 0, NULL);
664 }
666 {
667 ret = return_zero();
668 }
669 _SEH2_END;
670
671 return ret == return_positive();
672}
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:180
int return_negative_4(void *, int)
Definition: psehtest2.c:137

◆ DEFINE_TEST() [13/104]

DEFINE_TEST ( test_continue_execution_11  )

Definition at line 696 of file pseh.c.

697{
698 static int ret;
699
700 ret = return_zero();
701
703 {
704 RaiseException(0xE00DEAD0, 0, 0, NULL);
706 }
708 {
709 ret = return_zero();
710 }
711 _SEH2_END;
712
713 return ret == return_positive();
714}
void set_positive(int *)
Definition: psehtest2.c:155

◆ DEFINE_TEST() [14/104]

DEFINE_TEST ( test_continue_execution_12  )

Definition at line 769 of file pseh.c.

770{
771 static int ret;
772
773 ret = return_zero();
774
776 {
777 RaiseException(0xE00DEAD0, 0, 0, NULL);
778 ret = return_arg(ret);
779 }
780 _SEH2_EXCEPT(set_positive(&ret), -12345)
781 {
782 ret = return_zero();
783 }
784 _SEH2_END;
785
786 return ret == return_positive();
787}

◆ DEFINE_TEST() [15/104]

DEFINE_TEST ( test_continue_execution_2  )

Definition at line 214 of file pseh.c.

215{
216 static int ret;
217
218 ret = return_zero();
219
221 {
222 RaiseException(0xE00DEAD0, 0, 0, NULL);
224 }
225 _SEH2_EXCEPT(-12345)
226 {
227 ret = return_zero();
228 }
229 _SEH2_END;
230
231 return ret == return_positive();
232}

◆ DEFINE_TEST() [16/104]

DEFINE_TEST ( test_continue_execution_3  )

Definition at line 256 of file pseh.c.

257{
258 static int ret;
259
260 ret = return_zero();
261
263 {
264 RaiseException(0xE00DEAD0, 0, 0, NULL);
266 }
268 {
269 ret = return_zero();
270 }
271 _SEH2_END;
272
273 return ret == return_positive();
274}
int return_minusone(void)
Definition: psehtest2.c:59

◆ DEFINE_TEST() [17/104]

DEFINE_TEST ( test_continue_execution_4  )

Definition at line 324 of file pseh.c.

325{
326 static int ret;
327
328 ret = return_zero();
329
331 {
332 RaiseException(0xE00DEAD0, 0, 0, NULL);
334 }
336 {
337 ret = return_zero();
338 }
339 _SEH2_END;
340
341 return ret == return_positive();
342}

◆ DEFINE_TEST() [18/104]

DEFINE_TEST ( test_continue_execution_5  )

Definition at line 366 of file pseh.c.

367{
368 static int ret;
369
370 ret = return_zero();
371
373 {
374 RaiseException(0xE00DEAD0, 0, 0, NULL);
376 }
378 {
379 ret = return_zero();
380 }
381 _SEH2_END;
382
383 return ret == return_positive();
384}
int return_minusone_2(void *)
Definition: psehtest2.c:89

◆ DEFINE_TEST() [19/104]

DEFINE_TEST ( test_continue_execution_6  )

Definition at line 434 of file pseh.c.

435{
436 static int ret;
437
438 ret = return_zero();
439
441 {
442 RaiseException(0xE00DEAD0, 0, 0, NULL);
444 }
446 {
447 ret = return_zero();
448 }
449 _SEH2_END;
450
451 return ret == return_positive();
452}
int return_negative_2(void *)
Definition: psehtest2.c:77

◆ DEFINE_TEST() [20/104]

DEFINE_TEST ( test_continue_execution_7  )

Definition at line 476 of file pseh.c.

477{
478 static int ret;
479
480 ret = return_zero();
481
483 {
484 RaiseException(0xE00DEAD0, 0, 0, NULL);
486 }
488 {
489 ret = return_zero();
490 }
491 _SEH2_END;
492
493 return ret == return_positive();
494}
int return_minusone_3(int)
Definition: psehtest2.c:119

◆ DEFINE_TEST() [21/104]

DEFINE_TEST ( test_continue_execution_8  )

Definition at line 544 of file pseh.c.

545{
546 static int ret;
547
548 ret = return_zero();
549
551 {
552 RaiseException(0xE00DEAD0, 0, 0, NULL);
554 }
556 {
557 ret = return_zero();
558 }
559 _SEH2_END;
560
561 return ret == return_positive();
562}
int return_negative_3(int)
Definition: psehtest2.c:107

◆ DEFINE_TEST() [22/104]

DEFINE_TEST ( test_continue_execution_9  )

Definition at line 586 of file pseh.c.

587{
588 static int ret;
589
590 ret = return_zero();
591
593 {
594 RaiseException(0xE00DEAD0, 0, 0, NULL);
596 }
598 {
599 ret = return_zero();
600 }
601 _SEH2_END;
602
603 return ret == return_positive();
604}
int return_minusone_4(void *, int)
Definition: psehtest2.c:149

◆ DEFINE_TEST() [23/104]

DEFINE_TEST ( test_continue_search_1  )

Definition at line 166 of file pseh.c.

167{
168 static int ret;
169
170 ret = return_zero();
171
173 {
175 {
176 RaiseException(0xE00DEAD0, 0, 0, NULL);
177 ret = return_zero();
178 }
180 {
181 ret = return_zero();
182 }
183 _SEH2_END;
184 }
186 {
188 }
189 _SEH2_END;
190
191 return ret == return_positive();
192}
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91

◆ DEFINE_TEST() [24/104]

DEFINE_TEST ( test_continue_search_2  )

Definition at line 276 of file pseh.c.

277{
278 static int ret;
279
280 ret = return_zero();
281
283 {
285 {
286 RaiseException(0xE00DEAD0, 0, 0, NULL);
287 ret = return_zero();
288 }
290 {
291 ret = return_zero();
292 }
293 _SEH2_END;
294 }
296 {
298 }
299 _SEH2_END;
300
301 return ret == return_positive();
302}

◆ DEFINE_TEST() [25/104]

DEFINE_TEST ( test_continue_search_3  )

Definition at line 386 of file pseh.c.

387{
388 static int ret;
389
391
393 {
395 {
396 RaiseException(0xE00DEAD0, 0, 0, NULL);
397 ret = return_zero();
398 }
400 {
401 ret = return_zero();
402 }
403 _SEH2_END;
404 }
406 {
407 ret = return_arg(ret);
408 }
409 _SEH2_END;
410
411 return ret == return_positive();
412}
int return_zero_2(void *)
Definition: psehtest2.c:65

◆ DEFINE_TEST() [26/104]

DEFINE_TEST ( test_continue_search_4  )

Definition at line 496 of file pseh.c.

497{
498 static int ret;
499
500 ret = return_zero();
501
503 {
505 {
506 RaiseException(0xE00DEAD0, 0, 0, NULL);
507 ret = return_zero();
508 }
510 {
511 ret = return_zero();
512 }
513 _SEH2_END;
514 }
516 {
518 }
519 _SEH2_END;
520
521 return ret == return_positive();
522}
int return_zero_3(int)
Definition: psehtest2.c:95

◆ DEFINE_TEST() [27/104]

DEFINE_TEST ( test_continue_search_5  )

Definition at line 606 of file pseh.c.

607{
608 static int ret;
609
610 ret = return_zero();
611
613 {
615 {
616 RaiseException(0xE00DEAD0, 0, 0, NULL);
617 ret = return_zero();
618 }
620 {
621 ret = return_zero();
622 }
623 _SEH2_END;
624 }
626 {
628 }
629 _SEH2_END;
630
631 return ret == return_positive();
632}
int return_zero_4(void *, int)
Definition: psehtest2.c:125

◆ DEFINE_TEST() [28/104]

DEFINE_TEST ( test_continue_search_6  )

Definition at line 716 of file pseh.c.

717{
718 static int ret;
719 static int ret2;
720
721 ret = return_zero();
722 ret2 = return_zero();
723
725 {
727 {
728 RaiseException(0xE00DEAD0, 0, 0, NULL);
729 ret = return_zero();
730 ret2 = return_zero();
731 }
733 {
734 ret = return_zero();
735 ret2 = return_zero();
736 }
737 _SEH2_END;
738 }
740 {
741 ret = return_arg(ret);
742 ret2 = return_arg(ret2);
743 }
744 _SEH2_END;
745
746 return ret == return_positive() && ret2 == return_positive();
747}

◆ DEFINE_TEST() [29/104]

DEFINE_TEST ( test_empty_1  )

Definition at line 76 of file pseh.c.

77{
79 return 1;
80}

◆ DEFINE_TEST() [30/104]

DEFINE_TEST ( test_empty_2  )

Definition at line 82 of file pseh.c.

83{
85 return 1;
86}

◆ DEFINE_TEST() [31/104]

DEFINE_TEST ( test_empty_3  )

Definition at line 88 of file pseh.c.

89{
91 return 1;
92}

◆ DEFINE_TEST() [32/104]

DEFINE_TEST ( test_empty_4  )

Definition at line 94 of file pseh.c.

95{
97 return 1;
98}

◆ DEFINE_TEST() [33/104]

DEFINE_TEST ( test_empty_5  )

Definition at line 100 of file pseh.c.

101{
103 return 1;
104}

◆ DEFINE_TEST() [34/104]

DEFINE_TEST ( test_empty_6  )

Definition at line 106 of file pseh.c.

107{
109 return 1;
110}

◆ DEFINE_TEST() [35/104]

DEFINE_TEST ( test_empty_7  )

Definition at line 112 of file pseh.c.

113{
115 return 1;
116}

◆ DEFINE_TEST() [36/104]

DEFINE_TEST ( test_empty_8  )

Definition at line 118 of file pseh.c.

119{
121 return 1;
122}

◆ DEFINE_TEST() [37/104]

DEFINE_TEST ( test_execute_handler_1  )

Definition at line 126 of file pseh.c.

127{
128 static int ret;
129
130 ret = return_zero();
131
133 {
134 RaiseException(0xE00DEAD0, 0, 0, NULL);
135 ret = return_zero();
136 }
138 {
140 }
141 _SEH2_END;
142
143 return ret == return_positive();
144}

◆ DEFINE_TEST() [38/104]

DEFINE_TEST ( test_execute_handler_10  )

Definition at line 634 of file pseh.c.

635{
636 static int ret;
637
638 ret = return_zero();
639
641 {
642 RaiseException(0xE00DEAD0, 0, 0, NULL);
643 ret = return_zero();
644 }
646 {
648 }
649 _SEH2_END;
650
651 return ret == return_positive();
652}
int return_positive_4(void *, int)
Definition: psehtest2.c:131

◆ DEFINE_TEST() [39/104]

DEFINE_TEST ( test_execute_handler_11  )

Definition at line 676 of file pseh.c.

677{
678 static int ret;
679
680 ret = return_zero();
681
683 {
684 RaiseException(0xE00DEAD0, 0, 0, NULL);
685 ret = return_zero();
686 }
688 {
690 }
691 _SEH2_END;
692
693 return ret == return_positive();
694}

◆ DEFINE_TEST() [40/104]

DEFINE_TEST ( test_execute_handler_12  )

Definition at line 749 of file pseh.c.

750{
751 static int ret;
752
753 ret = return_zero();
754
756 {
757 RaiseException(0xE00DEAD0, 0, 0, NULL);
758 ret = return_zero();
759 }
761 {
762 ret = return_arg(ret);
763 }
764 _SEH2_END;
765
766 return ret == return_positive();
767}

◆ DEFINE_TEST() [41/104]

DEFINE_TEST ( test_execute_handler_2  )

Definition at line 194 of file pseh.c.

195{
196 static int ret;
197
198 ret = return_zero();
199
201 {
202 RaiseException(0xE00DEAD0, 0, 0, NULL);
203 ret = return_zero();
204 }
205 _SEH2_EXCEPT(12345)
206 {
208 }
209 _SEH2_END;
210
211 return ret == return_positive();
212}

◆ DEFINE_TEST() [42/104]

DEFINE_TEST ( test_execute_handler_3  )

Definition at line 236 of file pseh.c.

237{
238 static int ret;
239
240 ret = return_zero();
241
243 {
244 RaiseException(0xE00DEAD0, 0, 0, NULL);
245 ret = return_zero();
246 }
248 {
250 }
251 _SEH2_END;
252
253 return ret == return_positive();
254}

◆ DEFINE_TEST() [43/104]

DEFINE_TEST ( test_execute_handler_4  )

Definition at line 304 of file pseh.c.

305{
306 static int ret;
307
308 ret = return_zero();
309
311 {
312 RaiseException(0xE00DEAD0, 0, 0, NULL);
313 ret = return_zero();
314 }
316 {
318 }
319 _SEH2_END;
320
321 return ret == return_positive();
322}

◆ DEFINE_TEST() [44/104]

DEFINE_TEST ( test_execute_handler_5  )

Definition at line 346 of file pseh.c.

347{
348 static int ret;
349
350 ret = return_zero();
351
353 {
354 RaiseException(0xE00DEAD0, 0, 0, NULL);
355 ret = return_zero();
356 }
358 {
360 }
361 _SEH2_END;
362
363 return ret == return_positive();
364}
int return_one_2(void *)
Definition: psehtest2.c:83

◆ DEFINE_TEST() [45/104]

DEFINE_TEST ( test_execute_handler_6  )

Definition at line 414 of file pseh.c.

415{
416 static int ret;
417
418 ret = return_zero();
419
421 {
422 RaiseException(0xE00DEAD0, 0, 0, NULL);
423 ret = return_zero();
424 }
426 {
428 }
429 _SEH2_END;
430
431 return ret == return_positive();
432}
int return_positive_2(void *)
Definition: psehtest2.c:71

◆ DEFINE_TEST() [46/104]

DEFINE_TEST ( test_execute_handler_7  )

Definition at line 456 of file pseh.c.

457{
458 static int ret;
459
460 ret = return_zero();
461
463 {
464 RaiseException(0xE00DEAD0, 0, 0, NULL);
465 ret = return_zero();
466 }
468 {
470 }
471 _SEH2_END;
472
473 return ret == return_positive();
474}
int return_one_3(int)
Definition: psehtest2.c:113

◆ DEFINE_TEST() [47/104]

DEFINE_TEST ( test_execute_handler_8  )

Definition at line 524 of file pseh.c.

525{
526 static int ret;
527
528 ret = return_zero();
529
531 {
532 RaiseException(0xE00DEAD0, 0, 0, NULL);
533 ret = return_zero();
534 }
536 {
538 }
539 _SEH2_END;
540
541 return ret == return_positive();
542}
int return_positive_3(int)
Definition: psehtest2.c:101

◆ DEFINE_TEST() [48/104]

DEFINE_TEST ( test_execute_handler_9  )

Definition at line 566 of file pseh.c.

567{
568 static int ret;
569
570 ret = return_zero();
571
573 {
574 RaiseException(0xE00DEAD0, 0, 0, NULL);
575 ret = return_zero();
576 }
578 {
580 }
581 _SEH2_END;
582
583 return ret == return_positive();
584}
int return_one_4(void *, int)
Definition: psehtest2.c:143

◆ DEFINE_TEST() [49/104]

DEFINE_TEST ( test_finally_1  )

Definition at line 1113 of file pseh.c.

1114{
1115 static int ret;
1116
1117 ret = return_zero();
1118
1119 _SEH2_TRY
1120 {
1121 ret = return_arg(ret);
1122 }
1124 {
1125 ret = return_positive();
1126 }
1127 _SEH2_END;
1128
1129 return ret == return_positive();
1130}

◆ DEFINE_TEST() [50/104]

DEFINE_TEST ( test_finally_10  )

Definition at line 1351 of file pseh.c.

1352{
1353 static int ret;
1354
1355 ret = return_zero();
1356
1357 _SEH2_TRY
1358 {
1359 _SEH2_TRY
1360 {
1361 _SEH2_TRY
1362 {
1363 RaiseException(0xE00DEAD0, 0, 0, NULL);
1364 ret = return_zero();
1365 }
1367 {
1368 if(ret == return_zero())
1369 ret = return_positive();
1370 }
1371 _SEH2_END;
1372 }
1374 {
1375 if(ret == return_positive())
1377 }
1378 _SEH2_END;
1379 }
1381 {
1382 ret = return_arg(ret);
1383 }
1384 _SEH2_END;
1385
1386 return ret == return_positive() + return_one();
1387}

◆ DEFINE_TEST() [51/104]

DEFINE_TEST ( test_finally_11  )

Definition at line 1389 of file pseh.c.

1390{
1391 static int ret;
1392
1393 ret = return_zero();
1394
1395 _SEH2_TRY
1396 {
1397 _SEH2_TRY
1398 {
1399 _SEH2_TRY
1400 {
1401 ret = return_arg(ret);
1402 }
1404 {
1405 ret = return_zero();
1406 }
1407 _SEH2_END;
1408 }
1410 {
1411 ret = return_positive();
1412 RaiseException(0xE00DEAD0, 0, 0, NULL);
1413 ret = return_zero();
1414 }
1415 _SEH2_END;
1416 }
1418 {
1419 if(ret == return_positive())
1420 ret += return_one();
1421 }
1422 _SEH2_END;
1423
1424 return ret == return_positive() + return_one();
1425}

◆ DEFINE_TEST() [52/104]

DEFINE_TEST ( test_finally_12  )

Definition at line 1427 of file pseh.c.

1428{
1429 static int ret;
1430
1431 ret = return_zero();
1432
1433 _SEH2_TRY
1434 {
1435 _SEH2_TRY
1436 {
1437 _SEH2_TRY
1438 {
1439 ret = return_arg(ret);
1440 }
1442 {
1443 ret = return_positive();
1444 RaiseException(0xE00DEAD0, 0, 0, NULL);
1445 ret = return_zero();
1446 }
1447 _SEH2_END;
1448 }
1450 {
1451 if(ret == return_positive())
1452 ret += return_one();
1453 }
1454 _SEH2_END;
1455 }
1457 {
1458 if(ret == return_positive() + return_one())
1459 ret += return_one();
1460 }
1461 _SEH2_END;
1462
1463 return ret == return_positive() + return_one() + return_one();
1464}

◆ DEFINE_TEST() [53/104]

DEFINE_TEST ( test_finally_13  )

Definition at line 1501 of file pseh.c.

1502{
1503 static int ret;
1504
1505 ret = return_zero();
1506
1507 _SEH2_TRY
1508 {
1509 ret = return_arg(ret);
1511 ret = return_zero();
1512 }
1514 {
1515 ret = return_positive();
1516 }
1517 _SEH2_END;
1518
1520}
static void test_finally_13_helper(void)
Definition: pseh.c:1469
static int test_finally_13_ret
Definition: pseh.c:1466

◆ DEFINE_TEST() [54/104]

DEFINE_TEST ( test_finally_14  )

Definition at line 1566 of file pseh.c.

1567{
1568 static int ret;
1569
1570 ret = return_zero();
1571
1572 _SEH2_TRY
1573 {
1574 ret = return_arg(ret);
1576 ret = return_positive();
1577 }
1579 {
1580 ret = return_zero();
1581 }
1582 _SEH2_END;
1583
1585}
static void test_finally_14_helper(void)
Definition: pseh.c:1525
static int test_finally_14_ret
Definition: pseh.c:1522

◆ DEFINE_TEST() [55/104]

DEFINE_TEST ( test_finally_2  )

Definition at line 1132 of file pseh.c.

1133{
1134 static int ret;
1135
1136 ret = return_zero();
1137
1138 _SEH2_TRY
1139 {
1140 ret = return_arg(ret);
1142 }
1144 {
1145 ret = return_positive();
1146 }
1147 _SEH2_END;
1148
1149 return ret == return_positive();
1150}

◆ DEFINE_TEST() [56/104]

DEFINE_TEST ( test_finally_3  )

Definition at line 1152 of file pseh.c.

1153{
1154 static int ret;
1155
1156 ret = return_zero();
1157
1158 _SEH2_TRY
1159 {
1160 ret = return_arg(ret);
1161 _SEH2_YIELD(goto leave);
1162 }
1164 {
1165 ret = return_positive();
1166 }
1167 _SEH2_END;
1168
1169leave:
1170 return ret == return_positive();
1171}

◆ DEFINE_TEST() [57/104]

DEFINE_TEST ( test_finally_4  )

Definition at line 1193 of file pseh.c.

1194{
1196}
static int test_finally_4_helper(void)
Definition: pseh.c:1175
static int test_finally_4_ret
Definition: pseh.c:1173

◆ DEFINE_TEST() [58/104]

DEFINE_TEST ( test_finally_5  )

Definition at line 1198 of file pseh.c.

1199{
1200 static int ret;
1201
1202 ret = return_zero();
1203
1204 _SEH2_TRY
1205 {
1206 _SEH2_TRY
1207 {
1208 RaiseException(0xE00DEAD0, 0, 0, NULL);
1209 ret = return_zero();
1210 }
1212 {
1213 ret = return_positive();
1214 }
1215 _SEH2_END;
1216 }
1218 {
1219 ret = return_arg(ret);
1220 }
1221 _SEH2_END;
1222
1223 return ret == return_positive();
1224}

◆ DEFINE_TEST() [59/104]

DEFINE_TEST ( test_finally_6  )

Definition at line 1226 of file pseh.c.

1227{
1228 static int ret;
1229
1230 ret = return_zero();
1231
1232 _SEH2_TRY
1233 {
1234 _SEH2_TRY
1235 {
1236 ret = return_arg(ret);
1237 }
1239 {
1240 if(ret == return_zero())
1241 ret = return_positive();
1242 }
1243 _SEH2_END;
1244 }
1246 {
1247 if(ret == return_positive())
1249 }
1250 _SEH2_END;
1251
1252 return ret == return_positive() + return_one();
1253}

◆ DEFINE_TEST() [60/104]

DEFINE_TEST ( test_finally_7  )

Definition at line 1255 of file pseh.c.

1256{
1257 static int ret;
1258
1259 ret = return_zero();
1260
1261 _SEH2_TRY
1262 {
1263 _SEH2_TRY
1264 {
1265 ret = return_arg(ret);
1267 }
1269 {
1270 if(ret == return_zero())
1271 ret = return_positive();
1272 }
1273 _SEH2_END;
1274 }
1276 {
1277 if(ret == return_positive())
1279 }
1280 _SEH2_END;
1281
1282 return ret == return_positive() + return_one();
1283}

◆ DEFINE_TEST() [61/104]

DEFINE_TEST ( test_finally_8  )

Definition at line 1285 of file pseh.c.

1286{
1287 static int ret;
1288
1289 ret = return_zero();
1290
1291 _SEH2_TRY
1292 {
1293 _SEH2_TRY
1294 {
1295 ret = return_arg(ret);
1296 _SEH2_YIELD(goto leave);
1297 }
1299 {
1300 if(ret == return_zero())
1301 ret = return_positive();
1302 }
1303 _SEH2_END;
1304 }
1306 {
1307 if(ret == return_positive())
1309 }
1310 _SEH2_END;
1311
1312leave:
1313 return ret == return_positive() + return_one();
1314}

◆ DEFINE_TEST() [62/104]

DEFINE_TEST ( test_finally_9  )

Definition at line 1346 of file pseh.c.

1347{
1349}
static int test_finally_9_helper(void)
Definition: pseh.c:1318
static int test_finally_9_ret
Definition: pseh.c:1316

◆ DEFINE_TEST() [63/104]

DEFINE_TEST ( test_finally_goto  )

Definition at line 2538 of file pseh.c.

2539{
2540 volatile int val = 0;
2541
2542 _SEH2_TRY
2543 {
2544 val |= 1;
2545 _SEH2_TRY
2546 {
2547 val |= 2;
2548 goto next;
2549 }
2551 {
2552 val |= 4;
2553 *((char*)(intptr_t)0xdeadc0de) = 0;
2554 val |= 8;
2555 }
2556 _SEH2_END;
2557
2558 val |= 16;
2559next:
2560 val |= 32;
2561 *((char*)(intptr_t)0xdeadc0de) = 0;
2562 val |= 64;
2563 }
2564 _SEH2_EXCEPT(1)
2565 {
2566 val |= 128;
2567 }
2568 _SEH2_END;
2569
2570 return (val == (128|4|2|1));
2571}
GLuint GLfloat * val
Definition: glext.h:7180
static unsigned __int64 next
Definition: rand_nt.c:6
int intptr_t
Definition: vcruntime.h:134

◆ DEFINE_TEST() [64/104]

DEFINE_TEST ( test_leave_1  )

Definition at line 791 of file pseh.c.

792{
793 static int ret;
794
795 ret = return_zero();
796
798 {
801 ret = return_zero();
802 }
804 {
805 ret = return_zero();
806 }
807 _SEH2_END;
808
809 return ret == return_positive();
810}

◆ DEFINE_TEST() [65/104]

DEFINE_TEST ( test_leave_2  )

Definition at line 812 of file pseh.c.

813{
814 static int ret;
815
816 ret = return_zero();
817
819 {
822
823 RaiseException(0xE00DEAD0, 0, 0, NULL);
824 ret = return_zero();
825 }
827 {
828 ret = return_zero();
829 }
830 _SEH2_END;
831
832 return ret == return_positive();
833}

◆ DEFINE_TEST() [66/104]

DEFINE_TEST ( test_leave_3  )

Definition at line 835 of file pseh.c.

836{
837 static int ret;
838
839 ret = return_zero();
840
842 {
844
845 if(return_one())
847
848 ret = return_zero();
849 }
851 {
852 ret = return_zero();
853 }
854 _SEH2_END;
855
856 return ret == return_positive();
857}

◆ DEFINE_TEST() [67/104]

DEFINE_TEST ( test_leave_4  )

Definition at line 859 of file pseh.c.

860{
861 static int ret;
862
863 ret = return_zero();
864
866 {
867 int i;
868 int n = return_one() + return_one();
869
870 for(i = return_zero(); i < n; ++ i)
871 {
872 if(i == return_one())
873 {
876 }
877 }
878
879 ret = return_zero();
880 }
882 {
883 ret = return_zero();
884 }
885 _SEH2_END;
886
887 return ret == return_positive();
888}
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ DEFINE_TEST() [68/104]

DEFINE_TEST ( test_leave_5  )

Definition at line 890 of file pseh.c.

891{
892 static int ret;
893
894 ret = return_zero();
895
897 {
898 switch(return_one())
899 {
900 case 0: ret = return_zero();
901 case 1: ret = return_positive(); _SEH2_LEAVE;
902 case 2: ret = return_zero();
903 }
904
905 ret = return_zero();
906 }
908 {
909 ret = return_zero();
910 }
911 _SEH2_END;
912
913 return ret == return_positive();
914}

◆ DEFINE_TEST() [69/104]

DEFINE_TEST ( test_leave_6  )

Definition at line 916 of file pseh.c.

917{
918 static int ret;
919
920 ret = return_zero();
921
923 {
925 {
927 }
929 {
930 ret = return_zero();
931 }
932 _SEH2_END;
933
935 }
937 {
938 ret = return_zero();
939 }
940 _SEH2_END;
941
942 return ret == return_positive();
943}

◆ DEFINE_TEST() [70/104]

DEFINE_TEST ( test_nested_exception  )

Definition at line 2573 of file pseh.c.

2574{
2575 volatile int val = 0;
2576
2577 _SEH2_TRY
2578 {
2579 val |= 1;
2580 _SEH2_TRY
2581 {
2582 val |= 2;
2583 *((char*)(intptr_t)0xdeadc0de) = 0;
2584 val |= 4;
2585 }
2586 _SEH2_EXCEPT(1)
2587 {
2588 val |= 8;
2589 *((char*)(intptr_t)0xdeadc0de) = 0;
2590 val |= 16;
2591 }
2592 _SEH2_END;
2593
2594 val |= 32;
2595 *((char*)(intptr_t)0xdeadc0de) = 0;
2596 val |= 64;
2597 }
2598 _SEH2_EXCEPT(1)
2599 {
2600 val |= 128;
2601 }
2602 _SEH2_END;
2603
2604 return (val == (1|2|8|128));
2605}

◆ DEFINE_TEST() [71/104]

DEFINE_TEST ( test_nested_locals_1  )

Definition at line 2258 of file pseh.c.

2259{
2260 int var1 = return_one();
2261
2262 _SEH2_TRY
2263 {
2264 RaiseException(0xE00DEAD0, 0, 0, 0);
2265 }
2266 _SEH2_EXCEPT((var1 = (var1 == return_one() ? return_positive() : var1)), EXCEPTION_EXECUTE_HANDLER)
2267 {
2268 if(var1 == return_positive())
2269 var1 = return_positive() + 1;
2270 }
2271 _SEH2_END;
2272
2273 return var1 == return_positive() + 1;
2274}

◆ DEFINE_TEST() [72/104]

DEFINE_TEST ( test_nested_locals_2  )

Definition at line 2276 of file pseh.c.

2277{
2278 int var1 = return_positive();
2279
2280 _SEH2_TRY
2281 {
2282 }
2284 {
2285 if(var1 == return_positive())
2286 var1 = return_positive() + 1;
2287 }
2288 _SEH2_END;
2289
2290 return var1 == return_positive() + 1;
2291}

◆ DEFINE_TEST() [73/104]

DEFINE_TEST ( test_nested_locals_3  )

Definition at line 2293 of file pseh.c.

2294{
2295 int var1 = return_zero();
2296
2297 _SEH2_TRY
2298 {
2299 _SEH2_TRY
2300 {
2301 var1 = return_one();
2302 RaiseException(0xE00DEAD0, 0, 0, 0);
2303 }
2305 {
2306 if(var1 == return_one())
2307 var1 = return_positive();
2308 }
2309 _SEH2_END;
2310 }
2312 {
2313 if(var1 == return_positive())
2314 var1 = return_positive() + 1;
2315 }
2316 _SEH2_END;
2317
2318 return var1 == return_positive() + 1;
2319}

◆ DEFINE_TEST() [74/104]

DEFINE_TEST ( test_PSEH3_bug  )

Definition at line 2715 of file pseh.c.

2716{
2717 volatile int count = 0;
2718 int dummy = 0;
2719
2720 _SEH2_TRY
2721 {
2722 if (count++ == 0)
2723 {
2724 *(volatile int*)0x12345678 = 0x12345678;
2725 }
2726 }
2728 {
2729 dummy = 0;
2730 }
2731 _SEH2_END;
2732
2733 (void)dummy;
2734 return (count == 1);
2735}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ DEFINE_TEST() [75/104]

DEFINE_TEST ( test_PSEH3_bug2  )

Definition at line 2747 of file pseh.c.

2748{
2749 unsigned long status = 0;
2750 _SEH2_TRY
2751 {
2752 *(volatile int*)0x12345678 = 0x12345678;
2753 }
2755 {
2758 }
2759 _SEH2_END;
2760
2761 return (status == STATUS_ACCESS_VIOLATION);
2762}
#define STATUS_ACCESS_VIOLATION
void use_lots_of_stack(void)
Definition: pseh.c:2738
Definition: ps.c:97

◆ DEFINE_TEST() [76/104]

DEFINE_TEST ( test_unvolatile  )

Definition at line 2419 of file pseh.c.

2420{
2421 int val = 0;
2422
2423 _SEH2_TRY
2424 {
2425 val = return_one();
2426 *((char*)(intptr_t)0xc0000000) = 0;
2427 }
2429 {
2430 val = val + 3;
2431 }
2432 _SEH2_END;
2433
2434 /* This works with a proper SEH implementation, but not with our hacked PSEH */
2435#ifdef _USE_NATIVE_SEH
2436 return (val == 4);
2437#else
2438 return (val == 4 || val == 3);
2439#endif
2440}

◆ DEFINE_TEST() [77/104]

DEFINE_TEST ( test_unvolatile_2  )

Definition at line 2442 of file pseh.c.

2443{
2444 int val = 0;
2445
2446 _SEH2_TRY
2447 {
2448 val = 1;
2449 *((char*)(intptr_t)0xc0000000) = 0;
2450 val = 2;
2451 }
2453 {
2454 val = val + 3;
2455 }
2456 _SEH2_END;
2457
2458 return (val == 3) || (val == 4) || (val == 5);
2459}

◆ DEFINE_TEST() [78/104]

DEFINE_TEST ( test_unvolatile_3  )

Definition at line 2470 of file pseh.c.

2471{
2472 register int val1 = 0, val2 = 0;
2473
2474 _SEH2_TRY
2475 {
2476 val1 = 1;
2477
2478 _SEH2_TRY
2479 {
2480 val2 = 1;
2481 *((char*)(intptr_t)0xc0000000) = 0;
2482 val2 = 2;
2483 }
2485 {
2486 val2 |= 4;
2487 }
2488 _SEH2_END;
2489
2490 val1 = 2;
2491 *((int*)(intptr_t)0xc0000000) = 1;
2492 val1 = 3;
2493 }
2495 {
2496 val1 = val1 * val2;
2497 }
2498 _SEH2_END;
2499
2500 /* The expected case */
2501 if ((val1 == 10) && (val2 == 5))
2502 return TRUE;
2503
2504 /* The compiler can optimize away "val1 = 1" and "val1 = 2" and
2505 only use the last "val1 = 3", in this case val1 is still 0
2506 when the outer exception handler kicks in */
2507 if ((val1 == 0) && (val2 == 5))
2508 return TRUE;
2509
2510 /* Same as above, but this time val2 optimized away */
2511 if (((val1 == 8) && (val2 == 4)) ||
2512 ((val1 == 0) && (val2 == 4)))
2513 return TRUE;
2514
2515 return FALSE;
2516}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ DEFINE_TEST() [79/104]

DEFINE_TEST ( test_unvolatile_4  )

Definition at line 2519 of file pseh.c.

2520{
2521 unsigned result = 0xdeadbeef;
2522
2523 _SEH2_TRY
2524 {
2525 *(char*)(intptr_t)0x80000000 = 1;
2526 }
2527 _SEH2_EXCEPT(result == 0xdeadbeef)
2528 {
2529 result = 2;
2530 }
2531 _SEH2_END;
2532
2533 result = (result == 0xdeadbeef) ? 0 : result + 1;
2534
2535 return result == 3;
2536}
GLuint64EXT * result
Definition: glext.h:11304

◆ DEFINE_TEST() [80/104]

DEFINE_TEST ( test_xcode_1  )

Definition at line 1982 of file pseh.c.

1983{
1984 static int ret;
1985
1986 ret = return_zero();
1987
1988 _SEH2_TRY
1989 {
1990 RaiseException(0xE00DEAD0, 0, 0, NULL);
1991 ret = return_zero();
1992 }
1994 {
1995 ret = return_arg(ret);
1996 }
1997 _SEH2_END;
1998
1999 return ret == return_positive();
2000}
static int verify_xcode(int code, int xcode, int *ret, int filter)
Definition: pseh.c:1972

◆ DEFINE_TEST() [81/104]

DEFINE_TEST ( test_xcode_2  )

Definition at line 2002 of file pseh.c.

2003{
2004 static int ret;
2005
2006 ret = return_zero();
2007
2008 _SEH2_TRY
2009 {
2010 RaiseException(0xE00DEAD0, 0, 0, NULL);
2011 ret = return_arg(ret);
2012 }
2014 {
2015 ret = return_zero();
2016 }
2017 _SEH2_END;
2018
2019 return ret == return_positive();
2020}

◆ DEFINE_TEST() [82/104]

DEFINE_TEST ( test_xcode_3  )

Definition at line 2022 of file pseh.c.

2023{
2024 static int ret;
2025
2026 ret = return_zero();
2027
2028 _SEH2_TRY
2029 {
2030 _SEH2_TRY
2031 {
2032 RaiseException(0xE00DEAD0, 0, 0, NULL);
2033 ret = return_zero();
2034 }
2036 {
2037 ret = return_zero();
2038 }
2039 _SEH2_END;
2040 }
2042 {
2043 ret = return_arg(ret);
2044 }
2045 _SEH2_END;
2046
2047 return ret == return_positive();
2048}

◆ DEFINE_TEST() [83/104]

DEFINE_TEST ( test_xpointers_1  )

Definition at line 1608 of file pseh.c.

1609{
1610 static int ret;
1611
1612 ret = return_zero();
1613
1614 _SEH2_TRY
1615 {
1616 RaiseException(0xE00DEAD0, 0, 0, NULL);
1617 }
1619 {
1620 ret = return_arg(ret);
1621 }
1622 _SEH2_END;
1623
1624 return ret == return_positive();
1625}
static int verify_xpointers(struct _EXCEPTION_POINTERS *ep, DWORD code, DWORD flags, DWORD argc, const ULONG_PTR *argv, int *ret, int filter)
Definition: pseh.c:1590

◆ DEFINE_TEST() [84/104]

DEFINE_TEST ( test_xpointers_10  )

Definition at line 1788 of file pseh.c.

1789{
1790 static int ret;
1791 static const ULONG_PTR args[] = { 1, 2, 12345 };
1792
1793 ret = return_zero();
1794
1795 _SEH2_TRY
1796 {
1797 RaiseException(0xE00DEAD0, 0, 2, args);
1798 ret = return_arg(ret);
1799 }
1801 {
1802 ret = return_zero();
1803 }
1804 _SEH2_END;
1805
1806 return ret == return_positive();
1807}
Definition: match.c:390
uint32_t ULONG_PTR
Definition: typedefs.h:65

◆ DEFINE_TEST() [85/104]

DEFINE_TEST ( test_xpointers_11  )

Definition at line 1809 of file pseh.c.

1810{
1811 static int ret;
1812 static const ULONG_PTR args[] = { 1, 2, 12345 };
1813
1814 ret = return_zero();
1815
1816 _SEH2_TRY
1817 {
1818 RaiseException(0xE00DEAD0, 0, 3, args);
1819 ret = return_arg(ret);
1820 }
1822 {
1823 ret = return_zero();
1824 }
1825 _SEH2_END;
1826
1827 return ret == return_positive();
1828}

◆ DEFINE_TEST() [86/104]

DEFINE_TEST ( test_xpointers_12  )

Definition at line 1830 of file pseh.c.

1831{
1832 static int ret;
1833
1834 ret = return_zero();
1835
1836 _SEH2_TRY
1837 {
1838 _SEH2_TRY
1839 {
1841 }
1843 {
1844 ret = return_zero();
1845 }
1846 _SEH2_END;
1847 }
1849 {
1850 ret = return_arg(ret);
1851 }
1852 _SEH2_END;
1853
1854 return ret == return_positive();
1855}
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23

◆ DEFINE_TEST() [87/104]

DEFINE_TEST ( test_xpointers_13  )

Definition at line 1857 of file pseh.c.

1858{
1859 static int ret;
1860 static const ULONG_PTR args[] = { 1, 2, 12345 };
1861
1862 ret = return_zero();
1863
1864 _SEH2_TRY
1865 {
1866 _SEH2_TRY
1867 {
1869 }
1871 {
1872 ret = return_zero();
1873 }
1874 _SEH2_END;
1875 }
1877 {
1878 ret = return_arg(ret);
1879 }
1880 _SEH2_END;
1881
1882 return ret == return_positive();
1883}

◆ DEFINE_TEST() [88/104]

DEFINE_TEST ( test_xpointers_14  )

Definition at line 1885 of file pseh.c.

1886{
1887 static int ret;
1888 static const ULONG_PTR args[] = { 1, 2, 12345 };
1889
1890 ret = return_zero();
1891
1892 _SEH2_TRY
1893 {
1894 _SEH2_TRY
1895 {
1897 }
1899 {
1900 ret = return_zero();
1901 }
1902 _SEH2_END;
1903 }
1905 {
1906 ret = return_arg(ret);
1907 }
1908 _SEH2_END;
1909
1910 return ret == return_positive();
1911}

◆ DEFINE_TEST() [89/104]

DEFINE_TEST ( test_xpointers_15  )

Definition at line 1913 of file pseh.c.

1914{
1915 static int ret;
1916 static const ULONG_PTR args[] = { 1, 2, 12345 };
1917
1918 ret = return_zero();
1919
1920 _SEH2_TRY
1921 {
1922 _SEH2_TRY
1923 {
1925 }
1927 {
1928 ret = return_zero();
1929 }
1930 _SEH2_END;
1931 }
1933 {
1934 ret = return_arg(ret);
1935 }
1936 _SEH2_END;
1937
1938 return ret == return_positive();
1939}

◆ DEFINE_TEST() [90/104]

DEFINE_TEST ( test_xpointers_16  )

Definition at line 1941 of file pseh.c.

1942{
1943 static int ret;
1944 static const ULONG_PTR args[] = { 1, 2, 12345 };
1945
1946 ret = return_zero();
1947
1948 _SEH2_TRY
1949 {
1950 _SEH2_TRY
1951 {
1953 }
1955 {
1956 ret = return_zero();
1957 }
1958 _SEH2_END;
1959 }
1961 {
1962 ret = return_arg(ret);
1963 }
1964 _SEH2_END;
1965
1966 return ret == return_positive();
1967}

◆ DEFINE_TEST() [91/104]

DEFINE_TEST ( test_xpointers_2  )

Definition at line 1627 of file pseh.c.

1628{
1629 static int ret;
1630
1631 ret = return_zero();
1632
1633 _SEH2_TRY
1634 {
1636 }
1638 {
1639 ret = return_arg(ret);
1640 }
1641 _SEH2_END;
1642
1643 return ret == return_positive();
1644}

◆ DEFINE_TEST() [92/104]

DEFINE_TEST ( test_xpointers_3  )

Definition at line 1646 of file pseh.c.

1647{
1648 static int ret;
1649 static const ULONG_PTR args[] = { 1, 2, 12345 };
1650
1651 ret = return_zero();
1652
1653 _SEH2_TRY
1654 {
1656 }
1658 {
1659 ret = return_arg(ret);
1660 }
1661 _SEH2_END;
1662
1663 return ret == return_positive();
1664}

◆ DEFINE_TEST() [93/104]

DEFINE_TEST ( test_xpointers_4  )

Definition at line 1666 of file pseh.c.

1667{
1668 static int ret;
1669 static const ULONG_PTR args[] = { 1, 2, 12345 };
1670
1671 ret = return_zero();
1672
1673 _SEH2_TRY
1674 {
1676 }
1678 {
1679 ret = return_arg(ret);
1680 }
1681 _SEH2_END;
1682
1683 return ret == return_positive();
1684}

◆ DEFINE_TEST() [94/104]

DEFINE_TEST ( test_xpointers_5  )

Definition at line 1686 of file pseh.c.

1687{
1688 static int ret;
1689 static const ULONG_PTR args[] = { 1, 2, 12345 };
1690
1691 ret = return_zero();
1692
1693 _SEH2_TRY
1694 {
1696 }
1698 {
1699 ret = return_arg(ret);
1700 }
1701 _SEH2_END;
1702
1703 return ret == return_positive();
1704}

◆ DEFINE_TEST() [95/104]

DEFINE_TEST ( test_xpointers_6  )

Definition at line 1706 of file pseh.c.

1707{
1708 static int ret;
1709 static const ULONG_PTR args[] = { 1, 2, 12345 };
1710
1711 ret = return_zero();
1712
1713 _SEH2_TRY
1714 {
1716 }
1718 {
1719 ret = return_arg(ret);
1720 }
1721 _SEH2_END;
1722
1723 return ret == return_positive();
1724}

◆ DEFINE_TEST() [96/104]

DEFINE_TEST ( test_xpointers_7  )

Definition at line 1726 of file pseh.c.

1727{
1728 static int ret;
1729
1730 ret = return_zero();
1731
1732 _SEH2_TRY
1733 {
1734 RaiseException(0xE00DEAD0, 0, 0, NULL);
1735 ret = return_arg(ret);
1736 }
1738 {
1739 ret = return_zero();
1740 }
1741 _SEH2_END;
1742
1743 return ret == return_positive();
1744}

◆ DEFINE_TEST() [97/104]

DEFINE_TEST ( test_xpointers_8  )

Definition at line 1746 of file pseh.c.

1747{
1748 static int ret;
1749 static const ULONG_PTR args[] = { 1, 2, 12345 };
1750
1751 ret = return_zero();
1752
1753 _SEH2_TRY
1754 {
1755 RaiseException(0xE00DEAD0, 0, 0, args);
1756 ret = return_arg(ret);
1757 }
1759 {
1760 ret = return_zero();
1761 }
1762 _SEH2_END;
1763
1764 return ret == return_positive();
1765}

◆ DEFINE_TEST() [98/104]

DEFINE_TEST ( test_xpointers_9  )

Definition at line 1767 of file pseh.c.

1768{
1769 static int ret;
1770 static const ULONG_PTR args[] = { 1, 2, 12345 };
1771
1772 ret = return_zero();
1773
1774 _SEH2_TRY
1775 {
1776 RaiseException(0xE00DEAD0, 0, 1, args);
1777 ret = return_arg(ret);
1778 }
1780 {
1781 ret = return_zero();
1782 }
1783 _SEH2_END;
1784
1785 return ret == return_positive();
1786}

◆ DEFINE_TEST() [99/104]

DEFINE_TEST ( test_yield_1  )

Definition at line 963 of file pseh.c.

964{
966}
static int test_yield_1_helper(void)
Definition: pseh.c:948

◆ DEFINE_TEST() [100/104]

DEFINE_TEST ( test_yield_2  )

Definition at line 985 of file pseh.c.

986{
988}
static int test_yield_2_helper(void)
Definition: pseh.c:969

◆ DEFINE_TEST() [101/104]

DEFINE_TEST ( test_yield_3  )

Definition at line 1016 of file pseh.c.

1017{
1019}
static int test_yield_3_helper(void)
Definition: pseh.c:991

◆ DEFINE_TEST() [102/104]

DEFINE_TEST ( test_yield_4  )

Definition at line 1048 of file pseh.c.

1049{
1051}
static int test_yield_4_helper(void)
Definition: pseh.c:1022

◆ DEFINE_TEST() [103/104]

DEFINE_TEST ( test_yield_5  )

Definition at line 1073 of file pseh.c.

1074{
1076}
static int test_yield_5_ret
Definition: pseh.c:1053
static int test_yield_5_helper(void)
Definition: pseh.c:1056

◆ DEFINE_TEST() [104/104]

DEFINE_TEST ( test_yield_6  )

Definition at line 1106 of file pseh.c.

1107{
1109}
static int test_yield_6_helper(void)
Definition: pseh.c:1081
static int test_yield_6_ret
Definition: pseh.c:1078

◆ Do_nested_from_except()

void Do_nested_from_except ( void  )

Definition at line 2977 of file pseh.c.

2978{
2979 volatile unsigned int Flags = 0;
2980
2981 _SEH2_TRY
2982 {
2983 RaiseException(0xDEADBEEF, 0, 0, NULL);
2984 }
2986 {
2987 _SEH2_TRY
2988 {
2989 _SEH2_TRY
2990 {
2991 Flags |= 1;
2992 }
2994 {
2995 Flags |= 2;
2996 }
2997 _SEH2_END;
2998 }
3000 {
3001 Flags |= 4;
3002 }
3003 _SEH2_END;
3004 }
3005 _SEH2_END;
3006
3007 ok(Flags == (1 | 4), "Flags = %x\n", Flags);
3008}
#define ok(value,...)
Definition: atltest.h:57
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by Test_nested_from_except().

◆ no_op()

void no_op ( void  )

Definition at line 30 of file psehtest2.c.

31{
32}

◆ passthrough_handler()

static int passthrough_handler ( struct _EXCEPTION_RECORD e,
void f,
struct _CONTEXT c,
void d 
)
static

Definition at line 2645 of file pseh.c.

2646{
2648}
@ ExceptionContinueSearch
Definition: compat.h:91

Referenced by call_test().

◆ return_arg()

int return_arg ( int  arg)

Definition at line 24 of file psehtest2.c.

25{
26 return arg;
27}
void * arg
Definition: msvc.h:10

Referenced by DEFINE_TEST(), test_bug_4004_helper_1(), test_finally_14_helper(), test_finally_4_helper(), and test_finally_9_helper().

◆ return_minusone()

int return_minusone ( void  )

Definition at line 59 of file psehtest2.c.

60{
61 return -1;
62}

Referenced by DEFINE_TEST().

◆ return_minusone_2()

int return_minusone_2 ( void p)

Definition at line 89 of file psehtest2.c.

90{
91 return -1;
92}

Referenced by DEFINE_TEST().

◆ return_minusone_3()

int return_minusone_3 ( int  n)

Definition at line 119 of file psehtest2.c.

120{
121 return -1;
122}

Referenced by DEFINE_TEST().

◆ return_minusone_4()

int return_minusone_4 ( void p,
int  n 
)

Definition at line 149 of file psehtest2.c.

150{
151 return -1;
152}

Referenced by DEFINE_TEST().

◆ return_negative()

int return_negative ( void  )

Definition at line 47 of file psehtest2.c.

48{
49 return -1234;
50}

Referenced by DEFINE_TEST().

◆ return_negative_2()

int return_negative_2 ( void p)

Definition at line 77 of file psehtest2.c.

78{
79 return -1234;
80}

Referenced by DEFINE_TEST().

◆ return_negative_3()

int return_negative_3 ( int  n)

Definition at line 107 of file psehtest2.c.

108{
109 return -1234;
110}

Referenced by DEFINE_TEST().

◆ return_negative_4()

int return_negative_4 ( void p,
int  n 
)

Definition at line 137 of file psehtest2.c.

138{
139 return -1234;
140}

Referenced by DEFINE_TEST().

◆ return_one()

int return_one ( void  )

Definition at line 53 of file psehtest2.c.

54{
55 return 1;
56}

Referenced by DEFINE_TEST(), test_finally_13_helper(), test_finally_14_helper(), test_finally_9_helper(), and test_yield_6_helper().

◆ return_one_2()

int return_one_2 ( void p)

Definition at line 83 of file psehtest2.c.

84{
85 return 1;
86}

Referenced by DEFINE_TEST().

◆ return_one_3()

int return_one_3 ( int  n)

Definition at line 113 of file psehtest2.c.

114{
115 return 1;
116}

Referenced by DEFINE_TEST().

◆ return_one_4()

int return_one_4 ( void p,
int  n 
)

Definition at line 143 of file psehtest2.c.

144{
145 return 1;
146}

Referenced by DEFINE_TEST().

◆ return_positive()

◆ return_positive_2()

int return_positive_2 ( void p)

Definition at line 71 of file psehtest2.c.

72{
73 return 1234;
74}

Referenced by DEFINE_TEST().

◆ return_positive_3()

int return_positive_3 ( int  n)

Definition at line 101 of file psehtest2.c.

102{
103 return 1234;
104}

Referenced by DEFINE_TEST().

◆ return_positive_4()

int return_positive_4 ( void p,
int  n 
)

Definition at line 131 of file psehtest2.c.

132{
133 return 1234;
134}

Referenced by DEFINE_TEST().

◆ return_zero()

◆ return_zero_2()

int return_zero_2 ( void p)

Definition at line 65 of file psehtest2.c.

66{
67 return 0;
68}

Referenced by DEFINE_TEST().

◆ return_zero_3()

int return_zero_3 ( int  n)

Definition at line 95 of file psehtest2.c.

96{
97 return 0;
98}

Referenced by DEFINE_TEST().

◆ return_zero_4()

int return_zero_4 ( void p,
int  n 
)

Definition at line 125 of file psehtest2.c.

126{
127 return 0;
128}

Referenced by DEFINE_TEST().

◆ sanity_check()

static DECLSPEC_NOINLINE int sanity_check ( int  ret,
struct volatile_context before,
struct volatile_context after 
)
static

Definition at line 2632 of file pseh.c.

2633{
2634 if(ret && memcmp(before, after, sizeof(*before)))
2635 {
2636 trace("volatile context corrupted\n");
2637 return 0;
2638 }
2639
2640 return ret;
2641}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by call_test().

◆ set_positive()

void set_positive ( int p)

Definition at line 155 of file psehtest2.c.

156{
157 *p = 1234;
158}
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by DEFINE_TEST().

◆ START_TEST()

START_TEST ( pseh  )

Definition at line 3023 of file pseh.c.

3024{
3025#ifdef _M_IX86
3026 Test_structs_no_seh();
3027 Test_structs_seh_except();
3028 Test_structs_seh_finally();
3029 Test_structs_seh_nested();
3030#endif
3033
3034 const struct subtest testsuite[] =
3035 {
3036 USE_TEST(test_empty_1),
3037 USE_TEST(test_empty_2),
3038 USE_TEST(test_empty_3),
3039 USE_TEST(test_empty_4),
3040 USE_TEST(test_empty_5),
3041 USE_TEST(test_empty_6),
3042 USE_TEST(test_empty_7),
3043 USE_TEST(test_empty_8),
3044
3045 USE_TEST(test_execute_handler_1),
3046 USE_TEST(test_continue_execution_1),
3047 USE_TEST(test_continue_search_1),
3048 USE_TEST(test_execute_handler_2),
3049 USE_TEST(test_continue_execution_2),
3050
3051 USE_TEST(test_execute_handler_3),
3052 USE_TEST(test_continue_execution_3),
3053 USE_TEST(test_continue_search_2),
3054 USE_TEST(test_execute_handler_4),
3055 USE_TEST(test_continue_execution_4),
3056
3057 USE_TEST(test_execute_handler_5),
3058 USE_TEST(test_continue_execution_5),
3059 USE_TEST(test_continue_search_3),
3060 USE_TEST(test_execute_handler_6),
3061 USE_TEST(test_continue_execution_6),
3062
3063 USE_TEST(test_execute_handler_7),
3064 USE_TEST(test_continue_execution_7),
3065 USE_TEST(test_continue_search_4),
3066 USE_TEST(test_execute_handler_8),
3067 USE_TEST(test_continue_execution_8),
3068
3069 USE_TEST(test_execute_handler_9),
3070 USE_TEST(test_continue_execution_9),
3071 USE_TEST(test_continue_search_5),
3072 USE_TEST(test_execute_handler_10),
3073 USE_TEST(test_continue_execution_10),
3074
3075 USE_TEST(test_execute_handler_11),
3076 USE_TEST(test_continue_execution_11),
3077 USE_TEST(test_continue_search_6),
3078 USE_TEST(test_execute_handler_12),
3079 USE_TEST(test_continue_execution_12),
3080
3081 USE_TEST(test_leave_1),
3082 USE_TEST(test_leave_2),
3083 USE_TEST(test_leave_3),
3084 USE_TEST(test_leave_4),
3085 USE_TEST(test_leave_5),
3086 USE_TEST(test_leave_6),
3087
3088 USE_TEST(test_yield_1),
3089 USE_TEST(test_yield_2),
3090 USE_TEST(test_yield_3),
3091 USE_TEST(test_yield_4),
3092 USE_TEST(test_yield_5),
3093 USE_TEST(test_yield_6),
3094
3095 USE_TEST(test_finally_1),
3096 USE_TEST(test_finally_2),
3097 USE_TEST(test_finally_3),
3098 USE_TEST(test_finally_4),
3099 USE_TEST(test_finally_5),
3100 USE_TEST(test_finally_6),
3101 USE_TEST(test_finally_7),
3102 USE_TEST(test_finally_8),
3103 USE_TEST(test_finally_9),
3104 USE_TEST(test_finally_10),
3105 USE_TEST(test_finally_11),
3106 USE_TEST(test_finally_12),
3107 USE_TEST(test_finally_13),
3108 USE_TEST(test_finally_14),
3109
3110 USE_TEST(test_xpointers_1),
3111 USE_TEST(test_xpointers_2),
3112 USE_TEST(test_xpointers_3),
3113 USE_TEST(test_xpointers_4),
3114 USE_TEST(test_xpointers_5),
3115 USE_TEST(test_xpointers_6),
3116 USE_TEST(test_xpointers_7),
3117 USE_TEST(test_xpointers_8),
3118 USE_TEST(test_xpointers_9),
3119 USE_TEST(test_xpointers_10),
3120 USE_TEST(test_xpointers_11),
3121 USE_TEST(test_xpointers_12),
3122 USE_TEST(test_xpointers_13),
3123 USE_TEST(test_xpointers_14),
3124 USE_TEST(test_xpointers_15),
3125 USE_TEST(test_xpointers_16),
3126
3127 USE_TEST(test_xcode_1),
3128 USE_TEST(test_xcode_2),
3129 USE_TEST(test_xcode_3),
3130
3131 USE_TEST(test_abnorm_1),
3132 USE_TEST(test_abnorm_2),
3133 USE_TEST(test_abnorm_3),
3134 USE_TEST(test_abnorm_4),
3135 USE_TEST(test_abnorm_5),
3136 USE_TEST(test_abnorm_6),
3137 USE_TEST(test_abnorm_7),
3138 USE_TEST(test_abnorm_8),
3139
3140 USE_TEST(test_nested_locals_1),
3141 USE_TEST(test_nested_locals_2),
3142 USE_TEST(test_nested_locals_3),
3143
3144 USE_TEST(test_bug_4004),
3145 USE_TEST(test_bug_4663),
3146
3147 USE_TEST(test_unvolatile),
3148 USE_TEST(test_unvolatile_2),
3149#ifndef __cplusplus
3150 USE_TEST(test_unvolatile_3),
3151#endif
3152 USE_TEST(test_unvolatile_4),
3153 USE_TEST(test_finally_goto),
3154 USE_TEST(test_nested_exception),
3155 USE_TEST(test_PSEH3_bug),
3156 USE_TEST(test_PSEH3_bug2),
3157 };
3158
3159 size_t i;
3160
3161 for(i = 0; i < sizeof(testsuite) / sizeof(testsuite[0]); ++ i)
3162 ok(call_test(testsuite[i].func), "%s failed\n", testsuite[i].name);
3163}
void Test_nested_from_except(void)
Definition: pseh.c:3010
static DECLSPEC_NOINLINE int call_test(int(*func)(void))
Definition: pseh.c:2653
void Test_collided_unwind(void)
Definition: pseh.c:2923
#define USE_TEST(NAME_)
Definition: pseh.c:2766
Definition: pseh.c:2769
const char * name
Definition: pseh.c:2770

◆ test_bug_4004_helper_1()

static void test_bug_4004_helper_1 ( void  )
static

Definition at line 2333 of file pseh.c.

2334{
2335 int i1, i2, i3;
2336
2337 i1 = return_positive();
2338 i2 = return_positive();
2339 i3 = return_positive();
2340 (void)return_arg(i1 + i2 + i3);
2341
2342 _SEH2_TRY
2343 {
2344 RaiseException(0xE00DEAD0, 0, 0, NULL);
2345 }
2347 {
2348 }
2349 _SEH2_END;
2350}

Referenced by test_bug_4004_helper_2().

◆ test_bug_4004_helper_2()

static void test_bug_4004_helper_2 ( void  )
static

Definition at line 2353 of file pseh.c.

2354{
2355 _SEH2_TRY
2356 {
2358 }
2360 {
2361 }
2362 _SEH2_END;
2363}
static void test_bug_4004_helper_1(void)
Definition: pseh.c:2333

Referenced by DEFINE_TEST().

◆ Test_collided_unwind()

void Test_collided_unwind ( void  )

Definition at line 2923 of file pseh.c.

2924{
2925 volatile int Flags = 0;
2926 volatile int Count = 0;
2927 jmp_buf JumpBuffer;
2928 int ret;
2929#ifdef _M_IX86
2930 unsigned int Registration = __readfsdword(0);
2931#endif
2932
2933 ret = setjmp(JumpBuffer);
2934 if (ret == 0)
2935 {
2936 _SEH2_TRY
2937 {
2938 _SEH2_TRY
2939 {
2940 _SEH2_TRY
2941 {
2942 Flags |= 1;
2943 *((volatile int*)(LONG_PTR)-1) = 123;
2944 }
2946 {
2947 Count++;
2948 Flags |= 2;
2949 if (Count) // This is to prevent the compiler from optimizing stuff out
2950 longjmp(JumpBuffer, 1);
2951 Flags |= 4;
2952 }
2953 _SEH2_END;
2954 }
2956 {
2957 Count++;
2958 Flags |= 8;
2959 }
2960 _SEH2_END;
2961 }
2963 {
2964 Flags |= 16;
2965 }
2966 _SEH2_END;
2967 }
2968
2969 ok(Flags == (1 | 2 | 8), "Flags = %x\n", Flags);
2970 ok(Count == 2, "Count = %d\n", Count);
2971#ifdef _M_IX86
2972 ok(__readfsdword(0) == Registration, "SEH registration corrupted!\n");
2973 *(unsigned int*)NtCurrentTeb() = Registration;
2974#endif
2975}
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION * Registration
Definition: fltkernel.h:991
#define NtCurrentTeb
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
int Count
Definition: noreturn.cpp:7
#define setjmp
Definition: setjmp.h:211
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:188

Referenced by START_TEST().

◆ test_finally_13_helper()

static void test_finally_13_helper ( void  )
static

Definition at line 1469 of file pseh.c.

1470{
1472
1473 _SEH2_TRY
1474 {
1475 _SEH2_TRY
1476 {
1478 _SEH2_YIELD(return);
1480 }
1482 {
1485 }
1486 _SEH2_END;
1487 }
1489 {
1492
1493 RaiseException(0xE00DEAD0, 0, 0, NULL);
1495 }
1496 _SEH2_END;
1497
1499}

Referenced by DEFINE_TEST().

◆ test_finally_14_helper()

static void test_finally_14_helper ( void  )
static

Definition at line 1525 of file pseh.c.

1526{
1528
1529 _SEH2_TRY
1530 {
1531 _SEH2_TRY
1532 {
1533 _SEH2_TRY
1534 {
1536 RaiseException(0xE00DEAD0, 0, 0, NULL);
1538 }
1540 {
1543 }
1544 _SEH2_END;
1545 }
1547 {
1550
1551 RaiseException(0xE00DEAD0, 0, 0, NULL);
1553 }
1554 _SEH2_END;
1555 }
1557 {
1560 }
1561 _SEH2_END;
1562
1564}

Referenced by DEFINE_TEST().

◆ test_finally_4_helper()

static int test_finally_4_helper ( void  )
static

Definition at line 1175 of file pseh.c.

1176{
1178
1179 _SEH2_TRY
1180 {
1182 _SEH2_YIELD(return return_positive());
1183 }
1185 {
1187 }
1188 _SEH2_END;
1189
1190 return return_zero();
1191}

Referenced by DEFINE_TEST().

◆ test_finally_9_helper()

static int test_finally_9_helper ( void  )
static

Definition at line 1318 of file pseh.c.

1319{
1321
1322 _SEH2_TRY
1323 {
1324 _SEH2_TRY
1325 {
1327 _SEH2_YIELD(return return_positive());
1328 }
1330 {
1333 }
1334 _SEH2_END;
1335 }
1337 {
1340 }
1341 _SEH2_END;
1342
1343 return return_zero();
1344}

Referenced by DEFINE_TEST().

◆ Test_nested_from_except()

void Test_nested_from_except ( void  )

Definition at line 3010 of file pseh.c.

3011{
3013
3014#ifdef _M_IX86
3015 /* Temporarily remove the SEH registration (see CORE-20316) */
3016 unsigned int Registration = __readfsdword(0);
3017 *(unsigned int*)NtCurrentTeb() = -1;
3019 *(unsigned int*)NtCurrentTeb() = Registration;
3020#endif
3021}
void Do_nested_from_except(void)
Definition: pseh.c:2977

Referenced by START_TEST().

◆ test_yield_1_helper()

static int test_yield_1_helper ( void  )
static

Definition at line 948 of file pseh.c.

949{
951 {
953 }
955 {
956 _SEH2_YIELD(return return_zero());
957 }
958 _SEH2_END;
959
960 return return_zero();
961}

Referenced by DEFINE_TEST().

◆ test_yield_2_helper()

static int test_yield_2_helper ( void  )
static

Definition at line 969 of file pseh.c.

970{
972 {
973 RaiseException(0xE00DEAD0, 0, 0, NULL);
974 _SEH2_YIELD(return return_zero());
975 }
977 {
979 }
980 _SEH2_END;
981
982 return return_zero();
983}

Referenced by DEFINE_TEST().

◆ test_yield_3_helper()

static int test_yield_3_helper ( void  )
static

Definition at line 991 of file pseh.c.

992{
994 {
996 {
998 }
1000 {
1001 _SEH2_YIELD(return return_zero());
1002 }
1003 _SEH2_END;
1004
1005 _SEH2_YIELD(return return_zero());
1006 }
1008 {
1009 _SEH2_YIELD(return return_zero());
1010 }
1011 _SEH2_END;
1012
1013 return return_zero();
1014}

Referenced by DEFINE_TEST().

◆ test_yield_4_helper()

static int test_yield_4_helper ( void  )
static

Definition at line 1022 of file pseh.c.

1023{
1024 _SEH2_TRY
1025 {
1026 _SEH2_TRY
1027 {
1028 RaiseException(0xE00DEAD0, 0, 0, NULL);
1029 _SEH2_YIELD(return return_zero());
1030 }
1032 {
1033 _SEH2_YIELD(return return_positive());
1034 }
1035 _SEH2_END;
1036
1037 _SEH2_YIELD(return return_zero());
1038 }
1040 {
1041 _SEH2_YIELD(return return_zero());
1042 }
1043 _SEH2_END;
1044
1045 return return_zero();
1046}

Referenced by DEFINE_TEST().

◆ test_yield_5_helper()

static int test_yield_5_helper ( void  )
static

Definition at line 1056 of file pseh.c.

1057{
1059
1060 _SEH2_TRY
1061 {
1062 _SEH2_YIELD(return return_positive());
1063 }
1065 {
1067 }
1068 _SEH2_END;
1069
1070 return return_zero();
1071}

Referenced by DEFINE_TEST().

◆ test_yield_6_helper()

static int test_yield_6_helper ( void  )
static

Definition at line 1081 of file pseh.c.

1082{
1084
1085 _SEH2_TRY
1086 {
1087 _SEH2_TRY
1088 {
1089 _SEH2_YIELD(return return_positive());
1090 }
1092 {
1094 }
1095 _SEH2_END;
1096 }
1098 {
1100 }
1101 _SEH2_END;
1102
1103 return return_zero();
1104}

Referenced by DEFINE_TEST().

◆ unhandled_exception()

static LONG WINAPI unhandled_exception ( PEXCEPTION_POINTERS  ExceptionInfo)
static

Definition at line 2608 of file pseh.c.

2609{
2610 trace("unhandled exception %08lX thrown from %p\n", ExceptionInfo->ExceptionRecord->ExceptionCode, ExceptionInfo->ExceptionRecord->ExceptionAddress);
2612}
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
DWORD ExceptionCode
Definition: compat.h:208
PVOID ExceptionAddress
Definition: compat.h:211

Referenced by call_test().

◆ use_lots_of_stack()

void use_lots_of_stack ( void  )

Definition at line 2738 of file pseh.c.

2739{
2740 int i;
2741 volatile int arr[512];
2742 for (i = 0; i < 512; i++)
2743 arr[i] = 123;
2744 (void)arr;
2745}

Referenced by DEFINE_TEST().

◆ verify_xcode()

static int verify_xcode ( int  code,
int  xcode,
int ret,
int  filter 
)
static

Definition at line 1972 of file pseh.c.

1973{
1974 *ret = code == xcode;
1975
1976 if(*ret)
1977 *ret = return_positive();
1978
1979 return filter;
1980}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
Definition: inflate.c:139

Referenced by DEFINE_TEST().

◆ verify_xpointers()

static int verify_xpointers ( struct _EXCEPTION_POINTERS ep,
DWORD  code,
DWORD  flags,
DWORD  argc,
const ULONG_PTR argv,
int ret,
int  filter 
)
static

Definition at line 1590 of file pseh.c.

1591{
1592 *ret =
1593 ep &&
1594 ep->ExceptionRecord &&
1595 ep->ContextRecord &&
1599 (argv || !argc) &&
1600 memcmp(ep->ExceptionRecord->ExceptionInformation, argv, sizeof(argv[0]) * argc) == 0;
1601
1602 if(*ret)
1603 *ret = return_positive();
1604
1605 return filter;
1606}
static int argc
Definition: ServiceArgs.c:12
GLbitfield flags
Definition: glext.h:7161
#define argv
Definition: mplay32.c:18
PCONTEXT ContextRecord
Definition: rtltypes.h:201
DWORD NumberParameters
Definition: compat.h:212
DWORD ExceptionFlags
Definition: compat.h:209
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213

Referenced by DEFINE_TEST().

Variable Documentation

◆ test_finally_13_ret

int test_finally_13_ret
static

Definition at line 1466 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_13_helper().

◆ test_finally_14_ret

int test_finally_14_ret
static

Definition at line 1522 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_14_helper().

◆ test_finally_4_ret

int test_finally_4_ret
static

Definition at line 1173 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_4_helper().

◆ test_finally_9_ret

int test_finally_9_ret
static

Definition at line 1316 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_9_helper().

◆ test_yield_5_ret

int test_yield_5_ret
static

Definition at line 1053 of file pseh.c.

Referenced by DEFINE_TEST(), and test_yield_5_helper().

◆ test_yield_6_ret

int test_yield_6_ret
static

Definition at line 1078 of file pseh.c.

Referenced by DEFINE_TEST(), and test_yield_6_helper().