From f2c0ae46c11db7b0bfd4b4d638aaa3ff282d6ba0 Mon Sep 17 00:00:00 2001 From: Gliniak Date: Mon, 20 Dec 2021 08:53:45 +0100 Subject: [PATCH] [Kernel] Added missing month to RtlTimeFieldsToTime Additionally added check for highest possible month day --- src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc index db3cef5db..18378b662 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc @@ -529,9 +529,10 @@ DECLARE_XBOXKRNL_EXPORT1(RtlTimeToTimeFields, kNone, kImplemented); dword_result_t RtlTimeFieldsToTime(pointer_t time_fields_ptr, lpqword_t time_ptr) { if (time_fields_ptr->year < 1601 || time_fields_ptr->month < 1 || - time_fields_ptr->month > 11 || time_fields_ptr->day < 1 || - time_fields_ptr->hour > 23 || time_fields_ptr->minute > 59 || - time_fields_ptr->second > 59 || time_fields_ptr->milliseconds > 999) { + time_fields_ptr->month > 12 || time_fields_ptr->day < 1 || + time_fields_ptr->day > 31 || time_fields_ptr->hour > 23 || + time_fields_ptr->minute > 59 || time_fields_ptr->second > 59 || + time_fields_ptr->milliseconds > 999) { return 0; } auto year = date::year{time_fields_ptr->year};