Repository navigation
winrun: Steam sign-in window renders (cross-process drawing, Z order, socket owners) - #107
Merged
Merged
Conversation
Shows what a program's socket traffic carries (the first 240 bytes of the first 300 transfers, as escaped text) for send, recv, WSASend and WSARecv, overlapped or not. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Steam's client answers its web UI transport socket with 403 Forbidden unless the connecting process checks out: it looks the peer's port up with GetExtendedTcpTable and opens the owning process. dwOwningPid was always 0 (the kernel recorded no owner), OpenProcess(0) failed and every connection from the web helper was refused. The kernel's socket objects now record the process that made them (socket or accept), the socket list reports it (NetSocket::pid, in the former reserved field: the record stays 56 bytes), and GetExtendedTcpTable fills dwOwningPid in its owner-PID and owner-module classes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Steam's web helper creates its main window ("SteamWebhelper") through
ATL, which takes its window procedure thunks from atlthunk.dll on
Windows 10 and later. The DLL was missing, ATL's fallback failed and it
raised STATUS_NO_MEMORY, ending the browser process a second after the
window appeared.
AtlThunk_AllocateData/InitData/DataToCode/FreeData hand out 16-byte
thunks from pools of a code page (written once, then executable) and a
data page: each thunk loads its first argument and procedure RIP-relative
from its data slot, so no code is written per thunk. newlibs.exe checks
the four functions (all pass on Windows 11).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rest of steamwebhelper.exe's delay imports: the web helper ended with a delay-load failure on USER32!CallWindowProcA right after creating the Steam window. CallWindowProcA calls the procedure as CallWindowProcW does (messages are the same for both character sets in this runtime), PtInRegion tests a point against a region's rectangles, and Shell_NotifyIconA answers as Shell_NotifyIconW. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mmit Steam's sign-in window appeared, then its renderer died writing V8 code pages (PAGE_EXECUTE_READWRITE, committed). jit_fault only switched present pages between read-write and read-execute; a page discarded (DiscardVirtualMemory, MEM_RESET) or never touched while mapped read-execute faults as not present, and the write went unhandled. jit_fault now records the pages it made read-execute. A fault on a page that is not present switches it too when its mapping forbids the access; when the mapping allows it, the fault is the kernel failing to give a frame and keeps the normal exception path, as before. Setting a protection (commit, VirtualProtect) clears the record for its pages. MEM_RESET no longer marks its pages uncommitted: on Windows they stay committed with their protection. The unhandled-exception report gives the page fault error code with an access violation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chromium's GPU process draws the browser process's windows: in software compositing it calls GetDC on the browser's HWND and BitBlts each frame into it. winrun's window handles were per-process counters and GetDC of an unknown handle returned NULL, so Steam's sign-in window stayed black. Window handles now name their process (0x20000000 + pid * 0x10000 + 4 * slot; slots go round so a destroyed window's handle is not reused at once). GetDC of another live process's window gives a DC whose BitBlt sends the pixels, in a shared memory object, to that process through its handle service (new DRAW request); the owner draws them with its own GetDC/ReleaseDC, which presents them. IsWindow of another process's window asks that process (IS_WINDOW request). xwindow.exe checks it with a child process blitting into its parent's window (6/6 on Windows 11) and joins the Win32 checks under PRISM. Diagnostics under OSYX_WINRUN_FAILTRACE: the first cross-process blits, and an exception handed to the program's unhandled-exception filter (a crash handler's filter usually ends the process silently). Co-Authored-By: Claude Opus 5.5 <[email protected]>
- OSYX_WINRUN_ECHO_FILES=<part>[;<part>]: what the program writes to a
file whose path contains a part goes to stderr too (Steam and CEF keep
their logs in files inside the guest).
- OSYX_WINRUN_APPEND_ARGS=<part>:<args>: arguments added to children
whose program path contains <part> ('+' separates, '~' is a comma), for
Chromium's logging switches.
- Stall reports name each thread (SetThreadDescription).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Steam's sign-in window stayed black: Chromium's native window occlusion tracking walks EnumWindows and takes each listed window as covering the ones after it. winrun listed every window of the process (child and message-only windows too) in handle order, so older windows of the web helper came before Steam's window and its content was marked occluded; the renderer then never drew. Windows now carry a place in the Z order: a window goes to the top when created, shown (other than the no-activate and minimizing commands), activated (SetForegroundWindow, SetActiveWindow, BringWindowToTop) or placed at HWND_TOP/HWND_TOPMOST, and to the bottom at HWND_BOTTOM. EnumWindows lists top-level, non-message-only windows from the top down; GetTopWindow(NULL) gives the topmost. With this, cross-process drawing and the earlier fixes, the 64-bit Steam client shows its rendered "Sign in to Steam" window (QR code from the Steam servers included). Also: the stall reports' per-thread system call record covers thread ids up to 8192 (kernel, diagnostics only), a DuplicateHandle of a section refused for rights is named under FAILTRACE, and the first EnumWindows results are traced. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A non-blocking connect whose connection fails at once (refused, unreachable, reset, timed out) returns WSAEWOULDBLOCK; SO_ERROR, FD_CONNECT and select report the failure, as on Windows. - select with nothing in any set fails with WSAEINVAL (checked on Windows 11) instead of sleeping; winsock.exe expected the sleep. The Win32 suite on OSyx: 2947 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows a CreateFile asking only for access that touches no data (WRITE_DAC, READ_CONTROL, attributes) is not checked against the share modes of other opens, and its own share mode restricts no one. winrun counted it like any open, so Chromium's PreventExecuteMapping (which reopens a fresh temporary file with WRITE_DAC to deny mapping it executable) failed with a sharing violation on files the browser had open, the temporary file its renderers park strings in included. Diagnostics: OSYX_WINRUN_TRACE_FILES=<part> logs ReadFile and WriteFile on matching files (offset, size, result), and faults dispatched to the program's handlers are traced under OSYX_WINRUN_FAILTRACE. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #106, which was merged before these commits. With this PR the 64-bit Steam client shows a fully rendered "Sign in to Steam" window: the sign-in form, plus the QR code the Steam servers send.
Changes
kernel/src/net.rs;NetSocket::pidtakes the place of the oldreservedfield, so the record stays 56 bytes;GetExtendedTcpTablenow fills dwOwningPid). Steam answered its web UI websocket with 403 because it could not identify the peer process.mem.rs): V8 code pages that were discarded while read-execute faulted, and the renderer died. MEM_RESET now keeps pages committed, as on Windows.xwindow.exe(6/6 on Windows 11).selectwith every set empty fails with WSAEINVAL. Both checked on Windows 11;winsock.exeupdated to match.Verification
Remaining
Labels: bug, network, kernel, desktop
🤖 Generated with Claude Code