[PATCH v2 0/1] MR4739: ntdll: Don't hardcode page size
While this is not needed for 16k pages to work, it does seem sensible. -- v2: ntdll: Don't hardcode page size https://gitlab.winehq.org/wine/wine/-/merge_requests/4739
From: Fabian Maurer <dark.shadow4(a)web.de> --- dlls/ntdll/loader.c | 6 ++++++ dlls/ntdll/ntdll_misc.h | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 4fc8af2662e..af4d17516c0 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -83,6 +83,8 @@ SYSTEM_DLL_INIT_BLOCK LdrSystemDllInitBlock = { 0xf0 }; void *__wine_syscall_dispatcher = NULL; unixlib_handle_t __wine_unixlib_handle = 0; +UINT_PTR page_size; + /* windows directory */ const WCHAR windows_dir[] = L"C:\\windows"; /* system directory with trailing backslash */ @@ -4255,10 +4257,14 @@ void loader_init( CONTEXT *context, void **entry ) if (!imports_fixup_done) { + SYSTEM_BASIC_INFORMATION basic_info; ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb; + NtQuerySystemInformation(SystemBasicInformation, &basic_info, sizeof(basic_info), NULL); + page_size = basic_info.PageSize; + peb->LdrData = &ldr; peb->FastPebLock = &peb_lock; peb->TlsBitmap = &tls_bitmap; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 756b19ae649..faf46d62d27 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -41,11 +41,7 @@ #define NTDLL_TLS_ERRNO 16 /* TLS slot for _errno() */ -#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) -static const UINT_PTR page_size = 0x1000; -#else extern UINT_PTR page_size; -#endif /* exceptions */ extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4739
This merge request was closed by Alexandre Julliard. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4739
Superseded by 6e1c906fa6d12dd9c9db7d497b65ffe1efc62983 and subsequent commits. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4739#note_99417
participants (3)
-
Alexandre Julliard (@julliard) -
Fabian Maurer -
Fabian Maurer (@DarkShadow44)