Maarten Lankhorst : ntdll: Fix some exception tests to pass on Windows.

Alexandre Julliard julliard at winehq.org
Wed May 7 13:28:15 CDT 2008


Module: wine
Branch: master
Commit: 9c509234bc7d3d615da60b80e5c7c528d5858c0c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9c509234bc7d3d615da60b80e5c7c528d5858c0c

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Wed May  7 10:41:52 2008 -0700

ntdll: Fix some exception tests to pass on Windows.

---

 dlls/ntdll/tests/exception.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index d6168ee..80a8fbd 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -105,7 +105,7 @@ static const struct exception
 
     /* test loading an invalid selector */
     { { 0xb8, 0xef, 0xbe, 0x00, 0x00, 0x8e, 0xe8, 0xc3 },  /* mov $beef,%ax; mov %ax,%gs; ret */
-      5, 2, STATUS_ACCESS_VIOLATION, 2, { 0, 0xbee8 } },
+      5, 2, STATUS_ACCESS_VIOLATION, 2, { 0, 0xbee8 } }, /* 0xbee8 or 0xffffffff */
 
     /* test accessing a zero selector */
     { { 0x06, 0x31, 0xc0, 0x8e, 0xc0, 0x26, 0xa1, 0, 0, 0, 0, 0x07, 0xc3 },
@@ -358,6 +358,14 @@ static DWORD handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *fram
             goto skip_params;
     }
 
+    /* Seems that both 0xbee8 and 0xfffffffff can be returned in windows */
+    if (except->nb_params == 2 && rec->NumberParameters == 2
+        && except->params[1] == 0xbee8 && rec->ExceptionInformation[1] == 0xffffffff
+        && except->params[0] == rec->ExceptionInformation[0])
+    {
+        goto skip_params;
+    }
+
     for (i = 0; i < rec->NumberParameters; i++)
         ok( rec->ExceptionInformation[i] == except->params[i],
             "%u: Wrong parameter %d: %lx/%x\n",
@@ -485,7 +493,8 @@ static DWORD direction_flag_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATI
 #ifdef __GNUC__
     unsigned int flags;
     __asm__("pushfl; popl %0" : "=r" (flags) );
-    ok( !(flags & 0x400), "eflags has DF bit set\n" );
+    /* older windows versions don't clear DF properly so don't test */
+    if (flags & 0x400) trace( "eflags has DF bit set\n" );
 #endif
     ok( context->EFlags & 0x400, "context eflags has DF bit cleared\n" );
     got_exception++;




More information about the wine-cvs mailing list