[PATCH 1/6] [NtDll]: in SYSTEM_BASIC_INFORMATION, the active processors' field refers to the affinity mask

Eric Pouech eric.pouech at orange.fr
Tue Sep 15 14:37:55 CDT 2009




A+
---

 dlls/kernel32/cpu.c  |    2 +-
 dlls/ntdll/virtual.c |    2 +-
 include/winternl.h   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index 6648dc4..800828a 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -382,7 +382,7 @@ VOID WINAPI GetSystemInfo(
         cachedsi.dwPageSize                  = sbi.PageSize;
         cachedsi.lpMinimumApplicationAddress = sbi.LowestUserAddress;
         cachedsi.lpMaximumApplicationAddress = sbi.HighestUserAddress;
-        cachedsi.dwNumberOfProcessors        = sbi.ActiveProcessors;
+        cachedsi.dwNumberOfProcessors        = sbi.NumberOfProcessors;
         cachedsi.dwAllocationGranularity     = sbi.AllocationGranularity;
 
 	/* choose sensible defaults ...
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index dc9559e..fe2ef26 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1380,7 +1380,7 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info )
     info->AllocationGranularity   = get_mask(0) + 1;
     info->LowestUserAddress       = (void *)0x10000;
     info->HighestUserAddress      = (char *)user_space_limit - 1;
-    info->ActiveProcessors        = NtCurrentTeb()->Peb->NumberOfProcessors;
+    info->ActiveProcessorsAffinityMask = (1 << NtCurrentTeb()->Peb->NumberOfProcessors) - 1;
     info->NumberOfProcessors      = NtCurrentTeb()->Peb->NumberOfProcessors;
 }
 
diff --git a/include/winternl.h b/include/winternl.h
index 07c778c..d35adea 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1196,7 +1196,7 @@ typedef struct _SYSTEM_BASIC_INFORMATION {
     ULONG_PTR AllocationGranularity;
     PVOID     LowestUserAddress;
     PVOID     HighestUserAddress;
-    ULONG_PTR ActiveProcessors;
+    ULONG_PTR ActiveProcessorsAffinityMask;
     BYTE      NumberOfProcessors;
 #else
     BYTE Reserved1[24];






More information about the wine-patches mailing list