mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Properly implement NdisGetSystemUpTime, based on http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-11/0616.html
svn path=/trunk/; revision=38587
This commit is contained in:
parent
3f64101cc9
commit
c5c778d46e
1 changed files with 12 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue