Juan Lang : ntdll: Don't allow setting a zero thread affinity.

Alexandre Julliard julliard at winehq.org
Tue Sep 29 11:09:07 CDT 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Mon Sep 28 08:25:16 2009 -0700

ntdll: Don't allow setting a zero thread affinity.

---

 dlls/ntdll/tests/info.c |    1 -
 dlls/ntdll/thread.c     |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 37895ef..6495acc 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -920,7 +920,6 @@ static void test_affinity(void)
         "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
     thread_affinity = 0;
     status = pNtSetInformationThread( GetCurrentThread(), ThreadAffinityMask, &thread_affinity, sizeof(thread_affinity) );
-    todo_wine
     ok( status == STATUS_INVALID_PARAMETER,
         "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
 
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 07e063a..dab1c1d 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -1216,6 +1216,7 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
             const ULONG_PTR *paff = data;
             if (length != sizeof(ULONG_PTR)) return STATUS_INVALID_PARAMETER;
             if (*paff & ~affinity_mask) return STATUS_INVALID_PARAMETER;
+            if (!*paff) return STATUS_INVALID_PARAMETER;
             SERVER_START_REQ( set_thread_info )
             {
                 req->handle   = wine_server_obj_handle( handle );




More information about the wine-cvs mailing list