Added patch to set ldr.EntryPoint for main executable (fixes wine bug 33034).

This commit is contained in:
Sebastian Lackner
2014-08-06 00:19:57 +02:00
parent 399f43a3f2
commit e08596a770
6 changed files with 66 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ PATCHLIST := Miscellaneous.ok \
ntdll-FD_Cache.ok \
ntdll-Junction_Points.ok \
ntdll-Pipe_SpecialCharacters.ok \
ntdll-loader_EntryPoint.ok \
quartz-MediaSeeking_Positions.ok \
server-ACL_Compat.ok \
server-Address_Change_Notification.ok \
@@ -349,6 +350,24 @@ ntdll-Pipe_SpecialCharacters.ok:
echo '+ { "ntdll-Pipe_SpecialCharacters", "Michael Müller", "Allow special characters in pipe names." },'; \
) > ntdll-Pipe_SpecialCharacters.ok
# Patchset ntdll-loader_EntryPoint
# |
# | Included patches:
# | * Set ldr.EntryPoint for main executable. [by Sebastian Lackner]
# |
# | This patchset fixes the following Wine bugs:
# | * [#33034] Many GFWL (Games For Windows Live) 1.x/2.x/3.x games crash or exit silently on startup (DiRT 2/3, GTA IV Steam)
# |
# | Modified files:
# | * dlls/ntdll/loader.c
# |
.INTERMEDIATE: ntdll-loader_EntryPoint.ok
ntdll-loader_EntryPoint.ok:
$(PATCH) < ntdll-loader_EntryPoint/0001-ntdll-Set-ldr.EntryPoint-for-main-executable.patch
@( \
echo '+ { "ntdll-loader_EntryPoint", "Sebastian Lackner", "Set ldr.EntryPoint for main executable." },'; \
) > ntdll-loader_EntryPoint.ok
# Patchset quartz-MediaSeeking_Positions
# |
# | Included patches:

View File

@@ -1,4 +1,4 @@
Author: Michael Müller
Subject: Allow special characters in pipe names.
Revision: 1
Fixes: [28995] Allow special characters in pipe names.
Fixes: [28995] Allow special characters in pipe names

View File

@@ -0,0 +1,38 @@
From 63a62bb5903e62f161b7e5972662220c606d702f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 2 Aug 2014 18:27:20 +0200
Subject: ntdll: Set ldr.EntryPoint for main executable.
---
dlls/ntdll/loader.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 79aa341..c869d8f 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -921,9 +921,10 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename )
else p = wm->ldr.FullDllName.Buffer;
RtlInitUnicodeString( &wm->ldr.BaseDllName, p );
- if ((nt->FileHeader.Characteristics & IMAGE_FILE_DLL) && !is_dll_native_subsystem( hModule, nt, p ))
+ if (!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL) || !is_dll_native_subsystem( hModule, nt, p ))
{
- wm->ldr.Flags |= LDR_IMAGE_IS_DLL;
+ if (nt->FileHeader.Characteristics & IMAGE_FILE_DLL)
+ wm->ldr.Flags |= LDR_IMAGE_IS_DLL;
if (nt->OptionalHeader.AddressOfEntryPoint)
wm->ldr.EntryPoint = (char *)hModule + nt->OptionalHeader.AddressOfEntryPoint;
}
@@ -1049,7 +1050,7 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
if (wm->ldr.Flags & LDR_DONT_RESOLVE_REFS) return STATUS_SUCCESS;
if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.BaseAddress, reason );
- if (!entry) return STATUS_SUCCESS;
+ if (!entry || !(wm->ldr.Flags & LDR_IMAGE_IS_DLL)) return STATUS_SUCCESS;
if (TRACE_ON(relay))
{
--
1.7.9.5

View File

@@ -0,0 +1,4 @@
Author: Sebastian Lackner
Subject: Set ldr.EntryPoint for main executable.
Revision: 1
Fixes: [33034] Set ldr.EntryPoint for main executable