diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 31eb66c1439..683a5e7bdf6 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -25,6 +25,7 @@ #include "windef.h" #include "winternl.h" #include "wine/test.h" +#include "ddk/wdm.h" static unsigned int page_size; @@ -33,6 +34,8 @@ static NTSTATUS (WINAPI *pRtlFreeUserStack)(void *); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static const BOOL is_win64 = sizeof(void*) != sizeof(int); +static SYSTEM_BASIC_INFORMATION sbi; + static HANDLE create_target_process(const char *arg) { char **argv; @@ -513,9 +516,17 @@ static void test_NtMapViewOfSection(void) CloseHandle(process); } +static void test_user_shared_data(void) +{ + const KSHARED_USER_DATA *user_shared_data = (void *)0x7ffe0000; + + ok(user_shared_data->NumberOfPhysicalPages == sbi.MmNumberOfPhysicalPages, + "Got number of physical pages %#x, expected %#x.\n", + user_shared_data->NumberOfPhysicalPages, sbi.MmNumberOfPhysicalPages); +} + START_TEST(virtual) { - SYSTEM_BASIC_INFORMATION sbi; HMODULE mod; int argc; @@ -546,4 +557,5 @@ START_TEST(virtual) test_NtAllocateVirtualMemory(); test_RtlCreateUserStack(); test_NtMapViewOfSection(); + test_user_shared_data(); } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index f993dd314c3..9c9e5f60557 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -222,6 +222,7 @@ static void set_process_name( int argc, char *argv[] ) */ TEB *thread_init(void) { + SYSTEM_BASIC_INFORMATION sbi; TEB *teb; void *addr; SIZE_T size; @@ -310,6 +311,9 @@ TEB *thread_init(void) user_shared_data->TickCountMultiplier = 1 << 24; fill_cpu_info(); + virtual_get_system_info( &sbi ); + user_shared_data->NumberOfPhysicalPages = sbi.MmNumberOfPhysicalPages; + return teb; }