Commit 0f0bf586 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Don't fixup imports for executables.

parent 7307298a
......@@ -1306,7 +1306,6 @@ static void test_import_resolution(void)
ok( mod != NULL, "failed to load err %u\n", GetLastError() );
if (!mod) break;
ptr = (struct imports *)((char *)mod + page_size);
todo_wine
ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n",
(void *)ptr->thunks[0].u1.Function, data.module, data.function.name );
FreeLibrary( mod );
......
......@@ -1509,12 +1509,8 @@ static void load_builtin_callback( void *module, const char *filename )
}
wm->ldr.Flags |= LDR_WINE_INTERNAL;
if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
!NtCurrentTeb()->Peb->ImageBaseAddress) /* if we already have an executable, ignore this one */
{
NtCurrentTeb()->Peb->ImageBaseAddress = module;
}
else
if ((nt->FileHeader.Characteristics & IMAGE_FILE_DLL) ||
nt->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_NATIVE)
{
/* fixup imports */
......@@ -1591,7 +1587,11 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
/* fixup imports */
if (!(flags & DONT_RESOLVE_DLL_REFERENCES))
nt = RtlImageNtHeader( module );
if (!(flags & DONT_RESOLVE_DLL_REFERENCES) &&
((nt->FileHeader.Characteristics & IMAGE_FILE_DLL) ||
nt->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_NATIVE))
{
if ((status = fixup_imports( wm, load_path )) != STATUS_SUCCESS)
{
......@@ -1612,8 +1612,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
/* send DLL load event */
nt = RtlImageNtHeader( module );
SERVER_START_REQ( load_dll )
{
req->mapping = wine_server_obj_handle( mapping );
......
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