[NTOSKRNL] Also account PRCBs for Io operations counters
authorPierre Schweitzer <pierre@reactos.org>
Sun, 9 Dec 2018 18:30:07 +0000 (19:30 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 9 Dec 2018 18:30:07 +0000 (19:30 +0100)
ntoskrnl/ex/sysinfo.c

index b43aa2c..1d8e1c5 100644 (file)
@@ -695,6 +695,19 @@ QSI_DEF(SystemPerformanceInformation)
     Spi->IoReadOperationCount = IoReadOperationCount;
     Spi->IoWriteOperationCount = IoWriteOperationCount;
     Spi->IoOtherOperationCount = IoOtherOperationCount;
+    for (i = 0; i < KeNumberProcessors; i ++)
+    {
+        Prcb = KiProcessorBlock[i];
+        if (Prcb)
+        {
+            Spi->IoReadTransferCount.QuadPart += Prcb->IoReadTransferCount.QuadPart;
+            Spi->IoWriteTransferCount.QuadPart += Prcb->IoWriteTransferCount.QuadPart;
+            Spi->IoOtherTransferCount.QuadPart += Prcb->IoOtherTransferCount.QuadPart;
+            Spi->IoReadOperationCount += Prcb->IoReadOperationCount;
+            Spi->IoWriteOperationCount += Prcb->IoWriteOperationCount;
+            Spi->IoOtherOperationCount += Prcb->IoOtherOperationCount;
+        }
+    }
 
     Spi->AvailablePages = (ULONG)MmAvailablePages;
     /*
@@ -805,7 +818,6 @@ QSI_DEF(SystemPerformanceInformation)
         }
     }
 
-
     return STATUS_SUCCESS;
 }