Skip to content

Expand Steam installer Win32 compatibility - #67

Merged
v3nn7 merged 1 commit into
mainfrom
codex/steam-api
Oct 31, 2026
Merged

v3nn7 merged 1 commit into
mainfrom
codex/steam-api

Conversation

@v3nn7

@v3nn7 v3nn7 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Expand the Win32 runtime used by the Steam installer and its plug-ins. Add PE32 bridges for C runtime functions, event and message waits, thread entry and exit, message boxes, and C++ allocation operators. Implement legacy _snprintf, _snwprintf, wcschr, and time with architecture-appropriate calling conventions and data widths.

Fix 32-bit security descriptor parsing that prevented Steam Setup from creating its plug-in directory. Update Win Parity to recognize decorated C++ exports and mark operator new partial because allocation failure does not throw.

Steam Setup reaches its welcome screen, but child controls remain black. The full Steam client is not yet supported.

Validation

  • python -m unittest scripts/test_winparity.py: 20 passed.
  • git diff origin/main...HEAD --check.
  • Before rebase, scripts/win-test.ps1: 2720 checks passed; 4 checks failed from the existing vectored-exception thread test. PE32, x64 formatting, time and thread checks passed.
  • Full Windows test after rebase: 2726 checks passed; 4 checks failed from the same existing vectored-exception thread test.
  • QEMU Steam Setup before the latest formatting additions reached the welcome screen; its child controls were black.

Summary by CodeRabbit

  • New Features
    • Expanded compatibility for 32-bit Windows applications, including legacy narrow and wide formatting, wide-character search, and time functions.
    • Improved support for 32-bit thread callbacks and CRT thread routines.
    • Added support for additional message, event, and handle-wait APIs.
  • Bug Fixes
    • Improved handling of 32-bit security descriptors and related file permissions.
    • Corrected legacy formatting behavior, including truncation and wide-format specifiers.

@v3nn7 v3nn7 added enhancement New feature or request desktop Area: desktop labels Oct 31, 2026
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This change adds CRT exports and PE32 argument handling, routes WOW64 thread and wait calls through 32-bit bridges, and changes security descriptor parsing. It also updates export parity analysis and adds tests for the compatibility paths.

Changes: Win32 PE32 compatibility

Layer / File(s) Summary
CRT exports and formatting
compatibility/win32/src/ucrt/printf.rs, compatibility/win32/src/ucrt/string.rs, compatibility/win32/src/ucrt/time.rs, compatibility/win32/src/wow64.rs, compatibility/win32/src/wow64/sigs.rs, compatibility/win32/tests/src/api32.c, compatibility/win32/tests/src/crt4.c
The CRT adds _snprintf, _snwprintf, wcschr, and time. The formatting paths support PE32 argument slots and legacy behavior. Tests exercise formatting, string functions, time, and allocation exports.
PE32 thread and wait bridges
compatibility/win32/src/ucrt/runtime.rs, compatibility/win32/src/kernel32.rs, compatibility/win32/src/user32.rs, compatibility/win32/src/wow64.rs, compatibility/win32/src/wow64/sigs.rs, compatibility/win32/tests/src/api32.c, compatibility/win32/tests/src/thread32.c
WOW64 thread startup uses 32-bit callbacks. Wait and message-wait imports convert PE32 handle arrays before calling host APIs. Tests cover thread exit codes, waits, messages, and events.
PE32 security descriptors
compatibility/win32/src/objsec.rs, compatibility/win32/tests/src/api32.c
Security descriptor entry points parse the supplied descriptor directly. The API test checks permissions applied from a PE32 absolute descriptor.

Win32 parity analysis

Layer / File(s) Summary
Alias resolution and export classification
scripts/winparity.py, scripts/test_winparity.py
The analyzer recognizes loop-built aliases and named cdecl declarations. It applies export classification and reason handling to both analysis paths. Tests cover alias resolution, signature parsing, and allocation export classification.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: zenix1111

Merge Risk: Moderate · up to 64839

PE32 programs that start threads through the C runtime can overflow a stack larger than 1 MiB. Each thread also leaves memory behind after it exits. Honor the requested stack size before merging, and track the thread cleanup leak as a follow-up.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codspeed

codspeed Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 33 untouched benchmarks


Comparing codex/steam-api (64839f3) with main (b73d944)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Area: desktop enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant