mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[COMPILER_APITEST] Add another SEH test
See CORE-20316
This commit is contained in:
@@ -2972,7 +2972,52 @@ void Test_collided_unwind(void)
|
||||
ok(__readfsdword(0) == Registration, "SEH registration corrupted!\n");
|
||||
*(unsigned int*)NtCurrentTeb() = Registration;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Do_nested_from_except(void)
|
||||
{
|
||||
volatile unsigned int Flags = 0;
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
RaiseException(0xDEADBEEF, 0, 0, NULL);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
Flags |= 1;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Flags |= 2;
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
_SEH2_FINALLY
|
||||
{
|
||||
Flags |= 4;
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
ok(Flags == (1 | 4), "Flags = %x\n", Flags);
|
||||
}
|
||||
|
||||
void Test_nested_from_except(void)
|
||||
{
|
||||
Do_nested_from_except();
|
||||
|
||||
#ifdef _M_IX86
|
||||
/* Temporarily remove the SEH registration (see CORE-20316) */
|
||||
unsigned int Registration = __readfsdword(0);
|
||||
*(unsigned int*)NtCurrentTeb() = -1;
|
||||
Do_nested_from_except();
|
||||
*(unsigned int*)NtCurrentTeb() = Registration;
|
||||
#endif
|
||||
}
|
||||
|
||||
START_TEST(pseh)
|
||||
@@ -2984,6 +3029,7 @@ START_TEST(pseh)
|
||||
Test_structs_seh_nested();
|
||||
#endif
|
||||
Test_collided_unwind();
|
||||
Test_nested_from_except();
|
||||
|
||||
const struct subtest testsuite[] =
|
||||
{
|
||||
|
Reference in New Issue
Block a user