mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 00:43:21 +00:00
- Implement a helper for updating IO transfer counters. Based on a patch by Dmitry Chapyshev.
svn path=/trunk/; revision=41358
This commit is contained in:
parent
de4dace673
commit
37fdc19299
|
@ -89,6 +89,44 @@ IopUpdateOperationCount(IN IOP_TRANSFER_TYPE Type)
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
__inline
|
||||
VOID
|
||||
IopUpdateTransferCount(IN IOP_TRANSFER_TYPE Type, IN ULONG TransferCount)
|
||||
{
|
||||
PLARGE_INTEGER CountToChange;
|
||||
PLARGE_INTEGER TransferToChange;
|
||||
|
||||
/* Make sure I/O operations are being counted */
|
||||
if (IoCountOperations)
|
||||
{
|
||||
if (Type == IopReadTransfer)
|
||||
{
|
||||
/* Increase read count */
|
||||
CountToChange = &PsGetCurrentProcess()->ReadTransferCount;
|
||||
TransferToChange = &IoReadTransferCount;
|
||||
}
|
||||
else if (Type == IopWriteTransfer)
|
||||
{
|
||||
/* Increase write count */
|
||||
CountToChange = &PsGetCurrentProcess()->WriteTransferCount;
|
||||
TransferToChange = &IoWriteTransferCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Increase other count */
|
||||
CountToChange = &PsGetCurrentProcess()->OtherTransferCount;
|
||||
TransferToChange = &IoOtherTransferCount;
|
||||
}
|
||||
|
||||
/* Increase the process-wide count */
|
||||
ExInterlockedAddLargeStatistic(CountToChange, TransferCount);
|
||||
|
||||
/* Increase global count */
|
||||
ExInterlockedAddLargeStatistic(TransferToChange, TransferCount);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
__inline
|
||||
BOOLEAN
|
||||
|
|
Loading…
Reference in a new issue