nx_pe_container_win_ping.nx
buildroot/runtime/nx_pe_container_win_ping.nx
about
nx_pe_container_win.nx -- W4-a: a NISHI ORGAN runs as a Job-Object-governed, supervised container.
Composes W2c (Job boundary + limit + CreateProcessW + Wait + GetExitCode + reap) with W3b-6 (a
realistic nxc2-compiled organ that runs entirely native). Same governed-run pipeline as W2c, but the
child workload is no longer `cmd.exe /c exit 7` -- it is our own Nishi organ `nx_win_compiled_organ.exe`
(allocate->fill->print->exit 88). So a sovereign Nishi organ now runs UNDER native Job-Object
governance and is reaped by a native supervisor -- the core of nx_container_win, no HCS/VM/Docker.
1. CreateJobObjectW(NULL,NULL) -> hJob
2. SetInformationJobObject(hJob, 2, &basic{ActiveProcessLimit=8}, 0x40) (governance installed)
3. AssignProcessToJobObject(hJob, (HANDLE)-1) (self joins the job)
4. CreateProcessW(NULL,"nx_win_compiled_organ.exe",...,CREATE_NO_WINDOW,...,&si,&pi) (organ; auto-joins job)
5. WaitForSingleObject(pi.hProcess, INFINITE)
6. GetExitCodeProcess(pi.hProcess, &code)
7. ExitProcess(code)
CreateProcessW (lpApplicationName=NULL) resolves the bare filename via the app-load-directory search
rule: the supervisor exe and the organ exe both live in _offc, so "nx_win_compiled_organ.exe" is
found there. The command line is in the RW .data section (CreateProcessW may modify it).
NO-FALSE-GREEN: the organ prints "NX\n" and exits 88. Supervisor exit == 88 proves it launched the
Nishi organ as a governed child and reaped its real exit code (cmd would never yield "NX"+88). The
organ's "NX" on the console proves the governed child actually executed.
7 kernel32 imports, identical proven .text/.idata to W2c (nx_pe_job_run_test); ONLY the .data command
line differs. Founded on nx_pe_writer.nx (hand byte-layout, tutor-scaffold).
lineage_id: substrate_pe_container_win_v1 (genealogy: win32_job_objects_2000 + runc_init_2014)
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_hal.nxnx_pe_writer.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 33 | const PE_CWIN_FILE_SIZE: i64 = 0x800 |
functions
| 36 | func nxcw_put_utf16(buf: *u8, off: i64, s: *u8) -> i64 |
| 47 | func nx_pe_emit_container(buf: *u8) -> i64 |
| 198 | func main() -> i64 |