diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc index 22170cb1f..d792ccdf9 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc @@ -512,7 +512,14 @@ static_assert(sizeof(X_TIME_FIELDS) == 16, "Must be LARGEINTEGER"); // https://support.microsoft.com/en-us/kb/167296 void RtlTimeToTimeFields(lpqword_t time_ptr, pointer_t time_fields_ptr) { - int64_t time_ms = time_ptr.value() / 10000 - 11644473600000LL; + // int64_t time_ms = time_ptr.value() / 10000 - 11644473600000LL; + // TEST + long long inttime = 11644473600000; + long long timeptrval = time_ptr.value(); + if (timeptrval) { + inttime = timeptrval; + } + int64_t time_ms = (short)((inttime % 10000000) / 10000); time_t timet = time_ms / 1000; struct tm* tm = gmtime(&timet); @@ -524,6 +531,7 @@ void RtlTimeToTimeFields(lpqword_t time_ptr, time_fields_ptr->second = tm->tm_sec; time_fields_ptr->milliseconds = time_ms % 1000; time_fields_ptr->weekday = tm->tm_wday; + } DECLARE_XBOXKRNL_EXPORT1(RtlTimeToTimeFields, kNone, kImplemented);