https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1fa9fdb625d0be01d0245…
commit 1fa9fdb625d0be01d02456a8482d17122f147684
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Mar 9 22:17:22 2020 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Oct 24 13:26:33 2020 +0200
[PSEH2_TEST] Fix compilation with MSVC
---
modules/rostests/tests/CMakeLists.txt | 4 +---
modules/rostests/tests/pseh2/psehtest.c | 26 +++++++++++++-------------
2 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/modules/rostests/tests/CMakeLists.txt
b/modules/rostests/tests/CMakeLists.txt
index 78164342591..0fc1ed4c2bd 100644
--- a/modules/rostests/tests/CMakeLists.txt
+++ b/modules/rostests/tests/CMakeLists.txt
@@ -1,6 +1,4 @@
add_subdirectory(mmixer_test)
-if(NOT MSVC)
- add_subdirectory(pseh2)
-endif()
+add_subdirectory(pseh2)
add_subdirectory(dllexport)
add_subdirectory(spec2def)
diff --git a/modules/rostests/tests/pseh2/psehtest.c
b/modules/rostests/tests/pseh2/psehtest.c
index dbd0e1e56c4..242b3ecff8e 100644
--- a/modules/rostests/tests/pseh2/psehtest.c
+++ b/modules/rostests/tests/pseh2/psehtest.c
@@ -2417,7 +2417,7 @@ DEFINE_TEST(test_unvolatile)
_SEH2_TRY
{
val = return_one();
- *((char*)0xc0000000) = 0;
+ *((char*)(intptr_t)0xc0000000) = 0;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -2435,7 +2435,7 @@ DEFINE_TEST(test_unvolatile_2)
_SEH2_TRY
{
val = 1;
- *((char*)0xc0000000) = 0;
+ *((char*)(intptr_t)0xc0000000) = 0;
val = 2;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -2467,7 +2467,7 @@ DEFINE_TEST(test_unvolatile_3)
_SEH2_TRY
{
val2 = 1;
- *((char*)0xc0000000) = 0;
+ *((char*)(intptr_t)0xc0000000) = 0;
val2 = 2;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -2477,7 +2477,7 @@ DEFINE_TEST(test_unvolatile_3)
_SEH2_END;
val1 = 2;
- *((int*)0xc0000000) = 1;
+ *((int*)(intptr_t)0xc0000000) = 1;
val1 = 3;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -2511,7 +2511,7 @@ DEFINE_TEST(test_unvolatile_4)
_SEH2_TRY
{
- *(char*)0x80000000 = 1;
+ *(char*)(intptr_t)0x80000000 = 1;
}
_SEH2_EXCEPT(result == 0xdeadbeef)
{
@@ -2539,7 +2539,7 @@ DEFINE_TEST(test_finally_goto)
_SEH2_FINALLY
{
val |= 4;
- *((char*)0xdeadc0de) = 0;
+ *((char*)(intptr_t)0xdeadc0de) = 0;
val |= 8;
}
_SEH2_END;
@@ -2547,7 +2547,7 @@ DEFINE_TEST(test_finally_goto)
val |= 16;
next:
val |= 32;
- *((char*)0xdeadc0de) = 0;
+ *((char*)(intptr_t)0xdeadc0de) = 0;
val |= 64;
}
_SEH2_EXCEPT(1)
@@ -2569,19 +2569,19 @@ DEFINE_TEST(test_nested_exception)
_SEH2_TRY
{
val |= 2;
- *((char*)0xdeadc0de) = 0;
+ *((char*)(intptr_t)0xdeadc0de) = 0;
val |= 4;
}
_SEH2_EXCEPT(1)
{
val |= 8;
- *((char*)0xdeadc0de) = 0;
+ *((char*)(intptr_t)0xdeadc0de) = 0;
val |= 16;
}
_SEH2_END;
val |= 32;
- *((char*)0xdeadc0de) = 0;
+ *((char*)(intptr_t)0xdeadc0de) = 0;
val |= 64;
}
_SEH2_EXCEPT(1)
@@ -2644,14 +2644,14 @@ int call_test(int (* func)(void))
static int ret;
static struct volatile_context before, after;
static LPTOP_LEVEL_EXCEPTION_FILTER prev_unhandled_exception;
-#ifndef _PSEH3_H_
+#if !defined(_PSEH3_H_) && !defined(_MSC_VER)
static _SEH2Registration_t * prev_frame;
_SEH2Registration_t passthrough_frame;
#endif
prev_unhandled_exception = SetUnhandledExceptionFilter(&unhandled_exception);
-#if defined(_X86_) && !defined(_PSEH3_H_)
+#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
prev_frame = (_SEH2Registration_t *)__readfsdword(0);
passthrough_frame.SER_Prev = prev_frame;
passthrough_frame.SER_Handler = passthrough_handler;
@@ -2687,7 +2687,7 @@ int call_test(int (* func)(void))
ret = func();
#endif
-#if defined(_X86_) && !defined(_PSEH3_H_)
+#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
if((_SEH2Registration_t *)__readfsdword(0) != &passthrough_frame ||
passthrough_frame.SER_Prev != prev_frame)
{
trace("exception registration list corrupted\n");