Paul Gofman : ntdll: Fill ActiveProcessorCount field in _KUSER_SHARED_DATA.

Alexandre Julliard julliard at winehq.org
Mon May 25 15:44:23 CDT 2020


Module: wine
Branch: master
Commit: 1306bd941b7052a97910795a86aeae873f4fcb08
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1306bd941b7052a97910795a86aeae873f4fcb08

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Mon May 25 18:42:01 2020 +0300

ntdll: Fill ActiveProcessorCount field in _KUSER_SHARED_DATA.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/tests/virtual.c | 3 +++
 dlls/ntdll/thread.c        | 1 +
 2 files changed, 4 insertions(+)

diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
index 3b0d74daeb..59c2224816 100644
--- a/dlls/ntdll/tests/virtual.c
+++ b/dlls/ntdll/tests/virtual.c
@@ -528,6 +528,9 @@ static void test_user_shared_data(void)
     ok(user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] /* Supported since Pentium CPUs. */,
             "_RDTSC not available.\n");
 #endif
+    ok(user_shared_data->ActiveProcessorCount == NtCurrentTeb()->Peb->NumberOfProcessors
+            || broken(!user_shared_data->ActiveProcessorCount) /* before Win7 */,
+            "Got unexpected ActiveProcessorCount %u.\n", user_shared_data->ActiveProcessorCount);
 }
 
 START_TEST(virtual)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 19e09c7e38..78574d0c5d 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -238,6 +238,7 @@ static void fill_user_shared_data( struct _KUSER_SHARED_DATA *data )
         features[PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE] = !!(sci.FeatureSet & CPU_FEATURE_ARM_V8_CRYPTO);
         break;
     }
+    data->ActiveProcessorCount = NtCurrentTeb()->Peb->NumberOfProcessors;
 }
 
 HANDLE user_shared_data_init_done(void)




More information about the wine-cvs mailing list