mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 04:13:35 +00:00
[NTOSKRNL]: NtQuerySystemInformation(SystemProcessInformation) should skip zombie processes, and it should use the KTHREAD ThreadListEntry, not the ETHREAD ThreadListEntry. Fixes winetest since Idle Threads are int he former, not the latter (verified and Windows does this too).
svn path=/trunk/; revision=55731
This commit is contained in:
@@ -711,7 +711,9 @@ QSI_DEF(SystemProcessInformation)
|
||||
|
||||
/* Check for overflow */
|
||||
if (Size < sizeof(SYSTEM_PROCESS_INFORMATION))
|
||||
{
|
||||
Overflow = TRUE;
|
||||
}
|
||||
|
||||
/* Zero user's buffer */
|
||||
if (!Overflow) RtlZeroMemory(Spi, Size);
|
||||
@@ -719,14 +721,25 @@ QSI_DEF(SystemProcessInformation)
|
||||
SystemProcess = PsIdleProcess;
|
||||
Process = SystemProcess;
|
||||
Current = (PUCHAR) Spi;
|
||||
CurrentSize = 0;
|
||||
ImageNameMaximumLength = 0;
|
||||
|
||||
do
|
||||
{
|
||||
SpiCurrent = (PSYSTEM_PROCESS_INFORMATION) Current;
|
||||
|
||||
if ((Process->ProcessExiting) &&
|
||||
(Process->Pcb.Header.SignalState) &&
|
||||
!(Process->ActiveThreads) &&
|
||||
(IsListEmpty(&Process->Pcb.ThreadListHead)))
|
||||
{
|
||||
DPRINT1("Skipping zombie\n");
|
||||
goto Skip;
|
||||
}
|
||||
|
||||
ThreadsCount = 0;
|
||||
CurrentEntry = Process->ThreadListHead.Flink;
|
||||
while (CurrentEntry != &Process->ThreadListHead)
|
||||
CurrentEntry = Process->Pcb.ThreadListHead.Flink;
|
||||
while (CurrentEntry != &Process->Pcb.ThreadListHead)
|
||||
{
|
||||
ThreadsCount++;
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
@@ -770,7 +783,9 @@ QSI_DEF(SystemProcessInformation)
|
||||
|
||||
/* Check for overflow */
|
||||
if (TotalSize > Size)
|
||||
{
|
||||
Overflow = TRUE;
|
||||
}
|
||||
|
||||
/* Fill system information */
|
||||
if (!Overflow)
|
||||
@@ -821,10 +836,10 @@ QSI_DEF(SystemProcessInformation)
|
||||
SpiCurrent->PrivatePageCount = Process->CommitCharge;
|
||||
ThreadInfo = (PSYSTEM_THREAD_INFORMATION)(SpiCurrent + 1);
|
||||
|
||||
CurrentEntry = Process->ThreadListHead.Flink;
|
||||
while (CurrentEntry != &Process->ThreadListHead)
|
||||
CurrentEntry = Process->Pcb.ThreadListHead.Flink;
|
||||
while (CurrentEntry != &Process->Pcb.ThreadListHead)
|
||||
{
|
||||
CurrentThread = CONTAINING_RECORD(CurrentEntry, ETHREAD,
|
||||
CurrentThread = (PETHREAD)CONTAINING_RECORD(CurrentEntry, KTHREAD,
|
||||
ThreadListEntry);
|
||||
|
||||
ThreadInfo->KernelTime.QuadPart = UInt32x32To64(CurrentThread->Tcb.KernelTime, KeMaximumIncrement);
|
||||
@@ -850,6 +865,7 @@ QSI_DEF(SystemProcessInformation)
|
||||
}
|
||||
|
||||
/* Handle idle process entry */
|
||||
Skip:
|
||||
if (Process == PsIdleProcess) Process = NULL;
|
||||
|
||||
Process = PsGetNextProcess(Process);
|
||||
|
||||
Reference in New Issue
Block a user