Skip to content

win32: SteamSetup runs through its wizard without black windows - #77

Merged
v3nn7 merged 5 commits into
mainfrom
feat/steam-zen-api-complete
Oct 31, 2026
Merged

v3nn7 merged 5 commits into
mainfrom
feat/steam-zen-api-complete

Conversation

@v3nn7

@v3nn7 v3nn7 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

SteamSetup (32-bit NSIS installer) opened many black windows and stopped after the first page. It now shows a single window and runs the whole wizard in QEMU: Welcome, Language, Install location, file copy, "Completing Steam Setup". Files land in /Program Files/Steam.

The branch also carries the earlier Steam/Zen API parity work (eed49d0, 8ab817c, ab5a1af).

Fixes

  • Child controls (WS_CHILD) no longer own a PRISM window; they draw into their top-level ancestor's surface (removes the black windows and the compositor's 32-window limit).
  • Stock BUTTON, STATIC and EDIT classes draw; a click sends WM_COMMAND.
  • Dialogs serve DWL_MSGRESULT, DWL_DLGPROC and DWL_USER, so nsDialogs can subclass the NSIS main window and Next works.
  • Bridge signatures for SHGetFolderPathW/A and NtQuerySystemInformation.
  • DLL_THREAD_ATTACH/DETACH of PE32 DLLs run through call32.
  • New Surface::into_sub in boot/gfx with a test.

🤖 Generated with Claude Code

v3nn7 and others added 5 commits October 31, 2026 17:42
…ndows

Every WS_CHILD window was its own PRISM window, shown as a blank black
window and counted against the compositor's 32-window limit. SteamSetup
(NSIS) creates a dozen controls per page, so it opened many black windows.

A child now stays hidden in PRISM and draws into its top-level ancestor's
surface (Surface::into_sub), presents through the ancestor, repaints after
a parent erase and gets the pointer messages for its rectangle. The stock
BUTTON, STATIC and EDIT classes draw and send WM_COMMAND on a click.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GetProcAddress(shfolder, SHGetFolderPathW) failed for 32-bit programs
because the bridge had no signature for it. Dialog pages had a black
background because the OSyxDialog class had no brush.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…words

Page changes in SteamSetup stopped after the first click: every child
control still owned a hidden PRISM window, and the compositor cut the
client off at 32 windows ("too many surfaces"). A WS_CHILD window is now
only a Win32 object (Win::win is None) drawn into its ancestor's surface.

SetWindowLong/GetWindowLong on a dialog now serve DWL_MSGRESULT,
DWL_DLGPROC and DWL_USER, so nsDialogs can subclass the NSIS main window
and handle the Next button.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ge NtQuerySystemInformation

A thread created by a 32-bit program called DllMain of its PE32 DLLs
(System.dll) as 64-bit code and crashed with 0xc0000005 when the Steam
installer began copying files. run_thread32 now delivers DLL_THREAD_ATTACH
and DETACH through call32. NtQuerySystemInformation gets its bridge
signature and the 44-byte SYSTEM_BASIC_INFORMATION of 32-bit callers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@v3nn7 v3nn7 added bug Something isn't working 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

The pull request adds shared-surface child controls and basic behavior for stock Win32 controls. It also updates WOW64 thread notifications and NtQuerySystemInformation layouts, and adds a clipped graphics surface view.

Changes: Child-window and stock-control support

Layer / File(s) Summary
Clipped surface views
boot/gfx/src/lib.rs
Surface::into_sub returns an optional clipped view that shares the parent pixel buffer and stride. A test checks clipping, shared writes, and empty results.
Child window surface and input routing
compatibility/win32/src/user32.rs, compatibility/win32/src/user32/dialogs.rs
Child controls use their top-level ancestor’s surface instead of an independent PRISM window. Window readiness, hit testing, pointer routing, invalidation, and window operations account for child controls.
Child drawing and presentation
compatibility/win32/src/user32.rs, compatibility/win32/src/user32/gdi.rs
GDI drawing and snapshots use child-aware surface lookup. Child damage is mapped to the host window, and the direct fast-blit path declines child-window targets.
Stock controls and dialog state
compatibility/win32/src/user32.rs, compatibility/win32/src/user32/dialogs.rs, compatibility/win32/src/wow64/sigs.rs, docs/windows-compatibility.md
Stock BUTTON, STATIC, and EDIT classes paint through ControlWndProc. Button clicks update supported check states and send the parent WM_COMMAND. Dialog window words and picker parenting are updated; the compatibility notes describe these behaviors.

WOW64 thread and system-information behavior

Layer / File(s) Summary
DLL thread notifications
compatibility/win32/src/loader.rs, compatibility/win32/src/wow64.rs
Native thread notifications skip WOW64 processes. The 32-bit thread path invokes DLL TLS callbacks and nonzero entry points around the start routine.
WOW64 information layouts and signatures
compatibility/win32/src/ntdll.rs, compatibility/win32/src/wow64/sigs.rs, site/winparity.json
NtQuerySystemInformation uses 32-bit fields and a 44-byte size for WOW64 callers, and retains the 64-bit layout otherwise. The signature table and parity results are updated.

Estimated code review effort: 4 (Complex) | ~50 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PRISM
  participant user32 as user32.rs
  participant ControlWndProc
  participant ParentWindow
  PRISM->>user32: Deliver pointer event
  user32->>user32: Hit-test and retarget to child control
  user32->>ControlWndProc: Dispatch control message
  ControlWndProc->>ParentWindow: Send WM_COMMAND for button click
Loading

Possibly related PRs

  • OSyxSoftware/OSyx#67: This pull request extends run_thread32 and the WOW64 signature table introduced by #67. It also adds child-control behavior related to the black controls noted there.
  • OSyxSoftware/OSyx#27: The WOW64 thread-notification changes use the bridge and PE32 loader paths added by #27.
  • OSyxSoftware/OSyx#44: This pull request adds child-window, stock-control, and dialog behavior related to the support described as still needed in #44.

Suggested reviewers: zenix1111

Merge Risk: Moderate · up to ea30d

The PR makes the SteamSetup wizard render and run, but it adds PE32 DLL thread notifications that can run concurrently with each other and with process initialization. That can crash DLLs that assume Windows serializes these calls. There are also smaller control-rendering and input gaps: stale pixels after a control is destroyed or hidden, three-state auto buttons, and synthetic input aimed at child controls. Fix the notification serialization before merging, or explicitly accept it.

- [ ] 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 feat/steam-zen-api-complete (ea30d46) with main (664532a)

Open in CodSpeed

@v3nn7
v3nn7 merged commit 8e20aec into main Oct 31, 2026
6 of 7 checks passed
@v3nn7 v3nn7 changed the title win32: SteamSetup runs through its wizard without black windows win32: SteamSetup runs end to end (no black windows, UAC elevation) Oct 31, 2026
@v3nn7 v3nn7 added security Area: security and removed security Area: security labels Oct 31, 2026
@v3nn7 v3nn7 changed the title win32: SteamSetup runs end to end (no black windows, UAC elevation) win32: SteamSetup runs through its wizard without black windows Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working desktop Area: desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant