Rémi Bernon : ntdll: Stub ThreadEnableAlignmentFaultFixup info class.
Alexandre Julliard
julliard at winehq.org
Fri Nov 20 14:54:32 CST 2020
Module: wine
Branch: master
Commit: ad24187de837f985cc9a11237ac560ace6b57aa4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ad24187de837f985cc9a11237ac560ace6b57aa4
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Thu Nov 19 10:18:54 2020 +0100
ntdll: Stub ThreadEnableAlignmentFaultFixup info class.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46216
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/tests/info.c | 33 +++++++++++++++++++++++++++++++++
dlls/ntdll/unix/thread.c | 11 +++++++++--
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 70ea7d5146b..5db7a800cbe 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -2505,6 +2505,37 @@ static void test_NtGetCurrentProcessorNumber(void)
ok(status == STATUS_SUCCESS, "got 0x%x (expected STATUS_SUCCESS)\n", status);
}
+static void test_ThreadEnableAlignmentFaultFixup(void)
+{
+ NTSTATUS status;
+ ULONG dummy;
+
+ dummy = 0;
+ status = NtQueryInformationThread( GetCurrentThread(), ThreadEnableAlignmentFaultFixup, &dummy, sizeof(ULONG), NULL );
+ ok( status == STATUS_INVALID_INFO_CLASS || broken(STATUS_NOT_IMPLEMENTED), "Expected STATUS_INVALID_INFO_CLASS, got %08x\n", status );
+ status = NtQueryInformationThread( GetCurrentThread(), ThreadEnableAlignmentFaultFixup, &dummy, 1, NULL );
+ ok( status == STATUS_INVALID_INFO_CLASS || broken(STATUS_NOT_IMPLEMENTED), "Expected STATUS_INVALID_INFO_CLASS, got %08x\n", status );
+
+ dummy = 1;
+ status = pNtSetInformationThread( GetCurrentThread(), ThreadEnableAlignmentFaultFixup, &dummy, sizeof(ULONG) );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
+ status = pNtSetInformationThread( (HANDLE)0xdeadbeef, ThreadEnableAlignmentFaultFixup, NULL, 0 );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
+ status = pNtSetInformationThread( (HANDLE)0xdeadbeef, ThreadEnableAlignmentFaultFixup, NULL, 1 );
+ ok( status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got %08x\n", status );
+ status = pNtSetInformationThread( (HANDLE)0xdeadbeef, ThreadEnableAlignmentFaultFixup, &dummy, 1 );
+ todo_wine ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status );
+ status = pNtSetInformationThread( GetCurrentProcess(), ThreadEnableAlignmentFaultFixup, &dummy, 1 );
+ todo_wine ok( status == STATUS_OBJECT_TYPE_MISMATCH, "Expected STATUS_OBJECT_TYPE_MISMATCH, got %08x\n", status );
+ dummy = 1;
+ status = pNtSetInformationThread( GetCurrentThread(), ThreadEnableAlignmentFaultFixup, &dummy, 1 );
+ ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status );
+
+ dummy = 0;
+ status = pNtSetInformationThread( GetCurrentProcess(), ThreadEnableAlignmentFaultFixup, &dummy, 8 );
+ ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status );
+}
+
static DWORD WINAPI start_address_thread(void *arg)
{
PRTL_THREAD_START_ROUTINE entry;
@@ -2774,4 +2805,6 @@ START_TEST(info)
test_readvirtualmemory();
test_queryvirtualmemory();
test_NtGetCurrentProcessorNumber();
+
+ test_ThreadEnableAlignmentFaultFixup();
}
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 8c91f49690b..9808fc610e3 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -1137,10 +1137,12 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
if (ret_len) *ret_len = sizeof(BOOLEAN);
return STATUS_SUCCESS;
+ case ThreadEnableAlignmentFaultFixup:
+ return STATUS_INVALID_INFO_CLASS;
+
case ThreadPriority:
case ThreadBasePriority:
case ThreadImpersonationToken:
- case ThreadEnableAlignmentFaultFixup:
case ThreadEventPair_Reusable:
case ThreadZeroTlsCell:
case ThreadPerformanceCount:
@@ -1316,11 +1318,16 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
#endif
}
+ case ThreadEnableAlignmentFaultFixup:
+ if (length != sizeof(BOOLEAN)) return STATUS_INFO_LENGTH_MISMATCH;
+ if (!data) return STATUS_ACCESS_VIOLATION;
+ FIXME( "ThreadEnableAlignmentFaultFixup stub!\n" );
+ return STATUS_SUCCESS;
+
case ThreadBasicInformation:
case ThreadTimes:
case ThreadPriority:
case ThreadDescriptorTableEntry:
- case ThreadEnableAlignmentFaultFixup:
case ThreadEventPair_Reusable:
case ThreadPerformanceCount:
case ThreadAmILastThread:
More information about the wine-cvs
mailing list