27 Commits
Author SHA1 Message Date
mirkobrombin 8d03604833 fix: answer the calls the .NET runtime makes while starting
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: halftone palette, system search load flag and message wait mask
2026-11-02 10:04:16 +00:00
mirkobrombin 66626bbfe2 feat: add GetCurrentThreadStackLimits
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Implemented the call for both widths from the thread block and checked it in the kernel threads test.
2026-10-30 10:34:51 +00:00
mirkobrombin cc497aedd7 chore: merge pull request #74 from rayzorben/feat/native-waits-alerts 2026-10-30 06:32:59 +00:00
mirkobrombin 5c91120232 chore: merge pull request #47 from rayzorben/feat/set-thread-context 2026-10-30 06:32:58 +00:00
Raymond Bennett 593a710833 feat: native waits, sleeps and thread alerts
Zig's standard library waits through ntdll: it sleeps with
NtDelayExecution, parks threads with NtWaitForAlertByThreadId and wakes them
with NtAlertThreadByThreadId, interrupts waits with NtAlertThread, and waits
for its children with an alertable NtWaitForSingleObject. These now run on
the scheduler's waits:

- NtDelayExecution sleeps for a native timeout (100 ns units, negative from
  now, positive a system time, none forever) and answers STATUS_USER_APC
  when it ran APCs and STATUS_ALERTED when the thread was alerted.
- NtAlertThread alerts a thread's alertable native wait; NtTestAlert takes
  the alert and runs the APCs.
- NtWaitForAlertByThreadId and NtAlertThreadByThreadId pair as their
  documentation describes, an alert that comes first being kept.
- NtWaitForSingleObject and NtWaitForMultipleObjects wait as
  WaitForSingleObjectEx and WaitForMultipleObjectsEx do, alertable ones
  included, which the object layer refused; their results are the same
  numbers.

Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the native wait, sleep and alert functions and the object test change
(cherry picked from commit 44686f355a19520c1c9abb10006adaecee34f114)
2026-10-29 01:30:25 -07:00
Raymond Bennett 70021be889 feat: add QueueUserAPC2 for ordinary user APCs
The .NET runtime looks it up and tests whether special user-mode APCs work.
With no flags it queues the APC QueueUserAPC queues. Special user-mode APCs,
which interrupt a thread outside an alertable wait, are not delivered here, so
those flags are refused; the runtime then suspends threads the other way, as
on systems without them.

Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the handler
(cherry picked from commit 3ec65bd94a8818d38ba568cd3258e2a9f466658d)
2026-10-28 23:16:38 -07:00
Raymond Bennett bf53b0b51a feat: add SetThreadContext for suspended 64-bit threads
Go preempts a goroutine that runs too long by suspending its thread, reading
its context and setting it to call the runtime's preemption function. With
the clock now running, restic got that far and stopped on SetThreadContext.

The control and integer groups of the CONTEXT become the registers the
thread continues with: in its own task when it is paused there, in its saved
snapshot otherwise. A thread that is not suspended keeps its registers.

Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the handler and NativeProcess::set_thread_registers
(cherry picked from commit b1c31f9ffbea6bb1d91458193357184f305818f4)
2026-10-28 23:14:32 -07:00
mirkobrombin 273c87e37b feat: add CallbackMayRunLong 2026-10-28 11:02:14 +00:00
mirkobrombin c1911963d1 fix: reserve the program's stack for threads that name only a commit size 2026-10-27 18:50:00 +00:00
mirkobrombin 56d33ace7e feat: add timer queues and thread pool timers
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Wrote timer queues, private pools and GetThreadIOPendingFlag with their tests.
2026-10-27 10:53:49 +00:00
mirkobrombin 44a593867c feat: run an SSH client's terminal and file transfer windows 2026-10-26 23:13:38 +00:00
mirkobrombin b946dd40d6 perf: block served waits on the host in parallel processes
Assisted-by: Claude:claude-opus-5.5
AI-Scope: measured served waits declining in parallel processes and wrote the change that blocks them on the host
2026-10-26 01:38:56 +00:00
mirkobrombin 72ec37d544 perf: answer decided waits inside served calls 2026-10-26 00:17:53 +00:00
mirkobrombin 61927c1cc8 fix: handle shared waits and semaphore wakeups 2026-10-25 06:09:55 +01:00
mirkobrombin 0a0fe4be89 feat: add shared Windows process state and parallel guest execution 2026-10-24 16:24:23 +00:00
Mirko Brombin f4509d0c1f feat: implement the Windows APIs that .NET programs and their installers call 2026-09-23 00:12:56 +00:00
Mirko Brombin 5d6213c688 feat: add hand thread handles to other processes, serve handle requests in 32-bit processes, read 32-bit wait arrays at their width and queue work items 2026-09-21 06:06:44 +00:00
Mirko Brombin bc97c80eed feat: add sleep on the reactor's descriptors and a wake event when idle, and poll other processes' frames only for windows they draw into 2026-09-20 20:45:03 +02:00
Mirko Brombin eda064950b feat: add place 32-bit allocations in free low gaps and serve completion-routine file I/O, PathCch calls and dependencies beside a library loaded by path 2026-09-20 07:03:09 +00:00
Mirko Brombin ead54d6b10 feat: run Google Chrome with NT object queries, COM apartments, file completion ports and SDDL descriptors 2026-09-03 21:44:05 +02:00
Mirko Brombin 26fbeabc78 feat: run Steam's web UI with cross-process handles, per-thread message queues, socket events and process identity 2026-09-03 16:48:12 +02:00
Mirko Brombin 66087052d8 feat: run Chromium's helper processes with DirectWrite, named pipes, jobs, inherited handles and shared sections 2026-09-03 06:06:54 +02:00
Mirko Brombin 7b3461c003 feat: run Chromium's web helper further with reserved address space, native registry, tokens and process lists 2026-09-03 03:46:34 +02:00
Mirko Brombin 966069f911 feat: run Steam to its web helper with real sockets, TLS chains, child environments and image protection 2026-09-03 02:50:56 +02:00
Mirko Brombin a7256dafac feat: run the Steam installer to Finish with child processes, shell links and sockets 2026-09-03 01:15:07 +02:00
Mirko Brombin 8254a1d068 feat: add window long and class data APIs, system metrics, DIB depths, child clipping, profile section names 2026-08-01 01:16:24 +02:00
Mirko Brombin efc6104b5b feat: add kernel32 services, guest threads and structured exceptions for PE64 processes 2026-07-31 21:45:18 +02:00