Use bespoke interfaces to communicate with wsldevicehost - #41099
Merged
Brian Perkins (Brian-Perkins) merged 3 commits intoJul 17, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Brian Perkins (Brian-Perkins)
July 17, 2026 01:12
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing âinboxâ string-parsing based communication path between the WSL service and wsldevicehost with bespoke COM interfaces (from the Microsoft.WSL.DeviceHost NuGet), moving configuration and device operations into structured method calls. It also introduces and packages a dedicated proxy/stub DLL to support cross-process COM for these interfaces.
Changes:
- Add/build/package
wsldevicehostproxystub.dlland register its interfaces/CLSID via MSI. - Refactor
GuestDeviceManager,DeviceHostProxy, andConsommeNetworkingto use typedIWsl*interfaces for virtiofs/virtionet/pmem + swiotlb configuration. - Bump
Microsoft.WSL.DeviceHostNuGet dependency and adjust build/docs accordingly.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/windows/wsldevicehoststub/WslDeviceHostProxyStub.rc | New version/resource metadata for wsldevicehostproxystub.dll. |
| src/windows/wsldevicehoststub/WslDeviceHostProxyStub.def | New exports definition for the proxy/stub DLL entry points. |
| src/windows/wsldevicehoststub/inc/CMakeLists.txt | Adds IDL generation target for WslDeviceHost.idl from the DeviceHost NuGet. |
| src/windows/wsldevicehoststub/CMakeLists.txt | Builds the new proxy/stub DLL from MIDL-generated sources and wires registration CLSID. |
| src/windows/wslcsession/WSLCVirtualMachine.h | Updates comments to reflect new capability forwarding semantics. |
| src/windows/wslcsession/WSLCVirtualMachine.cpp | Updates comments to reflect new device creation timing and responsibility. |
| src/windows/service/inc/wslc.idl | Updates interface comments for guest capabilities â wsldevicehost flow. |
| src/windows/service/exe/WslCoreVm.h | Removes stored swiotlb option string (now configured via devicehost APIs). |
| src/windows/service/exe/WslCoreVm.cpp | Routes virtio device operations through new GuestDeviceManager typed APIs. |
| src/windows/service/exe/HcsVirtualMachine.h | Removes virtiofs CLSID/swiotlb option string; tracks m_swiotlbConfigured. |
| src/windows/service/exe/HcsVirtualMachine.cpp | Updates virtiofs creation/removal + capability application to new APIs. |
| src/windows/common/GuestDeviceManager.h | Replaces generic âAddGuestDeviceâ with typed virtiofs/net/pmem methods and SetSwiotlb. |
| src/windows/common/GuestDeviceManager.cpp | Implements new typed device APIs and tracks virtionet devices by tag. |
| src/windows/common/DeviceHostProxy.h | Switches to IWsl* interfaces/callbacks; adds typed device creation + swiotlb methods. |
| src/windows/common/DeviceHostProxy.cpp | Implements typed device creation/teardown; adds vm caching and swiotlb configuration. |
| src/windows/common/ConsommeNetworking.h | Removes swiotlb/device-options string plumbing from constructor/state. |
| src/windows/common/ConsommeNetworking.cpp | Replaces virtionet string option parsing with typed config + IWslVirtioNetDevice port binds. |
| src/windows/common/CMakeLists.txt | Adds dependency on wsldevicehostidl for common library builds. |
| packages.config | Bumps Microsoft.WSL.DeviceHost package version. |
| msipackage/package.wix.in | Installs proxy/stub DLL and registers proxy/stub CLSID + interface proxy mappings + new devicehost CLSIDs. |
| msipackage/CMakeLists.txt | Includes wsldevicehostproxystub.dll in MSI binaries/dependencies. |
| doc/docs/dev-loop.md | Clarifies CMAKE_BUILD_TYPE=Release usage with --config Release. |
| CMakeLists.txt | Adds include path for generated DeviceHost headers and adds wsldevicehoststub subdirectories. |
Copilot started reviewing on behalf of
Brian Perkins (Brian-Perkins)
July 17, 2026 01:40
View session
Copilot started reviewing on behalf of
Brian Perkins (Brian-Perkins)
July 17, 2026 16:53
View session
Ben Hillis (benhillis)
approved these changes
Jul 17, 2026
Ben Hillis (benhillis)
left a comment
Member
There was a problem hiding this comment.
this is much better than the old string interface stuff, nice job Brian.
Brian Perkins (Brian-Perkins)
deleted the
user/bperkins/wsldevicehost_custom_interface
branch
July 17, 2026 19:03
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
Replace inbox interfaces between wsldevicehost and WSL service with custom interfaces. This moves parameter passing from complex string parsing to function calls. The expectation is that even though this is a COM interface, we have no reason to keep backwards compatibility and the interfaces can be modified as needed. The only caveat is that the registration piece is separate from the IDL file, so care must be taken if new interfaces/clsids are added that they are properly registered.