Author: ion
Date: Wed Aug 30 05:22:41 2006
New Revision: 23793
URL:
http://svn.reactos.org/svn/reactos?rev=23793&view=rev
Log:
- Jesus Christ... will Hell freeze over before someone finally listens and implements a
proper PE loader in Freeloader?
Modified:
trunk/reactos/ntoskrnl/ke/main.c
Modified: trunk/reactos/ntoskrnl/ke/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/main.c?rev=237…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/main.c (original)
+++ trunk/reactos/ntoskrnl/ke/main.c Wed Aug 30 05:22:41 2006
@@ -71,6 +71,8 @@
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, _main)
#endif
+
+extern LDR_DATA_TABLE_ENTRY HalModuleObject;
/* FUNCTIONS ****************************************************************/
@@ -240,6 +242,17 @@
(PVOID)KERNEL_BASE,
&DriverSize);
+ //
+ //
+ // HACK HACK HACK WHEN WILL YOU PEOPLE FIX FREELDR?!?!?!
+ // FREELDR SENDS US AN ***INVALID*** HAL PE HEADER!!!
+ // WE READ IT IN LdrInitModuleManagement ABOVE!!!
+ // WE SET .SizeOfImage TO A *GARBAGE* VALUE!!!
+ //
+ // This dirty hack fixes it, and should make symbol lookup work too.
+ //
+ HalModuleObject.SizeOfImage =
RtlImageNtHeader((PVOID)HalModuleObject.DllBase)->OptionalHeader.SizeOfImage;
+
/* Increase the last kernel address with the size of HAL */
LastKernelAddress += PAGE_ROUND_UP(DriverSize);