ntdll: Fill NumberOfPhysicalPages field in user shared data area.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48387
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2020-02-13 14:11:24 +03:00 committed by Alexandre Julliard
parent 22173f708e
commit 9689d07740
2 changed files with 17 additions and 1 deletions

View File

@ -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();
}

View File

@ -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;
}