mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
We need to separate the idea of 'fully initialized' from 'ldr data structures
are present' so we can deal with early thread creation. This fixes cygwin. svn path=/trunk/; revision=30591
This commit is contained in:
parent
7de35ea613
commit
b74b8c6e6a
1 changed files with 9 additions and 6 deletions
|
@ -249,7 +249,7 @@ LdrpInit(PCONTEXT Context,
|
|||
PEPFUNC EntryPoint;
|
||||
PIMAGE_DOS_HEADER PEDosHeader;
|
||||
PVOID ImageBase;
|
||||
PPEB Peb;
|
||||
PPEB Peb = NtCurrentPeb();
|
||||
PLDR_DATA_TABLE_ENTRY NtModule; // ntdll
|
||||
NLSTABLEINFO NlsTable;
|
||||
WCHAR FullNtDllPath[MAX_PATH];
|
||||
|
@ -257,12 +257,12 @@ LdrpInit(PCONTEXT Context,
|
|||
NTSTATUS Status;
|
||||
|
||||
DPRINT("LdrpInit()\n");
|
||||
if (NtCurrentPeb()->Ldr == NULL || NtCurrentPeb()->Ldr->Initialized == FALSE)
|
||||
DPRINT("Peb %p\n", Peb);
|
||||
ImageBase = Peb->ImageBaseAddress;
|
||||
DPRINT("ImageBase %p\n", ImageBase);
|
||||
|
||||
if (NtCurrentPeb()->Ldr == NULL)
|
||||
{
|
||||
Peb = NtCurrentPeb();
|
||||
DPRINT("Peb %p\n", Peb);
|
||||
ImageBase = Peb->ImageBaseAddress;
|
||||
DPRINT("ImageBase %p\n", ImageBase);
|
||||
if (ImageBase <= (PVOID)0x1000)
|
||||
{
|
||||
DPRINT("ImageBase is null\n");
|
||||
|
@ -419,7 +419,10 @@ LdrpInit(PCONTEXT Context,
|
|||
LdrpLoadUserModuleSymbols(NtModule);
|
||||
|
||||
#endif /* DBG || KDBG */
|
||||
}
|
||||
|
||||
if (NtCurrentPeb()->Ldr->Initialized == FALSE)
|
||||
{
|
||||
/* add entry for executable (becomes first list entry) */
|
||||
ExeModule = (PLDR_DATA_TABLE_ENTRY)RtlAllocateHeap (Peb->ProcessHeap,
|
||||
0,
|
||||
|
|
Loading…
Reference in a new issue