From 6ecbc52144e8e82a3d8a8d85c1c6198de26b0a46 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 15 Jan 2011 19:13:22 +0000 Subject: [PATCH] [NTOSKRNL] Fix comments and reduce code complexity. svn path=/trunk/; revision=50391 --- reactos/ntoskrnl/ps/process.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 01f9a77b17a..d65e4ed26c6 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -127,7 +127,7 @@ PEPROCESS NTAPI PsGetNextProcess(IN PEPROCESS OldProcess) { - PLIST_ENTRY Entry, ListHead; + PLIST_ENTRY Entry; PEPROCESS FoundProcess = NULL; PAGED_CODE(); PSTRACE(PS_PROCESS_DEBUG, "Process: %p\n", OldProcess); @@ -147,11 +147,10 @@ PsGetNextProcess(IN PEPROCESS OldProcess) Entry = PsActiveProcessHead.Flink; } - /* Set the list head and start looping */ - ListHead = &PsActiveProcessHead; - while (ListHead != Entry) + /* Loop the process list */ + while (Entry != &PsActiveProcessHead) { - /* Get the Thread */ + /* Get the process */ FoundProcess = CONTAINING_RECORD(Entry, EPROCESS, ActiveProcessLinks); /* Reference the process */ @@ -165,7 +164,7 @@ PsGetNextProcess(IN PEPROCESS OldProcess) /* Release the lock */ KeReleaseGuardedMutex(&PspActiveProcessMutex); - /* Reference the Process we had referenced earlier */ + /* Dereference the Process we had referenced earlier */ if (OldProcess) ObDereferenceObject(OldProcess); return FoundProcess; } @@ -621,7 +620,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, SeAuditProcessCreationInfo. ImageFileName); if (!NT_SUCCESS(Status)) goto CleanupWithRef; - + // // We need a PEB // @@ -641,7 +640,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, ASSERTMSG("No support for cloning yet\n", FALSE); } else - { + { /* This is the initial system process */ Flags &= ~PS_LARGE_PAGES; Status = MmInitializeProcessAddressSpace(Process, @@ -713,7 +712,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, RtlZeroMemory(&InitialPeb, sizeof(INITIAL_PEB)); InitialPeb.Mutant = (HANDLE)-1; InitialPeb.ImageUsesLargePages = 0; // FIXME: Not yet supported - + // // Create it only if we have an image section // @@ -850,7 +849,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, /* Run the Notification Routines */ PspRunCreateProcessNotifyRoutines(Process, TRUE); - + /* If 12 processes have been created, enough of user-mode is ready */ if (++ProcessCount == 12) Ki386PerfEnd();