[BOOTMGFW]: Last few straggling initialization checks.

[BOOTMGFW]: Recover the boot sequence from the BCD and entire the boot selection stage. Now the fun begins.

svn path=/trunk/; revision=70544
This commit is contained in:
Alex Ionescu 2016-01-08 06:19:14 +00:00
parent 44ab46cfa9
commit ae83268e16

View file

@ -1184,12 +1184,16 @@ BmMain (
NTSTATUS Status, LibraryStatus; NTSTATUS Status, LibraryStatus;
BL_LIBRARY_PARAMETERS LibraryParameters; BL_LIBRARY_PARAMETERS LibraryParameters;
PBL_RETURN_ARGUMENTS ReturnArguments; PBL_RETURN_ARGUMENTS ReturnArguments;
BOOLEAN RebootOnError;
PGUID AppIdentifier; PGUID AppIdentifier;
HANDLE BcdHandle, ResumeBcdHandle; HANDLE BcdHandle, ResumeBcdHandle;
PBL_BCD_OPTION EarlyOptions; PBL_BCD_OPTION EarlyOptions;
PWCHAR Stylesheet; PWCHAR Stylesheet;
BOOLEAN XmlLoaded, DisableIntegrity, TestSigning; BOOLEAN XmlLoaded, DisableIntegrity, TestSigning, PersistBootSequence;
BOOLEAN RebootOnError, CustomActions, ContinueLoop;
ULONG SequenceId, SequenceCount;
PGUID BootSequences;
//PBL_LOADED_APPLICATION_ENTRY* BootEntries;
//PBL_LOADED_APPLICATION_ENTRY BootEntry;
EfiPrintf(L"ReactOS UEFI Boot Manager Initializing...\n"); EfiPrintf(L"ReactOS UEFI Boot Manager Initializing...\n");
@ -1324,8 +1328,8 @@ BmMain (
/* Check if any bypass options are enabled */ /* Check if any bypass options are enabled */
BlImgQueryCodeIntegrityBootOptions(&BlpApplicationEntry, BlImgQueryCodeIntegrityBootOptions(&BlpApplicationEntry,
&DisableIntegrity, &DisableIntegrity,
&TestSigning); &TestSigning);
if (!DisableIntegrity) if (!DisableIntegrity)
{ {
/* Integrity checks are enabled, so validate our signature */ /* Integrity checks are enabled, so validate our signature */
@ -1363,11 +1367,69 @@ BmMain (
goto Failure; goto Failure;
} }
#ifdef BL_NET_SUPPORT
/* Register multicast printing routine */
BlUtlRegisterMulticastRoutine();
#endif
/* do more stuff!! */ /* Check if restart on failure is enabled */
//EfiPrintf(BlResourceFindMessage(BM_MSG_TEST)); BlGetBootOptionBoolean(BlpApplicationEntry.BcdData,
//EfiPrintf(Stylesheet); BcdLibraryBoolean_RestartOnFailure,
EfiStall(10000000); &RebootOnError);
/* Check if the boot sequence is persisted */
Status = BlGetBootOptionBoolean(BlpApplicationEntry.BcdData,
BcdBootMgrBoolean_PersistBootSequence,
&PersistBootSequence);
if (!NT_SUCCESS(Status))
{
/* It usually is */
PersistBootSequence = TRUE;
}
/* Check if there's custom actions to take */
Status = BlGetBootOptionBoolean(BlpApplicationEntry.BcdData,
BcdBootMgrBoolean_ProcessCustomActionsFirst,
&CustomActions);
if ((NT_SUCCESS(Status)) && (CustomActions))
{
/* We don't suppport this yet */
EfiPrintf(L"Not implemented\r\n");
Status = STATUS_NOT_IMPLEMENTED;
goto Failure;
}
/* At last, enter the boot selection stage */
SequenceId = 0;
do
{
ContinueLoop = FALSE;
/* Get the list of boot sequences */
SequenceCount = 0;
Status = BlGetBootOptionGuidList(BlpApplicationEntry.BcdData,
BcdBootMgrObjectList_BootSequence,
&BootSequences,
&SequenceCount);
EfiPrintf(L"Count: %d\r\n", SequenceCount);
EfiStall(1000000);
if (!NT_SUCCESS(Status))
{
//goto GetEntry;
}
if (NT_SUCCESS(Status))
{
continue;
}
if (RebootOnError)
{
break;
}
SequenceId++;
} while (ContinueLoop);
Failure: Failure:
/* Check if we got here due to an internal error */ /* Check if we got here due to an internal error */