Ignore the "magic flag" in RtlImageDirectoryEntryToData.
Modified: trunk/reactos/lib/rtl/image.c

Modified: trunk/reactos/lib/rtl/image.c
--- trunk/reactos/lib/rtl/image.c	2005-07-30 23:06:46 UTC (rev 16904)
+++ trunk/reactos/lib/rtl/image.c	2005-07-30 23:08:26 UTC (rev 16905)
@@ -27,8 +27,11 @@
 
   if (DosHeader && DosHeader->e_magic != IMAGE_DOS_SIGNATURE)
     {
+      extern ULONG KdDebuggerEnabled;
       DPRINT1("DosHeader->e_magic %x\n", DosHeader->e_magic);
       DPRINT1("NtHeader 0x%p\n", ((ULONG_PTR)BaseAddress + DosHeader->e_lfanew));
+      if (KdDebuggerEnabled)
+        DbgBreakPoint();
     }
 
   if (DosHeader && DosHeader->e_magic == IMAGE_DOS_SIGNATURE)
@@ -57,6 +60,10 @@
 	PIMAGE_NT_HEADERS NtHeader;
 	ULONG Va;
 
+	/* Magic flag for non-mapped images. */
+	if ((ULONG_PTR)BaseAddress & 1)
+	        BaseAddress = (PVOID)((ULONG_PTR)BaseAddress & ~1);
+
 	NtHeader = RtlImageNtHeader (BaseAddress);
 	if (NtHeader == NULL)
 		return NULL;