[NTOSKRNL]

Fix comments and reduce code complexity.

svn path=/trunk/; revision=50391
This commit is contained in:
Timo Kreuzer 2011-01-15 19:13:22 +00:00
parent b51f0a0553
commit 6ecbc52144

View file

@ -127,7 +127,7 @@ PEPROCESS
NTAPI NTAPI
PsGetNextProcess(IN PEPROCESS OldProcess) PsGetNextProcess(IN PEPROCESS OldProcess)
{ {
PLIST_ENTRY Entry, ListHead; PLIST_ENTRY Entry;
PEPROCESS FoundProcess = NULL; PEPROCESS FoundProcess = NULL;
PAGED_CODE(); PAGED_CODE();
PSTRACE(PS_PROCESS_DEBUG, "Process: %p\n", OldProcess); PSTRACE(PS_PROCESS_DEBUG, "Process: %p\n", OldProcess);
@ -147,11 +147,10 @@ PsGetNextProcess(IN PEPROCESS OldProcess)
Entry = PsActiveProcessHead.Flink; Entry = PsActiveProcessHead.Flink;
} }
/* Set the list head and start looping */ /* Loop the process list */
ListHead = &PsActiveProcessHead; while (Entry != &PsActiveProcessHead)
while (ListHead != Entry)
{ {
/* Get the Thread */ /* Get the process */
FoundProcess = CONTAINING_RECORD(Entry, EPROCESS, ActiveProcessLinks); FoundProcess = CONTAINING_RECORD(Entry, EPROCESS, ActiveProcessLinks);
/* Reference the process */ /* Reference the process */
@ -165,7 +164,7 @@ PsGetNextProcess(IN PEPROCESS OldProcess)
/* Release the lock */ /* Release the lock */
KeReleaseGuardedMutex(&PspActiveProcessMutex); KeReleaseGuardedMutex(&PspActiveProcessMutex);
/* Reference the Process we had referenced earlier */ /* Dereference the Process we had referenced earlier */
if (OldProcess) ObDereferenceObject(OldProcess); if (OldProcess) ObDereferenceObject(OldProcess);
return FoundProcess; return FoundProcess;
} }
@ -621,7 +620,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
SeAuditProcessCreationInfo. SeAuditProcessCreationInfo.
ImageFileName); ImageFileName);
if (!NT_SUCCESS(Status)) goto CleanupWithRef; if (!NT_SUCCESS(Status)) goto CleanupWithRef;
// //
// We need a PEB // We need a PEB
// //
@ -641,7 +640,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
ASSERTMSG("No support for cloning yet\n", FALSE); ASSERTMSG("No support for cloning yet\n", FALSE);
} }
else else
{ {
/* This is the initial system process */ /* This is the initial system process */
Flags &= ~PS_LARGE_PAGES; Flags &= ~PS_LARGE_PAGES;
Status = MmInitializeProcessAddressSpace(Process, Status = MmInitializeProcessAddressSpace(Process,
@ -713,7 +712,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
RtlZeroMemory(&InitialPeb, sizeof(INITIAL_PEB)); RtlZeroMemory(&InitialPeb, sizeof(INITIAL_PEB));
InitialPeb.Mutant = (HANDLE)-1; InitialPeb.Mutant = (HANDLE)-1;
InitialPeb.ImageUsesLargePages = 0; // FIXME: Not yet supported InitialPeb.ImageUsesLargePages = 0; // FIXME: Not yet supported
// //
// Create it only if we have an image section // Create it only if we have an image section
// //
@ -850,7 +849,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle,
/* Run the Notification Routines */ /* Run the Notification Routines */
PspRunCreateProcessNotifyRoutines(Process, TRUE); PspRunCreateProcessNotifyRoutines(Process, TRUE);
/* If 12 processes have been created, enough of user-mode is ready */ /* If 12 processes have been created, enough of user-mode is ready */
if (++ProcessCount == 12) Ki386PerfEnd(); if (++ProcessCount == 12) Ki386PerfEnd();