From 8a3239aef39bf007b0434fb26a49ad928cc7d1b0 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 7 Jan 2005 13:34:47 +0000 Subject: [PATCH] GetProcessAffinityMask() should return correct system affinity mask svn path=/trunk/; revision=12867 --- reactos/lib/kernel32/process/proc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/reactos/lib/kernel32/process/proc.c b/reactos/lib/kernel32/process/proc.c index d90490dffca..08ce35206d1 100644 --- a/reactos/lib/kernel32/process/proc.c +++ b/reactos/lib/kernel32/process/proc.c @@ -37,7 +37,18 @@ GetProcessAffinityMask (HANDLE hProcess, LPDWORD lpSystemAffinityMask) { PROCESS_BASIC_INFORMATION ProcessInfo; + SYSTEM_BASIC_INFORMATION SystemInfo; NTSTATUS Status; + + Status = NtQuerySystemInformation(SystemBasicInformation, + &SystemInfo, + sizeof(SystemInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } Status = NtQueryInformationProcess (hProcess, ProcessBasicInformation, @@ -51,9 +62,7 @@ GetProcessAffinityMask (HANDLE hProcess, } *lpProcessAffinityMask = (DWORD)ProcessInfo.AffinityMask; - - /* FIXME */ - *lpSystemAffinityMask = 0x00000001; + *lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessors; return TRUE; }