[libromdata] WimPrivate::addFields_XML(): Fix copy/paste error for FILETIMEs.

Both lastmodtime_high and lastmodtime_low were being initialized to
strtoul(s_highPart, ...).

Testing Windows 10 (10.0.19041.5363) recovery image: (winre.wim)
- HIGHPART: 0x01D5ACCD
- LOWPART:  0x97A856C3
- Decimal: 132201763089962691

Timestamp conversions before and after: (using TZ=UTC)
- Before: 12/07/2019 07:07:37 AM
- After:  12/07/2019 07:11:48 AM

Manually converting it using a website:
- Saturday, December 7, 2019 7:11:48 AM

TODO: Split the XML code into a separate .cpp file and add DelayLoad checks.
This commit is contained in:
David Korth 2025-03-31 22:19:49 -04:00
parent 924ed20e29
commit f6398a63ee
2 changed files with 5 additions and 1 deletions

View File

@ -64,6 +64,10 @@
field is a "warning" field.
* DpfReader: Fixed a regression that broke reading RPF files.
* Affects: v2.4 - v2.4.1
* Wim: Fix image timestamp parsing. Previously, the "HIGHPART" was used
for both the high and low 32 bits. The date would usually be correct,
but the timestamp would be off by minutes. Both "HIGHPART" and "LOWPART"
are now correctly used to build the 64-bit FILETIME timestamp.
* Other changes:
* CMake: Added an ENABLE_NETWORKING option to control whether or not

View File

@ -249,7 +249,7 @@ int WimPrivate::addFields_XML()
if (s_highPart && s_lowPart) {
// Parse HIGHPART and LOWPART, then combine them like FILETIME.
const uint32_t lastmodtime_high = strtoul(s_highPart, nullptr, 16);
const uint32_t lastmodtime_low = strtoul(s_highPart, nullptr, 16);
const uint32_t lastmodtime_low = strtoul(s_lowPart, nullptr, 16);
currentindex.lastmodificationtime = WindowsSplitTimeToUnixTime(lastmodtime_high, lastmodtime_low);
}
}