Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/tests/virtual.c | 6 ++++++ programs/wineboot/wineboot.c | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 9c2cf824018..df5d601927a 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -579,6 +579,12 @@ static void test_user_shared_data(void) ok(user_shared_data->ActiveProcessorCount == NtCurrentTeb()->Peb->NumberOfProcessors || broken(!user_shared_data->ActiveProcessorCount) /* before Win7 */, "Got unexpected ActiveProcessorCount %u.\n", user_shared_data->ActiveProcessorCount); + if (user_shared_data->ActiveProcessorCount) + ok(user_shared_data->ActiveProcessorAffinity == (user_shared_data->ActiveProcessorCount >= 64 + ? ~(ULONG_PTR)0 : ((ULONG_PTR)1 << user_shared_data->ActiveProcessorCount) - 1) + || broken(!user_shared_data->ActiveProcessorAffinity) /* before Win7 */, + "Got unexpected ActiveProcessorAffinity %s.\n", + wine_dbgstr_longlong(user_shared_data->ActiveProcessorAffinity)); ok(user_shared_data->ActiveGroupCount == 1 || broken(!user_shared_data->ActiveGroupCount) /* before Win7 */, "Got unexpected ActiveGroupCount %u.\n", user_shared_data->ActiveGroupCount); diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 05a5ee6aa62..b3a28444a06 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -332,6 +332,8 @@ static void create_user_shared_data(void) break; } data->ActiveProcessorCount = NtCurrentTeb()->Peb->NumberOfProcessors; + data->ActiveProcessorAffinity = data->ActiveProcessorCount >= 64 + ? ~(ULONG_PTR)0 : ((ULONG_PTR)1 << data->ActiveProcessorCount) - 1; data->ActiveGroupCount = 1;
initialize_xstate_features( data );