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:
Art Yerkes 2007-11-20 10:22:52 +00:00
parent 7de35ea613
commit b74b8c6e6a

View file

@ -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,