Lords II Win16 USER.290 RedrawWindow

Evidence: scratch/runs/20261107-lords2-win16-redraw/. This work follows complete staging and the original installer trace. The guest program and its media are unchanged.

The retained original call is USER ordinal 290, RedrawWindow(hwnd16=0x0133, rect=NULL, region16=0, flags=0x0101), at CS:IP 0067:946f, returning to 0067:9478. The first LANGUAGE.INF LZCopy had returned +3313 and the destination matched the original 3313 bytes. The installer then reached 93% before dispatch trapped on the missing API. This identifies an emulator implementation gap, not a guest file-copy failure.

Wine's Win16 export specification identifies the Pascal WORD/far-pointer/WORD/WORD signature and BOOL16 return. Its Win16 window adapter widens signed RECT16 coordinates and translates window and GDI handles while preserving the flag values. Ten argument bytes and the four-byte far return are callee-owned. From SP+4 the words are flags, HRGN, rectangle offset, rectangle selector, HWND. A nonzero selector with offset zero is a valid pointer.

The RedrawWindow documentation makes 0x0101 an invalidation followed by synchronous processing of required paint. Ordinary invalidation remains deferred. Erasure requested with INVALIDATE belongs to painting; a sender must not erase before BeginPaint. A clean UPDATENOW must not invent damage. A nested callback may create new damage that must survive the outer EndPaint.

The existing Win32 handler mutates a bounding update rectangle but does not read HRGN or complete synchronous painting. The existing Win16 UpdateWindow continuation already retains each invocation's return record on the guest stack and runs far WM_PAINT, including nested BeginPaint's WM_ERASEBKGND and its DX:AX result. Reusing that callback path avoids sending a 32-bit callback frame to 16-bit code. The shared damage model itself remains a bounding rectangle.

Aranna explicitly released source/build/runtime at 03:41:39Z. After the graphics worker's short locked build finished at 03:43:08Z, I added USER.290 dispatch and its adapter to src/09e-win16-api.wat. It checks externally supplied handles before crossing the strict handle mapper, widens signed far RECT16 or resolves a narrow region to its bounding box, clips invalidation to the recorded client, validates existing damage when requested, and preserves pending erase unless NOERASE is specified. UPDATENOW uses the existing Win16 UpdateWindow continuation with an invocation-owned TRUE result. It consumes exactly ten Pascal argument bytes, restores the far caller, and clears callback DX.

The implemented flag subset is INVALIDATE, ERASE, VALIDATE, NOERASE and UPDATENOW. Internal-paint, explicit child traversal controls, nonclient flags and ERASENOW still trap with diagnostic marker 0xca16a929 and the actual flags; they are not treated as successful hints. The shared update engine's bounding-box/partial-validation limits and existing UpdateWindow child-paint behavior remain. Desktop redraw is not implemented. This is a real implementation of the demonstrated installer path, not a claim of complete painting parity.

test/test-win16-redraw-window.js generates an ordinary NE application with imported far calls, RegisterClass/CreateWindow, a far window procedure, actual BeginPaint/EndPaint, nested redraw, HRGN allocation, signed and offset-zero rectangles, invalid HWND/HRGN, clean updates, validation, NOERASE and deferred/new damage. Fifty ordinary GDI allocations give the window exactly the retained narrow handle 0x0133; no handle table is patched. The old module traps on the captured 0x0101 call (baseline-captured-ne.log). All 16 cases pass on both newly built modules. Their results include caller SP=0xff00 before/after the API and after callbacks, and TRUE restored independently of the guest procedure's DX:AX result. Existing Win16 WINDOWPOS/painting callback coverage and parent/child paint-order coverage pass. The mandatory locked full build passes. Evidence includes logs and native state rows. The implementation and regression were published as 7d0f110dd67bbc80275b9b749bd2ecf455721a19.

A fresh separate box bx_au5gvjn4 received 619 pinned dependency/module/media files after a persisted UUID creation request. Offline computed dependency closure, remote preflight, both modules' native redraw, Win16 flags/temp-drive, generated LZCopy and observer-passivity checks all passed. This was one original invocation, using the changed standard module: actual HTTP bytes and the instantiated module both have SHA-256 2f9fd9f5fb1841afe68f47f61d9870ea617a73f2c45253cbf662c2479b723e55. The alternate module was preflighted, not used for a second original run.

The unchanged original reached the exact captured HWND 0x0133, NULL rectangle/region, 0x0101 call at 0067:946f. The first actual caller block at 0067:9478 has AX=1, DX=0 and SP changing from linear 2066326 to 2066340: ten argument bytes plus the four-byte far return. The API trace's immediate return marker occurs at callback handoff and is not itself completion evidence; the retained caller block proves completion (redraw-return-proof.json, after-copy-live.json.gz). The original destination LANGUAGE.INF again has 3313 bytes and the retained exact SHA-256. The installer continued through the remaining copies and displayed “Lords 2 Demo installation is now complete. All files were successfully copied to your hard drive.” (after-copy.png). There were 172 destination files; 171 match source media by size/hash. The destination SIERRA.INF differs by 23 bytes after ordinary installer profile writes; original media remains unchanged.

After the ordinary completion OK, the first new blocker was the installer’s System Error: DdeConnect returned 400A (after-finish-wait.png, blocker-live.json.gz, blocker-summary.json). The error MessageBox call is at selector 004f, linear EIP 0018791e (IP 791e), with its text captured from the guest far pointer. No further progression input, relaunch or unchanged replay occurred. 0x400a is the existing Win16 DDEML connection path's NO_CONV_ESTABLISHED result; the next investigation is why the installer’s shell DDE conversation cannot connect, starting with src/09f-win16-ddeml.wat and the existing Win32 PROGMAN DDE tests. The selected API observer does not retain DDEML.7's arguments, so the service/topic and exact root cause are not yet demonstrated. Installed launch and gameplay remain unverified.

Eleven command receipts are complete: eight balanced ordinary dialog clicks, two observation-only waits and normal Quit. The final Chrome exit was code 0 without a signal. All 181 original media hashes and all 619 staged pins passed post-run verification. The browser profile, owned harness/server/deadline processes and port were gone before the explicitly delegated normal box stop. Stop stop_a65cb5f6addf9afd completed at 03:53:15.031Z, forced=false, error=null; the box is archived and its active expiry is null (original expiry 05:16:48.492Z). Unique logs/captures/modules were recovered and hash-verified before stopping. Shared source/build/runtime were released earlier; evidence contains Git identity/diffs, not source archives or copied media.