mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[FREELDR] Initialize a global module list head for freeldr
This commit is contained in:
parent
6eac9b5891
commit
f9849f7cc4
3 changed files with 35 additions and 0 deletions
|
@ -64,6 +64,13 @@ VOID __cdecl BootMain(IN PCCH CmdLine)
|
|||
/* Initialize I/O subsystem */
|
||||
FsInit();
|
||||
|
||||
/* Initialize the module list */
|
||||
if (!PeLdrInitializeModuleList())
|
||||
{
|
||||
UiMessageBoxCritical("Unable to initialize module list.");
|
||||
goto Quit;
|
||||
}
|
||||
|
||||
RunLoader();
|
||||
|
||||
Quit:
|
||||
|
|
|
@ -26,6 +26,9 @@ typedef VOID
|
|||
|
||||
extern PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback;
|
||||
|
||||
BOOLEAN
|
||||
PeLdrInitializeModuleList(VOID);
|
||||
|
||||
BOOLEAN
|
||||
PeLdrLoadImage(
|
||||
_In_ PCSTR FilePath,
|
||||
|
|
|
@ -25,6 +25,8 @@ DBG_DEFAULT_CHANNEL(PELOADER);
|
|||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
LIST_ENTRY FrLdrModuleList;
|
||||
|
||||
PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback = NULL;
|
||||
|
||||
#ifdef _WIN64
|
||||
|
@ -518,6 +520,29 @@ PeLdrpScanImportAddressTable(
|
|||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
PeLdrInitializeModuleList(VOID)
|
||||
{
|
||||
PLDR_DATA_TABLE_ENTRY FreeldrDTE;
|
||||
|
||||
InitializeListHead(&FrLdrModuleList);
|
||||
|
||||
/* Allocate a data table entry for freeldr.sys.
|
||||
The base name is scsiport.sys for imports from ntbootdd.sys */
|
||||
if (!PeLdrAllocateDataTableEntry(&FrLdrModuleList,
|
||||
"scsiport.sys",
|
||||
"freeldr.sys",
|
||||
&__ImageBase,
|
||||
&FreeldrDTE))
|
||||
{
|
||||
/* Cleanup and bail out */
|
||||
ERR("Failed to allocate DTE for freeldr\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PVOID
|
||||
PeLdrInitSecurityCookie(PLDR_DATA_TABLE_ENTRY LdrEntry)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue