- Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archiv...
authorStefan Ginsberg <stefanginsberg@gmail.com>
Mon, 5 Jan 2009 17:51:55 +0000 (17:51 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Mon, 5 Jan 2009 17:51:55 +0000 (17:51 +0000)
svn path=/trunk/; revision=38587

reactos/drivers/network/ndis/ndis/stubs.c

index f1b3d07..448860a 100644 (file)
@@ -532,17 +532,19 @@ NdisGetReceivedPacket(
  */
 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;
 }