Skip to content

Fixup publishing of WXC in the SDK. - #7

Merged
shschaefer merged 1 commit into
mainfrom
dev/shschaefer/sdk_cleanup
Feb 17, 2026
Merged

shschaefer merged 1 commit into
mainfrom
dev/shschaefer/sdk_cleanup

Conversation

@shschaefer

Copy link
Copy Markdown
Contributor

Cleanup the call methods from the SDK to WXC.

@shschaefer
shschaefer merged commit bca5fc5 into main Feb 17, 2026
1 check passed
@shschaefer
shschaefer deleted the dev/shschaefer/sdk_cleanup branch March 5, 2026 22:31
Soham Das (SohamDas2021) added a commit that referenced this pull request Jun 17, 2026
Soham Das (SohamDas2021) added a commit that referenced this pull request Jun 26, 2026
Lily Barkley (lilybarkley-msft) added a commit that referenced this pull request Jun 26, 2026
Soham Das (SohamDas2021) added a commit that referenced this pull request Jul 13, 2026
* Added lxc bubblewrap wslc roadmap

* docs: WSLC item #7 — UNC paths to be rejected

Co-authored-by: Copilot <[email protected]>

* Addressed pr comments

* Filesystem policy gaps captured wrt Gudge's doc

* Network policy gaps captured wrt Branden's NW GA doc

* More dep on WSLC SDK

* Update roadmap doc with addressed workitems

* Added examples for WSLC networking items

* Added host vs vm vs container enforcement argument for wslc

* Update roadmap doc

* Updated work-item status

---------

Co-authored-by: Copilot <[email protected]>
Gudge (MGudgin) pushed a commit that referenced this pull request Jul 23, 2026
Two callback paths updated:

  collect_host_children:    uses entry.file_type() (no link follow) and skips entries where is_symlink() is true.

  cb_get_placeholder_info:  uses fs::symlink_metadata and returns ERROR_FILE_NOT_FOUND for any host file that is a reparse point.

From the AC's perspective, host-side reparse points inside an allowed branch are simply invisible — semantically identical to paths that are not in policy. Threat-model item #7 (reparse-point follow-out from within a granted directory) is closed.

Empirical confirmation via mklink /J inside the rw scratch dir:

  host           [sneaky, subdir, canary.txt, readme.txt]

  LU view        [canary.txt, readme.txt, subdir]                 (sneaky filtered)

  AC view        [canary.txt, readme.txt, subdir]                 (sneaky filtered)

Co-authored-by: Copilot <[email protected]>
Dan Legg (danlegg) pushed a commit that referenced this pull request Aug 7, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Huzaifa Danish (huzaifa-d) pushed a commit that referenced this pull request Aug 7, 2026
…on bfscfg.exe

- #7 (SohamDas2021): available_backends() pushed hardcoded string literals, and
  the drift tests only checked that a separate hardcoded list was valid wire
  names — not that the pushed literals matched. Derive every pushed name from
  ContainmentBackend::wire_name() so it can't be typo'd, and make the emittable
  test iterate the enum so it verifies ContainmentBackend::wire_name() agrees
  with the canonical wire::Containment serde names.

- #9 (SohamDas2021): select_tier() reported AppContainerBfs from the tier2_bfs
  build flag alone, but detect() also requires bfscfg.exe on disk for a
  policy-carrying request (else it falls to DACL). Add a bfscfg_available()
  probe and require both the feature and a resolvable bfscfg.exe before naming
  BFS, so the reported tier ceiling matches what a real request achieves.

Co-authored-by: Copilot App <[email protected]>
Huzaifa Danish (huzaifa-d) added a commit that referenced this pull request Aug 7, 2026
#725)

* feat(engine): port TS host detectors (lxc, windows_sandbox) to Rust

Port the two TypeScript-only host-availability detectors into Rust and fold their results into mxc_engine::platform::platform_support(), broadening its contract from 'backends mxc-sdk can launch' to 'host-available backends' (Phase 1 of the backend-support-probe plan, PR #717).

- Add lxc_common::availability::is_lxc_available() (shallow 'lxc-ls --version' probe).
- Add windows_sandbox_lifecycle::availability::is_windows_sandbox_available() (DISM State:Enabled with a 10s timeout, WindowsSandbox.exe fallback when DISM can't run; invokes the absolute System32\dism.exe path).
- platform_support(): Linux arm reports lxc and/or bubblewrap; Windows arm adds windows_sandbox alongside processcontainer. Update doc comments to host-capability wording.
- Add drift-guard tests tying reported literals to Containment wire names and asserting the live platform_support() output only contains real wire names.
- Loosen the locked mxc-sdk platform_support tests for the broadened contract.

Co-authored-by: Copilot App <[email protected]>

* feat(engine): add available_backends() host-capability probe API

Add mxc_engine::probe with the read-only available_backends() API from the backend-support-probe plan (PR #717, Phase 2). Reports only the containment backends the current host can run, each with its effective isolation tier when it has a tier ladder.

- AvailableBackend { backend, tier: Option<String> } serializes to camelCase JSON with tier omitted (never null) when the backend has no tier ladder.
- available_backends() has per-platform arms reusing the landed detectors: macOS -> seatbelt; Linux -> bubblewrap/lxc; Windows -> processcontainer (with effective tier) + windows_sandbox + wslc (feature-gated). Empty Vec is a normal result, not an error.
- select_tier() is a pure precedence fn (base-container -> appcontainer-bfs -> appcontainer-dacl floor), unit-testable without a real host or the tier2_bfs feature.
- Re-exported from mxc_engine and the public mxc-sdk.
- 8 unit tests: serde shape (tier omitted vs present), host + unconditional wire-name drift guards, canonical-tier drift guard, Windows processcontainer-always-with-tier, tier precedence, non-Windows processcontainer absence.

Stacked on the host-detector port (PR #725); the standalone detectors it reuses land there.

Co-authored-by: Copilot App <[email protected]>

* fix(windows_sandbox): address Copilot review on host detectors

- Resolve dism.exe / WindowsSandbox.exe via GetSystemDirectoryW instead of the attacker-controllable %SystemRoot% env var (UAC inherits an unelevated parent's environment, so an env-derived path let a standard user point the probe at a planted binary). Mirrors the src/host/plm/src/wpr_path.rs pattern; falls back to the C:\\Windows\\System32 literal only on an outright Win32 failure.
- Pass DISM's /English global option so the parsed 'State : Enabled' tokens are not localized on non-English Windows (previously an enabled Sandbox could be reported unavailable there, since a successful DISM run also skips the exe fallback).
- Soften platform_support() docs: available_methods is the currently detected subset, not an exhaustive capability list — backends without a Rust detector yet (notably isolation_session) are omitted even when the host could run them, so absence is not proof a backend cannot run.

Co-authored-by: Copilot App <[email protected]>

* docs: trim comments; drop DISM from windows_sandbox probe

Trim the module-level narratives and over-explained item docs across the host detectors and probe to concise, necessary comments; remove duplicated phrasing (e.g. 'universal floor') within and across files.

Also drop the DISM query from the Windows Sandbox probe: dism /online requires elevation and this probe only ever runs unelevated (wxc-exec does not self-elevate), so DISM always failed through to the WindowsSandbox.exe existence check anyway. Detection is now exe-only, which also removes the subprocess-launch attack surface (only a .exists() remains). A short comment records why DISM is skipped.

Co-authored-by: Copilot App <[email protected]>

* refactor(appcontainer): centralize isolation-tier name strings

Address @bbonaby's review note (#717): the tier-name strings were hand-written across the appcontainer fallback code. Make IsolationTier the single source of truth in both directions.

- Add IsolationTier::ALL (canonical tier set, strongest-first) and derive a FromStr impl from as_str() via ALL, so the two directions cannot drift and adding a tier is a one-line change to ALL + as_str.
- Remove the ad-hoc test-only parse_force_tier(); the production MXC_FORCE_TIER seam now parses via FromStr.
- Add typed ForceTierGuard::set_tier(IsolationTier) and migrate all 18 valid force-tier call-sites off raw string literals (the one negative test intentionally keeps a raw invalid value).
- Add a round-trip test asserting every ALL tier survives as_str -> FromStr.

The available_backends() probe (already merged here) consumes as_str() with its own drift guard; the CI coverage gate for new tiers/backends is tracked in the follow-up issue.

Co-authored-by: Copilot App <[email protected]>

* feat(engine): add isolation_session host detection (registration-based)

Add isolation_session to the host-availability surfaces using @adpa-ms's registration-based approach from #761: availability is whether the in-proc Windows.AI.IsolationSession IsoSessionOps WinRT class is registered on the OS (its activation factory resolves), not a build-number gate.

- New isolation_session_common::availability::is_isolation_session_available(): attempts IsoSessionOps activation (CoInitialize MTA, balanced), OnceLock-cached, elevation-free. Pure available_from() split from the COM probe for unit testing (CLASS_E_CLASSNOTAVAILABLE / REGDB_E_CLASSNOTREG and any other activation failure map to unavailable).
- Wire it into both Windows host-capability surfaces, gated behind the engine's isolation_session feature: available_backends() (probe) and platform_support(). This closes the previously-documented Rust/TS parity gap where TS reported isolation_session but Rust did not.
- Add isolation_session to the probe's EMITTABLE_BACKENDS drift guard and loosen the mxc-sdk Windows platform_support test to allow it.

Validated with the feature on and off: fmt clean, clippy -D warnings clean (default, isolation_session, and wslc+tier2_bfs+isolation_session), and tests green.

Co-authored-by: Copilot App <[email protected]>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* docs: trim comments in the windows_sandbox + isolation_session probes

Keep only comments that explain non-obvious code (why exe-not-DISM, the GetSystemDirectoryW env-spoof rationale, the Win32 buffer-grow retry, and the COM init/uninit balancing); drop the rest. No behavior change.

Co-authored-by: Copilot App <[email protected]>

* docs: restore platform_support module rationale

Restore the 'why this exists' note (in-process host discovery, decoupled from the TypeScript SDK; lives in the engine so the SDK and executor binaries share one impl) that an earlier comment-trim over-aggressively removed. Kept concise.

Co-authored-by: Copilot App <[email protected]>

* docs: restore pre-existing platform.rs comments simplified by this PR

Per review: only prune comments in files/comments this PR introduces. Restore the pre-existing comments an earlier trim pass simplified in platform.rs:
- module doc (full 'stop depending on the TypeScript SDK' + 'lives alongside dispatch.rs' rationale),
- platform_support() fn doc (the wxc-exec --probe and wslc/feature specifics; dropped only the now-inaccurate 'restricted to backends mxc-sdk can run' clause the broadened contract invalidated, pointing to the field doc instead),
- the Linux-arm bwrap / MIN_BWRAP_VERSION note (kept, plus the new lxc line).

The two sdk_helpers.rs comments were left corrected rather than reverted: this PR's behavior change made them factually wrong (LXC is now reported; WSLC is no longer the only other Windows backend).

Co-authored-by: Copilot App <[email protected]>

* refactor(wxc_common): extract shared system_directory() helper

Addresses jsidewhite's review on #725: GetSystemDirectoryW + grow-retry was duplicated in windows_sandbox availability.rs and plm/wpr_path.rs. Consolidate into wxc_common::system_dir and route both call-sites through it.

Co-authored-by: Copilot App <[email protected]>

* fix(engine): address review on host detectors (wslc probe, tier de-drift, COM guard)

- probe.rs: report wslc via wslc_common::is_available() (WSL2 + runtime check) instead of WslcSdk::load(), matching platform_support() and the runner preflight (SohamDas).
- fallback_detector.rs: generate IsolationTier's enum, ALL, as_str, and FromStr from one macro list so the mapping is exhaustive both ways and cannot drift (SohamDas).
- isolation_session/availability.rs: wrap CoInitializeEx/CoUninitialize in an RAII ComApartment guard so a panic in IsoSessionOps::new() still balances COM init (SohamDas).

Co-authored-by: Copilot App <[email protected]>

* fix(windows_sandbox): route runner preflight through the trusted availability probe

check_sandbox_available() used an env-spoofable %SystemRoot% path while capability reporting used GetSystemDirectoryW. Delegate the preflight to is_windows_sandbox_available() so reporting and execution agree and the runner is no longer environment-spoofable (Copilot review).

Co-authored-by: Copilot App <[email protected]>

* fix(windows_sandbox): launch WindowsSandbox.exe from the trusted system path

The daemon launched the sandbox binary by bare name, relying on the executable
search order (app dir/CWD) — an attacker-planted binary could run in its place,
outside the sandbox. Resolve it under the trusted system_directory()
(GetSystemDirectoryW), matching the detection path hardened elsewhere in this PR.
Surfaced by adversarial review.

Co-authored-by: Copilot App <[email protected]>

* fix(engine): keep platform_support() limited to SDK-launchable backends

available_backends() (introduced by this PR) is the host-capability probe; it
already reports the broad set (lxc, windows_sandbox, isolation_session, wslc).
platform_support() must stay limited to the backends mxc_sdk::spawn_sandbox can
actually launch (dispatch.rs: seatbelt, bubblewrap, processcontainer, wslc), or a
caller picking an advertised method gets a guaranteed UnsupportedContainment
error. This PR had wrongly expanded platform_support() to add lxc (Linux) and
windows_sandbox + isolation_session (Windows); revert those arms and the field
doc to the launchable-only contract (per #717 design 7.1). The new drift tests
are kept. Addresses SohamDas2021 / Copilot review.

Co-authored-by: Copilot App <[email protected]>

* fix(lxc): bound and cache the lxc-ls availability probe

is_lxc_available() ran `lxc-ls --version` with a blocking status() and no cache,
so a hung lxc-ls would block discovery indefinitely and every call re-spawned it
(unlike the isolation_session and windows_sandbox probes). Cache the result in a
OnceLock and wait with a bounded deadline, killing and reaping the child on
timeout. Addresses SohamDas2021 review.

Co-authored-by: Copilot App <[email protected]>

* fix(engine): derive probe backend names from the enum; gate BFS tier on bfscfg.exe

- #7 (SohamDas2021): available_backends() pushed hardcoded string literals, and
  the drift tests only checked that a separate hardcoded list was valid wire
  names — not that the pushed literals matched. Derive every pushed name from
  ContainmentBackend::wire_name() so it can't be typo'd, and make the emittable
  test iterate the enum so it verifies ContainmentBackend::wire_name() agrees
  with the canonical wire::Containment serde names.

- #9 (SohamDas2021): select_tier() reported AppContainerBfs from the tier2_bfs
  build flag alone, but detect() also requires bfscfg.exe on disk for a
  policy-carrying request (else it falls to DACL). Add a bfscfg_available()
  probe and require both the feature and a resolvable bfscfg.exe before naming
  BFS, so the reported tier ceiling matches what a real request achieves.

Co-authored-by: Copilot App <[email protected]>

* docs(mxc-sdk): add host-backend discovery usage guidance + before/after

Documents platform_support() vs available_backends() (which to use when), a
usage example, and the tier-ceiling caveat, plus the before/after framing.
Addresses jsidewhite review on #725.

Co-authored-by: Copilot App <[email protected]>

* fix(lxc): drop unread exit code from LxcLsOutcome::ExitedFailure

The decision only distinguishes success from every other outcome, so the
Option<i32> exit code was never read (dead code under -D warnings). Make
ExitedFailure a unit variant. Addresses Copilot review.

Co-authored-by: Copilot App <[email protected]>

* fix(engine): report BFS tier ceiling from tier2_bfs alone, not bfscfg.exe

Reverts the bfscfg.exe gating added earlier in this PR. The probe's tier is a
CEILING (strongest reachable for some request), not a per-request value:
detect() returns AppContainerBfs for a no-filesystem-policy request without
bfscfg.exe, so the ceiling on any tier2_bfs build is BFS regardless of bfscfg.
Gating the ceiling on bfscfg under-reported it to appcontainer-dacl on a
tier2_bfs host lacking bfscfg. bfscfg only decides whether a policy-carrying
request stays at BFS or drops to DACL, which is a request-time dispatch concern.
Addresses Copilot review; supersedes the earlier response to the bfscfg comment.

Co-authored-by: Copilot App <[email protected]>

* test(mxc-sdk): fence platform_support() to the SDK-launchable set

The platform_support consistency tests were loosened earlier in the PR when it
temporarily advertised lxc / windows_sandbox / isolation_session; after those
moved to available_backends() the tests were never re-tightened, so they still
permitted the excluded backends and a regression re-advertising one would pass
(the Linux loop also passed vacuously on a host with no methods).

- Linux: assert available_methods == exactly ["bubblewrap"] (lxc excluded).
- Windows: keep processcontainer-first, then assert every method is
  processcontainer | wslc, explicitly excluding windows_sandbox /
  isolation_session.

Addresses SohamDas2021 review.

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Huzaifa Danish <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 10, 2026
Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
@RamonArjona4 RamonArjona4 mentioned this pull request Aug 11, 2026
2 of 8 tasks
@MGudgin Gudge (MGudgin) mentioned this pull request Aug 12, 2026
5 of 8 tasks
Soham Das (SohamDas2021) added a commit that referenced this pull request Aug 12, 2026
…ce (PR 2b/3) (#801)

* Enable WSLc state-aware sandbox lifecycle through the experimental.wslc surface

Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d

* Document WSLc state-aware fixture ordering and sandbox-id substitution

Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d

* Address WSLc state-aware review comments #3-#7 and unify WSLC E2E runner

Co-authored-by: Copilot <[email protected]>

Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d

* Add schema version to wslc state aware config jsons

* Enforce fs delegation/normalization at state-aware provision, reject network-mode changes by presence post-provision

* Addressed PR comments

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d

---------

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f3ae1af2-7b79-4340-a5ce-a5402e7ede3d
Dan Legg (danlegg) pushed a commit that referenced this pull request Sep 1, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Dan Legg (danlegg) pushed a commit that referenced this pull request Oct 1, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Dan Legg (danlegg) pushed a commit that referenced this pull request Oct 1, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Dan Legg (danlegg) pushed a commit that referenced this pull request Oct 6, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Dan Legg (danlegg) pushed a commit that referenced this pull request Oct 7, 2026
Address the code-review findings on the coresident explicit-load change
(38dbd88). Runtime binding still activates the MSI IsoSessionApp.dll by
absolute path with zero registry mutation; this commit hardens the
surrounding load, error, and diagnostic behavior.

regfree.rs (#1,#5,#6,#7,#8,#9,#10):
- Load the App DLL with LoadLibraryExW using
  LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32 so
  the runtime directory is the sole search root for its dependencies
  (search-order hijack hardening). Reject non-absolute
  MXC_ISOSESSION_RUNTIME_DIR overrides.
- Replace the 2-state load cache with a 3-state RuntimeLoad enum
  (Absent / Loaded / Unloadable). A missing default folder still falls
  back to inbox activation, but an honored-but-broken explicit override
  or a present-but-unloadable DLL now surfaces the error instead of
  silently falling back.
- Report real Win32 errors (GetProcAddress) and null-check the returned
  factory pointer before from_raw.
- Gate success-path eprintln! on MXC_DIAG_CONSOLE.
- Correct the CoInitializeEx SAFETY comment.
- Add unit tests for runtime-dir resolution and app-dll path building.

manager.rs (#2): wrap the over-length activate line for rustfmt.

oneshot.md (#4,#11): document the two activation paths, the
runtime-folder resolution table (MXC_ISOSESSION_RUNTIME_DIR /
DEFAULT_RUNTIME_DIR), apartment init, and prerequisites; fix
RoInitialize -> CoInitializeEx wording.

tests/scripts (#3): accept EITHER inbox (System32 DLL + registry) OR the
coresident MSI runtime dir in the prerequisite probe, so the suites no
longer skip on an MSI-only host.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f5cc2011-5308-43d6-a8ea-2b8ed9b6ceb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants