Repository navigation
Load CoreMessaging lazily for DispatcherQueue creation - #153
Merged
Merged
Conversation
Resolve the system export only when a current-thread controller is needed. Cache successful resolution for the process lifetime, release failed and racing module candidates, and preserve the native HRESULT and queue lifecycle contracts. Cover loader failures, cache races, native shutdown, and production addon import tables. Copilot-Session: 4e384326-bd2c-4cd0-92c8-3583786a11e1 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mixed-language test coverageWorkflow status: ✅ Passed
|
shisan (qiutongMS)
approved these changes
Sep 15, 2026
leileizhang (lei9444)
deleted the
lei9444-lazy-coremessaging-loading
branch
September 15, 2026 05:20
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
Remove the existing production static import of
CoreMessaging.dll!CreateDispatcherQueueController. Importing the WinRT root or/comentrypoint no longer loads CoreMessaging merely because the unused DispatcherQueue helper is linked into the addon.CoreMessaging.dllwithLoadLibraryExW(..., LOAD_LIBRARY_SEARCH_SYSTEM32)only when a current-thread controller must be created. Use the SDK/windows-rsextern "system"ABI and unchanged HRESULT/output conversion.This is a standalone change against
main, based on3f2371025b5690c6bd2708c61d0b4f2fe6747df7. It does not change other optional subsystem loaders, public APIs, generated output, or shared JS sidecars. This is not a general older-Windows support or full addon feature-isolation guarantee.Regression coverage
Nine new core tests cover deferred missing-DLL/export errors, success-only caching, retries, failed-export cleanup, eight-way concurrent publication with seven losing module releases, unchanged queue-query behavior, and live creation/reuse/callback/shutdown behavior. The live case uses a dedicated initialized STA, pumps through shutdown completion and
GetResults, and retires its queue before apartment teardown.npm run test:importsinspects the real addon import tables with MSVCdumpbinand exercises fresh root/COM imports while accounting for host-preloaded DLLs. CI now runs it after both production x64 and ARM64 release builds, before artifact upload.Validation
cargo checkpassed; no i686 Node runcoremessaging.dll!CreateDispatcherQueueController; all three new import regressions failed against it. Both root and/comintroduced CoreMessaging into otherwise bare Node processes.pefile; packaged.nodebytes match their release DLLs. Both crates' release feature fingerprints are empty: notest-hooks.No OS components, registry settings, global search paths, or user windows were modified to exercise failure cases.