[ROSLOAD]: Begin target preparation code. 1/104.

[ROSLOAD]: Stubs for OslFatalErrorEx, OslAbortBoot.
OslpSanitizeLoadOptionsString, OslpSanitizeStringOptions
[ROSLOAD]: Implement OslBlStatusErrorHandler,
OslpRemoveInternalApplicationOptions
[ROSLOAD]: Begin work on OslPrepareTarget. Small misc. fixes.
[BOOTLIB]: Extend BlStatusError to handle a custom status error handler.
This commit is contained in:
Alex Ionescu 2018-02-03 15:52:31 -08:00
parent 3b777fd133
commit adcb9bd175
5 changed files with 334 additions and 12 deletions

View file

@ -16,6 +16,8 @@ CHAR AnsiBuffer[1024];
BOOLEAN BdDebuggerNotPresent;
BOOLEAN BdSubsystemInitialized;
BOOLEAN BdArchBlockDebuggerOperation;
BOOLEAN BlpStatusErrorInProgress;
PBL_STATUS_ERROR_HANDLER BlpStatusErrorHandler;
/* FUNCTIONS *****************************************************************/
@ -124,6 +126,35 @@ BlStatusError (
_In_ ULONG_PTR Parameter4
)
{
NTSTATUS Status;
/* Is this a non-boot error? */
if (ErrorCode != 1)
{
/* Is one already ongoing? */
if (!BlpStatusErrorInProgress)
{
/* Do we have a custom error handler registered? */
if (BlpStatusErrorHandler)
{
/* Call it, making sure to avoid recursion */
BlpStatusErrorInProgress = TRUE;
Status = BlpStatusErrorHandler(ErrorCode,
Parameter1,
Parameter2,
Parameter3,
Parameter4);
BlpStatusErrorInProgress = FALSE;
/* If the error handler consumed the error, we're done */
if (NT_SUCCESS(Status))
{
return;
}
}
}
}
/* Check if the boot debugger is enabled */
if (BlBdDebuggerEnabled())
{