runtime/inflate: return structured InflateStatus via inflate_zlib_ex #1421

Merged
tedin7 merged 1 commit from upstream-pr/1428 into main 2026-11-24 12:07:12 +00:00
tedin7 commented 2026-11-24 11:20:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:20:59Z.


Addresses #1198

Adds enum class InflateStatus { ok, insufficient_output, corrupt_stream, bad_checksum } and inflate_zlib_ex(...) to src/startup_stubs/inflate.h so callers can distinguish output-capacity overflow from corrupt streams and Adler-32 checksum mismatches, while keeping inflate_zlib(...) as a thin compatible wrapper.

Verification

  • g++ -std=c++17 -Wall -Wextra -Werror -Isrc tests/startup_inflate_status.cpp -o /tmp/startup_inflate_status && /tmp/startup_inflate_status
  • g++ -std=c++17 -Isrc tests/startup_inflate_probe.cpp -o /tmp/startup_inflate_probe && python3 tests/startup_inflate_check.py /tmp/startup_inflate_probe
  • python3 tests/docs_links_check.py && python3 tests/bidi_controls_check.py && git diff --check

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6580628105 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1428). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:20:59Z. --- Addresses #1198 Adds `enum class InflateStatus { ok, insufficient_output, corrupt_stream, bad_checksum }` and `inflate_zlib_ex(...)` to `src/startup_stubs/inflate.h` so callers can distinguish output-capacity overflow from corrupt streams and Adler-32 checksum mismatches, while keeping `inflate_zlib(...)` as a thin compatible wrapper. ### Verification - `g++ -std=c++17 -Wall -Wextra -Werror -Isrc tests/startup_inflate_status.cpp -o /tmp/startup_inflate_status && /tmp/startup_inflate_status` - `g++ -std=c++17 -Isrc tests/startup_inflate_probe.cpp -o /tmp/startup_inflate_probe && python3 tests/startup_inflate_check.py /tmp/startup_inflate_probe` - `python3 tests/docs_links_check.py && python3 tests/bidi_controls_check.py && git diff --check` AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-24 12:03:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:25:55Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207) at commit 4e69fd96:

  • Debug (--preset dev): ctest --preset dev -R '^startup_inflate_status$' --no-tests=error --output-on-failure — 1/1 passed (0.02s)
  • Release /O2 (--preset release): ctest --preset release -R '^startup_inflate_status$' --no-tests=error --output-on-failure — 1/1 passed (0.01s)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7130088459 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1428#issuecomment-7130088459). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:25:55Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207) at commit `4e69fd96`: - **Debug (`--preset dev`)**: `ctest --preset dev -R '^startup_inflate_status$' --no-tests=error --output-on-failure` — **1/1 passed** (0.02s) - **Release `/O2` (`--preset release`)**: `ctest --preset release -R '^startup_inflate_status$' --no-tests=error --output-on-failure` — **1/1 passed** (0.01s)
chatgpt-codex-connector[bot commented 2026-11-24 12:03:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:26:04Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T11:28:52.833708Z 4e69fd9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7130091721 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1428#issuecomment-7130091721). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T11:26:04Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"4e69fd96f9785e9f249f6fb55a646e49e1706d65","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T11:28:52.833708Z">2026-11-24T11:28:52.833708Z</relative-time> | `4e69fd9` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-24 13:00:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1421
No description provided.