Skip to content

Port 7-zip v23+ compatibility fixes from upstream PR #83#7

Merged
xexes merged 1 commit into
masterfrom
copilot/ed7d7216a7b3e78cbda666224b3cc433f7e3253b
May 31, 2026
Merged

Port 7-zip v23+ compatibility fixes from upstream PR #83#7
xexes merged 1 commit into
masterfrom
copilot/ed7d7216a7b3e78cbda666224b3cc433f7e3253b

Conversation

Copy link
Copy Markdown

Copilot AI commented May 31, 2026

Ports critical compatibility fixes from borisbrodski/sevenzipjbinding#83 (7z-23.01 branch) to support newer 7-zip engine behavior.

Changes

  • UniversalArchiveOpenCallback: return VT_EMPTY instead of E_NOINTERFACE

    • GetProperty() returns VT_EMPTY when IArchiveOpenVolumeCallback is not implemented, allowing 7-zip codec auto-detection to proceed instead of failing
    • GetStream() returns S_OK with NULL stream (or E_FAIL for CAB volumes) instead of E_NOINTERFACE
  • IArchiveExtractCallbackMessage2 / ReportExtractResult callback

    • New ReportExtractResultIndexType enum mapping 7-zip's NEventIndexType
    • IArchiveExtractCallback.reportExtractResult() default method for backward-compatible immediate error reporting
    • C++ side implements IArchiveExtractCallbackMessage2, exposes via QueryInterface
    • JNI bindings in JavaPackageSevenZip.h
  • kpidComment / kpidEncrypted / kpidCRC in update callback

    • IOutItem7z and OutItem gain propertyComment, propertyEncrypted, propertyCRC
    • CPPToJavaArchiveUpdateCallback.cpp switch handles the new propIDs
    • JNI field mappings added

Context

7-zip v23+ calls QueryInterface for IArchiveExtractCallbackMessage2 during extraction and requests additional properties (comment, encrypted, CRC) during archive creation. Without these changes, the engine either crashes on E_NOINTERFACE during open or silently loses error reporting capabilities.

…portExtractResult callback, kpidComment/Encrypted/CRC support

- Fix UniversalArchiveOpenCallback to return VT_EMPTY instead of E_NOINTERFACE
  when IArchiveOpenVolumeCallback is not implemented (allows 7-zip codec auto-detection)
- Add IArchiveExtractCallbackMessage2 support for ReportExtractResult callback
  (7-zip v23+ error reporting during extraction)
- Add kpidComment, kpidEncrypted, kpidCRC property support in update callback
- Add ReportExtractResultIndexType enum
- Add propertyComment/propertyEncrypted/propertyCRC to IOutItem7z and OutItem
@xexes xexes marked this pull request as ready for review May 31, 2026 21:19
@xexes xexes merged commit 49193b0 into master May 31, 2026
@xexes xexes deleted the copilot/ed7d7216a7b3e78cbda666224b3cc433f7e3253b branch May 31, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants