Commit a3de8d19 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

wow64: Respect the large address aware flag.

parent 5f6425f0
......@@ -1118,7 +1118,7 @@ NTSTATUS WINAPI wow64_NtSetInformationProcess( UINT *args )
PROCESS_STACK_ALLOCATION_INFORMATION info;
info.ReserveSize = stack->ReserveSize;
info.ZeroBits = stack->ZeroBits ? stack->ZeroBits : 0x7fffffff;
info.ZeroBits = get_zero_bits( stack->ZeroBits );
if (!(status = NtSetInformationProcess( handle, class, &info, sizeof(info) )))
stack->StackBase = PtrToUlong( info.StackBase );
return status;
......
......@@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wow);
USHORT native_machine = 0;
USHORT current_machine = 0;
ULONG_PTR args_alignment = 0;
ULONG_PTR default_zero_bits = 0x7fffffff;
typedef NTSTATUS (WINAPI *syscall_thunk)( UINT *args );
......@@ -566,10 +567,13 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
{
HMODULE module;
UNICODE_STRING str;
SYSTEM_BASIC_INFORMATION info;
RtlWow64GetProcessMachines( GetCurrentProcess(), &current_machine, &native_machine );
if (!current_machine) current_machine = native_machine;
args_alignment = (current_machine == IMAGE_FILE_MACHINE_I386) ? sizeof(ULONG) : sizeof(ULONG64);
NtQuerySystemInformation( SystemEmulationBasicInformation, &info, sizeof(info), NULL );
default_zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff;
#define GET_PTR(name) p ## name = RtlFindExportedRoutineByName( module, #name )
......
......@@ -39,6 +39,7 @@ extern BOOL get_file_redirect( OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN;
extern USHORT native_machine DECLSPEC_HIDDEN;
extern USHORT current_machine DECLSPEC_HIDDEN;
extern ULONG_PTR args_alignment DECLSPEC_HIDDEN;
extern ULONG_PTR default_zero_bits DECLSPEC_HIDDEN;
extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN;
struct object_attr64
......@@ -83,7 +84,7 @@ static inline ULONG64 get_ulong64( UINT **args )
static inline ULONG_PTR get_zero_bits( ULONG_PTR zero_bits )
{
return zero_bits ? zero_bits : 0x7fffffff;
return zero_bits ? zero_bits : default_zero_bits;
}
static inline void **addr_32to64( void **addr, ULONG *addr32 )
......
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