[ros-diffs] [sginsberg] 38587: - Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-11/0616.html

sginsberg at svn.reactos.org sginsberg at svn.reactos.org
Mon Jan 5 18:51:56 CET 2009


Author: sginsberg
Date: Mon Jan  5 11:51:55 2009
New Revision: 38587

URL: http://svn.reactos.org/svn/reactos?rev=38587&view=rev
Log:
- Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-11/0616.html

Modified:
    trunk/reactos/drivers/network/ndis/ndis/stubs.c

Modified: trunk/reactos/drivers/network/ndis/ndis/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/stubs.c?rev=38587&r1=38586&r2=38587&view=diff
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/stubs.c [iso-8859-1] Mon Jan  5 11:51:55 2009
@@ -532,17 +532,19 @@
  */
 VOID
 EXPORT
-NdisGetSystemUpTime(
-    OUT PULONG  pSystemUpTime)
-/*
- * FUNCTION:
- * ARGUMENTS:
- * NOTES:
- *    NDIS 5.0
- */
+NdisGetSystemUpTime(OUT PULONG pSystemUpTime)
 {           
-    /* Get the uptime of the system in msec */
-     *pSystemUpTime = ( (SharedUserData->TickCountLowDeprecated *  SharedUserData->TickCountMultiplier) / 0x1000000); 
+    ULONG Increment;
+    LARGE_INTEGER TickCount;
+
+    /* Get the increment and current tick count */
+    Increment = KeQueryTimeIncrement();
+    KeQueryTickCount(&TickCount);
+
+    /* Convert to milliseconds and return */
+    TickCount.QuadPart *= Increment;
+    TickCount.QuadPart /= (10 * 1000);
+    *pSystemUpTime = TickCount.LowPart;
 }
 
 



More information about the Ros-diffs mailing list