mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:EX] Fix swapped values in ExGetCurrentProcessorCounts() (#4565)
The function should return the kernel time for the idle thread in the first argument, and kernel time + user time for the current thread in the second argument. Also retrieve the processor number from the cached PRCB instead of calling KeGetCurrentProcessorNumber() which retrieves the PRCB again since the processor could switch in-between those calls. NdisGetCurrentProcessorCounts() function follows the same prototype which is the correct one.
This commit is contained in:
parent
bc85db7d8c
commit
8e01dee251
2 changed files with 7 additions and 7 deletions
|
@ -45,8 +45,8 @@
|
|||
VOID
|
||||
NTAPI
|
||||
ExGetCurrentProcessorCounts(
|
||||
PULONG ThreadKernelTime,
|
||||
PULONG TotalCpuTime,
|
||||
PULONG IdleTime,
|
||||
PULONG KernelAndUserTime,
|
||||
PULONG ProcessorNumber);
|
||||
|
||||
VOID
|
||||
|
|
|
@ -342,17 +342,17 @@ ExGetCurrentProcessorCpuUsage(PULONG CpuUsage)
|
|||
*/
|
||||
VOID
|
||||
NTAPI
|
||||
ExGetCurrentProcessorCounts(PULONG ThreadKernelTime,
|
||||
PULONG TotalCpuTime,
|
||||
ExGetCurrentProcessorCounts(PULONG IdleTime,
|
||||
PULONG KernelAndUserTime,
|
||||
PULONG ProcessorNumber)
|
||||
{
|
||||
PKPRCB Prcb;
|
||||
|
||||
Prcb = KeGetCurrentPrcb();
|
||||
|
||||
*ThreadKernelTime = Prcb->KernelTime + Prcb->UserTime;
|
||||
*TotalCpuTime = Prcb->CurrentThread->KernelTime;
|
||||
*ProcessorNumber = KeGetCurrentProcessorNumber();
|
||||
*IdleTime = Prcb->IdleThread->KernelTime;
|
||||
*KernelAndUserTime = Prcb->KernelTime + Prcb->UserTime;
|
||||
*ProcessorNumber = (ULONG)Prcb->Number;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue