Commit 8ca9e0b1 authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Use the user shared data to implement GetTickCount().

parent 6a1667fa
......@@ -725,8 +725,8 @@
# @ stub GetThreadSelectedCpuSets
@ stdcall GetThreadTimes(long ptr ptr ptr ptr)
@ stdcall GetThreadUILanguage()
@ stdcall GetTickCount() kernel32.GetTickCount
@ stdcall -ret64 GetTickCount64() kernel32.GetTickCount64
@ stdcall GetTickCount()
@ stdcall -ret64 GetTickCount64()
@ stdcall GetTimeFormatA(long long ptr str ptr long) kernel32.GetTimeFormatA
@ stdcall GetTimeFormatEx(wstr long ptr wstr ptr long) kernel32.GetTimeFormatEx
@ stdcall GetTimeFormatW(long long ptr wstr ptr long) kernel32.GetTimeFormatW
......
......@@ -42,6 +42,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(sync);
static const struct _KUSER_SHARED_DATA *user_shared_data = (struct _KUSER_SHARED_DATA *)0x7ffe0000;
/* check if current version is NT or Win95 */
static inline BOOL is_version_nt(void)
{
......@@ -126,6 +128,34 @@ static BOOL get_open_object_attributes( OBJECT_ATTRIBUTES *attr, UNICODE_STRING
***********************************************************************/
/******************************************************************************
* GetTickCount (kernelbase.@)
*/
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
{
/* note: we ignore TickCountMultiplier */
return user_shared_data->u.TickCount.LowPart;
}
/******************************************************************************
* GetTickCount64 (kernelbase.@)
*/
ULONGLONG WINAPI DECLSPEC_HOTPATCH GetTickCount64(void)
{
ULONG high, low;
do
{
high = user_shared_data->u.TickCount.High1Time;
low = user_shared_data->u.TickCount.LowPart;
}
while (high != user_shared_data->u.TickCount.High2Time);
/* note: we ignore TickCountMultiplier */
return (ULONGLONG)high << 32 | low;
}
static HANDLE normalize_handle_if_console( HANDLE handle )
{
static HANDLE wait_event;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment