Vibhav Pant (@vibhavp) commented about dlls/opcservices/compress.c:
+ struct zip64_end_of_central_directory eocd64; + uint64_t eocd64_offset = archive->position; + struct zip64_extra_field extra_field; + + for (i = 0; i < archive->file_count; ++i) + { + const struct zip_file *file = archive->files[i]; + + cdh.signature = ZIP32_CDFH; + cdh.version = ZIP64_VERSION; + cdh.min_version = ZIP64_VERSION; + cdh.flags = USE_DATA_DESCRIPTOR; + cdh.method = 8; /* Z_DEFLATED */ + cdh.mtime = archive->mtime; + cdh.crc32 = file->crc32; + cdh.compressed_size = ~0u; The spec is a little unclear about when the central directory fields can be \~0:
4.4.1.4 If one of the fields in the end of central directory record is too small to hold required data, the field SHOULD be set to -1 (0xFFFF or 0xFFFFFFFF) and the ZIP64 format record SHOULD be created.
However, I couldn't find anything saying that the fields can be \~0 even when the value can fit inside a 32-bit integer (the data descriptor records are explicitly allowed to do this in 4.3.9.2). It should be fine, though. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8879#note_114533