Move the SDK API to its own IDL file#40784
Draft
OneBlue wants to merge 6 commits into
Draft
Conversation
OneBlue
commented
Jun 11, 2026
| </RegistryKey> | ||
|
|
||
| <!-- IWSLCSDKTerminationCallback--> | ||
| <RegistryKey Root="HKCR" Key="Interface\{86A807EA-F2A1-4382-93E5-09FB5F2F4A31}"> |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the WSLC SDK-facing COM surface by moving it into a separate IDL contract (WSLCCompat.idl) and adds a compatibility layer so the service can continue using wslc.idl internally while the SDK consumes the compat contract.
Changes:
- Introduces
WSLCCompat.idland wires it into IDL generation + proxy/stub build outputs. - Updates the service COM objects (session/container/process/session manager) to also implement
IWSLCCompat*interfaces and forward compat calls to existing implementations via conversion helpers. - Updates the SDK and tests to use
IWSLCCompat*interfaces/types instead of the internalwslc.idltypes.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/WslcSdkWinRTTests.cpp | Updates tests to obtain an IWSLCSession via QI from the SDK’s compat session. |
| test/windows/WslcSdkTests.cpp | Updates tests to use QI from compat session to the internal session interface for launching. |
| src/windows/wslcsession/WSLCSession.h | Makes WSLCSession implement IWSLCCompatSession and declares forwarding methods. |
| src/windows/wslcsession/WSLCSession.cpp | Adds IWSLCCompatSession forwarding implementations using the compat conversion layer. |
| src/windows/wslcsession/WSLCProcess.h | Makes WSLCProcess implement IWSLCCompatProcess and declares forwarding methods. |
| src/windows/wslcsession/WSLCProcess.cpp | Implements IWSLCCompatProcess forwarding methods. |
| src/windows/wslcsession/WSLCContainer.h | Makes WSLCContainer implement IWSLCCompatContainer and declares forwarding methods. |
| src/windows/wslcsession/WSLCContainer.cpp | Implements IWSLCCompatContainer forwarding methods. |
| src/windows/WslcSDK/WslcsdkPrivate.h | Switches SDK internals to store compat COM interfaces (IWSLCCompat*). |
| src/windows/WslcSDK/wslcsdk.cpp | Updates SDK implementation to use compat types/interfaces and adds handle conversion for compat contract. |
| src/windows/WslcSDK/TerminationCallback.h | Switches termination callback COM interface to compat version. |
| src/windows/WslcSDK/TerminationCallback.cpp | Updates termination callback implementation for compat reason enum. |
| src/windows/WslcSDK/ProgressCallback.h | Switches progress callback COM interface to compat version. |
| src/windows/WslcSDK/ProgressCallback.cpp | Updates progress callback implementation comments to compat interface name. |
| src/windows/WslcSDK/IOCallback.h | Switches IO callback plumbing to use IWSLCCompatProcess and compat handle type. |
| src/windows/WslcSDK/IOCallback.cpp | Updates IO callback implementation to use compat process/handle APIs. |
| src/windows/WslcSDK/CrashDumpCallback.h | Switches crash dump callback COM interface to compat version. |
| src/windows/WslcSDK/CrashDumpCallback.cpp | Updates crash dump callback implementation comments to compat interface name. |
| src/windows/service/stub/CMakeLists.txt | Adds generated compat proxy/stub sources to the stub target. |
| src/windows/service/inc/WSLCCompat.idl | New SDK-facing IDL contract defining IWSLCCompat* interfaces and types. |
| src/windows/service/inc/wslc.idl | Annotates intended usage and adds a coclass decl guard shared with compat IDL. |
| src/windows/service/inc/CMakeLists.txt | Adds WSLCCompat.idl to IDL generation. |
| src/windows/service/exe/WSLCSessionManager.h | Makes WSLCSessionManager implement IWSLCCompatSessionManager and declares forwarding methods. |
| src/windows/service/exe/WSLCSessionManager.cpp | Implements IWSLCCompatSessionManager forwarding using conversion helpers. |
| src/windows/common/CMakeLists.txt | Adds APICompat.{h,cpp} to the common library build. |
| src/windows/common/APICompat.h | Declares conversion helpers and owning conversion wrappers bridging compat <-> internal contracts. |
| src/windows/common/APICompat.cpp | Implements compat <-> internal enum/struct/callback conversions and owning wrapper conversions. |
| msipackage/package.wix.in | Registers the new compat interface IIDs for proxy/stub marshaling. |
OneBlue
commented
Jun 12, 2026
|
|
||
| cpp_quote("#ifdef __cplusplus") | ||
| cpp_quote("class DECLSPEC_UUID(\"a9b7a1b9-0671-405c-95f1-e0612cb4ce8f\") WSLCSessionManager;") | ||
| cpp_quote("class DECLSPEC_UUID(\"9FCD2067-9FC6-4EFA-9EB0-698169EBF7D3\") WSLCSessionFactory;") |
Collaborator
Author
There was a problem hiding this comment.
Fixed the casing here while I was reviewing this
OneBlue
commented
Jun 12, 2026
| @@ -922,10 +919,8 @@ | |||
| object | |||
Collaborator
Author
There was a problem hiding this comment.
Removed this method from that interface because it's only useful to the SDK
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 of the Pull Request
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed