Skip to content

Move the SDK API to its own IDL file#40784

Draft
OneBlue wants to merge 6 commits into
masterfrom
user/oneblue/sdk-api
Draft

Move the SDK API to its own IDL file#40784
OneBlue wants to merge 6 commits into
masterfrom
user/oneblue/sdk-api

Conversation

@OneBlue

@OneBlue OneBlue commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings June 11, 2026 22:49
Comment thread msipackage/package.wix.in
</RegistryKey>

<!-- IWSLCSDKTerminationCallback-->
<RegistryKey Root="HKCR" Key="Interface\{86A807EA-F2A1-4382-93E5-09FB5F2F4A31}">

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove once #40767 is merged

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.idl and 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 internal wslc.idl types.

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.

Comment thread src/windows/common/APICompat.cpp Outdated
Comment thread src/windows/wslcsession/WSLCSession.cpp
Comment thread src/windows/wslcsession/WSLCContainer.cpp
Comment thread src/windows/common/APICompat.h

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;")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the casing here while I was reviewing this

@@ -922,10 +919,8 @@
object

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this method from that interface because it's only useful to the SDK

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