[02/23] ntdll: Update user shared data in NtQuerySystemTime.

Andrew Wesie awesie at gmail.com
Sun Nov 13 12:35:02 CST 2016


Signed-off-by: Andrew Wesie <awesie at gmail.com>
---
 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 <mach/mach_time.h>
 #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




More information about the wine-patches mailing list