From 80443d48dc11e525a56d1968ccf9b9467f84cda3 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 11 Aug 2015 17:45:56 +0000 Subject: [PATCH] [WIN32K] Implement EngQueryLocalTime. This commit would not have been possible without Colin's SVN superpowers. svn path=/trunk/; revision=68692 --- reactos/win32ss/gdi/eng/stubs.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/gdi/eng/stubs.c b/reactos/win32ss/gdi/eng/stubs.c index a0d306efc03..b4e8c51f4f0 100644 --- a/reactos/win32ss/gdi/eng/stubs.c +++ b/reactos/win32ss/gdi/eng/stubs.c @@ -284,10 +284,21 @@ EngMultiByteToWideChar( VOID APIENTRY -EngQueryLocalTime(OUT PENG_TIME_FIELDS ptf) +EngQueryLocalTime( + _Out_ PENG_TIME_FIELDS ptf) { - // www.osr.com/ddk/graphics/gdifncs_389z.htm - UNIMPLEMENTED; + LARGE_INTEGER liSystemTime, liLocalTime; + NT_ASSERT(ptf != NULL); + + /* Query the system time */ + KeQuerySystemTime(&liSystemTime); + + /* Convert it to local time */ + ExSystemTimeToLocalTime(&liSystemTime, &liLocalTime); + + /* Convert the local time into time fields + (note that ENG_TIME_FIELDS is identical to TIME_FIELDS) */ + RtlTimeToTimeFields(&liLocalTime, (PTIME_FIELDS)ptf); } ULONG