- NtUserWaitForInputIdle: Call EngGetTickCount, removing duplicated code
[reactos.git] / reactos / subsystems / win32 / win32k / stubs / stubs.c
index 70f9efb..96f0736 100644 (file)
@@ -2888,12 +2888,21 @@ EngFreeSectionMem(IN PVOID SectionObject OPTIONAL,
     UNIMPLEMENTED;
     return FALSE;
 }
+
 ULONGLONG
 APIENTRY
 EngGetTickCount(VOID)
 {
- return ((ULONGLONG)SharedUserData->TickCountLowDeprecated * SharedUserData->TickCountMultiplier / 16777216);
+    ULONG Multiplier;
+    LARGE_INTEGER TickCount;
+
+    /* Get the multiplier and current tick count */
+    KeQueryTickCount(&TickCount);
+    Multiplier = SharedUserData->TickCountMultiplier;
+
+    /* Convert to milliseconds and return */
+    return (Int64ShrlMod32(UInt32x32To64(Multiplier, TickCount.LowPart), 24) +
+            (Multiplier * (TickCount.HighPart << 8)));
 }
  
 BOOLEAN