- Make use of the implemented transfer counter.

svn path=/trunk/; revision=41359
This commit is contained in:
Aleksey Bragin
2009-06-09 16:38:05 +00:00
parent 37fdc19299
commit fefcaea1a8
3 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ IopUpdateOperationCount(IN IOP_TRANSFER_TYPE Type)
static
__inline
VOID
IopUpdateTransferCount(IN IOP_TRANSFER_TYPE Type, IN ULONG TransferCount)
IopUpdateTransferCount(IN IOP_TRANSFER_TYPE Type, IN ULONG_PTR TransferCount)
{
PLARGE_INTEGER CountToChange;
PLARGE_INTEGER TransferToChange;
+3
View File
@@ -2354,6 +2354,9 @@ NtSetInformationFile(IN HANDLE FileHandle,
}
_SEH2_END;
/* Update transfer count */
IopUpdateTransferCount(IopOtherTransfer, Length);
/* Release the file lock, dereference the file and return */
IopUnlockFileObject(FileObject);
ObDereferenceObject(FileObject);
+23
View File
@@ -393,6 +393,29 @@ IopCompleteRequest(IN PKAPC Apc,
}
}
/* Update transfer count for everything but create operation */
if (!(Irp->Flags & IRP_CREATE_OPERATION))
{
if (Irp->Flags & IRP_WRITE_OPERATION)
{
/* Update write transfer count */
IopUpdateTransferCount(IopWriteTransfer,
Irp->IoStatus.Information);
}
else if (Irp->Flags & IRP_READ_OPERATION)
{
/* Update read transfer count */
IopUpdateTransferCount(IopReadTransfer,
Irp->IoStatus.Information);
}
else
{
/* Update other transfer count */
IopUpdateTransferCount(IopOtherTransfer,
Irp->IoStatus.Information);
}
}
/* Now that we've signaled the events, de-associate the IRP */
IopUnQueueIrpFromThread(Irp);