[PATCH v3 2/2] ntdll/tests: Raise an exception to check that EFlags.AC is cleared.

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Thu Sep 3 13:04:04 CDT 2020


From 59e3aa1e4eac8347714f2bfe27a243050f452129 Mon Sep 17 00:00:00 2001
From: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
Date: Thu, 3 Sep 2020 19:35:30 +0000
Subject: [PATCH 2/2] ntdll/tests: Raise an exception to check that EFlags.AC
 is cleared.

V3: Windows 8 32-bit leaves AC bit set.

V2: Change the test failure text to match the assertion.

Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
---
 dlls/ntdll/tests/exception.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 494f8fd96e7..3b346922943 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -773,6 +773,7 @@ static const BYTE align_check_code[] = {
     0x9d,                  	/* popf    */
     0x89,0xe1,                  /* mov %esp, %ecx */
     0x8b,0x49,0x1,              /* mov 0x1(%ecx), %ecx - cause exception */
+    0xfa,                  	/* cli - cause exception */
     0x35,0,0,4,0,       	/* xor    $0x40000,%eax */
     0x50,                  	/* push   %eax */
     0x9d,                  	/* popf    */
@@ -783,8 +784,11 @@ static const BYTE align_check_code[] = {
 static DWORD align_check_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame,
                                   CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher )
 {
-    ok (!(context->EFlags & 0x40000), "eflags has AC bit set\n");
+    ok (!(context->EFlags & 0x40000) ||
+        broken(context->EFlags & 0x40000) /* Windows 8 32-bit */,
+        "eflags has AC bit set\n");
     got_exception++;
+    context->Eip++;  /* skip cli */
     return ExceptionContinueExecution;
 }
 
@@ -921,7 +925,7 @@ static void test_exceptions(void)
     /* test alignment exceptions */
     got_exception = 0;
     run_exception_test(align_check_handler, NULL, align_check_code, sizeof(align_check_code), 0);
-    ok(got_exception == 0, "got %d alignment faults, expected 0\n", got_exception);
+    ok(got_exception == 1, "got %d alignment faults, expected 1\n", got_exception);
 
     /* test direction flag */
     got_exception = 0;
-- 
2.26.2



More information about the wine-devel mailing list