From 2452965580edc5c63b9662c1cd942bd7e0665df1 Mon Sep 17 00:00:00 2001 From: ergo720 <45463469+ergo720@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:00:15 +0100 Subject: [PATCH] Fixed a bug in RtlTimeFieldsToTime --- src/core/kernel/exports/EmuKrnlRtl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/kernel/exports/EmuKrnlRtl.cpp b/src/core/kernel/exports/EmuKrnlRtl.cpp index 96741bfe0..be1925fbd 100644 --- a/src/core/kernel/exports/EmuKrnlRtl.cpp +++ b/src/core/kernel/exports/EmuKrnlRtl.cpp @@ -42,6 +42,7 @@ namespace NtDll #include "core\kernel\init\CxbxKrnl.h" // For CxbxrAbort() #include "core\kernel\support\Emu.h" // For EmuLog(LOG_LEVEL::WARNING, ) +#include "EmuKrnlKi.h" #include #ifdef _WIN32 @@ -1661,7 +1662,10 @@ XBSYSAPI EXPORTNUM(304) xbox::boolean_xt NTAPI xbox::RtlTimeFieldsToTime TimeFields->Hour) * MINSPERHOUR + TimeFields->Minute) * SECSPERMIN + TimeFields->Second) * 1000 + - TimeFields->Millisecond) * TICKSPERMSEC; + TimeFields->Millisecond); + + // This function must return a time expressed in 100ns units (the Windows time interval), so it needs a final multiplication here + *Time = RtlExtendedIntegerMultiply(*Time, CLOCK_TIME_INCREMENT); RETURN(TRUE); }