You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sdk): expose retained Windows query process handles - #1524
Rust SDK embedders need to query and wait on the exact Windows workload process already retained by MXC. The current public process API exposes an integer PID, which requires another lookup for those operations. This adds MxcProcess::duplicate_query_process_handle() and a default SandboxProcess method returning Unsupported.
BaseContainer duplicates its retained process handle with PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, returning a non-inheritable OwnedHandle. The caller owns the duplicate while MXC retains process lifecycle and cleanup responsibility. Telemetry, warning and DACL wrappers forward the operation. Other backends retain the unsupported default. The API uses the retained process object throughout.
Refs #1521. This draft proposes the API shape for maintainer feedback; the initial implementation covers BaseContainer.
Validation: Windows SDK build and five selected tests passed against these exact five changed source files. Tests cover the unsupported default, forwarding through all three wrappers, operation after stdio transfer, and a query/wait duplicate that survives closure of its source duplicate and has inheritance disabled. The native unit queries the current test process; it creates no contained workload. The validation workflow requires the exact five passing test names and is confined to a separate contributor branch, outside this PR.
rustfmt and git diff --check passed. Full upstream CI and maintainer review remain pending.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The public API addition needs the required SDK README and versioned Rust reference updates.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Document MxcProcess operation in Rust API references
src/mxc-sdk/src/sandbox.rs:287
The maintained MxcProcess method list in docs/api-reference/rust/v1/types.md:313–328 omits this operation, and src/mxc-sdk/README.md does not describe it. Please update both alongside the public API, documenting its Windows-only signature, current BaseContainer support, Unsupported behavior elsewhere, restricted access rights, and caller ownership without transferring sandbox cleanup responsibility. Also note the intentional Rust-only availability relative to .NET and Node.
Addressed both review points in commit 46c3beef: DuplicateHandle failures now preserve the underlying Win32 error (and retain the HRESULT for other facilities), and the inert current-process test uses NtQueryObject to verify the duplicated handle has exactly query-limited-information and synchronize rights.
The separate fork-only validation run compiled the SDK with locked dependencies and passed all five fixed query/forwarding unit tests (3 + 1 + 1, zero failures). It did not run a sandbox or child workload, and its validation workflow is excluded from this PR. The PR’s CLA check is passing.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The draft native-handle API needs maintainer sign-off and upstream Windows validation beyond the reported selected tests.
No open issues 🎉
Review effort: Balanced
This branch has not been deployed
No deployments
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
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.
Rust SDK embedders need to query and wait on the exact Windows workload process already retained by MXC. The current public process API exposes an integer PID, which requires another lookup for those operations. This adds
MxcProcess::duplicate_query_process_handle()and a defaultSandboxProcessmethod returningUnsupported.BaseContainer duplicates its retained process handle with
PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, returning a non-inheritableOwnedHandle. The caller owns the duplicate while MXC retains process lifecycle and cleanup responsibility. Telemetry, warning and DACL wrappers forward the operation. Other backends retain the unsupported default. The API uses the retained process object throughout.Refs #1521. This draft proposes the API shape for maintainer feedback; the initial implementation covers BaseContainer.
Validation: Windows SDK build and five selected tests passed against these exact five changed source files. Tests cover the unsupported default, forwarding through all three wrappers, operation after stdio transfer, and a query/wait duplicate that survives closure of its source duplicate and has inheritance disabled. The native unit queries the current test process; it creates no contained workload. The validation workflow requires the exact five passing test names and is confined to a separate contributor branch, outside this PR.
rustfmtandgit diff --checkpassed. Full upstream CI and maintainer review remain pending.Microsoft Reviewers: Open in CodeFlow