Commit 168ce916 authored by Alexandre Julliard's avatar Alexandre Julliard

wow64: Use ProcessWow64Information to retrieve the 32-bit PEB.

parent 7261aca1
......@@ -873,7 +873,7 @@ static const WCHAR *get_cpu_dll_name(void)
*/
static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **context )
{
TEB32 *teb32 = (TEB32 *)((char *)NtCurrentTeb() + NtCurrentTeb()->WowTebOffset);
PEB32 *peb32;
HMODULE module, ntdll;
UNICODE_STRING str = RTL_CONSTANT_STRING( L"ntdll.dll" );
SYSTEM_BASIC_INFORMATION info;
......@@ -884,7 +884,8 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
NtQuerySystemInformation( SystemEmulationBasicInformation, &info, sizeof(info), NULL );
highest_user_address = (ULONG_PTR)info.HighestUserAddress;
default_zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff;
wow64info = (WOW64INFO *)((PEB32 *)ULongToPtr( teb32->Peb ) + 1);
NtQueryInformationProcess( GetCurrentProcess(), ProcessWow64Information, &peb32, sizeof(peb32), NULL );
wow64info = (WOW64INFO *)(peb32 + 1);
wow64info->NativeSystemPageSize = 0x1000;
wow64info->NativeMachineType = native_machine;
wow64info->EmulatedMachineType = current_machine;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment