Author: spetreolle
Date: Sat Feb 28 21:23:07 2015
New Revision: 66505
URL:
http://svn.reactos.org/svn/reactos?rev=66505&view=rev
Log:
[NTDLL/LDR]
LdrpInitializeProcess:
Don't use NtLdrEntry to initialize LdrpImageEntry.
It is overwritten afterwards to initialize the real NtLdrEntry.
Modified:
trunk/reactos/dll/ntdll/ldr/ldrinit.c
Modified: trunk/reactos/dll/ntdll/ldr/ldrinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrinit.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrinit.c [iso-8859-1] Sat Feb 28 21:23:07 2015
@@ -1846,24 +1846,24 @@
PebLdr.Initialized = TRUE;
/* Allocate a data entry for the Image */
- LdrpImageEntry = NtLdrEntry = LdrpAllocateDataTableEntry(Peb->ImageBaseAddress);
+ LdrpImageEntry = LdrpAllocateDataTableEntry(Peb->ImageBaseAddress);
/* Set it up */
- NtLdrEntry->EntryPoint = LdrpFetchAddressOfEntryPoint(NtLdrEntry->DllBase);
- NtLdrEntry->LoadCount = -1;
- NtLdrEntry->EntryPointActivationContext = 0;
- NtLdrEntry->FullDllName = ImageFileName;
+ LdrpImageEntry->EntryPoint =
LdrpFetchAddressOfEntryPoint(LdrpImageEntry->DllBase);
+ LdrpImageEntry->LoadCount = -1;
+ LdrpImageEntry->EntryPointActivationContext = 0;
+ LdrpImageEntry->FullDllName = ImageFileName;
if (IsDotNetImage)
- NtLdrEntry->Flags = LDRP_COR_IMAGE;
+ LdrpImageEntry->Flags = LDRP_COR_IMAGE;
else
- NtLdrEntry->Flags = 0;
+ LdrpImageEntry->Flags = 0;
/* Check if the name is empty */
if (!ImageFileName.Buffer[0])
{
/* Use the same Base name */
- NtLdrEntry->BaseDllName = NtLdrEntry->FullDllName;
+ LdrpImageEntry->BaseDllName = LdrpImageEntry->FullDllName;
}
else
{
@@ -1882,21 +1882,21 @@
if (!NtDllName)
{
/* Use the same Base name */
- NtLdrEntry->BaseDllName = NtLdrEntry->FullDllName;
+ LdrpImageEntry->BaseDllName = LdrpImageEntry->FullDllName;
}
else
{
/* Setup the name */
- NtLdrEntry->BaseDllName.Length = (USHORT)((ULONG_PTR)ImageFileName.Buffer
+ ImageFileName.Length - (ULONG_PTR)NtDllName);
- NtLdrEntry->BaseDllName.MaximumLength = NtLdrEntry->BaseDllName.Length
+ sizeof(WCHAR);
- NtLdrEntry->BaseDllName.Buffer = (PWSTR)((ULONG_PTR)ImageFileName.Buffer
+
- (ImageFileName.Length -
NtLdrEntry->BaseDllName.Length));
+ LdrpImageEntry->BaseDllName.Length =
(USHORT)((ULONG_PTR)ImageFileName.Buffer + ImageFileName.Length - (ULONG_PTR)NtDllName);
+ LdrpImageEntry->BaseDllName.MaximumLength =
LdrpImageEntry->BaseDllName.Length + sizeof(WCHAR);
+ LdrpImageEntry->BaseDllName.Buffer =
(PWSTR)((ULONG_PTR)ImageFileName.Buffer +
+ (ImageFileName.Length -
LdrpImageEntry->BaseDllName.Length));
}
}
/* Processing done, insert it */
- LdrpInsertMemoryTableEntry(NtLdrEntry);
- NtLdrEntry->Flags |= LDRP_ENTRY_PROCESSED;
+ LdrpInsertMemoryTableEntry(LdrpImageEntry);
+ LdrpImageEntry->Flags |= LDRP_ENTRY_PROCESSED;
/* Now add an entry for NTDLL */
NtLdrEntry = LdrpAllocateDataTableEntry(SystemArgument1);