mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-16 04:11:51 +00:00
The guest local tick was decoded into a DateTimeKind.Utc DateTime and then passed to TimeZoneInfo.ConvertTimeToUtc together with TimeZoneInfo.Local. That overload throws ArgumentException when a Utc-kind value is paired with a source zone other than UTC, so on any machine whose local zone is not UTC the export caught the exception and always returned INVALID_ARGUMENT. Re-tag the decoded value as DateTimeKind.Unspecified so it is interpreted as local wall-clock time and converted correctly. The reverse direction (sceRtcConvertUtcToLocalTime) was already correct because ConvertTimeFromUtc accepts a Utc-kind input. Add a RtcExports unit-test suite covering the tick/calendar conversions, DOS time packing, Win32 file time, leap-year and validation error codes, and a regression test that round-trips a UTC tick through local time and back.