From: Andrew Wesie Subject: [02/23] ntdll: Update user shared data in NtQuerySystemTime. Message-Id: <1479062123-21238-3-git-send-email-awesie@gmail.com> Date: Sun, 13 Nov 2016 12:35:02 -0600 In-Reply-To: <1479062123-21238-1-git-send-email-awesie@gmail.com> References: <1479062123-21238-1-git-send-email-awesie@gmail.com> Signed-off-by: Andrew Wesie --- dlls/ntdll/thread.c | 6 ------ dlls/ntdll/time.c | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index f3004bd..dc84867 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -343,12 +343,6 @@ HANDLE thread_init(void) /* initialize time values in user_shared_data */ NtQuerySystemTime( &now ); - user_shared_data->SystemTime.LowPart = now.u.LowPart; - user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.u.HighPart; - user_shared_data->u.TickCountQuad = (now.QuadPart - server_start_time) / 10000; - user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; - user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; - user_shared_data->TickCountMultiplier = 1 << 24; fill_cpu_info(); diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 96ffcfa..2dcb208 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -42,6 +42,7 @@ # include #endif +#define NONAMELESSUNION #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -49,6 +50,7 @@ #include "wine/unicode.h" #include "wine/debug.h" #include "ntdll_misc.h" +#include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -464,6 +466,13 @@ NTSTATUS WINAPI NtQuerySystemTime( PLARGE_INTEGER Time ) gettimeofday( &now, 0 ); Time->QuadPart = now.tv_sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; Time->QuadPart += now.tv_usec * 10; + + user_shared_data->SystemTime.LowPart = Time->u.LowPart; + user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = Time->u.HighPart; + user_shared_data->u.TickCountQuad = NtGetTickCount(); + user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; + user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; + user_shared_data->TickCountMultiplier = 1 << 24; return STATUS_SUCCESS; } -- 2.7.4