mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
wbemprox: Don't rely on GetTicksCount to determine boot time.
This commit is contained in:
parent
2c70e08cf8
commit
22b3a8251f
@ -945,21 +945,15 @@ static WCHAR *get_lastbootuptime(void)
|
|||||||
static const WCHAR fmtW[] =
|
static const WCHAR fmtW[] =
|
||||||
{'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
|
{'%','0','4','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u','%','0','2','u',
|
||||||
'.','%','0','6','u','+','0','0','0',0};
|
'.','%','0','6','u','+','0','0','0',0};
|
||||||
SYSTEMTIME st;
|
SYSTEM_TIMEOFDAY_INFORMATION ti;
|
||||||
FILETIME ft;
|
TIME_FIELDS tf;
|
||||||
ULARGE_INTEGER ticks;
|
|
||||||
WCHAR *ret;
|
WCHAR *ret;
|
||||||
|
|
||||||
if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL;
|
if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL;
|
||||||
GetSystemTime( &st );
|
|
||||||
SystemTimeToFileTime( &st, &ft );
|
NtQuerySystemInformation( SystemTimeOfDayInformation, &ti, sizeof(ti), NULL );
|
||||||
ticks.u.LowPart = ft.dwLowDateTime;
|
RtlTimeToTimeFields( &ti.liKeBootTime, &tf );
|
||||||
ticks.u.HighPart = ft.dwHighDateTime;
|
sprintfW( ret, fmtW, tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 );
|
||||||
ticks.QuadPart -= GetTickCount64() * 10000;
|
|
||||||
ft.dwLowDateTime = ticks.u.LowPart;
|
|
||||||
ft.dwHighDateTime = ticks.u.HighPart;
|
|
||||||
FileTimeToSystemTime( &ft, &st );
|
|
||||||
sprintfW( ret, fmtW, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds * 1000 );
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static const WCHAR *get_osarchitecture(void)
|
static const WCHAR *get_osarchitecture(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user