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