- Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archiv...
[reactos.git] / reactos / drivers / network / ndis / ndis / stubs.c
index 9f25317..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;
 }
 
 
@@ -1046,7 +1048,7 @@ NdisIMInitializeDeviceInstanceEx(
 
  
 VOID
-STDCALL
+NTAPI
 ndisProcWorkItemHandler(PVOID pContext)
 {
     PNDIS_WORK_ITEM pNdisItem = (PNDIS_WORK_ITEM)pContext;
@@ -1063,7 +1065,3 @@ NdisScheduleWorkItem(
     ExQueueWorkItem(pntWorkItem, CriticalWorkQueue);
     return NDIS_STATUS_SUCCESS;
 }
-
-
-
-/* EOF */