From: Stefan Ginsberg Date: Mon, 5 Jan 2009 17:51:55 +0000 (+0000) Subject: - Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archiv... X-Git-Tag: ReactOS-0.3.8~528 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=c5c778d46e7cd25857093a142088719e6339c380 - Properly implement NdisGetSystemUpTime, based on tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-11/0616.html svn path=/trunk/; revision=38587 --- diff --git a/reactos/drivers/network/ndis/ndis/stubs.c b/reactos/drivers/network/ndis/ndis/stubs.c index f1b3d079a4b..448860a3e97 100644 --- a/reactos/drivers/network/ndis/ndis/stubs.c +++ b/reactos/drivers/network/ndis/ndis/stubs.c @@ -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; }