mirror of
https://github.com/reactos/reactos.git
synced 2024-11-07 07:00:19 +00:00
- Jesus Christ... will Hell freeze over before someone finally listens and implements a proper PE loader in Freeloader?
svn path=/trunk/; revision=23793
This commit is contained in:
parent
ab77204ef9
commit
655e78f3cc
1 changed files with 13 additions and 0 deletions
|
@ -72,6 +72,8 @@ VOID INIT_FUNCTION _main(ULONG MultiBootMagic, PROS_LOADER_PARAMETER_BLOCK _Load
|
||||||
#pragma alloc_text(INIT, _main)
|
#pragma alloc_text(INIT, _main)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern LDR_DATA_TABLE_ENTRY HalModuleObject;
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -240,6 +242,17 @@ _main(ULONG MultiBootMagic,
|
||||||
(PVOID)KERNEL_BASE,
|
(PVOID)KERNEL_BASE,
|
||||||
&DriverSize);
|
&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 */
|
/* Increase the last kernel address with the size of HAL */
|
||||||
LastKernelAddress += PAGE_ROUND_UP(DriverSize);
|
LastKernelAddress += PAGE_ROUND_UP(DriverSize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue