[Draft/RFC] Add experimental Native Mode for Bluetooth DualSense - #19
Draft
potpiemuncher wants to merge 12 commits into
Draft
[Draft/RFC] Add experimental Native Mode for Bluetooth DualSense#19potpiemuncher wants to merge 12 commits into
potpiemuncher wants to merge 12 commits into
Conversation
Implements the policy §4 validation model: before DS4Windows releases the physical controller or requests elevation to attach, the usbip-win2 driver packages and the usbip.exe client must match a supported release-manifest entry. Fails closed with a specific, non-sensitive diagnostic. - NativeModeDriverManifest: single versioned data structure owning all tier/version/arch/signer policy. One ExperimentalBaseline entry for the tested 0.9.7.8 release (UDE 1.45.29.368, filter 1.45.28.868, usbip.exe ProductVersion 0.9.7.8, x64+x86, Microsoft Hardware Compatibility Publisher). A future fixed release can be added as a Production-tier entry without scattering version comparisons. - NativeModeDriverValidation: IDriverPackageInspector / IAuthenticodeVerifier seams plus the pure, unit-testable manifest-matching and fail-closed decision logic (NativeModeDriverValidator), result type, and the NativeModeDriverGate wiring point. - NativeModeDriverInspectors: OS-touching implementations. SetupAPI/CfgMgr32 enumeration of the UDE host controller by the stable hardware ID ROOT\USBIP_WIN2\UDE (never a machine-specific instance), driver-store resolution of INF/provider/DriverVer/catalog/arch/health, and WinVerifyTrust (GENERIC_VERIFY_V2) trust with chain-derived signer identification of the Microsoft HWCP (no substring match). - Wiring: ControlService.StartNativeModeAsync gates before controller release; NativeModeElevationBroker.RunAttachAsync re-validates before any elevation. 0.9.7.8 is allowed as ExperimentalBaseline; unknown/older/newer/mixed/ wrong-provider/test-signed/developer-signed/revoked/missing sets are refused. - 33 offline MSTest cases covering policy §7. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The driver validation gate added in 180dbdb has OS-touching paths (SetupAPI and Configuration Manager enumeration, driver-store INF resolution, and WinVerifyTrust chain inspection) that no offline test can exercise, because they require usbip-win2 to be installed. A mistake in any of them would fail closed against a valid installation and block Native Mode with no way for a user to tell whether their driver or the check itself was at fault. Add a read-only `validatedriver` command that runs the same gate and reports every value it observed next to the value the manifest expected, for all three components, so a mismatch names itself. The report includes the signer common name actually found on the verified chain, which is the value most likely to be wrong and the hardest to guess offline. The command runs from CheckOptions before the control service or main window is created, requests no elevation, releases no controller, starts no helper, and writes no settings. It attaches to a parent console when launched from a terminal and otherwise shows the same text in a copyable window, always writing the report to a file so it can be pasted into a bug report. Exit code is 0 on pass and non-zero on failure so it can be scripted. Report composition is a pure formatter covered by offline tests with fabricated observations, including redaction of user paths.
CopyNativeDualSenseServer runs AfterTargets=Build and copies the published helper into $(TargetDir)native. Release packaging uses `dotnet publish`, whose output is assembled from publish item groups rather than from the build output directory, so nothing carried the helper into a published package. A published build therefore omitted native\VirtualDualSenseUsbip.exe, and Native Mode failed at runtime when it could not locate the server executable. The existing guard only proved the helper had been produced, not that it shipped. Register the helper files as ResolvedFileToPublish under native\ so publish output matches build output. Verified with a clean CI-equivalent publish.
Record that the driver policy note's section 4 validation model is now implemented rather than proposed, and describe what the gate enforces: stable hardware-ID lookup, both packages matched against one release entry, trust verified through the Windows trust APIs with the publisher taken from the verified chain, and version and health checks, all fail-closed before the controller is released or elevation is requested. State the two limits plainly. Admitting release 0.9.7.8 as an experimental baseline does not assert that release is safe, because the kernel lifetime defect is unrepaired. And the enumeration and trust paths cannot be covered offline, so validatedriver should be run on a real installation before any build relying on this gate is distributed. Update the blocker list to record that the upstream driver report has been filed, that filing does not close the gate, and that the report cross- references an independent case showing the same corruption signature with a non-audio trigger. Install, repair, and uninstall policy remains open.
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.
Uh oh!
There was an error while loading. Please reload this page.