mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:EX] Fix returned number of handles for Idle System Process (#4661)
PsIdleProcess and PsInitialSystemProcess share the same handle table. This leads ObGetProcessHandleCount() to report the same number of handles when called on those system processes, when being enumerated by NtQuerySystemInformation(SystemProcessInformation). Instead, just return 0 for the handle count of the Idle process in SystemProcessInformation. This is not done in ObGetProcessHandleCount(), since a separate NtQueryInformationProcess(ProcessHandleCount) for the idle process should return a non-zero value. CORE-16577
This commit is contained in:
parent
de5af76811
commit
7ed0284e8e
1 changed files with 5 additions and 1 deletions
|
@ -1031,7 +1031,11 @@ QSI_DEF(SystemProcessInformation)
|
|||
SpiCurrent->BasePriority = Process->Pcb.BasePriority;
|
||||
SpiCurrent->UniqueProcessId = Process->UniqueProcessId;
|
||||
SpiCurrent->InheritedFromUniqueProcessId = Process->InheritedFromUniqueProcessId;
|
||||
SpiCurrent->HandleCount = ObGetProcessHandleCount(Process);
|
||||
|
||||
/* PsIdleProcess shares its handle table with PsInitialSystemProcess,
|
||||
* so return the handle count for System only, not Idle one. */
|
||||
SpiCurrent->HandleCount = (Process == PsIdleProcess) ? 0 : ObGetProcessHandleCount(Process);
|
||||
|
||||
SpiCurrent->PeakVirtualSize = Process->PeakVirtualSize;
|
||||
SpiCurrent->VirtualSize = Process->VirtualSize;
|
||||
SpiCurrent->PageFaultCount = Process->Vm.PageFaultCount;
|
||||
|
|
Loading…
Reference in a new issue