https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a0ecb3dc858f98cbff653...
commit 3a0ecb3dc858f98cbff653afd6c892f2941ac836 Author: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org AuthorDate: Sun Apr 1 15:25:15 2018 +0200 Commit: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org CommitDate: Sun Apr 1 22:50:16 2018 +0200
[NTOSKRNL] Don't hardcode flag values for DefaultHardErrorProcessing. --- ntoskrnl/ex/harderr.c | 12 +++++++----- ntoskrnl/ps/process.c | 12 ++++++------ 2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/ntoskrnl/ex/harderr.c b/ntoskrnl/ex/harderr.c index 30fdce8f0a..82d22f4926 100644 --- a/ntoskrnl/ex/harderr.c +++ b/ntoskrnl/ex/harderr.c @@ -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; diff --git a/ntoskrnl/ps/process.c b/ntoskrnl/ps/process.c index 119997a753..c6962762e3 100644 --- a/ntoskrnl/ps/process.c +++ b/ntoskrnl/ps/process.c @@ -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);