Repository navigation
Support STDIN through SDK - #41698
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Fix the ABI layout issue, add direct-process STDIN coverage, and correct the documented timing boundary.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (4)
What changed in this PR
Adds STDIN support to the C and WinRT SDKs, with stream lifetime fixes, tests, and documentation.
Changes:
- Adds
WSLC_PROCESS_FLAG_STDINand WinRTEnableStandardInput. - Propagates STDIN settings to processes and fixes stream buffer lifetime.
- Adds functional tests and API documentation.
Review findings require changes: the internal options layout breaks ABI compatibility, direct-process STDIN coverage is missing, and timing documentation needs correction.
| File | Description |
|---|---|
test/windows/WslcSdkWinRTTests.cpp |
Tests WinRT STDIN behavior. |
test/windows/WslcSdkTests.cpp |
Tests C SDK flags and STDIN. |
src/windows/WslcSDK/WslcsdkPrivate.h |
Stores internal process flags. |
src/windows/WslcSDK/wslcsdk.h |
Defines the public flags API. |
src/windows/WslcSDK/wslcsdk.def |
Exports the new API. |
src/windows/WslcSDK/wslcsdk.cpp |
Validates and propagates flags. |
src/windows/WslcSDK/winrt/wslcsdk.idl |
Adds the WinRT property. |
src/windows/WslcSDK/winrt/Streams.cpp |
Preserves buffers across suspension. |
src/windows/WslcSDK/winrt/ProcessSettings.h |
Declares STDIN state. |
src/windows/WslcSDK/winrt/ProcessSettings.cpp |
Implements STDIN configuration. |
doc/docs/api-reference/csharp/settings-classes/processsettings.md |
Documents the C# setting. |
doc/docs/api-reference/csharp/core-classes/process.md |
Documents C# input-stream requirements. |
doc/docs/api-reference/cpp/settings-classes/processsettings.md |
Documents the C++ setting. |
doc/docs/api-reference/cpp/core-classes/process.md |
Documents C++ input-stream requirements. |
doc/docs/api-reference/c/process-apis/wslcsetprocesssettingsflags.md |
Documents the C API. |
doc/docs/api-reference/c/process-apis/index.md |
Adds API navigation. |
doc/docs/api-reference/c/process-apis/.pages |
Updates API navigation. |
doc/docs/api-reference/c/enumerations/wslcprocessflags.md |
Documents process flags. |
doc/docs/api-reference/c/enumerations/index.md |
Adds enum navigation. |
doc/docs/api-reference/c/enumerations/.pages |
Updates enum navigation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| VERIFY_SUCCEEDED(WslcSetProcessSettingsCmdLine(&procSettings, argv, ARRAYSIZE(argv))); | ||
| VERIFY_SUCCEEDED(WslcSetProcessSettingsFlags(&procSettings, WSLC_PROCESS_FLAG_STDIN)); |
Blue (OneBlue)
left a comment
There was a problem hiding this comment.
LGTM, feel free to resolve the two minor comments in a followup
Feel free to merge it if it is done before I see it. I will do a followup. |



Summary of the Pull Request
Add support for STDIN usage through the SDK.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Adds process flags to the C SDK (
WslcProcessFlagsset viaWslcSetProcessSettingsFlags). The only flag supported at this time is the STDIN enabler (WSLC_PROCESS_FLAG_STDIN).Adds a similar property to the WinRT process settings (
EnableStandardInput).Also updates the docs and fixes an issue in the WinRT stream coroutines (not pinning a parameter used after suspension).
Validation Steps Performed
Added tests for the new flag/property and usage of STDIN.