Author: fireball
Date: Tue Jun  9 20:38:05 2009
New Revision: 41359

URL: http://svn.reactos.org/svn/reactos?rev=41359&view=rev
Log:
- Make use of the implemented transfer counter.

Modified:
    trunk/reactos/ntoskrnl/include/internal/io_x.h
    trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
    trunk/reactos/ntoskrnl/io/iomgr/irp.c

Modified: trunk/reactos/ntoskrnl/include/internal/io_x.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/io_x.h?rev=41359&r1=41358&r2=41359&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/io_x.h [iso-8859-1] Tue Jun  9 
20:38:05 2009
@@ -92,7 +92,7 @@
 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;

Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c?rev=41359&r1=41358&r2=41359&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Tue Jun  9 20:38:05 
2009
@@ -2353,6 +2353,9 @@
                 Status = _SEH2_GetExceptionCode();
             }
             _SEH2_END;
+
+            /* Update transfer count */
+            IopUpdateTransferCount(IopOtherTransfer, Length);
 
             /* Release the file lock, dereference the file and return */
             IopUnlockFileObject(FileObject);

Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?rev=41359&r1=41358&r2=41359&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Tue Jun  9 20:38:05 2009
@@ -390,6 +390,29 @@
                 /* Clear the APC Routine and remember this */
                 Irp->Overlay.AsynchronousParameters.UserApcRoutine = NULL;
                 SignaledCreateRequest = TRUE;
+            }
+        }
+
+        /* 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);
             }
         }
 

Reply via email to