Author: fireball
Date: Fri Aug 24 17:50:56 2012
New Revision: 57156
URL:
http://svn.reactos.org/svn/reactos?rev=57156&view=rev
Log:
[NTDLL/LDR]
- Check result of walking the import descriptor and properly fail in case it wasn't
successful.
See issue #7289 for more details.
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] Fri Aug 24 17:50:56 2012
@@ -1479,7 +1479,7 @@
ULONG HeapFlags;
PIMAGE_NT_HEADERS NtHeader;
LPWSTR NtDllName = NULL;
- NTSTATUS Status;
+ NTSTATUS Status, ImportStatus;
NLSTABLEINFO NlsTable;
PIMAGE_LOAD_CONFIG_DIRECTORY LoadConfig;
PTEB Teb = NtCurrentTeb();
@@ -1989,7 +1989,7 @@
}
/* Walk the IAT and load all the DLLs */
- LdrpWalkImportDescriptor(LdrpDefaultPath.Buffer, LdrpImageEntry);
+ ImportStatus = LdrpWalkImportDescriptor(LdrpDefaultPath.Buffer, LdrpImageEntry);
/* Check if relocation is needed */
if (Peb->ImageBaseAddress != (PVOID)NtHeader->OptionalHeader.ImageBase)
@@ -2039,6 +2039,9 @@
/* Phase 0 is done */
LdrpLdrDatabaseIsSetup = TRUE;
+
+ /* Check whether all static imports were properly loaded and return here */
+ if (!NT_SUCCESS(ImportStatus)) return ImportStatus;
/* Initialize TLS */
Status = LdrpInitializeTls();