mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 00:27:13 +00:00
[NTOSKRNL]
Fix comments and reduce code complexity. svn path=/trunk/; revision=50391
This commit is contained in:
parent
b51f0a0553
commit
6ecbc52144
1 changed files with 9 additions and 10 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue