https://git.reactos.org/?p=reactos.git;a=commitdiff;h=de1b195837867be3757660f236d07e4f0cdf206a

commit de1b195837867be3757660f236d07e4f0cdf206a
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sat Feb 10 20:30:14 2018 +0100
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sun Jul 1 14:45:21 2018 +0200

    [NDK] Fix the type of KPROCESS::ActiveProcessors
    Also fix related logic in KiSwapProcess
---
 ntoskrnl/ke/amd64/stubs.c | 8 +++-----
 sdk/include/ndk/ketypes.h | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/ntoskrnl/ke/amd64/stubs.c b/ntoskrnl/ke/amd64/stubs.c
index f63485eb78..9f8ed16e0d 100644
--- a/ntoskrnl/ke/amd64/stubs.c
+++ b/ntoskrnl/ke/amd64/stubs.c
@@ -278,13 +278,11 @@ KiSwapProcess(IN PKPROCESS NewProcess,
               IN PKPROCESS OldProcess)
 {
     PKIPCR Pcr = (PKIPCR)KeGetPcr();
-#ifdef CONFIG_SMP
-    LONG SetMember;
 
+#ifdef CONFIG_SMP
     /* Update active processor mask */
-    SetMember = (LONG)Pcr->SetMember;
-    InterlockedXor((PLONG)&NewProcess->ActiveProcessors, SetMember);
-    InterlockedXor((PLONG)&OldProcess->ActiveProcessors, SetMember);
+    InterlockedXor64((PLONG64)&NewProcess->ActiveProcessors, 
Pcr->Prcb.SetMember);
+    InterlockedXor64((PLONG64)&OldProcess->ActiveProcessors, 
Pcr->Prcb.SetMember);
 #endif
 
     /* Update CR3 */
diff --git a/sdk/include/ndk/ketypes.h b/sdk/include/ndk/ketypes.h
index 839a0d77d7..7a8c614a8d 100644
--- a/sdk/include/ndk/ketypes.h
+++ b/sdk/include/ndk/ketypes.h
@@ -1988,7 +1988,7 @@ typedef struct _KPROCESS
     UCHAR Iopl;
     UCHAR Unused;
 #endif
-    volatile ULONG ActiveProcessors;
+    volatile KAFFINITY ActiveProcessors;
     ULONG KernelTime;
     ULONG UserTime;
     LIST_ENTRY ReadyListHead;

Reply via email to