[NTOSKRNL] Don't hardcode flag values for DefaultHardErrorProcessing.

This commit is contained in:
Hermès Bélusca-Maïto 2018-04-01 15:25:15 +02:00
parent 1fadfea053
commit 3a0ecb3dc8
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 13 additions and 11 deletions

View file

@ -150,13 +150,15 @@ ExpRaiseHardError(IN NTSTATUS ErrorStatus,
NumberOfParameters,
UnicodeStringParameterMask,
Parameters,
(PreviousMode != KernelMode) ? TRUE: FALSE);
(PreviousMode != KernelMode) ? TRUE : FALSE);
}
}
/* Enable hard error processing if it is enabled for the process
* or if the exception status forces it */
if ((Process->DefaultHardErrorProcessing & 1) ||
/*
* Enable hard error processing if it is enabled for the process
* or if the exception status forces it.
*/
if ((Process->DefaultHardErrorProcessing & SEM_FAILCRITICALERRORS) ||
(ErrorStatus & HARDERROR_OVERRIDE_ERRORMODE))
{
/* Check if we have an exception port */
@ -199,7 +201,7 @@ ExpRaiseHardError(IN NTSTATUS ErrorStatus,
NumberOfParameters,
UnicodeStringParameterMask,
Parameters,
(PreviousMode != KernelMode) ? TRUE: FALSE);
(PreviousMode != KernelMode) ? TRUE : FALSE);
/* If we survived, return to caller */
*Response = ResponseReturnToCaller;

View file

@ -448,15 +448,14 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
/* Check if we have a parent */
if (Parent)
{
/* Inherit PID and Hard Error Processing */
/* Inherit PID and hard-error processing */
Process->InheritedFromUniqueProcessId = Parent->UniqueProcessId;
Process->DefaultHardErrorProcessing = Parent->
DefaultHardErrorProcessing;
Process->DefaultHardErrorProcessing = Parent->DefaultHardErrorProcessing;
}
else
{
/* Use default hard error processing */
Process->DefaultHardErrorProcessing = TRUE;
/* Use default hard-error processing */
Process->DefaultHardErrorProcessing = SEM_FAILCRITICALERRORS;
}
/* Check for a section handle */
@ -586,7 +585,8 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
PROCESS_PRIORITY_NORMAL,
Affinity,
DirectoryTableBase,
(BOOLEAN)(Process->DefaultHardErrorProcessing & 4));
BooleanFlagOn(Process->DefaultHardErrorProcessing,
SEM_NOALIGNMENTFAULTEXCEPT));
/* Duplicate Parent Token */
Status = PspInitializeProcessSecurity(Process, Parent);