https://git.reactos.org/?p=reactos.git;a=commitdiff;h=35f800c6e2996cf0f519c2...
commit 35f800c6e2996cf0f519c24b7a1d00dc1d955f5f Author: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org AuthorDate: Tue Jun 25 20:43:24 2019 +0200 Commit: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org CommitDate: Tue Jun 25 21:01:48 2019 +0200
[NTOS] Minor formatting enhancements only + typo fixes. --- ntoskrnl/ke/bug.c | 76 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 36 deletions(-)
diff --git a/ntoskrnl/ke/bug.c b/ntoskrnl/ke/bug.c index 3208e6ba687..f1e7a50376f 100644 --- a/ntoskrnl/ke/bug.c +++ b/ntoskrnl/ke/bug.c @@ -483,42 +483,42 @@ KiDoBugCheckCallbacks(VOID) PLIST_ENTRY ListHead, NextEntry, LastEntry; ULONG_PTR Checksum;
- /* First make sure that the list is Initialized... it might not be */ + /* First make sure that the list is initialized... it might not be */ ListHead = &KeBugcheckCallbackListHead; - if ((ListHead->Flink) && (ListHead->Blink)) + if ((!ListHead->Flink) || (!ListHead->Blink)) + return; + + /* Loop the list */ + LastEntry = ListHead; + NextEntry = ListHead->Flink; + while (NextEntry != ListHead) { - /* Loop the list */ - LastEntry = ListHead; - NextEntry = ListHead->Flink; - while (NextEntry != ListHead) + /* Get the reord */ + CurrentRecord = CONTAINING_RECORD(NextEntry, + KBUGCHECK_CALLBACK_RECORD, + Entry); + + /* Validate it */ + if (CurrentRecord->Entry.Blink != LastEntry) return; + Checksum = (ULONG_PTR)CurrentRecord->CallbackRoutine; + Checksum += (ULONG_PTR)CurrentRecord->Buffer; + Checksum += (ULONG_PTR)CurrentRecord->Length; + Checksum += (ULONG_PTR)CurrentRecord->Component; + + /* Make sure it's inserted and validated */ + if ((CurrentRecord->State == BufferInserted) && + (CurrentRecord->Checksum == Checksum)) { - /* Get the reord */ - CurrentRecord = CONTAINING_RECORD(NextEntry, - KBUGCHECK_CALLBACK_RECORD, - Entry); - - /* Validate it */ - if (CurrentRecord->Entry.Blink != LastEntry) return; - Checksum = (ULONG_PTR)CurrentRecord->CallbackRoutine; - Checksum += (ULONG_PTR)CurrentRecord->Buffer; - Checksum += (ULONG_PTR)CurrentRecord->Length; - Checksum += (ULONG_PTR)CurrentRecord->Component; - - /* Make sure it's inserted and valitdated */ - if ((CurrentRecord->State == BufferInserted) && - (CurrentRecord->Checksum == Checksum)) - { - /* Call the routine */ - CurrentRecord->State = BufferStarted; - (CurrentRecord->CallbackRoutine)(CurrentRecord->Buffer, - CurrentRecord->Length); - CurrentRecord->State = BufferFinished; - } - - /* Go to the next entry */ - LastEntry = NextEntry; - NextEntry = NextEntry->Flink; + /* Call the routine */ + CurrentRecord->State = BufferStarted; + (CurrentRecord->CallbackRoutine)(CurrentRecord->Buffer, + CurrentRecord->Length); + CurrentRecord->State = BufferFinished; } + + /* Go to the next entry */ + LastEntry = NextEntry; + NextEntry = NextEntry->Flink; } }
@@ -856,7 +856,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, case KERNEL_MODE_EXCEPTION_NOT_HANDLED: case ATTEMPTED_WRITE_TO_READONLY_MEMORY: case ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY: - + { /* Check if we have a trap frame */ if (!TrapFrame) { @@ -872,10 +872,11 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, Pc = (PVOID)KeGetTrapFramePc(TrapFrame); } break; + }
/* Wrong IRQL */ case IRQL_NOT_LESS_OR_EQUAL: - + { /* * The NT kernel has 3 special sections: * MISYSPTE, POOLMI and POOLCODE. The bug check code can @@ -933,10 +934,11 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, /* Clear Pc so we don't look it up later */ Pc = NULL; break; + }
/* Hard error */ case FATAL_UNHANDLED_HARD_ERROR: - + { /* Copy bug check data from hard error */ HardErrorParameters = (PULONG_PTR)BugCheckParameter2; KiBugCheckData[0] = BugCheckParameter1; @@ -950,10 +952,11 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, HardErrCaption = (PCHAR)BugCheckParameter3; HardErrMessage = (PCHAR)BugCheckParameter4; break; + }
/* Page fault */ case PAGE_FAULT_IN_NONPAGED_AREA: - + { /* Assume no driver */ DriverBase = NULL;
@@ -1014,6 +1017,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode, } } break; + }
/* Check if the driver forgot to unlock pages */ case DRIVER_LEFT_LOCKED_PAGES_IN_PROCESS: