Author: tkreuzer
Date: Sat May 10 08:37:45 2014
New Revision: 63211
URL:
http://svn.reactos.org/svn/reactos?rev=63211&view=rev
Log:
[KERNEL32] Fix GetTickCount on 64 bit architecture
[RTL] Implement RtlGetTickCount (currently a copy of GetTickCount from kernel32)
[NTDLL] Export RtlGetTickCount as NtGetTickCount and ZwGetTickCount
Modified:
trunk/reactos/dll/ntdll/def/ntdll.spec
trunk/reactos/dll/ntdll/rtl/libsupp.c
trunk/reactos/dll/win32/kernel32/client/time.c
trunk/reactos/lib/rtl/rtlp.h
Modified: trunk/reactos/dll/ntdll/def/ntdll.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Sat May 10 08:37:45 2014
@@ -175,7 +175,7 @@
@ stdcall NtGetCurrentProcessorNumber() ; 5.2 and higher
@ stdcall NtGetDevicePowerState(ptr ptr)
@ stdcall NtGetPlugPlayEvent(long long ptr long)
-@ stdcall -stub NtGetTickCount()
+@ stdcall NtGetTickCount() RtlGetTickCount
@ stdcall NtGetWriteWatch(long long ptr long ptr ptr ptr)
@ stdcall NtImpersonateAnonymousToken(ptr)
@ stdcall NtImpersonateClientOfPort(ptr ptr)
@@ -1051,7 +1051,7 @@
@ stdcall ZwGetCurrentProcessorNumber()
@ stdcall ZwGetDevicePowerState(ptr ptr)
@ stdcall ZwGetPlugPlayEvent(long long ptr long)
-;@ stdcall ZwGetTickCount() NtGetTickCount
+@ stdcall ZwGetTickCount() RtlGetTickCount
@ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch
@ stdcall ZwImpersonateAnonymousToken(ptr)
@ stdcall ZwImpersonateClientOfPort(ptr ptr) NtImpersonateClientOfPort
Modified: trunk/reactos/dll/ntdll/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/rtl/libsupp.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] Sat May 10 08:37:45 2014
@@ -613,4 +613,32 @@
return STATUS_SUCCESS;
}
+/* FIXME: code duplication with kernel32/client/time.c */
+ULONG
+NTAPI
+RtlGetTickCount(VOID)
+{
+ ULARGE_INTEGER TickCount;
+
+#ifdef _WIN64
+ TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
+#else
+ while (TRUE)
+ {
+ TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
+ TickCount.LowPart = SharedUserData->TickCount.LowPart;
+
+ if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
+ break;
+
+ YieldProcessor();
+ }
+#endif
+
+ return (ULONG)((UInt32x32To64(TickCount.LowPart,
+ SharedUserData->TickCountMultiplier) >> 24) +
+ UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
+ SharedUserData->TickCountMultiplier));
+}
+
/* EOF */
Modified: trunk/reactos/dll/win32/kernel32/client/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] Sat May 10 08:37:45 2014
@@ -446,6 +446,9 @@
{
ULARGE_INTEGER TickCount;
+#ifdef _WIN64
+ TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
+#else
while (TRUE)
{
TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
@@ -456,6 +459,7 @@
YieldProcessor();
}
+#endif
return (ULONG)((UInt32x32To64(TickCount.LowPart,
SharedUserData->TickCountMultiplier) >> 24) +
Modified: trunk/reactos/lib/rtl/rtlp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtlp.h?rev=63211&a…
==============================================================================
--- trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] Sat May 10 08:37:45 2014
@@ -125,6 +125,11 @@
#define RtlpAllocateStringMemory RtlpAllocateMemory
#define RtlpFreeStringMemory RtlpFreeMemory
+ULONG
+NTAPI
+RtlGetTickCount(VOID);
+#define NtGetTickCount RtlGetTickCount
+
BOOLEAN
NTAPI
RtlpSetInDbgPrint(