From: Fabian Maurer dark.shadow4@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 59624bc70f8..9c058057e86 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 */ @@ -4279,11 +4281,15 @@ void loader_init( CONTEXT *context, void **entry )
if (!imports_fixup_done) { + SYSTEM_BASIC_INFORMATION basic_info; MEMORY_BASIC_INFORMATION meminfo; 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; + NtQueryVirtualMemory( GetCurrentProcess(), LdrInitializeThunk, MemoryBasicInformation, &meminfo, sizeof(meminfo), NULL );
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index a7967a6c242..b02462035dc 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 );