Commit 526b9fc8 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Support relocating the main exe.

parent 56d9e1a8
......@@ -2041,7 +2041,8 @@ static NTSTATUS perform_relocations( void *module, IMAGE_NT_HEADERS *nt, SIZE_T
if (nt->OptionalHeader.SectionAlignment < page_size)
return STATUS_SUCCESS;
if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) && NtCurrentTeb()->Peb->ImageBaseAddress)
if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
module != NtCurrentTeb()->Peb->ImageBaseAddress)
return STATUS_SUCCESS;
relocs = &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
......
......@@ -2116,7 +2116,7 @@ void init_startup_info(void)
status = load_main_exe( params->ImagePathName.Buffer, NULL, params->CommandLine.Buffer,
machine, &image, &module );
if (status)
if (!NT_SUCCESS(status))
{
MESSAGE( "wine: failed to start %s\n", debugstr_us(&params->ImagePathName) );
NtTerminateProcess( GetCurrentProcess(), status );
......
......@@ -1743,7 +1743,7 @@ NTSTATUS load_start_exe( WCHAR **image, void **module )
wcscat( *image, startW );
init_unicode_string( &nt_name, *image );
status = find_builtin_dll( &nt_name, module, &size, &main_image_info, 0, 0, current_machine, 0, FALSE );
if (status)
if (!NT_SUCCESS(status))
{
MESSAGE( "wine: failed to load start.exe: %x\n", status );
NtTerminateProcess( GetCurrentProcess(), status );
......
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