Repository navigation
Add contract-driven flat Win32 bindings - #152
Merged
Merged
Conversation
Introduce standalone Win32 JSON evidence, immutable native call plans, branded handle carriers and namespace-isolated generation for five audited exports. Preserve the WinRT and COM surfaces and document the remaining migration scope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Mixed-language test coverageWorkflow status: ✅ Passed
|
leileizhang (lei9444)
marked this pull request as draft
September 11, 2026 08:20
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Preserve the complete frozen export and runtime surface, move manual evidence into independent JSON contracts, and restore native layouts, ownership, IOCP, subsystem contexts, census, samples and E2E scenarios. Add exact identity and semantic parity gates plus capability-preserving Registry and native-boundary hardening. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
leileizhang (lei9444)
marked this pull request as ready for review
September 11, 2026 12:45
Describe each sample's native APIs, setup requirements, generated namespace layout, expected output, resource cleanup and runtime side effects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Replace PR-specific Debug hash comparisons with explicit contract, ABI, ownership, buffer, IOCP, subsystem and package assertions. Load and typecheck all generated modules in ordinary tests, wire them into the existing CI jobs, and fix the strict-identifier, relative-import, pointer-null and descriptor validation bugs they expose. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Resolve architecture-specific utility symbols lazily so undecorated x86 imports do not prevent WinRT/COM binaries from loading. Run native subsystem lifecycle checks in bounded child processes with phase diagnostics instead of allowing one stalled platform call to block the whole test job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Keep the native MAPI capability and architecture-specific loader unchanged. Exercise lifecycle and error handling through a test-only ABI function table, and retain bounded live coverage for configured providers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Lower conditional output validity and resource aliasing into native call plans, including exact pointer-width HKEY matching. Coordinate file completion modes with asynchronous leases and exactly-once IOCP retirement. Support flags combinations, ship the complete JS runtime artifact, and add native, generated-module, artifact-consumer and live API regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Share versioned Win32 protocol types, structural validation and generated schema between codegen and core. Model validity, delivery, ownership and cleanup for direct returns and output parameters while retaining version-one compatibility. Move resource coordination, typed file capabilities and IOCP lifetimes into native core. Keep Node references and copy-back on the owner thread, retain queued-result budgets, and expand native and generated compatibility coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Add version-three aggregate field results and typed pointee descriptors. Capture native field ownership before return conversion or N-API wrapping while preserving caller-owned storage, resource extraction and cleanup retry behavior. Replace core callback receivers with token/channel delivery and keep TSFN registrations in an adapter-owned relay. Add generated CreateProcessW delivery-failure and GC handle-count regressions alongside native and Node lifecycle coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Document legacy ownership preconditions across the core and JS adapter, reject writes over pending raw cleanup fields, and cover borrowed handles, exclusive transfer, and partial result failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Register all described aggregate native states before fallible field processing and retain discarded-owned cleanup guards until cleanup succeeds. Cover protected-handle retries, cross-aggregate failures, truthful legacy markers, and undescribed legacy compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Apply successful input consumption and resource effects after output guards are registered, before fallible result decoding or cleanup. Add native success/failure regressions for consumed handles, leases, and file completion modes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Reject input and retiring-owner overlap before mutation or dispatch, acquire one owner-identity-ordered resource lock set, and retire through held guards. Add bounded regressions for DuplicateHandle reuse, aliases, cleanup retry, and concurrent lock coordination. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Share a retryable System32 module cache with typed lifecycle tables for Winsock, GDI+, Media Foundation and MAPI. Preserve explicit startup/shutdown state, balance concurrent load references, and enforce production addon import boundaries with native and artifact regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Avoid rereading and hashing WinMD for every COM request by reusing a lazy presence-only index within generate. Preserve routing precedence and full Win32 provenance validation, with snapshot reuse and strict-input regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
shisan (qiutongMS)
approved these changes
Sep 15, 2026
Replace historical migration acceptance wording with current capabilities, clarify COM and flat Win32 boundaries, document package and E2E entrypoints, and repair the missing unsafe-guide reference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
Preserve main CoreMessaging lazy loading and native import checks alongside Win32 runtime and type-check coverage. Resolve the overlapping package scripts without dropping either validation path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bfe6adcb-6e2c-4e05-86ca-83e923c28999
shisan (qiutongMS)
approved these changes
Sep 15, 2026
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.
Summary
Add dynamic invocation of Win32 DLL exports and generate JavaScript bindings with TypeScript declarations from
Windows.Win32.winmd.Samples
Examples in
samples/js/win32:system-info.mjsGetTickCount64and UTC time through a nativeSYSTEMTIMEstructure.registry-product-name.mjsHKEYcleanup.overlapped-file.mjsAbortSignal.The README includes setup, generated module paths, expected output, and cleanup behavior.
Builds on #102.