From: Paul Gofman pgofman@codeweavers.com
--- dlls/ntdll/tests/exception.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 771f32bb514..3954b90ef82 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -174,6 +174,7 @@ enum debugger_stages static int my_argc; static char** my_argv; static BOOL is_wow64; +static BOOL old_wow64; /* Wine old-style wow64 */ static BOOL have_vectored_api; static enum debugger_stages test_stage;
@@ -264,6 +265,7 @@ static const struct exception NTSTATUS alt_status; /* alternative status code */ DWORD alt_nb_params; /* alternative number of parameters */ DWORD alt_params[4]; /* alternative parameters */ + BOOL wow64_wine_todo; /* broken in Wine new wow64 mode. */ } exceptions[] = { /* 0 */ @@ -319,7 +321,9 @@ static const struct exception 5, 6, TRUE, STATUS_ACCESS_VIOLATION, 2, { 0, 0xffffffff } }, { { 0x0f, 0xa8, 0x31, 0xc0, 0x8e, 0xe8, 0x65, 0xa1, 0, 0, 0, 0, 0x0f, 0xa9, 0xc3 }, /* push %gs; xor %eax,%eax; mov %ax,%gs; mov %gs:(0),%ax; pop %gs; ret */ - 6, 6, FALSE, STATUS_ACCESS_VIOLATION, 2, { 0, 0xffffffff } }, + 6, 6, FALSE, STATUS_ACCESS_VIOLATION, 2, { 0, 0xffffffff }, + .wow64_wine_todo = TRUE, + },
/* test moving %cs -> %ss */ { { 0x0e, 0x17, 0x58, 0xc3 }, /* pushl %cs; popl %ss; popl %eax; ret */ @@ -734,6 +738,11 @@ static void test_prot_fault(void) skip( "Exception %u broken on Wow64\n", i ); continue; } + if (is_wow64 && !old_wow64 && exceptions[i].wow64_wine_todo && !strcmp(winetest_platform, "wine")) + { + todo_wine ok( 0, "Exception %u broken on Wow64 (Wine)\n", i ); + continue; + } got_exception = 0; run_exception_test(prot_fault_handler, &exceptions[i], &exceptions[i].code, sizeof(exceptions[i].code), 0); @@ -11021,6 +11030,16 @@ START_TEST(exception) #define X(f) p##f = (void*)GetProcAddress(hkernel32, #f) X(IsWow64Process); if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; + if (is_wow64) + { + TEB64 *teb64 = ULongToPtr( NtCurrentTeb()->GdiBatchCount ); + + if (teb64) + { + PEB64 *peb64 = ULongToPtr(teb64->Peb); + old_wow64 = !peb64->LdrData; + } + }
X(InitializeContext); X(InitializeContext2); @@ -11117,8 +11136,15 @@ START_TEST(exception) test_debuggee_xstate(); test_stage = STAGE_XSTATE_LEGACY_SSE; test_debuggee_xstate(); - test_stage = STAGE_SEGMENTS; - test_debuggee_segments(); + if ((!is_wow64 || old_wow64) || strcmp(winetest_platform, "wine")) + { + test_stage = STAGE_SEGMENTS; + test_debuggee_segments(); + } + else + { + todo_wine ok(0, "skipping test_debuggee_segments().\n"); + } #endif
/* rest of tests only run in parent */