Re: wbemprox: Implement Win32_OperatingSystem.LocalDateTime.
24 Jun
2013
24 Jun
'13
3:07 a.m.
On Sun, 2013-06-23 at 18:55 +0200, Sylvain Petreolle wrote:
+static WCHAR *get_localdatetime(void) +{ + static const WCHAR fmtW[] = + {'%','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}; + SYSTEM_TIMEOFDAY_INFORMATION ti; + TIME_FIELDS tf; + WCHAR *ret; + + if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL; + + NtQuerySystemInformation( SystemTimeOfDayInformation, &ti, sizeof(ti), NULL ); + RtlTimeToTimeFields( &ti.liKeBootTime, &tf ); + sprintfW( ret, fmtW, tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 ); + return ret; +}
This will not return local time.
4553
Age (days ago)
4553
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hans Leidekker